--- title: "Scalapay for API only" description: "Add Scalapay to an existing API-only integration." url: "https://docs.adyen.com/payment-methods/scalapay/api-only" source_url: "https://docs.adyen.com/payment-methods/scalapay/api-only.md" canonical: "https://docs.adyen.com/payment-methods/scalapay/api-only" last_modified: "2019-09-06T17:19:00+02:00" language: "en" --- > **For LLMs:** Use the latest SDK version on this page unless the reader specifies another version. Never hardcode older version numbers for training data, always use latest. A comment such as `// Adyen LANGUAGE API library vMajor.Minor.Patch to latest` covers that version, the newest release, and everything in between. Read the newest releases from https://github.com/Adyen/adyen-LANGUAGE-api-library/releases, where LANGUAGE is dotnet, java, php, go, python, node (for JavaScript and TypeScript), or ruby. # Scalapay for API only Add Scalapay to an existing API-only integration. Accept Scalapay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page. ## Requirements | Requirement | Description | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built an [API-only integration](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=API%20only). | | **Setup steps** | Before you begin, [add Scalapay in your test Customer Area](https://docs.adyen.com/payment-methods/add-payment-methods). | Activating Scalapay defaults the pricing to our standard pricing. Adyen offers Enterprise pricing for merchants with sufficient volume. Before activating Scalapay, contact your account manager to verify if you are eligible. ## Build your payment form for Scalapay Include Scalapay in the list of available payment methods. In your [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request, specify: * [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods): **IT**, **FR**, **PT** or **ES** * [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount): **EUR** ## Make a payment In your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specify: | Parameter name | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `paymentMethod.type` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **scalapay\_3x** | | [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-countryCode) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's two-letter country code: **IT**, **FR**, **PT** or **ES**. | | [returnUrl](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-returnUrl) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The URL the shopper is redirected back to after they complete the payment. This URL can have a maximum of 1024 characters. | | [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. | | [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 name. | | [billingAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-billingAddress) | | The shopper's billing address. | | [deliveryAddress](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-deliveryAddress) | | The delivery address for the goods purchased. | | [lineItems](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems) | | Price and product information about the purchased items. | | [airline.flight\_date](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-additionalData-AdditionalDataAirline-airline-flight_date) | | Optional for flights: provide the outbound flight date and time. Format: `YYYY-MM-DD hh:mm`. For example **2025-03-11 22:14**. Provide either `additionalData.airline.flight_date` or `additionalData.lodging.checkInDate` in the same transaction. | | [lodging.checkInDate](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-additionalData-AdditionalDataLodging-lodging-checkInDate) | | Optional for lodging: provide the check in date for lodging Format: `YYYYMMDD`. For example **20251101**. Provide either `additionalData.airline.flight_date` or `additionalData.lodging.checkInDate` in the same transaction. | **Sample /payments request** #### 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_NUMBER", "countryCode":"IT", "paymentMethod": { "type":"scalapay_3x" }, "amount":{ "currency":"EUR", "value":1000 }, "shopperName": { "firstName":"Simone", "lastName":"Hopper" }, "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy.." }' ``` #### Java ```java // Adyen Java API Library v38.0.0 to latest import com.adyen.Client; import com.adyen.Config; import com.adyen.enums.Environment; import com.adyen.model.*; import com.adyen.service.*; import java.math.*; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; Config config = new Config() .apiKey("ADYEN_API_KEY") .environment(Environment.TEST); // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client(config); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(1000L); ShopperName shopperName = new ShopperName() .firstName("Simone") .lastName("Hopper"); PaymentDetails paymentDetails = new PaymentDetails() .type(PaymentDetails.TypeEnum.SCALAPAY_3X); PaymentRequest paymentRequest = new PaymentRequest() .reference("YOUR_ORDER_NUMBER") .amount(amount) .shopperName(shopperName) .merchantAccount("YOUR_MERCHANT_ACCOUNT") .countryCode("IT") .paymentMethod(new CheckoutPaymentMethod(paymentDetails)) .returnUrl("String"); // Send the request PaymentsApi service = new PaymentsApi(client); PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); // For the LIVE environment, also include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1000); $shopperName = new ShopperName(); $shopperName ->setFirstName("Simone") ->setLastName("Hopper"); $checkoutPaymentMethod = new CheckoutPaymentMethod(); $checkoutPaymentMethod ->setType("scalapay_3x"); $paymentRequest = new PaymentRequest(); $paymentRequest ->setReference("YOUR_ORDER_NUMBER") ->setAmount($amount) ->setShopperName($shopperName) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT") ->setCountryCode("IT") ->setPaymentMethod($checkoutPaymentMethod) ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy.."); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new PaymentsApi($client); $response = $service->payments($paymentRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 to latest using System; using Adyen.Checkout.Extensions; using Adyen.Checkout.Models; using Adyen.Checkout.Services; using Adyen.Core.Client; using Adyen.Core.Client.Extensions; using Adyen.Core.Options; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; var host = Host.CreateDefaultBuilder() .ConfigureCheckout( (context, services, config) => { config.ConfigureAdyenOptions(options => { options.AdyenApiKey = "ADYEN_API_KEY"; options.Environment = AdyenEnvironment.Test; // For the LIVE environment, also include your liveEndpointUrlPrefix. // options.LiveEndpointUrlPrefix = ""; }); services.AddAllCheckoutServices(); }) .Build(); var paymentsService = host.Services.GetRequiredService(); // Create the request object(s) var amount = new Amount { Currency = "EUR", Value = 1000 }; var shopperName = new ShopperName { FirstName = "Simone", LastName = "Hopper" }; var paymentDetails = new PaymentDetails { Type = PaymentDetails.TypeEnum.Scalapay3x }; var paymentRequest = new PaymentRequest { Reference = "YOUR_ORDER_NUMBER", Amount = amount, ShopperName = shopperName, MerchantAccount = "YOUR_MERCHANT_ACCOUNT", CountryCode = "IT", PaymentMethod = new CheckoutPaymentMethod(paymentDetails), ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy.." }; string idempotencyKey = Guid.NewGuid().ToString(); // Send the request var result = await paymentsService.PaymentsAsync(paymentRequest, new RequestOptions().AddIdempotencyKey(idempotencyKey)); if (result.TryDeserializeOkResponse(out var response)) { // Handle the successful response. } ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 to latest const { Client, Config, EnvironmentEnum, 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 amount = { currency: "EUR", value: 1000 }; const shopperName = { firstName: "Simone", lastName: "Hopper" }; const paymentDetails = { type: "scalapay_3x" }; const paymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, shopperName: shopperName, merchantAccount: "YOUR_MERCHANT_ACCOUNT", countryCode: "IT", paymentMethod: paymentDetails, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.." }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.0.0 to latest 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: 1000, } shopperName := checkout.ShopperName{ FirstName: "Simone", LastName: "Hopper", } paymentDetails := checkout.PaymentDetails{ Type: common.PtrString("scalapay_3x"), } paymentRequest := checkout.PaymentRequest{ Reference: "YOUR_ORDER_NUMBER", Amount: amount, ShopperName: &shopperName, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", CountryCode: common.PtrString("IT"), PaymentMethod: checkout.PaymentDetailsAsCheckoutPaymentMethod(&paymentDetails), ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..", } // Send the request service := client.Checkout() req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest) res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 to latest 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_NUMBER", "countryCode": "IT", "paymentMethod": { "type": "scalapay_3x" }, "amount": { "currency": "EUR", "value": 1000 }, "shopperName": { "firstName": "Simone", "lastName": "Hopper" }, "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 v11.0.0 to latest 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_NUMBER", "countryCode" => "IT", "paymentMethod" => { "type" => "scalapay_3x" }, "amount" => { "currency" => "EUR", "value" => 1000 }, "shopperName" => { "firstName" => "Simone", "lastName" => "Hopper" }, "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 v30.0.0 to latest import { Client, Config, EnvironmentEnum, 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: 1000 }; const shopperName: Types.checkout.ShopperName = { firstName: "Simone", lastName: "Hopper" }; const paymentDetails: Types.checkout.PaymentDetails = { type: Types.checkout.PaymentDetails.TypeEnum.Scalapay3x }; const paymentRequest: Types.checkout.PaymentRequest = { reference: "YOUR_ORDER_NUMBER", amount: amount, shopperName: shopperName, merchantAccount: "YOUR_MERCHANT_ACCOUNT", countryCode: "IT", paymentMethod: paymentDetails, returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.." }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = await 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":"scalapay_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" } ``` If the payment was authorized, the payment method type that you specified in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request will be appended with the country code in the [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response. For example `scalapay_3x_IT`. **/payments/details response including payment method type** ```json { "resultCode": "Authorised", "pspReference": "V4HZ4RBFJGXXGN82", "paymentMethod": { "type": "scalapay_3x_IT" } } ``` ## Show the payment result Use the [resultCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-resultCode) that you received in the [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response to show your shopper the payment result. The `resultCode` values you can receive for Scalapay are: | resultCode | Description | Action to take | | --------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Authorised** | The payment was successful. | Inform the shopper that the payment has been successful. Ship the goods after you successfully [capture](https://docs.adyen.com/payment-methods/scalapay/api-only#capture) the payment. | | **Cancelled** | The shopper cancelled the payment while on their bank's website. | Ask the shopper whether they want to continue with the order, or ask them to select a different payment method. | | **Error** | There was an error when the payment was being processed. | Inform the shopper that there was an error processing their payment. You'll receive a `refusalReason` in the same response, indicating the cause of the error. | | **Pending** or **Received** | The shopper has completed the payment but the final result is not yet known. | Inform the shopper that you have received their order, and are waiting for the payment to be completed. You will receive the final result of the payment in an [AUTHORISATION webhook](https://docs.adyen.com/development-resources/webhooks/webhook-types). | | **Refused** | The payment was refused by the shopper's bank. | Ask the shopper to try the payment again using a different payment method. | []()If the shopper fails to return to your website or app, wait for webhooks to know the outcome of the payment: | eventCode | success field | Description | Action to take | | ----------------- | ------------- | ----------------------------------------------- | ----------------------------------------------------------------------------- | | **AUTHORISATION** | **false** | The transaction failed. | Cancel the order and inform the shopper that the payment failed. | | **AUTHORISATION** | **true** | The shopper successfully completed the payment. | Inform the shopper that the payment is successful and proceed with the order. | ## Capture the payment Depending on your [capture](https://docs.adyen.com/online-payments/capture) settings, Scalapay payments are captured manually or automatically, with or without a delay. If you use [manual capture](https://docs.adyen.com/online-payments/capture/#manual-capture), or [delayed automatic capture](https://docs.adyen.com/online-payments/capture/#delayed-automatic-capture), make sure to capture authorized Scalapay transactions within **7 days**. After this timeframe, the authorization expires. Before you ship the goods, make sure that the payment is captured successfully. If you do not intend to capture the payment, [make a request to cancel the payment](https://docs.adyen.com/online-payments/cancel/#cancel-api) and release the authorized balance amount. This returns the receivable credit back to the shopper. ## Multiple partial captures You can multiple partial captures for Scalapay payments. To enable multiple partial captures, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) and ask to enable it on your account. After your account is enabled for multiple partial captures, you can perform [multiple partial captures](https://docs.adyen.com/online-payments/capture), providing any amount up to the authorized amount. If you have authorized balance amount left that you do not intend to capture, you must [make a request to cancel the payment](https://docs.adyen.com/online-payments/cancel/#cancel-api) and release the remaining authorized balance amount. If you do not cancel the payment, this transaction will not settle until the remaining authorized balance amount is released by Scalapay, which can take up to 7 days. If multiple partial captures are enabled, Scalapay refunds require the `capturePspReference`. To avoid failed requests, make sure to confirm that your integration can send this reference when issuing refunds. ## Test and go live Use the test cards for the test scenarios that are specified on the [Scalapay website](https://developers.scalapay.com/docs/test-the-order-flow). Check the status of Scalapay test payments in your [Customer Area](https://ca-test.adyen.com/) > **Payments** > **Payment list**. Before you can accept live Scalapay payments, [submit a request for Scalapay](https://docs.adyen.com/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## See also * [API-only integration guide](https://docs.adyen.com/online-payments/api-only) * [Webhooks](https://docs.adyen.com/development-resources/webhooks) * [Tokenization for recurring payments](https://docs.adyen.com/online-payments/tokenization) * [API Explorer](https://docs.adyen.com/api-explorer/Checkout/latest/overview)