--- title: "Pix React Native Drop-in" description: "Add Pix to your Drop-in integration." url: "https://docs.adyen.com/payment-methods/pix/react-native-drop-in" source_url: "https://docs.adyen.com/payment-methods/pix/react-native-drop-in.md" canonical: "https://docs.adyen.com/payment-methods/pix/react-native-drop-in" last_modified: "2026-05-23T12:56:20+02:00" language: "en" --- # Pix React Native Drop-in Add Pix to your Drop-in integration. [View source](/payment-methods/pix/react-native-drop-in.md) You can add Pix to your existing integration. The following instructions show only what you must add to your integration specifically for Pix. 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. The additions you must make depends on the [server-side flow](/online-payments/build-your-integration) that your integration uses: ## Sessions flow Drop-in ### Before-You-Begin ## Requirements | Requirement | Description | | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Sessions flow [React Native Drop-in integration](/online-payments/build-your-integration/advanced-flow?platform=React%2BNative\&integration=Drop-in). | | | **Checkout API** | Make sure that you use Checkout API v68 or later. | | | **Setup steps** | Before you begin, [add Pix in your Customer Area](/payment-methods/add-payment-methods). | | ### Add-Parameters-Sessions-Request ## Add additional parameters to your /sessions request When you [create a payment session](/online-payments/build-your-integration/sessions-flow?platform=React%2BNative\&integration=Drop-in#create-a-payment-session), add the following parameters: | Parameter | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | [amount](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-amount) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The final price of the purchase. | | [shopperName](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-shopperName) | | Shopper's first name and last name. | | [socialSecurityNumber](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_socialSecurityNumber) | | The shopper's CPF or CNPJ number. This will be shown to the shopper on the Pix payment form. | | [shopperStatement](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_shopperStatement) | | Free-text field that will be shown to the shopper. Maximum length: 140 characters. | | [lineItems.id](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_lineItems-id) | | The name of the purchased item. Maximum 50 characters. | | [lineItems.amountIncludingTax](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_lineItems-amountIncludingTax) | | The price of the purchased item including tax. Maximum 200 characters. | **Example /sessions request** #### curl ```bash curl https://checkout-test.adyen.com/v71/sessions \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'Idempotency-Key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "value": 10000, "currency": "BRL" }, "countryCode": "BR", "returnUrl": "adyencheckout://your.package.name", "reference": "YOUR_PAYMENT_REFERENCE", "sessionValidity": "2021-12-21T13:00:00-03:00", "shopperStatement": "Your message to the shopper", "paymentMethod": { "type": "pix" }, "shopperName": { "firstName": "Jose", "lastName": "Silva" }, "socialSecurityNumber": "01234567890", "lineItems": [ { "id": "item1", "amountIncludingTax": 5000 }, { "id": "item2", "amountIncludingTax": 5000 } ] }' ``` #### Java ```java // Adyen Java API Library v40.0.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() .id("item1") .amountIncludingTax(5000L); LineItem lineItem2 = new LineItem() .id("item2") .amountIncludingTax(5000L); Amount amount = new Amount() .currency("BRL") .value(10000L); ShopperName shopperName = new ShopperName() .firstName("Jose") .lastName("Silva"); CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest() .reference("YOUR_PAYMENT_REFERENCE") .lineItems(Arrays.asList(lineItem1, lineItem2)) .amount(amount) .shopperName(shopperName) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .countryCode("BR") .socialSecurityNumber("01234567890") .returnUrl("adyencheckout://your.package.name") .shopperStatement("Your message to the shopper"); // Send the request PaymentsApi service = new PaymentsApi(client); CreateCheckoutSessionResponse response = service.sessions(createCheckoutSessionRequest, 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 ->setId("item1") ->setAmountIncludingTax(5000); $lineItem2 = new LineItem(); $lineItem2 ->setId("item2") ->setAmountIncludingTax(5000); $amount = new Amount(); $amount ->setCurrency("BRL") ->setValue(10000); $shopperName = new ShopperName(); $shopperName ->setFirstName("Jose") ->setLastName("Silva"); $createCheckoutSessionRequest = new CreateCheckoutSessionRequest(); $createCheckoutSessionRequest ->setReference("YOUR_PAYMENT_REFERENCE") ->setLineItems(array($lineItem1, $lineItem2)) ->setAmount($amount) ->setShopperName($shopperName) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setCountryCode("BR") ->setSocialSecurityNumber("01234567890") ->setReturnUrl("adyencheckout://your.package.name") ->setShopperStatement("Your message to the shopper"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->sessions($createCheckoutSessionRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v32.2.1 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 { Id = "item1", AmountIncludingTax = 5000 }; LineItem lineItem2 = new LineItem { Id = "item2", AmountIncludingTax = 5000 }; Amount amount = new Amount { Currency = "BRL", Value = 10000 }; ShopperName shopperName = new ShopperName { FirstName = "Jose", LastName = "Silva" }; CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest { Reference = "YOUR_PAYMENT_REFERENCE", LineItems = new List{ lineItem1, lineItem2 }, Amount = amount, ShopperName = shopperName, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", CountryCode = "BR", SocialSecurityNumber = "01234567890", ReturnUrl = "adyencheckout://your.package.name", ShopperStatement = "Your message to the shopper" }; // Send the request var service = new PaymentsService(client); var response = service.Sessions(createCheckoutSessionRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 const { Client, CheckoutAPI } = 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 createCheckoutSessionRequest = { merchantAccount: "YOUR_MERCHANT_ACCOUNT", amount: { value: 10000, currency: "BRL" }, countryCode: "BR", returnUrl: "adyencheckout://your.package.name", reference: "YOUR_PAYMENT_REFERENCE", sessionValidity: "2021-12-21T13:00:00-03:00", shopperStatement: "Your message to the shopper", paymentMethod: { type: "pix" }, shopperName: { firstName: "Jose", lastName: "Silva" }, socialSecurityNumber: "01234567890", lineItems: [ { id: "item1", amountIncludingTax: 5000 }, { id: "item2", amountIncludingTax: 5000 } ] } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.1.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{ Id: common.PtrString("item1"), AmountIncludingTax: common.PtrInt64(5000), } lineItem2 := checkout.LineItem{ Id: common.PtrString("item2"), AmountIncludingTax: common.PtrInt64(5000), } amount := checkout.Amount{ Currency: "BRL", Value: 10000, } shopperName := checkout.ShopperName{ FirstName: "Jose", LastName: "Silva", } createCheckoutSessionRequest := checkout.CreateCheckoutSessionRequest{ Reference: "YOUR_PAYMENT_REFERENCE", LineItems: []checkout.LineItem{ lineItem1, lineItem2, }, Amount: amount, ShopperName: &shopperName, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", CountryCode: common.PtrString("BR"), SocialSecurityNumber: common.PtrString("01234567890"), ReturnUrl: "adyencheckout://your.package.name", ShopperStatement: common.PtrString("Your message to the shopper"), } // Send the request service := client.Checkout() req := service.PaymentsApi.SessionsInput().IdempotencyKey("UUID").CreateCheckoutSessionRequest(createCheckoutSessionRequest) res, httpRes, err := service.PaymentsApi.Sessions(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v13.6.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": "YOUR_MERCHANT_ACCOUNT", "amount": { "value": 10000, "currency": "BRL" }, "countryCode": "BR", "returnUrl": "adyencheckout://your.package.name", "reference": "YOUR_PAYMENT_REFERENCE", "sessionValidity": "2021-12-21T13:00:00-03:00", "shopperStatement": "Your message to the shopper", "paymentMethod": { "type": "pix" }, "shopperName": { "firstName": "Jose", "lastName": "Silva" }, "socialSecurityNumber": "01234567890", "lineItems": [ { "id": "item1", "amountIncludingTax": 5000 }, { "id": "item2", "amountIncludingTax": 5000 } ] } # Send the request result = adyen.checkout.payments_api.sessions(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.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 => 'YOUR_MERCHANT_ACCOUNT', :amount => { :value => 10000, :currency => 'BRL' }, :countryCode => 'BR', :returnUrl => 'adyencheckout://your.package.name', :reference => 'YOUR_PAYMENT_REFERENCE', :sessionValidity => '2021-12-21T13:00:00-03:00', :shopperStatement => 'Your message to the shopper', :paymentMethod => { :type => 'pix' }, :shopperName => { :firstName => 'Jose', :lastName => 'Silva' }, :socialSecurityNumber => '01234567890', :lineItems => [ { :id => 'item1', :amountIncludingTax => 5000 }, { :id => 'item2', :amountIncludingTax => 5000 } ] } # Send the request result = adyen.checkout.payments_api.sessions(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.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 = { id: "item1", amountIncludingTax: 5000 }; const lineItem2: Types.checkout.LineItem = { id: "item2", amountIncludingTax: 5000 }; const amount: Types.checkout.Amount = { currency: "BRL", value: 10000 }; const shopperName: Types.checkout.ShopperName = { firstName: "Jose", lastName: "Silva" }; const createCheckoutSessionRequest: Types.checkout.CreateCheckoutSessionRequest = { reference: "YOUR_PAYMENT_REFERENCE", lineItems: [lineItem1, lineItem2], amount: amount, shopperName: shopperName, merchantAccount: "YOUR_MERCHANT_ACCOUNT", countryCode: "BR", socialSecurityNumber: "01234567890", returnUrl: "adyencheckout://your.package.name", shopperStatement: "Your message to the shopper" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` ### Add-Configuration ## Add additional configuration for Pix You do not need to add any configuration parameters for Pix. ## Refunds You can refund a payment within 90 days after the payment in the [Customer Area](/account/manage-payments#refund-a-payment) or via an [API](/online-payments/refund). ## Test and go live Pix is an asynchronous payment method. In the test environment, you can simulate a Pix payment by promoting the pending payment to a sale. 1. Log in to your [test Customer Area](https://ca-test.adyen.com/). 2. Go to **Transactions** > **Offers**. 3. Select the **PSP reference** of the pending Pix payment. 4. Select the **Promote this offer to a sale** button. Pix payments that have been paid (including test offers that you manually promoted to sale) are under **Transactions** > **Payments**. Test the reconciliation process by promoting test payments from offer to sale in your test Customer Area. Before you can accept live Pix payments, you need to [submit a request for Pix](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## Advanced flow Drop-in ### Before-You-Begin ## Requirements | Requirement | Description | | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Advanced flow [React Native Drop-in integration](/online-payments/build-your-integration/advanced-flow?platform=React%2BNative\&integration=Drop-in). | | | **Action handling** | Make sure that your existing integration is set up to [handle the additional action](/online-payments/build-your-integration/advanced-flow/?platform=React%2BNative\&integration=Drop-in#handle-the-redirect). `action.type`: **qrCode**. | | | **Setup steps** | Before you begin, [add Pix in your Customer Area](/payment-methods/add-payment-methods). | | ### Add-Configuration ## Add additional configuration for Pix You do not need to add any configuration parameters for Pix. ### Add-Parameters-Payments-Request ## Add additional parameters to your /payments request When you [make a payment](/online-payments/build-your-integration/advanced-flow/?platform=React%2BNative\&integration=Drop-in#make-a-payment), add the following parameters to the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: | Parameter | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [paymentMethod](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-paymentMethod) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The `state.data.paymentMethod` from the `onSubmit` event from your front end. | | [amount](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_amount) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The final price of the purchase. | | [shopperName](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperName) | | Shopper's first name and last name. | | [socialSecurityNumber](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_socialSecurityNumber) | | The shopper's CPF or CNPJ number. This will be shown to the shopper on the Pix payment form. | | [shopperStatement](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_shopperStatement) | | Free-text field that will be shown to the shopper. By default this contains the message: *$merchantName - Este pagamento PIX para $merchantName é processado por Adyen.* If you provide any value, keep the length under 60 characters. | | [sessionValidity](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_sessionValidity) | | The expiration date of the Pix payment. Default: 1 hour (Checkout API v71 or earlier) or 24 hours (Checkout API v72 or later). | | [lineItems.id](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_lineItems-id) | | The name of the purchased item. Maximum 50 characters. | | [lineItems.amountIncludingTax](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__reqParam_lineItems-amountIncludingTax) | | The price of the purchased item including tax. Maximum 200 characters. | It is advisable to send both `shopperName` and `socialSecurityNumber`, because this information will be shown to the shopper to help identify the payment. **Example payment request for Pix** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "amount": { "currency": "BRL", "value": 10000 }, "countryCode": "BR", "returnUrl": "adyencheckout://your.package.name", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_PAYMENT_REFERENCE", "paymentMethod": { "type": "pix" }, "shopperName": { "firstName": "Jose", "lastName": "Silva" }, "socialSecurityNumber": "01234567890", "shopperStatement": "Your message to the shopper", "sessionValidity": "2025-10-01T10:00:00+02:00", "lineItems": [ { "id": "item1", "amountIncludingTax": 5000 }, { "id": "item2", "amountIncludingTax": 5000 } ] }' ``` #### Java ```java // Adyen Java API Library v40.0.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() .id("item1") .amountIncludingTax(5000L); LineItem lineItem2 = new LineItem() .id("item2") .amountIncludingTax(5000L); Amount amount = new Amount() .currency("BRL") .value(10000L); ShopperName shopperName = new ShopperName() .firstName("Jose") .lastName("Silva"); PixDetails pixDetails = new PixDetails() .type(PixDetails.TypeEnum.PIX); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_PAYMENT_REFERENCE") .lineItems(Arrays.asList(lineItem1, lineItem2)) .amount(amount) .shopperName(shopperName) .sessionValidity("2025-10-01T10:00:00+02:00") .merchantAccount("YOUR_MERCHANT_ACCOUNT") .countryCode("BR") .socialSecurityNumber("01234567890") .paymentMethod(new CheckoutPaymentMethod(pixDetails)) .returnUrl("adyencheckout://your.package.name") .shopperStatement("Your message to the shopper"); // 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 ->setId("item1") ->setAmountIncludingTax(5000); $lineItem2 = new LineItem(); $lineItem2 ->setId("item2") ->setAmountIncludingTax(5000); $amount = new Amount(); $amount ->setCurrency("BRL") ->setValue(10000); $shopperName = new ShopperName(); $shopperName ->setFirstName("Jose") ->setLastName("Silva"); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setType("pix"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_PAYMENT_REFERENCE") ->setLineItems(array($lineItem1, $lineItem2)) ->setAmount($amount) ->setShopperName($shopperName) ->setSessionValidity("2025-10-01T10:00:00+02:00") ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setCountryCode("BR") ->setSocialSecurityNumber("01234567890") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("adyencheckout://your.package.name") ->setShopperStatement("Your message to the shopper"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v32.2.1 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 { Id = "item1", AmountIncludingTax = 5000 }; LineItem lineItem2 = new LineItem { Id = "item2", AmountIncludingTax = 5000 }; Amount amount = new Amount { Currency = "BRL", Value = 10000 }; ShopperName shopperName = new ShopperName { FirstName = "Jose", LastName = "Silva" }; PixDetails pixDetails = new PixDetails { Type = PixDetails.TypeEnum.Pix }; PaymentRequest paymentRequest = new PaymentRequest { Reference = "YOUR_PAYMENT_REFERENCE", LineItems = new List{ lineItem1, lineItem2 }, Amount = amount, ShopperName = shopperName, SessionValidity = "2025-10-01T10:00:00+02:00", MerchantAccount = "YOUR_MERCHANT_ACCOUNT", CountryCode = "BR", SocialSecurityNumber = "01234567890", PaymentMethod = new CheckoutPaymentMethod(pixDetails), ReturnUrl = "adyencheckout://your.package.name", ShopperStatement = "Your message to the shopper" }; // 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.0.0 const { Client, CheckoutAPI } = 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 = { amount: { currency: "BRL", value: 10000 }, countryCode: "BR", returnUrl: "adyencheckout://your.package.name", merchantAccount: "YOUR_MERCHANT_ACCOUNT", reference: "YOUR_PAYMENT_REFERENCE", paymentMethod: { type: "pix" }, shopperName: { firstName: "Jose", lastName: "Silva" }, socialSecurityNumber: "01234567890", shopperStatement: "Your message to the shopper", sessionValidity: "2025-10-01T10:00:00+02:00", lineItems: [ { id: "item1", amountIncludingTax: 5000 }, { id: "item2", amountIncludingTax: 5000 } ] } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.1.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{ Id: common.PtrString("item1"), AmountIncludingTax: common.PtrInt64(5000), } lineItem2 := checkout.LineItem{ Id: common.PtrString("item2"), AmountIncludingTax: common.PtrInt64(5000), } amount := checkout.Amount{ Currency: "BRL", Value: 10000, } shopperName := checkout.ShopperName{ FirstName: "Jose", LastName: "Silva", } pixDetails := checkout.PixDetails{ Type: common.PtrString("pix"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_PAYMENT_REFERENCE", LineItems: []checkout.LineItem{ lineItem1, lineItem2, }, Amount: amount, ShopperName: &shopperName, SessionValidity: common.PtrString("2025-10-01T10:00:00+02:00"), MerchantAccount: "YOUR_MERCHANT_ACCOUNT", CountryCode: common.PtrString("BR"), SocialSecurityNumber: common.PtrString("01234567890"), PaymentMethod: checkout.PixDetailsAsCheckoutPaymentMethod(&pixDetails), ReturnUrl: "adyencheckout://your.package.name", ShopperStatement: common.PtrString("Your message to the shopper"), } // 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 v13.6.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 = { "amount": { "currency": "BRL", "value": 10000 }, "countryCode": "BR", "returnUrl": "adyencheckout://your.package.name", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "reference": "YOUR_PAYMENT_REFERENCE", "paymentMethod": { "type": "pix" }, "shopperName": { "firstName": "Jose", "lastName": "Silva" }, "socialSecurityNumber": "01234567890", "shopperStatement": "Your message to the shopper", "sessionValidity": "2025-10-01T10:00:00+02:00", "lineItems": [ { "id": "item1", "amountIncludingTax": 5000 }, { "id": "item2", "amountIncludingTax": 5000 } ] } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.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 = { :amount => { :currency => 'BRL', :value => 10000 }, :countryCode => 'BR', :returnUrl => 'adyencheckout://your.package.name', :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :reference => 'YOUR_PAYMENT_REFERENCE', :paymentMethod => { :type => 'pix' }, :shopperName => { :firstName => 'Jose', :lastName => 'Silva' }, :socialSecurityNumber => '01234567890', :shopperStatement => 'Your message to the shopper', :sessionValidity => '2025-10-01T10:00:00+02:00', :lineItems => [ { :id => 'item1', :amountIncludingTax => 5000 }, { :id => 'item2', :amountIncludingTax => 5000 } ] } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.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 = { id: "item1", amountIncludingTax: 5000 }; const lineItem2: Types.checkout.LineItem = { id: "item2", amountIncludingTax: 5000 }; const amount: Types.checkout.Amount = { currency: "BRL", value: 10000 }; const shopperName: Types.checkout.ShopperName = { firstName: "Jose", lastName: "Silva" }; const pixDetails: Types.checkout.PixDetails = { type: Types.checkout.PixDetails.TypeEnum.Pix }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_PAYMENT_REFERENCE", lineItems: [lineItem1, lineItem2], amount: amount, shopperName: shopperName, sessionValidity: "2025-10-01T10:00:00+02:00", merchantAccount: "YOUR_MERCHANT_ACCOUNT", countryCode: "BR", socialSecurityNumber: "01234567890", paymentMethod: pixDetails, returnUrl: "adyencheckout://your.package.name", shopperStatement: "Your message to the shopper" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` The response includes the `action.type`: qrCode. **Example response with an additional action** ```json { "additionalData": { "pix.expirationDate": "2021-12-21T13:00:00-03:00", "acquirerReference": "00000000008815658961765250", "acquirerAccountCode": "PixBTGAcquirerAccount" }, "pspReference": "8815658961765250", "resultCode": "Pending", "action": { "paymentData": "Ab02b4c0!BQABAgA...", "paymentMethodType": "pix", "type": "qrCode", "qrCodeData": "DMhpN90TFR2e7TzwHYRFkhw4brxm2wHBg" } } ``` ## Refunds You can refund a payment within 90 days after the payment in the [Customer Area](/account/manage-payments#refund-a-payment) or via an [API](/online-payments/refund). ## Test and go live Pix is an asynchronous payment method. In the test environment, you can simulate a Pix payment by promoting the pending payment to a sale. 1. Log in to your [test Customer Area](https://ca-test.adyen.com/). 2. Go to **Transactions** > **Offers**. 3. Select the **PSP reference** of the pending Pix payment. 4. Select the **Promote this offer to a sale** button. Pix payments that have been paid (including test offers that you manually promoted to sale) are under **Transactions** > **Payments**. Test the reconciliation process by promoting test payments from offer to sale in your test Customer Area. Before you can accept live Pix payments, you need to [submit a request for Pix](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/).