--- title: "PayPal for API only" description: "Add PayPal to your API-only integration." url: "https://docs.adyen.com/payment-methods/paypal/api-only" source_url: "https://docs.adyen.com/payment-methods/paypal/api-only.md" canonical: "https://docs.adyen.com/payment-methods/paypal/api-only" last_modified: "2026-06-17T14:03:53+02:00" language: "en" --- # PayPal for API only Add PayPal to your API-only integration. [View source](/payment-methods/paypal/api-only.md) You can add PayPal to your existing integration. The following instructions show only what you must add to your integration specifically for PayPal. If an instruction on this page corresponds with a step in the main integration guide, it includes a link to corresponding step of the main integration guide. ## Requirements | Requirement | Description | | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing [API-only integration](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only). | | | **Redirect handling** | Make sure that your existing integration is set up to [handle the redirect](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#handle-the-redirect). `action.type`: **redirect**. | | | **Setup steps** | Before you begin: - [add PayPal in your Customer Area](/payment-methods/add-payment-methods). - complete the [PayPal setup steps](/online-payments/payment-methods/paypal/setup-paypal-direct-merchants/). | | ## How it works 1. The shopper selects PayPal as the payment method. 2. If applicable,the shopper enters their details in the [payment form that you build](#build-your-payment-form). 3. When you make the payment request, you [include additional information about the items that the shopper intends to purchase](#additional-parameters-payments). ## Build your payment form Include PayPal in the list of [available payment methods](#payment-methods). You don't have to include other fields in the payment form to collect information from your shopper . You can [download the logo for PayPal](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%2Bonly\&version=71#downloading-logos) to use in your form. ## Get PayPal as an available payment method When you make the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) to [get available payment methods](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#get-available-payment-methods), specify the following so that PayPal is included in the response. | Parameter | Values | | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-countryCode) | **AU**, **AT**, **BE**, **BR**, **BG**, **CA**, **HR**, **CY**, **CZ**, **DK**, **EE**, **FI**, **FR**, **DE**, **GIB**, **HK**, **HU**, **IS**, **ID**, **IE**, **IT**, **JP**, **LV**, **LT**, **LU**, **MY**, **MT**, **NL**, **NZ**, **PH**, **PL**, **PT**, **RO**, **SK**, **SI**, **KR**, **ES**, **SE**, **CH**, **TH**, **UA**, **AE**, **GB**, **US** | | [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount-currency) | **AUD**, **BGN**, **CAD**, **CHF**, **CZK**, **DKK**, **EUR**, **GBP**, **HKD**, **NOK**, **PLN**, **SEK**, **USD** | **Example request for available payment methods** ```bash curl https://checkout-test.adyen.com/v71/paymentMethods \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "countryCode": "US", "amount": { "currency": "USD", "value": 1000 } }' ``` **Example response with PayPal available** ```json { "paymentMethods": [ { "name": "PayPal", "type": "paypal" } ] } ``` ## Add additional parameters to your /payments request When you [make a payment](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#make-a-payment), add the following parameters: | Parameter | Required | Description | | ------------------------------------------------------------------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems) | | Price and product information about the purchased items. For each item, you only need to send `quantity`, `description`, `itemCategory`, `sku`, `amountExcludingTax`, and `taxAmount`. The allowed values for `itemCategory` are:- **DIGITAL\_GOODS**: goods that are stored, delivered, and used in electronic format. - **PHYSICAL\_GOODS**: tangible goods that can be shipped with proof of delivery. - **DONATION**: a contribution or gift for which no goods or services are exchanged, usually to a not-for-profit organization. | | `additionalData.paypalPairingId` | | **Only for customer-initiated transactions where you use the Fraudnet SDK and pass the same pairing ID to Fraudnet and Adyen.** A unique ID determined by you, to link a transaction to a Fraudnet PayPal risk session.PayPal refers to this ID as *pairing ID*, *CMID*, or *tracking ID*. | | `additionalData.paypalRisk` | | **Only for marketplaces as well as merchants in specific verticals.** The [PayPal risk fields](#paypal-risk-fields) that PayPal told you to send. You must include these fields in an `additional_data` array and send this in [stringified format](#risk-fields-formatting).Contact your PayPal account manager to learn which `paypalRisk` fields apply in your case and what happens if you do not populate a specific field. For a list of example fields, refer to the [common risk fields for marketplaces](#risk-field-marketplaces). | **Example payment request for PayPal** #### curl ```bash curl https://checkout-test.adyen.com/v71/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "USD", "value": 1000 }, "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "paypal", "subtype": "sdk" }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "lineItems": [ { "quantity": 1, "description": "Red Shoes", "itemCategory": "PHYSICAL_GOODS", "sku": "ABC123", "amountExcludingTax": 590, "taxAmount": 10 }, { "quantity": 3, "description": "Polkadot Socks", "itemCategory": "PHYSICAL_GOODS", "sku": "DEF234", "amountExcludingTax": 90, "taxAmount": 10 } ], "additionalData": { "paypalRisk": "{\"additional_data\":[{\"key\":\"sender_first_name\",\"value\":\"Simon\"},{\"key\":\"sender_last_name\",\"value\":\"Hopper\"},{\"key\":\"receiver_account_id\",\"value\":\"AH00000000000000000000001\"}]}" } }' ``` #### Java ```java // Adyen Java API Library v41.1.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) LineItem lineItem1 = new LineItem() .quantity(1L) .itemCategory("PHYSICAL_GOODS") .amountExcludingTax(590L) .description("Red Shoes") .sku("ABC123") .taxAmount(10L); LineItem lineItem2 = new LineItem() .quantity(3L) .itemCategory("PHYSICAL_GOODS") .amountExcludingTax(90L) .description("Polkadot Socks") .sku("DEF234") .taxAmount(10L); Amount amount = new Amount() .currency("USD") .value(1000L); PayPalDetails payPalDetails = new PayPalDetails() .subtype(PayPalDetails.SubtypeEnum.SDK) .type(PayPalDetails.TypeEnum.PAYPAL); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .lineItems(Arrays.asList(lineItem1, lineItem2)) .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .paymentMethod(new CheckoutPaymentMethod(payPalDetails)) .additionalData(new HashMap(Map.of( "paypalRisk", "{\"additional_data\":[{\"key\":\"sender_first_name\",\"value\":\"Simon\"},{\"key\":\"sender_last_name\",\"value\":\"Hopper\"},{\"key\":\"receiver_account_id\",\"value\":\"AH00000000000000000000001\"}]}" ))) .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $lineItem1 = new LineItem(); $lineItem1 ->setQuantity(1) ->setItemCategory("PHYSICAL_GOODS") ->setAmountExcludingTax(590) ->setDescription("Red Shoes") ->setSku("ABC123") ->setTaxAmount(10); $lineItem2 = new LineItem(); $lineItem2 ->setQuantity(3) ->setItemCategory("PHYSICAL_GOODS") ->setAmountExcludingTax(90) ->setDescription("Polkadot Socks") ->setSku("DEF234") ->setTaxAmount(10); $amount = new Amount(); $amount ->setCurrency("USD") ->setValue(1000); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setSubtype("sdk") ->setType("paypal"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setLineItems(array($lineItem1, $lineItem2)) ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setPaymentMethod($checkoutPaymentMethod) ->setAdditionalData( array( "paypalRisk" => "{"additional_data":[{"key":"sender_first_name","value":"Simon"},{"key":"sender_last_name","value":"Hopper"},{"key":"receiver_account_id","value":"AH00000000000000000000001"}]}" ) ) ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the LIVE environment, also include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) LineItem lineItem1 = new LineItem { Quantity = 1, ItemCategory = "PHYSICAL_GOODS", AmountExcludingTax = 590, Description = "Red Shoes", Sku = "ABC123", TaxAmount = 10 }; LineItem lineItem2 = new LineItem { Quantity = 3, ItemCategory = "PHYSICAL_GOODS", AmountExcludingTax = 90, Description = "Polkadot Socks", Sku = "DEF234", TaxAmount = 10 }; Amount amount = new Amount { Currency = "USD", Value = 1000 }; PayPalDetails payPalDetails = new PayPalDetails { Subtype = PayPalDetails.SubtypeEnum.Sdk, Type = PayPalDetails.TypeEnum.Paypal }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", LineItems = new List{ lineItem1, lineItem2 }, Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", PaymentMethod = new CheckoutPaymentMethod(payPalDetails), AdditionalData = new Dictionary { { "paypalRisk", "{\"additional_data\":[{\"key\":\"sender_first_name\",\"value\":\"Simon\"},{\"key\":\"sender_last_name\",\"value\":\"Hopper\"},{\"key\":\"receiver_account_id\",\"value\":\"AH00000000000000000000001\"}]}" } }, ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.1.0 const { Client, CheckoutAPI, Config, EnvironmentEnum } = require('`@adyen/api-library`'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", amount: { currency: "USD", value: 1000 }, shopperReference: "YOUR_UNIQUE_SHOPPER_ID", reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "paypal", subtype: "sdk" }, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", lineItems: [ { quantity: 1, description: "Red Shoes", itemCategory: "PHYSICAL_GOODS", sku: "ABC123", amountExcludingTax: 590, taxAmount: 10 }, { quantity: 3, description: "Polkadot Socks", itemCategory: "PHYSICAL_GOODS", sku: "DEF234", amountExcludingTax: 90, taxAmount: 10 } ], additionalData: { paypalRisk: "{\additional_data\:[{\key\:\"sender_first_name\",\value\:\"Simon\"},{\key\:\"sender_last_name\",\value\:\"Hopper\"},{\key\:\"receiver_account_id\",\value\:\"AH00000000000000000000001\"}]}" } } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.2.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) lineItem1 := checkout.LineItem{ Quantity: common.PtrInt64(1), ItemCategory: common.PtrString("PHYSICAL_GOODS"), AmountExcludingTax: common.PtrInt64(590), Description: common.PtrString("Red Shoes"), Sku: common.PtrString("ABC123"), TaxAmount: common.PtrInt64(10), } lineItem2 := checkout.LineItem{ Quantity: common.PtrInt64(3), ItemCategory: common.PtrString("PHYSICAL_GOODS"), AmountExcludingTax: common.PtrInt64(90), Description: common.PtrString("Polkadot Socks"), Sku: common.PtrString("DEF234"), TaxAmount: common.PtrInt64(10), } amount := checkout.Amount{ Currency: "USD", Value: 1000, } payPalDetails := checkout.PayPalDetails{ Subtype: common.PtrString("sdk"), Type: "paypal", } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", LineItems: []checkout.LineItem{ lineItem1, lineItem2, }, Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", PaymentMethod: checkout.PayPalDetailsAsCheckoutPaymentMethod(&payPalDetails), AdditionalData: &map[string]string{ "paypalRisk": "{\"additional_data\":[{\"key\":\"sender_first_name\",\"value\":\"Simon\"},{\"key\":\"sender_last_name\",\"value\":\"Hopper\"},{\"key\":\"receiver_account_id\",\"value\":\"AH00000000000000000000001\"}]}", }, ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"), } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "USD", "value": 1000 }, "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "paypal", "subtype": "sdk" }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "lineItems": [ { "quantity": 1, "description": "Red Shoes", "itemCategory": "PHYSICAL_GOODS", "sku": "ABC123", "amountExcludingTax": 590, "taxAmount": 10 }, { "quantity": 3, "description": "Polkadot Socks", "itemCategory": "PHYSICAL_GOODS", "sku": "DEF234", "amountExcludingTax": 90, "taxAmount": 10 } ], "additionalData": { "paypalRisk": "{\"additional_data\":[{\"key\":\"sender_first_name\",\"value\":\"Simon\"},{\"key\":\"sender_last_name\",\"value\":\"Hopper\"},{\"key\":\"receiver_account_id\",\"value\":\"AH00000000000000000000001\"}]}" } } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.2.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :amount => { :currency => 'USD', :value => 1000 }, :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :reference => 'YOUR_ORDER_NUMBER', :paymentMethod => { :type => 'paypal', :subtype => 'sdk' }, :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..', :lineItems => [ { :quantity => 1, :description => 'Red Shoes', :itemCategory => 'PHYSICAL_GOODS', :sku => 'ABC123', :amountExcludingTax => 590, :taxAmount => 10 }, { :quantity => 3, :description => 'Polkadot Socks', :itemCategory => 'PHYSICAL_GOODS', :sku => 'DEF234', :amountExcludingTax => 90, :taxAmount => 10 } ], :additionalData => { :paypalRisk => '{\:additional_data\ => [{\:key\ => \'sender_first_name\',\:value\ => \'Simon\'},{\:key\ => \'sender_last_name\',\:value\ => \'Hopper\'},{\:key\ => \'receiver_account_id\',\:value\ => \'AH00000000000000000000001\'}]}' } } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.1.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const lineItem1: Types.checkout.LineItem = { quantity: 1, itemCategory: "PHYSICAL_GOODS", amountExcludingTax: 590, description: "Red Shoes", sku: "ABC123", taxAmount: 10 }; const lineItem2: Types.checkout.LineItem = { quantity: 3, itemCategory: "PHYSICAL_GOODS", amountExcludingTax: 90, description: "Polkadot Socks", sku: "DEF234", taxAmount: 10 }; const amount: Types.checkout.Amount = { currency: "USD", value: 1000 }; const payPalDetails: Types.checkout.PayPalDetails = { subtype: Types.checkout.PayPalDetails.SubtypeEnum.Sdk, type: Types.checkout.PayPalDetails.TypeEnum.Paypal }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", lineItems: [lineItem1, lineItem2], amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", paymentMethod: payPalDetails, additionalData: { "paypalRisk": "{"additional_data":[{"key":"sender_first_name","value":"Simon"},{"key":"sender_last_name","value":"Hopper"},{"key":"receiver_account_id","value":"AH00000000000000000000001"}]}" }, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The response includes the `action.type`: **redirect**. **Example response with an additional action** ```json { "resultCode" : "RedirectShopper", "action" : { "paymentMethodType" : "paypal", "url":"https://test.adyen.com/hpp/checkout.shtml?u=redirectPayPal&p=eJxtkt..", "method" : "GET", "type" : "redirect" } } ``` ### PayPal risk fields PayPal requires *marketplaces* and also merchants in *specific verticals* to send information about the context of the transaction, for risk mitigation purposes. Not all businesses need to send risk fields. Contact your PayPal account manager to verify. #### Common PayPal risk fields for marketplaces As an example, the following table shows the most common `paypalRisk` fields that marketplaces need to send. It is possible that PayPal requires you to send more, less, or other fields. | PayPal risk field | Description | Data type/format | Example | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | | **Sender profile** fields: | | | | | sender\_account\_id | The unique identifier of the buyer's account on the marketplace platform. | String, alphanumeric | A12345N343 | | sender\_first\_name | The buyer's first name registered with their marketplace account. | String, alphanumeric | John | | sender\_last\_name | The buyer's last name registered with their marketplace account. | String, alphanumeric | Smith | | sender\_email | The buyer's email address registered with their marketplace account. | String in [E.123](https://en.wikipedia.org/wiki/E.123) email address format | john.smith\@email.com | | sender\_phone | The buyer's phone number registered with their marketplace account. | String in [E.123](https://en.wikipedia.org/wiki/E.123) telephone number format, national notation | 0687164125 | | sender\_address\_zip | **US only**. The buyer's postal code registered with their marketplace account. | String, alphanumeric | 60661 | | sender\_country\_code | The buyer's country registered with their marketplace account. | String in two-character [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) alpha-2 country code format. Exception: *QZ* (Kosovo). | US | | sender\_create\_date | The date that the buyer's marketplace account was created. | String in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date format | 2012-12-09T19:14:55.277-0:00 | | sender\_signup\_ip | The IP address that the buyer used when signing up on the marketplace platform. | String in IPv4 or IPv6 format | 213.52.172.120 | | sender\_popularity\_score | If you need to provide this field, ask your PayPal account manager for instructions. | String, possible values: **high**, **medium**, **low** | high | | **Receiver profile** fields: | | | | | receiver\_account\_id | The unique identifier of the seller's account on the marketplace platform. | String, alphanumeric | AH00000000000000000000001 | | receiver\_create\_date | The date that the seller's marketplace account was created. | String in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date format | 2012-12-09T19:14:55.277-0:00 | | receiver\_email | The seller's email address registered with their marketplace account. | String in [E.123](https://en.wikipedia.org/wiki/E.123) email address format | john.smith\@email.com | | receiver\_address\_country\_code | The seller's country registered with their marketplace account. | String in two-character [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) alpha-2 country code format. Exception: **QZ** (Kosovo). | US | | business\_name | The seller's business name registered with their marketplace account. | String, alphanumeric | | | recipient\_popularity\_score | If you need to provide this field, ask your PayPal account manager for instructions. | String, possible values: **high**, **medium**, **low** | high | | **Sender-Receiver interaction**: | | | | | first\_interaction\_date | The date of the first interaction between the buyer and the seller. The marketplace defines what an *interaction* is. For example, a payment transaction, a buyer choosing to follow a seller, and so on. | String in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date format | 2012-12-09T19:14:55.277-0:00 | | **Transaction information**: | | | | | txn\_count\_total | The total number of transactions that the buyer has made on the platform. These can be PayPal payments, or payments using a different payment method. | Number | | | **Payment Flow/Model/Type**: | | | | | vertical | If the seller is active in more than one business vertical, this field indicates the vertical that applies to the transaction. | String, alphanumeric | Household goods | | transaction\_is\_tangible | Indicates if the transaction is for tangible goods. | Boolean in string format. Possible values: **0** (false), or **1** (true) | 0 | #### Formatting To send PayPal risk fields, you must use the `additionalData.paypalRisk` field, and specify the risk fields as a stringified `additional_data` array. Each array item consists of: * `key`: the name of the PayPal risk field. * `value`: the value of the PayPal risk field for the current transaction. Here is an example of the original array and the array in stringified format. **additional\_data array** ```json { "additional_data": [ { "key": "sender_first_name", "value": "Simon" }, { "key": "sender_last_name", "value": "Hopper" }, { "key": "receiver_account_id", "value": "AH00000000000000000000001" } ] } ``` **Stringified array** ```sh "{\"additional_data\":[{\"key\":\"sender_first_name\",\"value\":\"Simon\"},{\"key\":\"sender_last_name\",\"value\":\"Hopper\"},{\"key\":\"receiver_account_id\",\"value\":\"AH00000000000000000000001\"}]}" ``` ### Amounts in Hungarian Forints (HUF) In case of a transaction in HUF, PayPal expects the transaction amount and the line item amounts to be rounded to the nearest whole amount. For example, an amount of HUF 74499 must be rounded to HUF 74500. PayPal also expects the rounded line item amounts to add up to the rounded transaction amount. If you do not round the amounts, Adyen will do that. However, a discrepancy can occur between the transaction amount and the total of the line item amounts. When this happens, PayPal doesn't accept the transaction. To avoid that problem, we recommend that you round all HUF amounts yourself and check that they add up. ## Set up PayPal Seller Protection PayPal Seller Protection only applies to physical goods. If you participate in the [PayPal Seller Protection](https://www.paypal.com/us/webapps/mpp/security/seller-protection) program, make sure that you submit the following fields in your payment requests: * [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-deliveryAddress) * [shopperName](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperName) * [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-lineItems) The details provided in these fields will populate the **Ship to** section of the PayPal checkout. We recommend that you check that your setup is working correctly with a test payment. Make sure that you submit the correct fields, and that the test payment is marked as eligible for PayPal Seller Protection in the transaction details. ## Get the payment outcome You can use the `resultCode` from the API response to show the shopper the [current payment status](/account/payments-lifecycle/). The `resultCode` values you can receive for PayPal are: | resultCode | Description | Action to take | | --------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Authorised** | The payment was successful. | Inform the shopper that the payment was successful. Note that the transaction may still fail, for example due to risk rules that are applied after authorisation. Wait for the [AUTHORISATION](https://docs.adyen.com/api-explorer/Webhooks/latest/post/AUTHORISATION) webhook to learn the final outcome. | | **Pending** or **Received** | The shopper has completed the payment but the final result is not yet known. | Inform the shopper that you received their order, and are waiting for the payment to be completed. Wait for the [AUTHORISATION](https://docs.adyen.com/api-explorer/Webhooks/latest/post/AUTHORISATION) webhook to learn the final outcome. | | **Error** | There was an error when the payment was being processed. | Inform the shopper that there was an error processing their payment. Wait for the [AUTHORISATION](https://docs.adyen.com/api-explorer/Webhooks/latest/post/AUTHORISATION) webhook. This will contain a `refusalReason` that indicates the cause of the error. | | **Refused** | The payment was refused by the shopper's bank. | Ask the shopper to try the payment again using a different payment method. | | **Cancelled** | The shopper canceled the PayPal payment. | Ask the shopper to select a different payment method. | However, the synchronous API response doesn't give you the final outcome. To learn the final status of a payment and determine how to proceed with the order, you should wait for webhooks. This is especially important if you use any [standard risk rules](/risk-management/configure-standard-risk-rules) or [custom risk rules](/risk-management/configure-custom-risk-rules) that trigger **after** authorisation. The webhooks you can receive for PayPal are: | eventCode | success field | Description | Action to take | | --------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [AUTHORISATION](https://docs.adyen.com/api-explorer/Webhooks/latest/post/AUTHORISATION) | **false** | The transaction failed. | Cancel the order and inform the shopper that the payment failed. | | [AUTHORISATION](https://docs.adyen.com/api-explorer/Webhooks/latest/post/AUTHORISATION) | **true** | The shopper successfully completed the payment. | Inform the shopper that the payment has been successful and proceed with the order. | | [OFFER\_CLOSED](https://docs.adyen.com/api-explorer/Webhooks/latest/post/OFFER_CLOSED) | **true** | The shopper did not complete the payment. | Cancel the order and inform the shopper that the payment timed out. Note that you only receive this information if you [enable the OFFER\_CLOSED event code](#add-to-webhooks). | ### Include more information in webhooks For PayPal, we recommend adding the following information to your [standard webhooks](/development-resources/webhooks/webhook-types): * [OFFER\_CLOSED](https://docs.adyen.com/api-explorer/Webhooks/latest/post/OFFER_CLOSED) event code: informs you if the shopper failed to complete the payment. To enable receiving this event code, follow the [instructions for non-default event codes](/development-resources/webhooks/webhook-types/#non-default-event-codes). * PayPal specific details. When enabled, your standard webhooks return the following details as `additionalData`: * `paypalEmail`: the email address of the shopper's PayPal account. * `paypalPayerId`: the shopper's PayPal Payer ID. * `paypalPayerStatus`: indicates if the shopper's account has been verified by PayPal. * `paypalAddressStatus`: indicates if the shopper's address has been confirmed by PayPal. * `paypalProtectionEligibility`: indicates if the payment is eligible for PayPal Seller Protection. * `paypalPayerResidenceCountry`: the shopper's country or region of residence. To enable receiving these details, follow the [instructions for additional settings](/development-resources/webhooks/webhook-types/additional-settings/), making sure to select **Include PayPal Details**. ## Refunds If you have not captured a PayPal payment, you can [cancel](/online-payments/cancel) it. If you have captured the payment and you want to return the funds to the shopper, you need to refund it. ## Recurring payments To prepare for making recurring payments: 1. Enable recurring payments. 2. Configure webhooks to ensure they include details about recurring payments. Then you can make recurring payments: 1. In the initial payment request, include specific parameters to create a token.\ This token represents the shopper's stored payment details. 2. In the later recurring payment requests, use the token. ### Enable recurring payments To enable recurring payments for PayPal, follow these steps: 1. Contact PayPal Support to enable **Reference Transactions** on your seller account. 2. Enable the recurring permissions on your PayPal account. Follow the steps described in the section [Give Adyen access to your PayPal account](/payment-methods/paypal/setup-paypal-direct-merchants/), and also grant the permissions **Charge an existing customer based on a prior transaction** and **Create and manage Recurring Payments**. ### Configure webhooks Enable the [Recurring tokens life cycle events](/development-resources/webhooks/webhook-types/#other-webhooks) webhook to receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook when you create a token. This webhook contains a `storedPaymentMethodId`, that you need to make a recurring payment later. ### Create a token To create a token, include the following parameters in your initial [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) or [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments)payment request: * `recurringProcessingModel`: **Subscription** or **UnscheduledCardOnFile** * `shopperInteraction`: **Ecommerce** * `shopperReference`: Your unique identifier for the shopper * `storePaymentMethod`: **true** * `shopperEmail`: Required when making a zero-value authorization request with `amount.value`: **0**. Do not include this parameter if the request is not for a zero-value authorization. When the payment has been settled, you receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) [webhook](/development-resources/webhooks) containing: * `type`: **recurring.token.created** * `shopperReference`: your unique identifier for the shopper. * `eventId`: the `pspReference` of the initial payment. * `storedPaymentMethodId`: the token that you need to make recurring payments for this shopper. Make sure that your server is able to receive the [Recurring tokens life cycle events](/development-resources/webhooks/webhook-types/#other-webhooks) webhook. You can [set up this webhook in your Customer Area](/development-resources/webhooks/#set-up-webhooks-in-your-customer-area). ### Make a payment with a token To make a later, recurring payment with the token, include in your [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) or [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: * `paymentMethod.storedPaymentMethodId`: The `storedPaymentMethodId` from the [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook. You can also get this value using the [/listRecurringDetails](https://docs.adyen.com/api-explorer/Recurring/latest/post/listRecurringDetails) endpoint. * `shopperReference`: The unique shopper identifier that you specified when creating the token. * `shopperInteraction`: **ContAuth**. * `recurringProcessingModel`: **Subscription** or **UnscheduledCardOnFile**. ## Test and go live When you are done setting up your integration, use your PayPal sandbox accounts to test the PayPal payment flow. Your **business** sandbox account lets you simulate your role as a merchant when testing payments. With your **personal** sandbox account you can simulate the role of a customer. Refer to the following resources: * For instructions to create sandbox accounts, see [Set up PayPal](/payment-methods/paypal/setup-paypal-direct-merchants#dev-sandbox-accounts). * For testing instructions, see the [PayPal sandbox testing guide](https://developer.paypal.com/api/rest/sandbox/). You can check the status of a PayPal test payment in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**. ### Before you go live For live operations, you need to get a live PayPal business account and configure your live environment. See [Set up PayPal](/payment-methods/paypal/setup-paypal-direct-merchants#go-live). Note that in the live environment, PayPal will only be available if: * The shopper is logged in to their PayPal account. * The shopper has at least one valid payment method on their PayPal account. ## See also * [API-only integration guide](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only)