--- title: "Oney Component" description: "Add Oney to an existing Components integration." url: "https://docs.adyen.com/payment-methods/oney/web-component" source_url: "https://docs.adyen.com/payment-methods/oney/web-component.md" canonical: "https://docs.adyen.com/payment-methods/oney/web-component" last_modified: "2020-07-10T16:32:00+02:00" language: "en" --- # Oney Component Add Oney to an existing Components integration. [View source](/payment-methods/oney/web-component.md) This page explains how to add Oney to your existing Web Components integration. When making a Oney payment request: 1. Collect shopper details and include them in the request. 2. Provide information about the purchased items by specifying `lineItems`. 3. Make sure that the payment is authorised and successfully [captured](#capture) before you ship the goods. ## 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 [Web Components integration](/online-payments/build-your-integration/sessions-flow?platform=Web\&integration=Components). | | **Setup steps** | Before you begin, [add Oney 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 [Web Components integration](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=Components). | | **Setup steps** | Before you begin, [add Oney in your Customer Area](/payment-methods/add-payment-methods). | ## API reference Select which endpoint you are using: ### Tab: `/sessions` This is the default with [Components v5.0.0](/online-payments/build-your-integration/sessions-flow?platform=Web\&integration=Components) or later. | Parameter name | Required | Description | | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-lineItems) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Price and product information about the purchased items. Oney will only approve the payment if the total amount specified in `lineItems` matches the `amount.value`. | | [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. This is where Oney will send the payment instructions. | | [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. | | [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-") | The shopper's first and last name (required). Maximum length: 32 characters. | | [telephoneNumber](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_telephoneNumber) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's mobile telephone number, using an international number format.- France: **+336** or **+337** followed by eight digits - Spain: **+346** or **+347** followed by eight digits | | [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 postal address of the shopper. `billingAddress.postalCode` must have five characters. | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-deliveryAddress) | | The postal address where the purchased goods should be delivered. If not provided, this is the same as the billing address. `deliveryAddress.postalCode` must have five characters. | | [dateOfBirth](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_dateOfBirth) | | The shopper's date of birth, if specified. The format must be YYYY-MM-DD. | | [shopperLocale](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_shopperLocale) | | A combination of language code and country code to specify the language used in your checkout.- France: **fr\_FR** - Spain: **es\_ES** | | [countryCode](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/sessions__reqParam_countryCode) | | The shopper's country.- France: **FR** - Spain: **ES** | | `additionalData.oneydata.trustFlag` | | An optional parameter to flag trusted shoppers to Oney for their risk assessment. To use this feature Oney must enable the setting. Possible values are `1` or `-1`. | | `additionalData.oneydata.merchantPays` | | Optional field to override the default configuration. When we set up Oney for your merchant account, we also configure who pays the interest fees.- **true**: You pay the interest fees of the shopper. - **false**: The shopper pays the interest fees. | #### 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", "reference":"YOUR_ORDER_REFERENCE", "amount":{ "currency":"EUR", "value": 15000 }, "shopperLocale":"fr_FR", "countryCode":"FR", "telephoneNumber": "+33 1 76 35 07 90", "shopperEmail":"shopper@example.com", "shopperName":{ "firstName":"Testperson-fr", "lastName":"Approved" }, "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "billingAddress":{ "city":"UGINE", "country":"FR", "houseNumberOrName":"0", "postalCode":"73400", "street":"461 Rue du Centenaire" }, "deliveryAddress":{ "city":"UGINE", "country":"FR", "houseNumberOrName":"0", "postalCode":"73400", "street":"461 Rue du Centenaire" }, "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..", "lineItems":[ { "quantity":"1", "amountExcludingTax":"5000", "taxPercentage":"0", "description":"Test item 1", "id":"item1", "taxAmount":"0", "amountIncludingTax":"5000" }, { "quantity":"1", "amountExcludingTax":"10000", "taxPercentage":"0", "description":"Test item 2", "id":"item2", "taxAmount":"0", "amountIncludingTax":"10000" } ] }' ``` #### 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("EUR") .value(15000L); LineItem lineItem1 = new LineItem() .quantity(1L) .amountExcludingTax(5000L) .taxPercentage(0L) .description("Test item 1") .id("item1") .taxAmount(0L) .amountIncludingTax(5000L); LineItem lineItem2 = new LineItem() .quantity(1L) .amountExcludingTax(10000L) .taxPercentage(0L) .description("Test item 2") .id("item2") .taxAmount(0L) .amountIncludingTax(10000L); Name name = new Name() .firstName("Testperson-fr") .lastName("Approved"); DeliveryAddress deliveryAddress = new DeliveryAddress() .country("FR") .city("UGINE") .houseNumberOrName("0") .street("461 Rue du Centenaire") .postalCode("73400"); BillingAddress billingAddress = new BillingAddress() .country("FR") .city("UGINE") .houseNumberOrName("0") .street("461 Rue du Centenaire") .postalCode("73400"); CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest() .amount(amount) .telephoneNumber("+33 1 76 35 07 90") .shopperEmail("shopper@example.com") .reference("YOUR_ORDER_REFERENCE") .lineItems(Arrays.asList(lineItem1, lineItem2)) .shopperName(name) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .deliveryAddress(deliveryAddress) .countryCode("FR") .shopperLocale("fr_FR") .billingAddress(billingAddress) .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") .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("EUR") ->setValue(15000); $lineItem1 = new LineItem(); $lineItem1 ->setQuantity(1) ->setAmountExcludingTax(5000) ->setTaxPercentage(0) ->setDescription("Test item 1") ->setId("item1") ->setTaxAmount(0) ->setAmountIncludingTax(5000); $lineItem2 = new LineItem(); $lineItem2 ->setQuantity(1) ->setAmountExcludingTax(10000) ->setTaxPercentage(0) ->setDescription("Test item 2") ->setId("item2") ->setTaxAmount(0) ->setAmountIncludingTax(10000); $name = new Name(); $name ->setFirstName("Testperson-fr") ->setLastName("Approved"); $deliveryAddress = new DeliveryAddress(); $deliveryAddress ->setCountry("FR") ->setCity("UGINE") ->setHouseNumberOrName("0") ->setStreet("461 Rue du Centenaire") ->setPostalCode("73400"); $billingAddress = new BillingAddress(); $billingAddress ->setCountry("FR") ->setCity("UGINE") ->setHouseNumberOrName("0") ->setStreet("461 Rue du Centenaire") ->setPostalCode("73400"); $createCheckoutSessionRequest = new CreateCheckoutSessionRequest(); $createCheckoutSessionRequest ->setAmount($amount) ->setTelephoneNumber("+33 1 76 35 07 90") ->setShopperEmail("shopper@example.com") ->setReference("YOUR_ORDER_REFERENCE") ->setLineItems(array($lineItem1, $lineItem2)) ->setShopperName($name) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setDeliveryAddress($deliveryAddress) ->setCountryCode("FR") ->setShopperLocale("fr_FR") ->setBillingAddress($billingAddress) ->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->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 = "EUR", Value = 15000 }; LineItem lineItem1 = new LineItem { Quantity = 1, AmountExcludingTax = 5000, TaxPercentage = 0, Description = "Test item 1", Id = "item1", TaxAmount = 0, AmountIncludingTax = 5000 }; LineItem lineItem2 = new LineItem { Quantity = 1, AmountExcludingTax = 10000, TaxPercentage = 0, Description = "Test item 2", Id = "item2", TaxAmount = 0, AmountIncludingTax = 10000 }; Name name = new Name { FirstName = "Testperson-fr", LastName = "Approved" }; DeliveryAddress deliveryAddress = new DeliveryAddress { Country = "FR", City = "UGINE", HouseNumberOrName = "0", Street = "461 Rue du Centenaire", PostalCode = "73400" }; BillingAddress billingAddress = new BillingAddress { Country = "FR", City = "UGINE", HouseNumberOrName = "0", Street = "461 Rue du Centenaire", PostalCode = "73400" }; CreateCheckoutSessionRequest createCheckoutSessionRequest = new CreateCheckoutSessionRequest { Amount = amount, TelephoneNumber = "+33 1 76 35 07 90", ShopperEmail = "shopper@example.com", Reference = "YOUR_ORDER_REFERENCE", LineItems = new List{ lineItem1, lineItem2 }, ShopperName = name, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", DeliveryAddress = deliveryAddress, CountryCode = "FR", ShopperLocale = "fr_FR", BillingAddress = billingAddress, 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.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", reference: "YOUR_ORDER_REFERENCE", amount: { currency: "EUR", value: 15000 }, shopperLocale: "fr_FR", countryCode: "FR", telephoneNumber: "+33 1 76 35 07 90", shopperEmail: "shopper@example.com", shopperName: { firstName: "Testperson-fr", lastName: "Approved" }, shopperReference: "YOUR_UNIQUE_SHOPPER_ID", billingAddress: { city: "UGINE", country: "FR", houseNumberOrName: "0", postalCode: "73400", street: "461 Rue du Centenaire" }, deliveryAddress: { city: "UGINE", country: "FR", houseNumberOrName: "0", postalCode: "73400", street: "461 Rue du Centenaire" }, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", lineItems: [ { quantity: "1", amountExcludingTax: "5000", taxPercentage: "0", description: "Test item 1", id: "item1", taxAmount: "0", amountIncludingTax: "5000" }, { quantity: "1", amountExcludingTax: "10000", taxPercentage: "0", description: "Test item 2", id: "item2", taxAmount: "0", amountIncludingTax: "10000" } ] } // 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: "EUR", Value: 15000, } lineItem1 := checkout.LineItem{ Quantity: common.PtrInt64(1), AmountExcludingTax: common.PtrInt64(5000), TaxPercentage: common.PtrInt64(0), Description: common.PtrString("Test item 1"), Id: common.PtrString("item1"), TaxAmount: common.PtrInt64(0), AmountIncludingTax: common.PtrInt64(5000), } lineItem2 := checkout.LineItem{ Quantity: common.PtrInt64(1), AmountExcludingTax: common.PtrInt64(10000), TaxPercentage: common.PtrInt64(0), Description: common.PtrString("Test item 2"), Id: common.PtrString("item2"), TaxAmount: common.PtrInt64(0), AmountIncludingTax: common.PtrInt64(10000), } name := checkout.Name{ FirstName: "Testperson-fr", LastName: "Approved", } deliveryAddress := checkout.DeliveryAddress{ Country: "FR", City: "UGINE", HouseNumberOrName: "0", Street: "461 Rue du Centenaire", PostalCode: "73400", } billingAddress := checkout.BillingAddress{ Country: "FR", City: "UGINE", HouseNumberOrName: "0", Street: "461 Rue du Centenaire", PostalCode: "73400", } createCheckoutSessionRequest := checkout.CreateCheckoutSessionRequest{ Amount: amount, TelephoneNumber: common.PtrString("+33 1 76 35 07 90"), ShopperEmail: common.PtrString("shopper@example.com"), Reference: "YOUR_ORDER_REFERENCE", LineItems: []checkout.LineItem{ lineItem1, lineItem2, }, ShopperName: &name, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", DeliveryAddress: &deliveryAddress, CountryCode: common.PtrString("FR"), ShopperLocale: common.PtrString("fr_FR"), BillingAddress: &billingAddress, 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.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", "reference": "YOUR_ORDER_REFERENCE", "amount": { "currency": "EUR", "value": 15000 }, "shopperLocale": "fr_FR", "countryCode": "FR", "telephoneNumber": "+33 1 76 35 07 90", "shopperEmail": "shopper@example.com", "shopperName": { "firstName": "Testperson-fr", "lastName": "Approved" }, "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "billingAddress": { "city": "UGINE", "country": "FR", "houseNumberOrName": "0", "postalCode": "73400", "street": "461 Rue du Centenaire" }, "deliveryAddress": { "city": "UGINE", "country": "FR", "houseNumberOrName": "0", "postalCode": "73400", "street": "461 Rue du Centenaire" }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "lineItems": [ { "quantity": "1", "amountExcludingTax": "5000", "taxPercentage": "0", "description": "Test item 1", "id": "item1", "taxAmount": "0", "amountIncludingTax": "5000" }, { "quantity": "1", "amountExcludingTax": "10000", "taxPercentage": "0", "description": "Test item 2", "id": "item2", "taxAmount": "0", "amountIncludingTax": "10000" } ] } # 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', :reference => 'YOUR_ORDER_REFERENCE', :amount => { :currency => 'EUR', :value => 15000 }, :shopperLocale => 'fr_FR', :countryCode => 'FR', :telephoneNumber => '+33 1 76 35 07 90', :shopperEmail => 'shopper@example.com', :shopperName => { :firstName => 'Testperson-fr', :lastName => 'Approved' }, :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :billingAddress => { :city => 'UGINE', :country => 'FR', :houseNumberOrName => '0', :postalCode => '73400', :street => '461 Rue du Centenaire' }, :deliveryAddress => { :city => 'UGINE', :country => 'FR', :houseNumberOrName => '0', :postalCode => '73400', :street => '461 Rue du Centenaire' }, :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..', :lineItems => [ { :quantity => '1', :amountExcludingTax => '5000', :taxPercentage => '0', :description => 'Test item 1', :id => 'item1', :taxAmount => '0', :amountIncludingTax => '5000' }, { :quantity => '1', :amountExcludingTax => '10000', :taxPercentage => '0', :description => 'Test item 2', :id => 'item2', :taxAmount => '0', :amountIncludingTax => '10000' } ] } # 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: "EUR", value: 15000 }; const lineItem1: Types.checkout.LineItem = { quantity: 1, amountExcludingTax: 5000, taxPercentage: 0, description: "Test item 1", id: "item1", taxAmount: 0, amountIncludingTax: 5000 }; const lineItem2: Types.checkout.LineItem = { quantity: 1, amountExcludingTax: 10000, taxPercentage: 0, description: "Test item 2", id: "item2", taxAmount: 0, amountIncludingTax: 10000 }; const name: Types.checkout.Name = { firstName: "Testperson-fr", lastName: "Approved" }; const deliveryAddress: Types.checkout.DeliveryAddress = { country: "FR", city: "UGINE", houseNumberOrName: "0", street: "461 Rue du Centenaire", postalCode: "73400" }; const billingAddress: Types.checkout.BillingAddress = { country: "FR", city: "UGINE", houseNumberOrName: "0", street: "461 Rue du Centenaire", postalCode: "73400" }; const createCheckoutSessionRequest: Types.checkout.CreateCheckoutSessionRequest = { amount: amount, telephoneNumber: "+33 1 76 35 07 90", shopperEmail: "shopper@example.com", reference: "YOUR_ORDER_REFERENCE", lineItems: [lineItem1, lineItem2], shopperName: name, merchantAccount: "YOUR_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "FR", shopperLocale: "fr_FR", billingAddress: billingAddress, 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.sessions(createCheckoutSessionRequest, { idempotencyKey: "UUID" }); ``` ### Tab: `/payments` If you implemented an [additional use case](/online-payments/build-your-integration). | Parameter name | Required | Description | | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Price and product information about the purchased items. Oney will only approve the payment if the total amount specified in `lineItems` matches the `amount.value`. | | [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. This is where Oney will send the payment instructions. | | [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. | | [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-") | The shopper's first and last name (required). Maximum length: 32 characters. | | [telephoneNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-telephoneNumber) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's mobile telephone number, using an international number format. - France: **+336** or **+337** followed by eight digits - Spain: **+346** or **+347** followed by eight digits | | [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 postal address of the shopper. `billingAddress.postalCode` must have five characters. | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-deliveryAddress) | | The postal address where the purchased goods should be delivered. If not provided, this is the same as the billing address. `deliveryAddress.postalCode` must have five characters. | | [dateOfBirth](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-dateOfBirth) | | The shopper's date of birth, if specified. The format must be YYYY-MM-DD. | | [shopperLocale](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperLocale) | | A combination of language code and country code to specify the language used in your checkout.- France: **fr\_FR** - Spain: **es\_ES** | | [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-countryCode) | | The shopper's country.- France: **FR** - Spain: **ES** | | `additionalData.oneydata.trustFlag` | | An optional field to flag trusted shoppers to Oney for their risk assessment. To use this feature Oney must enable the Oney trust setting on your account. Possible values are `1` or `-1`. | | `additionalData.oneydata.merchantPays` | | An optional field to override the default configuration. When we set up Oney for your merchant account, we also configure who pays the interest fees.- **true**: You pay the interest fees of the shopper. - **false**: The shopper pays the interest fees. | #### 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", "reference":"YOUR_ORDER_REFERENCE", "paymentMethod":{ "type":"facilypay_3x" }, "amount":{ "currency":"EUR", "value": 15000 }, "shopperLocale":"fr_FR", "countryCode":"FR", "telephoneNumber": "+33 1 76 35 07 90", "shopperEmail":"shopper@example.com", "shopperName":{ "firstName":"Testperson-fr", "lastName":"Approved" }, "shopperReference":"YOUR_UNIQUE_SHOPPER_ID", "billingAddress":{ "city":"UGINE", "country":"FR", "houseNumberOrName":"0", "postalCode":"73400", "street":"461 Rue du Centenaire" }, "deliveryAddress":{ "city":"UGINE", "country":"FR", "houseNumberOrName":"0", "postalCode":"73400", "street":"461 Rue du Centenaire" }, "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..", "lineItems":[ { "quantity":"1", "amountExcludingTax":"5000", "taxPercentage":"0", "description":"Test item 1", "id":"item1", "taxAmount":"0", "amountIncludingTax":"5000" }, { "quantity":"1", "amountExcludingTax":"10000", "taxPercentage":"0", "description":"Test item 2", "id":"item2", "taxAmount":"0", "amountIncludingTax":"10000" } ] }' ``` #### Java ```java // Create a Client to establish a connection to our services with your API Key from the Customer Area. Client client = new Client("ADYEN_API_KEY", Environment.TEST); Checkout checkout = new Checkout(client); PaymentsRequest paymentsRequest = new PaymentsRequest(); paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); paymentsRequest.setReference("YOUR_ORDER_REFERENCE"); PaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails(); paymentMethodDetails.setType("facilypay_3x"); paymentsRequest.setPaymentMethod(paymentMethodDetails); Amount amount = new Amount(); amount.setCurrency("EUR"); amount.setValue(15000L); paymentsRequest.setAmount(amount); paymentsRequest.setShopperLocale("fr_FR"); paymentsRequest.setCountryCode("FR"); paymentsRequest.setShopperEmail("shopper@example.com"); paymentsRequest.setDateOfBirth("1985-07-30"); paymentsRequest.setTelephoneNumber("+33 1 76 35 07 90"); Name shopperDetails = new Name(); shopperDetails.setFirstName("Testperson-fr"); shopperDetails.setGender(Name.GenderEnum.UNKNOWN); shopperDetails.setLastName("Approved"); paymentsRequest.setShopperName(shopperDetails); paymentsRequest.setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); Address billingAddress = new Address(); billingAddress.setCity("UGINE"); billingAddress.setCountry("FR"); billingAddress.setHouseNumberOrName("0"); billingAddress.setPostalCode("73400"); billingAddress.setStreet("461 Rue du Centenaire"); Address deliveryAddress = new Address(); deliveryAddress.setCity("UGINE"); deliveryAddress.setCountry("FR"); deliveryAddress.setHouseNumberOrName("0"); deliveryAddress.setPostalCode("73400"); deliveryAddress.setStreet("461 Rue du Centenaire"); paymentsRequest.setBillingAddress(billingAddress); paymentsRequest.setDeliveryAddress(deliveryAddress); paymentsRequest.setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy.."); List lineItems = new ArrayList<>(); lineItems.add( new LineItem() .quantity(1L) .amountExcludingTax(5000L) .taxPercentage(0L) .description("Test Item 1") .id("item1") .taxAmount(0L) .amountIncludingTax(5000L) ); lineItems.add( new LineItem() .quantity(1L) .amountExcludingTax(10000L) .taxPercentage(0L) .description("Test Item 2") .id("item2") .taxAmount(0L) .amountIncludingTax(10000L) ); 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", "reference" => "YOUR_ORDER_REFERENCE", "paymentMethod" => [ "type" => "facilypay_3x" ], "amount" => [ "currency" => "EUR", "value" => "15000" ], "shopperLocale" => "fr_FR", "countryCode" => "FR", "shopperEmail" => "shopper@example.com", "dateOfBirth" => "1985-07-30", "telephoneNumber" => "+33 1 76 35 07 90", "shopperName" => [ "firstName" => "Testperson-fr", "lastName" => "Approved" ], "shopperReference" => "YOUR_UNIQUE_SHOPPER_ID", "billingAddress" => [ "city" => "UGINE", "country" => "FR", "houseNumberOrName" => "0", "postalCode" => "73400", "street" => "461 Rue du Centenaire" ], "deliveryAddress" => [ "city" => "UGINE", "country" => "FR", "houseNumberOrName" => "0", "postalCode" => "73400", "street" => "461 Rue du Centenaire" ], "returnUrl" => "https://your-company.example.com/checkout?shopperOrder=12xy..", "lineItems" => [ [ "quantity" => "1", "amountExcludingTax" => "5000", "taxPercentage" => "0", "description" => "Test Item 1", "id" => "item1", "taxAmount" => "0", "amountIncludingTax" => "5000" ], [ "quantity" => "1", "amountExcludingTax" => "10000", "taxPercentage" => "0", "description" => "Test Item 2", "id" => "item2", "taxAmount" => "0", "amountIncludingTax" => "10000" ] ] ``` #### C\# ```cs // Set your X-API-KEY with the API key from the Customer Area. var client = new Client ("ADYEN_API_KEY", Environment.Test); var checkout = new Checkout(client); var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest { MerchantAccount = "YOUR_MERCHANT_ACCOUNT", Reference = "YOUR_ORDER_REFERENCE", PaymentMethod = new DefaultPaymentMethodDetails { Type = "facilypay_3x" }, Amount = new Adyen.Model.Checkout.Amount(currency: "EUR", value: 15000), ShopperLocale = "fr_FR", CountryCode = "EUR", ShopperEmail = "shopper@example.com", DateOfBirth = new DateTime(1981, 01, 13), TelephoneNumber = "+33 1 76 35 07 90", ShopperName = new Adyen.Model.Checkout.Name { FirstName = "Testperson-fr", LastName = "Approved" }, ShopperReference = "YOUR_UNIQUE_SHOPPER_ID", AdditionalData = new Dictionary { { "oneydata.merchantPays", "true"}, }, BillingAddress = new Adyen.Model.Checkout.Address ( city: "UGINE", country: "FR", houseNumberOrName: "0", postalCode: "73400", stateOrProvince: "", street: "461 Rue du Centenaire" ), DeliveryAddress = new Adyen.Model.Checkout.Address ( city: "UGINE", country: "FR", houseNumberOrName: "0", postalCode: "73400", stateOrProvince: "", street: "461 Rue du Centenaire" ), ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..", LineItems = new List { new LineItem(taxPercentage: 0, id: "item1", taxAmount: 0, description: "Test Item 1", amountIncludingTax: 5000, quantity: 1, amountExcludingTax: 5000), new LineItem(taxPercentage: 0, id: "item2", taxAmount: 0, description: "Test Item 2", amountIncludingTax: 10000, quantity: 1, amountExcludingTax: 10000), } }; ``` #### 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", reference: "YOUR_ORDER_REFERENCE", paymentMethod: { type: "facilypay_3x" }, amount: { currency: "EUR", value: 15000 }, shopperLocale: "fr_FR", countryCode: "FR", telephoneNumber: "+33 1 76 35 07 90", shopperEmail: "shopper@example.com", shopperName: { firstName: "Testperson-fr", lastName: "Approved" }, shopperReference: "YOUR_UNIQUE_SHOPPER_ID", billingAddress: { city: "UGINE", country: "FR", houseNumberOrName: "0", postalCode: "73400", street: "461 Rue du Centenaire" }, deliveryAddress: { city: "UGINE", country: "FR", houseNumberOrName: "0", postalCode: "73400", street: "461 Rue du Centenaire" }, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", lineItems: [ { quantity: "1", amountExcludingTax: "5000", taxPercentage: "0", description: "Test item 1", id: "item1", taxAmount: "0", amountIncludingTax: "5000" }, { quantity: "1", amountExcludingTax: "10000", taxPercentage: "0", description: "Test item 2", id: "item2", taxAmount: "0", amountIncludingTax: "10000" } ] } // 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", "reference": "YOUR_ORDER_REFERENCE", "paymentMethod": { "type": "facilypay_3x" }, "amount": { "currency": "EUR", "value": 15000 }, "shopperLocale": "fr_FR", "countryCode": "FR", "telephoneNumber": "+33 1 76 35 07 90", "shopperEmail": "shopper@example.com", "shopperName": { "firstName": "Testperson-fr", "lastName": "Approved" }, "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "billingAddress": { "city": "UGINE", "country": "FR", "houseNumberOrName": "0", "postalCode": "73400", "street": "461 Rue du Centenaire" }, "deliveryAddress": { "city": "UGINE", "country": "FR", "houseNumberOrName": "0", "postalCode": "73400", "street": "461 Rue du Centenaire" }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "lineItems": [ { "quantity": "1", "amountExcludingTax": "5000", "taxPercentage": "0", "description": "Test item 1", "id": "item1", "taxAmount": "0", "amountIncludingTax": "5000" }, { "quantity": "1", "amountExcludingTax": "10000", "taxPercentage": "0", "description": "Test item 2", "id": "item2", "taxAmount": "0", "amountIncludingTax": "10000" } ] } 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', :reference => 'YOUR_ORDER_REFERENCE', :paymentMethod => { :type => 'facilypay_3x' }, :amount => { :currency => 'EUR', :value => 15000 }, :shopperLocale => 'fr_FR', :countryCode => 'FR', :telephoneNumber => '+33 1 76 35 07 90', :shopperEmail => 'shopper@example.com', :shopperName => { :firstName => 'Testperson-fr', :lastName => 'Approved' }, :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :billingAddress => { :city => 'UGINE', :country => 'FR', :houseNumberOrName => '0', :postalCode => '73400', :street => '461 Rue du Centenaire' }, :deliveryAddress => { :city => 'UGINE', :country => 'FR', :houseNumberOrName => '0', :postalCode => '73400', :street => '461 Rue du Centenaire' }, :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..', :lineItems => [ { :quantity => '1', :amountExcludingTax => '5000', :taxPercentage => '0', :description => 'Test item 1', :id => 'item1', :taxAmount => '0', :amountIncludingTax => '5000' }, { :quantity => '1', :amountExcludingTax => '10000', :taxPercentage => '0', :description => 'Test item 2', :id => 'item2', :taxAmount => '0', :amountIncludingTax => '10000' } ] } result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` ## Component configuration ### Step 1: Create a DOM element Create a DOM element on your checkout page for each type of Oney installment you support, placing it where you want the payment method form to be rendered: ```html
``` ### Step 2: Create an instance of the Component Create an instance of the Oney Component for each type of Oney installment you support. | Number of installments | Payment method type | Supported county | | ---------------------- | ------------------- | ---------------------------------- | | **3** | **facilypay\_3x** | France (**FR**) and Spain (**ES**) | | **4** | **facilypay\_4x** | France (**FR**) and Spain (**ES**) | | **6** | **facilypay\_6x** | Spain (**ES**) | | **10** | **facilypay\_10x** | France (**FR**) and Spain (**ES**) | | **12** | **facilypay\_12x** | France (**FR**) and Spain (**ES**) | Use the `create` method of your `AdyenCheckout` instance, in this case `checkout`, to create the Component: ```js const oney_3xComponent = checkout.create('facilypay_3x').mount('#oney_3x-container'); const oney_4xComponent = checkout.create('facilypay_4x').mount('#oney_4x-container'); ``` By default, the shopper input fields are visible and editable. Follow the instructions in [optional configuration](#oney-optional) if you want to change these settings. ### Optional configuration You can add the following optional configuration to configure the visibility of the shopper input fields for Oney : | Parameter name | Description | Default | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | | `personalDetails` | Shopper full name, date of birth, phone number, and email address. | **editable** | | `billingAddress` | The address where to send the invoice. | **editable** | | `deliveryAddress` | The address where the purchased goods should be delivered. By default, the delivery address is the same as the billing address. When the shopper selects they want to specify a different address, the delivery address fields will appear. | **editable** | You can set the visibility to **hidden**, **readOnly** or **editable**. Although you can hide the fields from your payment form, you must still provide this information in your payment request. If you want to add optional configuration, include this in a configuration object. The following example shows how to configure the Component to make the `deliveryAddress` field **readOnly**: ```js const oneyConfiguration = { visibility: { personalDetails: editable, // Optional. These fields will appear on the payment form, // and the shopper can edit them. // This is the default behavior. billingAddress: editable, // Optional. These fields will appear on the payment form, // and the shopper can edit them. // This is the default behavior. deliveryAddress: readOnly // Optional. These fields will appear on the payment form, // but the shopper cannot edit them. }; } ``` Use the `create` method of your `AdyenCheckout` instance, in this case `checkout`, to create an instance of the Component. Add the configuration object for each Oney installment type that you support. ```js const oney_3xComponent = checkout.create('facilypay_3x', oneyConfiguration).mount('#oney_3x-container'); const oney_4xComponent = checkout.create('facilypay_4x', oneyConfiguration).mount('#oney_4x-container'); ``` ## Capture the payment Make sure that the payment is captured successfully before you ship the goods. Depending on your [capture](/online-payments/capture) settings, Oney payments are captured manually or automatically, with or without a delay. If a payment is captured after more than six days, the payment authorization expires and the payment must be authorised again. ## Refund the payment If a Oney payment has not yet been captured, you can [cancel](/online-payments/cancel) it. If the payment has already been captured and you want to return the funds to the shopper, you need to [refund](/online-payments/refund) it. The minimum refund amount is EUR 1. You can refund payments until 13 months after they have been captured. ### Partial refunds To [partially refund](/online-payments/refund) a Oney payment, specify in your call to the [/payments/{paymentPspReference}/refunds](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/refunds) endpoint: * `modificationAmount`: The amount to be refunded to the shopper. ```json { "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "modificationAmount":{ "currency":"EUR", "value":400 }, "originalReference":"8825408195409505" } ``` You will receive a [/payments/{paymentPspReference}/refunds](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/refunds) response containing a `pspReference` associated with this request. Once we have processed your request, you will also receive a REFUND webhook. For more information, refer to [Refund](/online-payments/refund). ## Test and go live Before accepting live Oney payments, test your integration using the following test details: ### France | Test card number | Expiry date | CVV | | ------------------- | --------------------------------- | ---------- | | 4970 1015 1882 0000 | Any date within 3 years from now. | Any value. | | 4970 1030 6015 0000 | Any date within 3 years from now. | Any value. | | 4970 1027 3124 0000 | Any date within 3 years from now. | Any value. | | 4970 1022 9571 0000 | Any date within 3 years from now. | Any value. | | 4970 1093 1788 0000 | Any date within 3 years from now. | Any value. | | 4970 1017 0783 0000 | Any date within 3 years from now. | Any value. | | 4970 1090 7275 0000 | Any date within 3 years from now. | Any value. | | 4970 1084 5160 0000 | Any date within 3 years from now. | Any value. | You can test different responses by changing the amount to be paid: * **Authorised**: between EUR 150.00 and EUR 999.99 * **Pending**: between EUR 1000.00 and EUR 1499.99 * **Refused**: between EUR 1500.00 and EUR 2000.00 To test different responses when making payments in 10 or 12 installments, you need to include the following: * **Authorised**: * Shopper email: **10X12X.OK.BDE\@oney.fr**. * Under **Complétez vos informations**, include: * Vos revenus: **3500€** * Origine du revenu principal: **Salarie** * Vos charges: **500€** * Under **Signez votre contrat**, include: * Phone number: use **0666000000** to bypass a digital signature, or a real phone number to receive the OTP SMS for digital signing. * **Refused**: * Shopper email: **10X12X.KO.BDE\@oney.fr**. * In the **Completez vos informations** step, include: * Vos revenus: **1000€** * Origine du revenu principal: **Autres** * Vos charges: **800€** To test the full Oney payment flow, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other). ### Spain | Test card number | Expiry date | CVV | | ------------------- | ----------- | --- | | 5436 0310 3060 6378 | 01/2099 | 257 | | 5199 9923 1264 1465 | 01/2099 | 010 | | 2223 0000 1047 9399 | 01/2099 | 299 | | 4543 4740 0224 9996 | 01/2099 | 956 | You can test the different responses by using the following information: * **Authorised**: * Shopper email: **test\_ok\@oney.com** * Correct CVV * **Refused**: * Shopper email: **test\_ko\@oney.com** * Incorrect CVV If you have issues accessing the Buy Now Pay Later subscription form when testing for Spain, or Italy, make sure that your IP address is from the EU region. For assistance, contact your network administrator. Alternatively, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to can provide a static IP address range to be allowlisted by Oney. ### Go live Before you can accept live Oney payments, you need to [submit a request for Oney 3x4x](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## See also * [Web Components integration guide](/online-payments/components-web) * [Webhooks](/development-resources/webhooks) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)