--- title: "PayBright Drop-in integration" description: "Add PayBright to anexisting iOS Drop-in integration." url: "https://docs.adyen.com/payment-methods/paybright/ios-drop-in" source_url: "https://docs.adyen.com/payment-methods/paybright/ios-drop-in.md" canonical: "https://docs.adyen.com/payment-methods/paybright/ios-drop-in" last_modified: "2026-05-25T12:55:01+02:00" language: "en" --- # PayBright Drop-in integration Add PayBright to anexisting iOS Drop-in integration. [View source](/payment-methods/paybright/ios-drop-in.md) PayBright has been acquired by [Affirm](/payment-methods/affirm). Adyen will not accept new PayBright integrations. This page explains how to add PayBright to your existing iOS Drop-in integration. ## Requirements Select the [server-side flow](/online-payments/build-your-integration) that your integration uses: ### Tab: Sessions flow | Requirement | Description | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built a Sessions flow [iOS Drop-in integration](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Drop-in). | | **Setup steps** | Before you begin, [add PayBright in your Customer Area](/payment-methods/add-payment-methods). | ### Tab: Advanced flow | Requirement | Description | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Integration type** | Make sure that you have built an Advanced flow [iOS Drop-in integration](/online-payments/build-your-integration/advanced-flow?platform=iOS\&integration=Drop-in). | | **Setup steps** | Before you begin, [add PayBright in your Customer Area](/payment-methods/add-payment-methods). | ## API reference Select which endpoint you are using: ### Tab: `/sessions` This is the default with [Drop-in v5.0.0](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Drop-in) or later. | Parameter name | Required | Description | | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | [shopperName](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-shopperName) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Shopper's first name and last name. | | [dateOfBirth](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/sessions__reqParam_dateOfBirth) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's date of birth. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-shopperEmail) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's email address. | | [telephoneNumber](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__resParam_telephoneNumber) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's phone number. | | [countryCode](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__resParam_countryCode) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's country. For example, `CA`. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-billingAddress) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The address where to send the invoice. | | [shopperReference](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_shopperReference) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | A unique reference to identify the shopper (minimum length three characters). | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-deliveryAddress) | | The address where the purchased goods should be delivered. If blank or missing, `billingAddress` is used by default. | | [shopperLocale](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__resParam_shopperLocale) | | A combination of language code and country code to define which language should be used in the PayBright checkout page. | | [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-lineItems) | | Price and product information about the purchased items. This is optional, but we recommend to include this data to improve approval rates. | #### curl ```bash curl https://checkout-test.adyen.com/v69/sessions \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "countryCode":"CA", "amount":{ "currency":"", "value":6000 }, "shopperLocale":"", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "reference":"YOUR_ORDER_NUMBER", "shopperName":{ "firstName":"", "lastName":"" }, "dateOfBirth":"", "telephoneNumber":"", "shopperEmail":"", "{hint:state.data.billingAddress from onSubmit}billingAddress{/hint}":{ "city":"", "country":"CA", "houseNumberOrName":"", "postalCode":"", "stateOrProvince":"", "street":"" }, "{hint:state.data.deliveryAddress from onSubmit}deliveryAddress{/hint}":{ "city":"", "country":"CA", "houseNumberOrName":"", "postalCode":"", "stateOrProvince":"", "street":"" }, "returnUrl":"my-app://adyen", "lineItems":[ { "description":"Shoes", "quantity":"1", "amountIncludingTax":"4000", "amountExcludingTax":"3310", "taxCategory":"Low" }, { "description":"Socks", "quantity":"2", "amountIncludingTax":"3000", "amountExcludingTax":"2480", "taxCategory":"Low" }, { "description":"Discount", "amountExcludingTax":"-1000", "amountIncludingTax":"-1000", "quantity":"1", "taxCategory":"Low" } ] }' ``` #### Java ```java // Adyen Java API Library v39.3.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) Amount amount = new Amount() .currency("") .value(6000L); LineItem lineItem1 = new LineItem() .quantity(1L) .amountExcludingTax(3310L) .description("Shoes") .amountIncludingTax(4000L); LineItem lineItem2 = new LineItem() .quantity(2L) .amountExcludingTax(2480L) .description("Socks") .amountIncludingTax(3000L); LineItem lineItem3 = new LineItem() .quantity(1L) .amountExcludingTax(-1000L) .description("Discount") .amountIncludingTax(-1000L); Name name = new Name() .firstName("") .lastName(""); DeliveryAddress deliveryAddress = new DeliveryAddress() .country("CA") .stateOrProvince("") .city("") .houseNumberOrName("") .street("") .postalCode(""); BillingAddress billingAddress = new BillingAddress() .country("CA") .stateOrProvince("") .city("") .houseNumberOrName("") .street("") .postalCode(""); CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest() .amount(amount) .telephoneNumber("") .shopperEmail("") .reference("YOUR_ORDER_NUMBER") .lineItems(Arrays.asList(lineItem1, lineItem2, lineItem3)) .shopperName(name) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .deliveryAddress(deliveryAddress) .countryCode("CA") .shopperLocale("") .billingAddress(billingAddress) .returnUrl("my-app://adyen") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // 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) $amount = new Amount(); $amount ->setCurrency("") ->setValue(6000); $lineItem1 = new LineItem(); $lineItem1 ->setQuantity(1) ->setAmountExcludingTax(3310) ->setDescription("Shoes") ->setAmountIncludingTax(4000); $lineItem2 = new LineItem(); $lineItem2 ->setQuantity(2) ->setAmountExcludingTax(2480) ->setDescription("Socks") ->setAmountIncludingTax(3000); $lineItem3 = new LineItem(); $lineItem3 ->setQuantity(1) ->setAmountExcludingTax(-1000) ->setDescription("Discount") ->setAmountIncludingTax(-1000); $name = new Name(); $name ->setFirstName("") ->setLastName(""); $deliveryAddress = new DeliveryAddress(); $deliveryAddress ->setCountry("CA") ->setStateOrProvince("") ->setCity("") ->setHouseNumberOrName("") ->setStreet("") ->setPostalCode(""); $billingAddress = new BillingAddress(); $billingAddress ->setCountry("CA") ->setStateOrProvince("") ->setCity("") ->setHouseNumberOrName("") ->setStreet("") ->setPostalCode(""); $createCheckoutSessionRequest = new CreateCheckoutSessionRequest(); $createCheckoutSessionRequest ->setAmount($amount) ->setTelephoneNumber("") ->setShopperEmail("") ->setReference("YOUR_ORDER_NUMBER") ->setLineItems(array($lineItem1, $lineItem2, $lineItem3)) ->setShopperName($name) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setDeliveryAddress($deliveryAddress) ->setCountryCode("CA") ->setShopperLocale("") ->setBillingAddress($billingAddress) ->setReturnUrl("my-app://adyen") ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->sessions($createCheckoutSessionRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v32.1.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) Amount amount = new Amount { Currency = "", Value = 6000 }; LineItem lineItem1 = new LineItem { Quantity = 1, AmountExcludingTax = 3310, Description = "Shoes", AmountIncludingTax = 4000 }; LineItem lineItem2 = new LineItem { Quantity = 2, AmountExcludingTax = 2480, Description = "Socks", AmountIncludingTax = 3000 }; LineItem lineItem3 = new LineItem { Quantity = 1, AmountExcludingTax = -1000, Description = "Discount", AmountIncludingTax = -1000 }; Name name = new Name { FirstName = "", LastName = "" }; DeliveryAddress deliveryAddress = new DeliveryAddress { Country = "CA", StateOrProvince = "", City = "", HouseNumberOrName = "", Street = "", PostalCode = "" }; BillingAddress billingAddress = new BillingAddress { Country = "CA", StateOrProvince = "", City = "", HouseNumberOrName = "", Street = "", PostalCode = "" }; CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest { Amount = amount, TelephoneNumber = "", ShopperEmail = "", Reference = "YOUR_ORDER_NUMBER", LineItems = new List{ lineItem1, lineItem2, lineItem3 }, ShopperName = name, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", DeliveryAddress = deliveryAddress, CountryCode = "CA", ShopperLocale = "", BillingAddress = billingAddress, ReturnUrl = "my-app://adyen", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; // 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 v29.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", countryCode: "CA", amount: { currency: "", value: 6000 }, shopperLocale: "", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", reference: "YOUR_ORDER_NUMBER", shopperName: { firstName: "", lastName: "" }, dateOfBirth: "", telephoneNumber: "", shopperEmail: "", billingAddress: { city: "", country: "CA", houseNumberOrName: "", postalCode: "", stateOrProvince: "", street: "" }, deliveryAddress: { city: "", country: "CA", houseNumberOrName: "", postalCode: "", stateOrProvince: "", street: "" }, returnUrl: "my-app://adyen", lineItems: [ { description: "Shoes", quantity: "1", amountIncludingTax: "4000", amountExcludingTax: "3310", taxCategory: "Low" }, { description: "Socks", quantity: "2", amountIncludingTax: "3000", amountExcludingTax: "2480", taxCategory: "Low" }, { description: "Discount", amountExcludingTax: "-1000", amountIncludingTax: "-1000", quantity: "1", taxCategory: "Low" } ] } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.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) amount := checkout.Amount{ Currency: "", Value: 6000, } lineItem1 := checkout.LineItem{ Quantity: common.PtrInt64(1), AmountExcludingTax: common.PtrInt64(3310), Description: common.PtrString("Shoes"), AmountIncludingTax: common.PtrInt64(4000), } lineItem2 := checkout.LineItem{ Quantity: common.PtrInt64(2), AmountExcludingTax: common.PtrInt64(2480), Description: common.PtrString("Socks"), AmountIncludingTax: common.PtrInt64(3000), } lineItem3 := checkout.LineItem{ Quantity: common.PtrInt64(1), AmountExcludingTax: common.PtrInt64(-1000), Description: common.PtrString("Discount"), AmountIncludingTax: common.PtrInt64(-1000), } name := checkout.Name{ FirstName: "", LastName: "", } deliveryAddress := checkout.DeliveryAddress{ Country: "CA", StateOrProvince: common.PtrString(""), City: "", HouseNumberOrName: "", Street: "", PostalCode: "", } billingAddress := checkout.BillingAddress{ Country: "CA", StateOrProvince: common.PtrString(""), City: "", HouseNumberOrName: "", Street: "", PostalCode: "", } createCheckoutSessionRequest := checkout.CreateCheckoutSessionRequest{ Amount: amount, TelephoneNumber: common.PtrString(""), ShopperEmail: common.PtrString(""), Reference: "YOUR_ORDER_NUMBER", LineItems: []checkout.LineItem{ lineItem1, lineItem2, lineItem3, }, ShopperName: &name, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", DeliveryAddress: &deliveryAddress, CountryCode: common.PtrString("CA"), ShopperLocale: common.PtrString(""), BillingAddress: &billingAddress, ReturnUrl: "my-app://adyen", ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"), } // 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", "countryCode": "CA", "amount": { "currency": "", "value": 6000 }, "shopperLocale": "", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "reference": "YOUR_ORDER_NUMBER", "shopperName": { "firstName": "", "lastName": "" }, "dateOfBirth": "", "telephoneNumber": "", "shopperEmail": "", "billingAddress": { "city": "", "country": "CA", "houseNumberOrName": "", "postalCode": "", "stateOrProvince": "", "street": "" }, "deliveryAddress": { "city": "", "country": "CA", "houseNumberOrName": "", "postalCode": "", "stateOrProvince": "", "street": "" }, "returnUrl": "my-app://adyen", "lineItems": [ { "description": "Shoes", "quantity": "1", "amountIncludingTax": "4000", "amountExcludingTax": "3310", "taxCategory": "Low" }, { "description": "Socks", "quantity": "2", "amountIncludingTax": "3000", "amountExcludingTax": "2480", "taxCategory": "Low" }, { "description": "Discount", "amountExcludingTax": "-1000", "amountIncludingTax": "-1000", "quantity": "1", "taxCategory": "Low" } ] } # Send the request result = adyen.checkout.payments_api.sessions(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v10.4.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', :countryCode => 'CA', :amount => { :currency => '', :value => 6000 }, :shopperLocale => '', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :reference => 'YOUR_ORDER_NUMBER', :shopperName => { :firstName => '', :lastName => '' }, :dateOfBirth => '', :telephoneNumber => '', :shopperEmail => '', :billingAddress => { :city => '', :country => 'CA', :houseNumberOrName => '', :postalCode => '', :stateOrProvince => '', :street => '' }, :deliveryAddress => { :city => '', :country => 'CA', :houseNumberOrName => '', :postalCode => '', :stateOrProvince => '', :street => '' }, :returnUrl => 'my-app://adyen', :lineItems => [ { :description => 'Shoes', :quantity => '1', :amountIncludingTax => '4000', :amountExcludingTax => '3310', :taxCategory => 'Low' }, { :description => 'Socks', :quantity => '2', :amountIncludingTax => '3000', :amountExcludingTax => '2480', :taxCategory => 'Low' }, { :description => 'Discount', :amountExcludingTax => '-1000', :amountIncludingTax => '-1000', :quantity => '1', :taxCategory => 'Low' } ] } # Send the request result = adyen.checkout.payments_api.sessions(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v29.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 amount: Types.checkout.Amount = { currency: "", value: 6000 }; const lineItem1: Types.checkout.LineItem = { quantity: 1, amountExcludingTax: 3310, description: "Shoes", amountIncludingTax: 4000 }; const lineItem2: Types.checkout.LineItem = { quantity: 2, amountExcludingTax: 2480, description: "Socks", amountIncludingTax: 3000 }; const lineItem3: Types.checkout.LineItem = { quantity: 1, amountExcludingTax: -1000, description: "Discount", amountIncludingTax: -1000 }; const name: Types.checkout.Name = { firstName: "", lastName: "" }; const deliveryAddress: Types.checkout.DeliveryAddress = { country: "CA", stateOrProvince: "", city: "", houseNumberOrName: "", street: "", postalCode: "" }; const billingAddress: Types.checkout.BillingAddress = { country: "CA", stateOrProvince: "", city: "", houseNumberOrName: "", street: "", postalCode: "" }; const createCheckoutSessionRequest: Types.checkout.CreateCheckoutSessionRequest = { amount: amount, telephoneNumber: "", shopperEmail: "", reference: "YOUR_ORDER_NUMBER", lineItems: [lineItem1, lineItem2, lineItem3], shopperName: name, merchantAccount: "YOUR_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "CA", shopperLocale: "", billingAddress: billingAddress, returnUrl: "my-app://adyen", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` ### Tab: `/payments` If you implemented an [additional use case](/online-payments/build-your-integration). | Parameter name | Required | Description | | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | [shopperName](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperName) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Shopper's first name and last name. | | [dateOfBirth](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-dateOfBirth) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's date of birth. | | [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's email address. | | [telephoneNumber](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_telephoneNumber) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's phone number. | | [countryCode](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_countryCode) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's country. For example, `CA`. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-billingAddress) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The address where to send the invoice. | | [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | A unique reference to identify the shopper (minimum length three characters). | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-deliveryAddress) | | The address where the purchased goods should be delivered. If blank or missing, `billingAddress` is used by default. | | [shopperLocale](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_shopperLocale) | | A combination of language code and country code to define which language should be used in the PayBright checkout page. | | [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems) | | Price and product information about the purchased items. This is optional, but we recommend to include this data to improve approval rates. | #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "countryCode":"CA", "amount":{ "currency":"", "value":6000 }, "shopperLocale":"", "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "reference":"YOUR_ORDER_NUMBER", "paymentMethod":{ "type":"paybright" }, "shopperName":{ "firstName":"", "lastName":"" }, "dateOfBirth":"", "telephoneNumber":"", "shopperEmail":"", "{hint:state.data.billingAddress from onSubmit}billingAddress{/hint}":{ "city":"", "country":"CA", "houseNumberOrName":"", "postalCode":"", "stateOrProvince":"", "street":"" }, "{hint:state.data.deliveryAddress from onSubmit}deliveryAddress{/hint}":{ "city":"", "country":"CA", "houseNumberOrName":"", "postalCode":"", "stateOrProvince":"", "street":"" }, "returnUrl":"my-app://adyen", "lineItems":[ { "description":"Shoes", "quantity":"1", "amountIncludingTax":"4000", "amountExcludingTax":"3310", "taxCategory":"Low" }, { "description":"Socks", "quantity":"2", "amountIncludingTax":"3000", "amountExcludingTax":"2480", "taxCategory":"Low" }, { "description":"Discount", "amountExcludingTax":"-1000", "amountIncludingTax":"-1000", "quantity":"1", "taxCategory":"Low" } ] }' ``` #### Java ```java Client client = new Client("ADYEN_API_KEY", Environment.TEST); Checkout checkout = new Checkout(client); PaymentsRequest paymentsRequest = new PaymentsRequest(); paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); paymentsRequest.setCountryCode("CA"); Amount amount = new Amount(); amount.setCurrency("USD"); amount.setValue(6000L); paymentsRequest.setAmount(amount); paymentsRequest.setShopperLocale(""); paymentsRequest.setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); paymentsRequest.setReference("YOUR_ORDER_NUMBER"); paymentsRequest.setChannel(PaymentsRequest.ChannelEnum.WEB); DefaultPaymentMethodDetails defaultPaymentMethodDetails = new DefaultPaymentMethodDetails(); defaultPaymentMethodDetails.setType("paybright"); paymentsRequest.setPaymentMethod(defaultPaymentMethodDetails); Name shopperName = new Name(); shopperName.setFirstName(""); shopperName.setLastName(""); paymentsRequest.setTelephoneNumber(""); paymentsRequest.setShopperEmail(""); paymentsRequest.setDateOfBirth(""); Address billingAddress = new Address(); billingAddress.setStreet(""); billingAddress.setHouseNumberOrName(""); billingAddress.setCity(""); billingAddress.setPostalCode(""); billingAddress.setStateOrProvince(""); billingAddress.setCountry("CA"); paymentsRequest.setBillingAddress(billingAddress); Address deliveryAddress = new Address(); deliveryAddress.setStreet(""); deliveryAddress.setHouseNumberOrName(""); deliveryAddress.setCity(""); deliveryAddress.setPostalCode(""); deliveryAddress.setStateOrProvince(""); deliveryAddress.setCountry("CA"); paymentsRequest.setDeliveryAddress(deliveryAddress); paymentsRequest.setReturnUrl("my-app://adyen"); List lineItems = new ArrayList<>(); lineItems.add( new LineItem() .quantity(1L) .amountExcludingTax(3310L) .description("Shoes") .amountIncludingTax(4000L) .taxCategory("Low") ); lineItems.add( new LineItem() .quantity(2L) .amountExcludingTax(2480L) .description("Socks") .amountIncludingTax(3000L) .taxCategory("Low") ); lineItems.add( new LineItem() .quantity(1L) .amountExcludingTax(1000L) .description("Discount") .amountIncludingTax(1000L) .taxCategory("Low") ); paymentsRequest.setLineItems(lineItems); PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest); ``` #### PHP ```php // Set your X-API-KEY with the API key from the Customer Area. $client = new \Adyen\Client(); $client->setXApiKey("ADYEN_API_KEY"); $service = new \Adyen\Service\Checkout($client); $params = [ "merchantAccount" => "YOUR_MERCHANT_ACCOUNT", "countryCode" => "CA", "shopperLocale" => "", "amount" => [ "currency" => "USD", "value" => 6000 ], "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID", "reference" => "YOUR_ORDER_NUMBER", "paymentMethod" => [ "type" => "paybright" ], "shopperName" => [ "firstName" => "", "lastName" => "" ], "telephoneNumber" => "", "shopperEmail" => "", "dateOfBirth" => "", "billingAddress" => [ "city" => "", "country" => "CA", "houseNumberOrName" => "", "postalCode" => "", "stateOrProvince" => "", "street" => "" ], "deliveryAddress" => [ "city" => "", "country" => "CA", "houseNumberOrName" => "", "postalCode" => "", "stateOrProvince" => "", "street" => "" ], "returnUrl" => "my-app://adyen", "lineItems" => [ [ "quantity" => "1", "amountExcludingTax" => "3310", "description" => "Shoes", "amountIncludingTax" => "4000", "taxCategory" => "Low" ], [ "quantity" => "2", "amountExcludingTax" => "2480", "description" => "Socks", "amountIncludingTax" => "3000", "taxCategory" => "Low" ], [ "quantity" => "1", "amountExcludingTax" => "-1000", "description" => "Discount", "amountIncludingTax" => "-1000", "taxCategory" => "Low" ] ] ]; $result = $service->payments($params); // Check if further action is needed if (array_key_exists("action", $result)){ // Pass the action object to your frontend. // $result["action"] } else { // No further action needed, pass the resultCode to your front end // $result['resultCode'] } ``` #### C\# ```cs var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest { MerchantAccount = "YOUR_MERCHANT_ACCOUNT", CountryCode = "CA", Amount = new Adyen.Model.Checkout.Amount("", 6000), ShopperReference = "YOUR_UNIQUE_SHOPPER_ID", Reference = "YOUR_ORDER_NUMBER", Channel = Adyen.Model.Checkout.PaymentRequest.ChannelEnum.Web, TelephoneNumber = "", ShopperEmail= "", ReturnUrl = "my-app://adyen", DateOfBirth = new DateTime(1970, 07, 10), ShopperLocale = "", LineItems = new List { new LineItem(amountIncludingTax: 4000, amountExcludingTax: 3310, quantity:1, description: "shoes"), new LineItem(amountIncludingTax: 3000, amountExcludingTax: 2480, quantity:2, description: "Socks"), new LineItem(amountIncludingTax: -1000, amountExcludingTax:-1000, quantity:1, description: "Discount") }, PaymentMethod = new DefaultPaymentMethodDetails { Type = "paybright", BillingAddress = new Adyen.Model.Checkout.Address(country: "CA") { City = "", HouseNumberOrName = "", PostalCode = "", StateOrProvince = "", Street = "" }, DeliveryAddress = new Adyen.Model.Checkout.Address { City = "", HouseNumberOrName = "", PostalCode = "", StateOrProvince = "", Street = "" }, }, ShopperName = new Adyen.Model.Checkout.Name { FirstName = "", LastName = "" } }; ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v16.1.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object const client = new Client({apiKey: "YOUR_X_API_KEY", environment: "TEST"}); // Create the request object const paymentRequest = { merchantAccount: "YOUR_MERCHANT_ACCOUNT", countryCode: "CA", amount: { currency: "", value: 6000 }, shopperLocale: "", shopperReference: "YOUR_UNIQUE_SHOPPER_ID", reference: "YOUR_ORDER_NUMBER", paymentMethod: { type: "paybright" }, shopperName: { firstName: "", lastName: "" }, dateOfBirth: "", telephoneNumber: "", shopperEmail: "", billingAddress: { city: "", country: "CA", houseNumberOrName: "", postalCode: "", stateOrProvince: "", street: "" }, deliveryAddress: { city: "", country: "CA", houseNumberOrName: "", postalCode: "", stateOrProvince: "", street: "" }, returnUrl: "my-app://adyen", lineItems: [ { description: "Shoes", quantity: "1", amountIncludingTax: "4000", amountExcludingTax: "3310", taxCategory: "Low" }, { description: "Socks", quantity: "2", amountIncludingTax: "3000", amountExcludingTax: "2480", taxCategory: "Low" }, { description: "Discount", amountExcludingTax: "-1000", amountIncludingTax: "-1000", quantity: "1", taxCategory: "Low" } ] } // Make the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Python ```py # Adyen Python API Library v12.0.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "YOUR_X_API_KEY" adyen.client.platform = "test" # The environment to use library in. json_request = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "countryCode": "CA", "amount": { "currency": "", "value": 6000 }, "shopperLocale": "", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "reference": "YOUR_ORDER_NUMBER", "paymentMethod": { "type": "paybright" }, "shopperName": { "firstName": "", "lastName": "" }, "dateOfBirth": "", "telephoneNumber": "", "shopperEmail": "", "billingAddress": { "city": "", "country": "CA", "houseNumberOrName": "", "postalCode": "", "stateOrProvince": "", "street": "" }, "deliveryAddress": { "city": "", "country": "CA", "houseNumberOrName": "", "postalCode": "", "stateOrProvince": "", "street": "" }, "returnUrl": "my-app://adyen", "lineItems": [ { "description": "Shoes", "quantity": "1", "amountIncludingTax": "4000", "amountExcludingTax": "3310", "taxCategory": "Low" }, { "description": "Socks", "quantity": "2", "amountIncludingTax": "3000", "amountExcludingTax": "2480", "taxCategory": "Low" }, { "description": "Discount", "amountExcludingTax": "-1000", "amountIncludingTax": "-1000", "quantity": "1", "taxCategory": "Low" } ] } result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.1.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'YOUR_X_API_KEY' adyen.env = :test # Set to "live" for live environment request_body = { :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :countryCode => 'CA', :amount => { :currency => '', :value => 6000 }, :shopperLocale => '', :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :reference => 'YOUR_ORDER_NUMBER', :paymentMethod => { :type => 'paybright' }, :shopperName => { :firstName => '', :lastName => '' }, :dateOfBirth => '', :telephoneNumber => '', :shopperEmail => '', :billingAddress => { :city => '', :country => 'CA', :houseNumberOrName => '', :postalCode => '', :stateOrProvince => '', :street => '' }, :deliveryAddress => { :city => '', :country => 'CA', :houseNumberOrName => '', :postalCode => '', :stateOrProvince => '', :street => '' }, :returnUrl => 'my-app://adyen', :lineItems => [ { :description => 'Shoes', :quantity => '1', :amountIncludingTax => '4000', :amountExcludingTax => '3310', :taxCategory => 'Low' }, { :description => 'Socks', :quantity => '2', :amountIncludingTax => '3000', :amountExcludingTax => '2480', :taxCategory => 'Low' }, { :description => 'Discount', :amountExcludingTax => '-1000', :amountIncludingTax => '-1000', :quantity => '1', :taxCategory => 'Low' } ] } result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` ## Drop-in configuration ### Tab: v5.0.0 or later There is no required PayBright-specific integration for Drop-in. ### Tab: v4.x.x There is no required PayBright specific integration for Drop-in. ## Capture the payment By default, all PayBright payments are [captured automatically](/online-payments/capture) after authorisation. If you prefer to capture the payment after the goods have been sent, or when you want to partially capture payments, you need to set up a [capture delay](/online-payments/capture#delayed-automatic-capture) or use [manual capture](/online-payments/capture#manual-capture). When you capture the payment, the shopper is charged for the first installment. ### Partial captures Partial captures are not available if you enabled [automatic capture](/online-payments/capture) in your [Customer Area](https://ca-test.adyen.com/). To [partially capture](/online-payments/capture) a PayBright payment, specify in your [/capture](https://docs.adyen.com/api-explorer/#/Payment/capture) request: * `modificationAmount`: The amount that the shopper should pay.  * `additionalData.openinvoicedata`: Optional Price and product information for the items that the shopper should pay for. Although the field names are different, the information in `additionalData.openinvoicedata` is the same as what you provided in `lineItems` when making a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: | openinvoicedata | lineItems | Description | | --------------- | -------------------- | ------------------------------------------------------------------------------------------------- | | `itemAmount` | `amountExcludingTax` | The price for one item, without the tax, in [minor units](/development-resources/currency-codes). | | `itemVatAmount` | `taxAmount` | The tax amount for one item, in minor units. | The following example shows how to make a partial capture request if the shopper only kept one pair of socks from the two included in the original payment request. **/capture request** ```json { "originalReference":"COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "modificationAmount":{ "currency":"", "value":"4500" }, "additionalData":{ "openinvoicedata.numberOfLines":"2", "openinvoicedata.line1.currencyCode":"", "openinvoicedata.line1.description":"Shoes", "openinvoicedata.line1.itemAmount":"3310", "openinvoicedata.line1.itemVatAmount":"690", "openinvoicedata.line1.numberOfItems":"1", "openinvoicedata.line2.currencyCode":"", "openinvoicedata.line2.description":"Socks", "openinvoicedata.line2.itemAmount":"1240", "openinvoicedata.line2.itemVatAmount":"260", "openinvoicedata.line2.numberOfItems":"1", }, "reference":"YOUR_CAPTURE_REFERENCE" } ``` Any unclaimed amount that is left over after partially capturing a payment is automatically cancelled. When your account is enabled for *multiple* partial captures, the unclaimed amount after an initial capture is not automatically cancelled. To set up multiple partial captures, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other). Multiple partial captures will create a new invoice for each capture.  ## Refunds and cancellations If a payment has not yet been captured, you can [cancel](/online-payments/cancel) it. If the PayBright payment has already been captured and you want to return the funds to the shopper, you need to [refund](/online-payments/refund) it. ### Partial refunds To [partially refund](/online-payments/refund) a payment, specify in your [/payments/{paymentPspReference}/refunds](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/refunds) request: * `modificationAmount`: The amount to be refunded to the shopper. * `additionalData.openinvoicedata`: Optional Price and product information about the returned items. Providing `additionalData.openinvoicedata` is optional, and although the field names are different, the information is the same as what you provided in `lineItems` when making a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: | openinvoicedata | lineItems | Description | | --------------- | -------------------- | ------------------------------------------------------------------------------------------------- | | `itemAmount` | `amountExcludingTax` | The price for one item, without the tax, in [minor units](/development-resources/currency-codes). | | `itemVatAmount` | `taxAmount` | The tax amount for one item, in minor units. | The following example shows how to make a partial refund request if the shopper returned the shoes included in the original payment request. **/refund request** ```json { "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "originalReference":"COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE", "modificationAmount":{ "currency":"", "value":"4000" }, "additionalData":{ "openinvoicedata.numberOfLines":"1", "openinvoicedata.line1.currencyCode":"", "openinvoicedata.line1.description":"Shoes", "openinvoicedata.line1.itemAmount":"3310", "openinvoicedata.line1.itemVatAmount":"690", "openinvoicedata.line1.numberOfItems":"1" }, "reference":"YOUR_REFUND_REFERENCE" } ``` ## Test and go live To test PayBright payments, use the test details provided in the [PayBright developer documentation](https://developer.paybright.com/docs/testing-resources-completed-pending-failed). You can check the status of test payments in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**. Before you can accept live PayBright payments, you need to [submit a request for PayBright](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## See also * [iOS Components integration guide](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components) * [Webhooks](/development-resources/webhooks) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)