--- title: "Oney for API only" description: "Add Oney to an existing API-only integration." url: "https://docs.adyen.com/payment-methods/oney/api-only" source_url: "https://docs.adyen.com/payment-methods/oney/api-only.md" canonical: "https://docs.adyen.com/payment-methods/oney/api-only" last_modified: "2023-01-16T00:18:00+01:00" language: "en" --- # Oney for API only Add Oney to an existing API-only integration. [View source](/payment-methods/oney/api-only.md) Accept Oney payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page. When making a Oney payment: 1. [Collect shopper details](#paymentform) and specify these in your [payment request](#make-a-payment). 2. Provide information about the purchased items by specifying `lineItems` in your [payment request](#make-a-payment). 3. Make sure that the payment is authorised and successfully [captured](#capture) before you ship the goods. ## Requirements | Requirement | Description | | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built an [API-only integration](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=API%20only). | | **Setup steps** | Before you begin, [add Oney in your test Customer Area](/payment-methods/add-payment-methods). | ## Build your payment form for Oney When making a Oney payment, collect the following shopper details: | Shopper detail | Required | Description | | ---------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | | Full name | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's first name and last name. | | Email | ![-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 invoice. | | Date of birth | | The shopper's date of birth, if specified. | | Telephone number | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's telephone number. | | Billing address | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The address of the shopper associated with their payment details, to be included on the invoice. | | Delivery address | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The postal address of the shopper where the items will be delivered. | If you are using the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) endpoint to show the available payment methods to the shopper, specify the following in your request: * [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods): **FR**, **ES** or **IT** * [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount): **EUR** * [amount.value](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount): The value of the payment. Based on the [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods), the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response contains: | `paymentMethod.type` | Number of installments and country/region | | -------------------- | ----------------------------------------------------------------------------- | | **facilypay\_3x** | for 3 Oney installments in France (**FR**), Spain (**ES**) or Italy (**IT**). | | **facilypay\_4x** | for 4 Oney installments in France (**FR**), Spain (**ES**) or Italy (**IT**). | | **facilypay\_6x** | for 6 Oney installments in Spain (**ES**). | | **facilypay\_10x** | for 10 Oney installments in France (**FR**) or Spain (**ES**). | | **facilypay\_12x** | for 12 Oney installments in France (**FR**) or Spain (**ES**). | We provide logos for Oney which you can use on your payment form. For more information, refer to [Downloading logos](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only#downloading-logos). ## Make a payment From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying: * `paymentMethod.type`: The type of Oney payment the shopper wants to use. Possible values: * **facilypay\_3x** (**FR**, **ES** or **IT**) * **facilypay\_4x** (**FR**, **ES** or **IT**) * **facilypay\_6x** (**ES** only) * **facilypay\_10x** (**FR** or **ES**) * **facilypay\_12x** (**FR** or **ES**) * [shopperName](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperName): The shopper's first and last name (required). Maximum length: 32 characters. * [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail): The shopper's email address. This is where Oney will send the payment instructions. * [dateOfBirth](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-dateOfBirth) Optional : The shopper's date of birth, if specified. The format must be YYYY-MM-DD. * [telephoneNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-telephoneNumber): 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 * Italy : **+393** followed by eight digits * [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-billingAddress): The address of the shopper associated with their payment details. *  `billingAddress.postalCode` must have five characters. * [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-deliveryAddress): The postal address of the shopper where the items will be delivered. * `deliveryAddress.postalCode` must have five characters. * [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-countryCode): The shopper's country/region.\ Format: the two-letter [ISO-3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. Exception: **QZ** (Kosovo). * [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. Refer to [list of supported languages](/online-payments/build-your-integration/sessions-flow/?platform=Web\&integration=Drop-in#optional-configuration). * [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems): 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`. * [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): A unique reference to identify the shopper. Minimum length: three characters. * [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl): The URL where the shopper will be redirected back to after completing the payment. The URL can contain a maximum of 1024 characters and must include the protocol: `http://` or `https://`. For example, `https://your-company.example.com/checkout/`. You can also include your own additional query parameters, for example, shopper ID or order reference number. * `additionalData.oneydata.trustFlag` Optional : 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: **2**, **1**, **0**, **-1**, **-2**. * `additionalData.oneydata.merchantPays` Optional : 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 for the shopper. * **false**: The shopper pays the interest fees. For example: ```json "additionalData": { "oneydata.merchantPays": true, "oneydata.trustFlag": "1" } ``` Here's an example of a payment of **EUR 150** split into three installments. #### curl ```bash # Set your X-API-KEY with the API key from the Customer Area. curl https://checkout-test.adyen.com/v68/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "reference": "YOUR_ORDER_NUMBER", "countryCode": "FR", "amount": { "currency": "EUR", "value": 15000 }, "paymentMethod": { "type": "facilypay_3x" }, "billingAddress": { "city": "UGINE", "country": "FR", "houseNumberOrName": "0", "postalCode": "73400", "street": "461 Rue du Centenaire" }, "deliveryAddress": { "city": "UGINE", "country": "FR", "houseNumberOrName": "0", "postalCode": "73400", "stateOrProvince": "", "street": "461 Rue du Centenaire" }, "shopperName": { "firstName": "Testperson-fr", "lastName": "Approved" }, "telephoneNumber": "+33 1 76 35 07 90", "dateOfBirth": "1985-07-30", "shopperEmail": "shopper@example.com", "shopperLocale": "fr_FR", "lineItems" : [ { "taxPercentage" : 0, "id" : "item1", "taxAmount" : 0, "description" : "Test Item 1", "amountIncludingTax" : 5000, "quantity" : 1, "amountExcludingTax" : 5000 }, { "taxPercentage" : 0, "id" : "item2", "taxAmount" : 0, "description" : "Test Item 2", "amountIncludingTax" : 10000, "quantity" : 1, "amountExcludingTax" : 10000 } ], "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy.." }' ``` #### Java ```java // Adyen Java API Library v27.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, additionally 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) .taxPercentage(0L) .amountExcludingTax(5000L) .description("Test Item 1") .id("item1") .taxAmount(0L) .amountIncludingTax(5000L); LineItem lineItem2 = new LineItem() .quantity(1L) .taxPercentage(0L) .amountExcludingTax(10000L) .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") .stateOrProvince("") .city("UGINE") .houseNumberOrName("0") .street("461 Rue du Centenaire") .postalCode("73400"); PaymentDetails paymentDetails = new PaymentDetails() .type(PaymentDetails.TypeEnum.FACILYPAY_3X); BillingAddress billingAddress = new BillingAddress() .country("FR") .city("UGINE") .houseNumberOrName("0") .street("461 Rue du Centenaire") .postalCode("73400"); PaymentRequest paymentRequest = new PaymentRequest() .amount(amount) .telephoneNumber("+33 1 76 35 07 90") .dateOfBirth(OffsetDateTime.parse("1985-07-30")) .shopperEmail("shopper@example.com") .reference("YOUR_ORDER_NUMBER") .lineItems(Arrays.asList(lineItem1, lineItem2)) .shopperName(name) .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .deliveryAddress(deliveryAddress) .countryCode("FR") .paymentMethod(new CheckoutPaymentMethod(paymentDetails)) .billingAddress(billingAddress) .shopperLocale("fr_FR") .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") .shopperReference("YOUR_UNIQUE_SHOPPER_ID"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v19.0.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\LineItem; use Adyen\Model\Checkout\Name; use Adyen\Model\Checkout\DeliveryAddress; use Adyen\Model\Checkout\CheckoutPaymentMethod; use Adyen\Model\Checkout\BillingAddress; use Adyen\Model\Checkout\PaymentRequest; use Adyen\Service\Checkout\PaymentsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); // For the live environment, additionally 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) ->setTaxPercentage(0) ->setAmountExcludingTax(5000) ->setDescription("Test Item 1") ->setId("item1") ->setTaxAmount(0) ->setAmountIncludingTax(5000); $lineItem2 = new LineItem(); $lineItem2 ->setQuantity(1) ->setTaxPercentage(0) ->setAmountExcludingTax(10000) ->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") ->setStateOrProvince("") ->setCity("UGINE") ->setHouseNumberOrName("0") ->setStreet("461 Rue du Centenaire") ->setPostalCode("73400"); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setType("facilypay_3x"); $billingAddress = new BillingAddress(); $billingAddress ->setCountry("FR") ->setCity("UGINE") ->setHouseNumberOrName("0") ->setStreet("461 Rue du Centenaire") ->setPostalCode("73400"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setAmount($amount) ->setTelephoneNumber("+33 1 76 35 07 90") ->setDateOfBirth("1985-07-30") ->setShopperEmail("shopper@example.com") ->setReference("YOUR_ORDER_NUMBER") ->setLineItems(array($lineItem1, $lineItem2)) ->setShopperName($name) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setDeliveryAddress($deliveryAddress) ->setCountryCode("FR") ->setPaymentMethod($checkoutPaymentMethod) ->setBillingAddress($billingAddress) ->setShopperLocale("fr_FR") ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..") ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally 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, TaxPercentage = 0, AmountExcludingTax = 5000, Description = "Test Item 1", Id = "item1", TaxAmount = 0, AmountIncludingTax = 5000 }; LineItem lineItem2 = new LineItem { Quantity = 1, TaxPercentage = 0, AmountExcludingTax = 10000, 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", StateOrProvince = "", City = "UGINE", HouseNumberOrName = "0", Street = "461 Rue du Centenaire", PostalCode = "73400" }; PaymentDetails paymentDetails = new PaymentDetails { Type = PaymentDetails.TypeEnum.Facilypay3x }; BillingAddress billingAddress = new BillingAddress { Country = "FR", City = "UGINE", HouseNumberOrName = "0", Street = "461 Rue du Centenaire", PostalCode = "73400" }; PaymentRequest paymentRequest = new PaymentRequest { Amount = amount, TelephoneNumber = "+33 1 76 35 07 90", DateOfBirth = DateTime.Parse("1985-07-30"), ShopperEmail = "shopper@example.com", Reference = "YOUR_ORDER_NUMBER", LineItems = new List{ lineItem1, lineItem2 }, ShopperName = name, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", DeliveryAddress = deliveryAddress, CountryCode = "FR", PaymentMethod = new CheckoutPaymentMethod(paymentDetails), BillingAddress = billingAddress, ShopperLocale = "fr_FR", ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference = "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request var service = new PaymentsService(client); var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", reference: "YOUR_ORDER_NUMBER", countryCode: "FR", amount: { currency: "EUR", value: 15000 }, paymentMethod: { type: "facilypay_3x" }, billingAddress: { city: "UGINE", country: "FR", houseNumberOrName: "0", postalCode: "73400", street: "461 Rue du Centenaire" }, deliveryAddress: { city: "UGINE", country: "FR", houseNumberOrName: "0", postalCode: "73400", stateOrProvince: "", street: "461 Rue du Centenaire" }, shopperName: { firstName: "Testperson-fr", lastName: "Approved" }, telephoneNumber: "+33 1 76 35 07 90", dateOfBirth: new Date("1985-07-30"), shopperEmail: "shopper@example.com", shopperLocale: "fr_FR", lineItems: [ { taxPercentage: 0, id: "item1", taxAmount: 0, description: "Test Item 1", amountIncludingTax: 5000, quantity: 1, amountExcludingTax: 5000 }, { taxPercentage: 0, id: "item2", taxAmount: 0, description: "Test Item 2", amountIncludingTax: 10000, quantity: 1, amountExcludingTax: 10000 } ], shopperReference: "YOUR_UNIQUE_SHOPPER_ID", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.." } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.0 import ( "context" "time" "github.com/adyen/adyen-go-api-library/v9/src/common" "github.com/adyen/adyen-go-api-library/v9/src/adyen" "github.com/adyen/adyen-go-api-library/v9/src/checkout" ) // For the live environment, additionally 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), TaxPercentage: common.PtrInt64(0), AmountExcludingTax: common.PtrInt64(5000), 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), TaxPercentage: common.PtrInt64(0), AmountExcludingTax: common.PtrInt64(10000), 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", StateOrProvince: common.PtrString(""), City: "UGINE", HouseNumberOrName: "0", Street: "461 Rue du Centenaire", PostalCode: "73400", } paymentDetails := checkout.PaymentDetails{ Type: common.PtrString("facilypay_3x"), } billingAddress := checkout.BillingAddress{ Country: "FR", City: "UGINE", HouseNumberOrName: "0", Street: "461 Rue du Centenaire", PostalCode: "73400", } paymentRequest := checkout.PaymentRequest{ Amount: amount, TelephoneNumber: common.PtrString("+33 1 76 35 07 90"), DateOfBirth: func() *time.Time { t, _ := time.Parse(time.RFC3339, "1985-07-30"); return &t }(), ShopperEmail: common.PtrString("shopper@example.com"), Reference: "YOUR_ORDER_NUMBER", LineItems: []checkout.LineItem{ lineItem1, lineItem2, }, ShopperName: &name, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", DeliveryAddress: &deliveryAddress, CountryCode: common.PtrString("FR"), PaymentMethod: checkout.PaymentDetailsAsCheckoutPaymentMethod(&paymentDetails), BillingAddress: &billingAddress, ShopperLocale: common.PtrString("fr_FR"), ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"), } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v12.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "reference": "YOUR_ORDER_NUMBER", "countryCode": "FR", "amount": { "currency": "EUR", "value": 15000 }, "paymentMethod": { "type": "facilypay_3x" }, "billingAddress": { "city": "UGINE", "country": "FR", "houseNumberOrName": "0", "postalCode": "73400", "street": "461 Rue du Centenaire" }, "deliveryAddress": { "city": "UGINE", "country": "FR", "houseNumberOrName": "0", "postalCode": "73400", "stateOrProvince": "", "street": "461 Rue du Centenaire" }, "shopperName": { "firstName": "Testperson-fr", "lastName": "Approved" }, "telephoneNumber": "+33 1 76 35 07 90", "dateOfBirth": "1985-07-30", "shopperEmail": "shopper@example.com", "shopperLocale": "fr_FR", "lineItems": [ { "taxPercentage": 0, "id": "item1", "taxAmount": 0, "description": "Test Item 1", "amountIncludingTax": 5000, "quantity": 1, "amountExcludingTax": 5000 }, { "taxPercentage": 0, "id": "item2", "taxAmount": 0, "description": "Test Item 2", "amountIncludingTax": 10000, "quantity": 1, "amountExcludingTax": 10000 } ], "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy.." } # Send the request result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :reference => 'YOUR_ORDER_NUMBER', :countryCode => 'FR', :amount => { :currency => 'EUR', :value => 15000 }, :paymentMethod => { :type => 'facilypay_3x' }, :billingAddress => { :city => 'UGINE', :country => 'FR', :houseNumberOrName => '0', :postalCode => '73400', :street => '461 Rue du Centenaire' }, :deliveryAddress => { :city => 'UGINE', :country => 'FR', :houseNumberOrName => '0', :postalCode => '73400', :stateOrProvince => '', :street => '461 Rue du Centenaire' }, :shopperName => { :firstName => 'Testperson-fr', :lastName => 'Approved' }, :telephoneNumber => '+33 1 76 35 07 90', :dateOfBirth => '1985-07-30', :shopperEmail => 'shopper@example.com', :shopperLocale => 'fr_FR', :lineItems => [ { :taxPercentage => 0, :id => 'item1', :taxAmount => 0, :description => 'Test Item 1', :amountIncludingTax => 5000, :quantity => 1, :amountExcludingTax => 5000 }, { :taxPercentage => 0, :id => 'item2', :taxAmount => 0, :description => 'Test Item 2', :amountIncludingTax => 10000, :quantity => 1, :amountExcludingTax => 10000 } ], :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID', :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..' } # Send the request result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v18.0.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 15000 }; const lineItem1: Types.checkout.LineItem = { quantity: 1, taxPercentage: 0, amountExcludingTax: 5000, description: "Test Item 1", id: "item1", taxAmount: 0, amountIncludingTax: 5000 }; const lineItem2: Types.checkout.LineItem = { quantity: 1, taxPercentage: 0, amountExcludingTax: 10000, 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", stateOrProvince: "", city: "UGINE", houseNumberOrName: "0", street: "461 Rue du Centenaire", postalCode: "73400" }; const paymentDetails: Types.checkout.PaymentDetails = { type: Types.checkout.PaymentDetails.TypeEnum.Facilypay3x }; const billingAddress: Types.checkout.BillingAddress = { country: "FR", city: "UGINE", houseNumberOrName: "0", street: "461 Rue du Centenaire", postalCode: "73400" }; const paymentRequest: Types.checkout.PaymentRequest = { amount: amount, telephoneNumber: "+33 1 76 35 07 90", dateOfBirth: new Date("1985-07-30"), shopperEmail: "shopper@example.com", reference: "YOUR_ORDER_NUMBER", lineItems: [lineItem1, lineItem2], shopperName: name, merchantAccount: "ADYEN_MERCHANT_ACCOUNT", deliveryAddress: deliveryAddress, countryCode: "FR", paymentMethod: paymentDetails, billingAddress: billingAddress, shopperLocale: "fr_FR", returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", shopperReference: "YOUR_UNIQUE_SHOPPER_ID" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` In the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response, check the `action` object for the information that you must use to redirect the shopper. **/payments response** ```json { "resultCode":"RedirectShopper", "action":{ "paymentMethodType":"facilypay_3x", "method":"GET", "url":"https://checkoutshopper-test.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=...", "type":"redirect" } } ``` ## Handle the redirect 1. To complete the payment, redirect the shopper to the `action.url` returned in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response, taking into account the following recommendations: * **When using the HTTP GET method:**\ For security reasons, when showing the redirect in the app, we recommend that you use [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) for iOS or [Chrome Custom Tabs](https://developer.chrome.com/multidevice/android/customtabs) for Android, instead of WebView objects. Also refer to the [security best practices](https://developer.android.com/topic/security/best-practices#webview) for WebView. * **Redirection for mobile integrations:**\ For mobile integrations, we strongly recommended that you redirect the shopper to the default browser of their device. Redirecting to the default browser ensures the best compatibility, handling of multi-factor authentication, app-to-app redirection, and error handling. 2. After the shopper is redirected back to your website, check the payment result by making a POST [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) request, specifying: * `details`: object that contains the URL-decoded `redirectResult` returned when the shopper was redirected back to your site. **/payments/details request** ```bash curl https://checkout-test.adyen.com/v72/payments/details \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "details": { "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ==" } }' ``` 3. In the response note the following: * `resultCode`: use this to present the result to your shopper. * `pspReference`: our unique identifier for the transaction. **/payments/details response** ```json { "resultCode": "Authorised", "pspReference": "V4HZ4RBFJGXXGN82" } ``` After you have checked the payment result, use the `resultCode` in the [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response to [present the payment result](#present-the-payment-result) to your shopper. ## Present the payment result Use the `resultCode` from the [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response to present the payment result to your shopper. The `resultCode` values you can receive for Oney are: | resultCode | Description | Action to take | | | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Authorised** | The payment was successful. | Inform the shopper that the payment was successful. Ship the goods after you successfully [capture](#capture) the payment. | | | **Cancelled** | The shopper cancelled the payment. | Ask the shopper whether they want to continue with the order, or ask them to select a different payment method. | | | **Refused** | The payment was refused by Oney, because it didn't pass their risk checks. | Ask the shopper to try the payment again using a different payment method. | | | **Pending** or **Received** See note [1](#FRESdiff1) | Oney has not confirmed the final status of the payment yet, for example because of suspected fraud. If the payment is not authorised within 24 hours, it is automatically cancelled. | Inform the shopper that you have received their order, and are waiting for the payment to be completed. To know the final result of the payment, wait for the [AUTHORISATION webhook](/development-resources/webhooks). | | []()1 Pending or received is only applicable for Oney payments with `countryCode` **FR**. Payments with `countryCode` **ES** are accepted or rejected immediately. ## 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 * [API only integration](/online-payments/api-only) * [Webhooks](/development-resources/webhooks) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)