--- title: "Point of sale for platforms" description: "Process point-of-sale payments on behalf of your account holders." url: "https://docs.adyen.com/classic-platforms/platforms-for-pos" source_url: "https://docs.adyen.com/classic-platforms/platforms-for-pos.md" canonical: "https://docs.adyen.com/classic-platforms/platforms-for-pos" last_modified: "2021-08-02T16:33:00+02:00" language: "en" --- # Point of sale for platforms Process point-of-sale payments on behalf of your account holders. [View source](/classic-platforms/platforms-for-pos.md) This page is for classic Adyen for Platforms integrations. If you are just starting your implementation, refer to our [new integration guide](/adyen-for-platforms-model) instead. Adyen for Platforms enables you to onboard account holders with point-of-sale (POS) integrations to accept in-person payments. To make this happen, you need to: * [Subscribe to store notifications](#subscribe-to-notifications). * [Add a store](#add-store) for the account holder. * [Assign a terminal to the store](#assign-terminal-to-store) and ship it to the the account holder's store address. * [Split funds](#split-a-payment) between accounts in your platform. ## Requirements Before you start processing point-of-sale payments for your account holders, you need to: * Have a [Terminal API integration with Adyen](/point-of-sale/get-started). * Be familiar with the features of [Adyen for Platforms](/platforms), such as [account structure](/classic-platforms/account-structure), the [onboarding and verification process](/classic-platforms/onboard-users), split payments, and notifications. * Contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) and provide the following required information. * Countries * Currencies * Merchant category codes (MCCs) * Payment methods You can specify different currencies, MCCs, and payment methods for each country/region. We use this information to enable you to create stores based on the type of payments that must be processed in the store. ## Subscribe to store notifications When you add a store for an account holder, we send a notification to let you know the store has been set up. To ensure you receive this notification: 1. Make a POST request to the [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), specifying: * `active`: **true**. * `description`: Your text to recognize the notification subscription by. * An `eventConfigs` array with `eventType`: **ACCOUNT\_HOLDER\_STORE\_STATUS\_CHANGE** and `includeMode`: **INCLUDE**. * `notifyURL`: Endpoint on your server where you'll receive the notifications. * `hmacSignatureKey`: Use this parameter if you want us to [protect notifications with HMAC signatures](/classic-platforms/configure-notifications/signing-notifications-with-hmac). It specifies the HMAC key that we'll use to calculate the HMAC signatures of the notifications we send to the `notifyURL`. On your end you'll need to verify the signatures of the incoming notifications. * `notifyUsername` and `notifyPassword`: Username and password that we need for basic authentication with the server where you'll receive the notifications. * `sslProtocol`: Protocol used to secure the communication, such as **TLS** or **SSL**. **/createNotificationConfiguration request** ```bash curl https://cal-test.adyen.com/cal/services/Notification/v6/createNotificationConfiguration \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "configurationDetails":{ "active": true, "description":"YOUR_UNIQUE_DESCRIPTION", "eventConfigs":[ { "eventType":"ACCOUNT_HOLDER_STORE_STATUS_CHANGE", "includeMode":"INCLUDE" } ], "notifyURL":"https://www.merchant-domain.com/notification-handler", "hmacSignatureKey":"c6c608e9d2ec95889cb9757e6beb4956c187f44cf7bb7297b16880c0310af7ff", "notifyUsername":"YOUR_USERNAME", "notifyPassword":"YOUR_PASSWORD", "sslProtocol":"SSL" } }' ``` **Response** ```json { "pspReference": "8515681150749298", "configurationDetails": { "active": true, "description": "YOUR_UNIQUE_DESCRIPTION", "eventConfigs": [ { "eventType": "ACCOUNT_HOLDER_STORE_STATUS_CHANGE", "includeMode": "INCLUDE" } ], "notificationId": 20337, "notifyURL": "https://www.merchant-domain.com/notification-handler", "sslProtocol": "SSLInsecureCiphers" } } ``` 2. Make sure that your server [accepts the notifications](/classic-platforms/configure-notifications#accept-notifications). 3. Use the `notificationId` you receive in the response to [test the notification](/classic-platforms/configure-notifications#test-a-notification). ## Create a store for the account holder Make sure our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) has enabled creating stores. If you haven't requested this yet, refer to the [requirements](#requirements). Once our Support Team has enabled creating stores, you can start adding stores for your account holders. To provide store details, include a `storeDetails` array when you create a new account holder or when you update an existing one: 1. Make a POST request to one of the following endpoints: | Situation | Endpoint | Specify | | ------------------------------------------------------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | There is no account holder for the sub-merchant yet. | [/createAccountHolder](https://docs.adyen.com/api-explorer/#/Account/createAccountHolder) | The usual [parameters to create a business account holder](/classic-platforms/account-holders-and-accounts#create-an-account-holder), as well as `businessDetails.taxId`. | | You want to add a store to an existing account holder. | [/updateAccountHolder](https://docs.adyen.com/api-explorer/#/Account/updateAccountHolder) | `accountHolderCode`: Your unique reference for the account holder. Include `businessDetails.taxId`, unless it is already present as part of `businessDetails`. | 2. In the request body, include an [accountHolderDetails.storeDetails](https://docs.adyen.com/api-explorer/Account/latest/post/createAccountHolder#request-accountHolderDetails-storeDetails) array, specifying: * [address](https://docs.adyen.com/api-explorer/Account/latest/post/createAccountHolder#request-accountHolderDetails-storeDetails-address): The `city`, `country`, `houseNumberOrName`, `postalCode`, `stateOrProvince`, and `street` of the physical store where the account holder will process payments from. * [fullPhoneNumber](https://docs.adyen.com/api-explorer/Account/latest/post/createAccountHolder#request-accountHolderDetails-storeDetails-fullPhoneNumber): The phone number of the store. * [merchantAccount](https://docs.adyen.com/api-explorer/Account/latest/post/createAccountHolder#request-accountHolderDetails-storeDetails-merchantAccount): The merchant account used for accepting payments. * [merchantCategoryCode](https://docs.adyen.com/api-explorer/Account/latest/post/createAccountHolder#request-accountHolderDetails-storeDetails-merchantCategoryCode): The merchant category code (MCC) that classifies the business of the account holder. * [storeName](https://docs.adyen.com/api-explorer/Account/latest/post/createAccountHolder#request-accountHolderDetails-storeDetails-storeName): The name of the account holder's store. This will be included in the shopper statement. * [storeReference](https://docs.adyen.com/api-explorer/Account/latest/post/createAccountHolder#request-accountHolderDetails-storeDetails-storeReference): Your unique reference for the account holder's store. The next example shows a [/createAccountHolder](https://docs.adyen.com/api-explorer/#/Account/createAccountHolder) request to create a new account holder with a store. **/createAccountHolder request** ```bash curl https://cal-test.adyen.com/cal/services/Account/v6/createAccountHolder \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "accountHolderCode": "YOUR_UNIQUE_ACCOUNT_HOLDER_CODE", "accountHolderDetails": { "address": { "country": "US" }, "businessDetails": { "legalBusinessName": "Real Good Restaurant Inc.", "taxId": "444455555", "shareholders": [ { "name": { "firstName": "Maria", "gender": "FEMALE", "lastName": "Green" }, "address": { "country": "US" } } ] }, "email": "maria@green.com", "storeDetails" : [ { "storeReference": "YOUR_SUBMERCHANT_STORE_ID", "storeName": "Store Name", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "merchantCategoryCode": "7999", "address" : { "city": "Store City", "country": "US", "houseNumberOrName": "1", "postalCode": "123", "stateOrProvince": "CA", "street": "Store Street" }, "fullPhoneNumber": "+31201234567" } ] }, "legalEntity": "Business" }' ``` The following example shows how to add a store to an existing account holder using an [/updateAccountHolder](https://docs.adyen.com/api-explorer/#/Account/updateAccountHolder) call. **/updateAccountHolder request** ```bash curl https://cal-test.adyen.com/cal/services/Account/v6/updateAccountHolder \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "accountHolderCode": "YOUR_UNIQUE_ACCOUNT_HOLDER_CODE", "accountHolderDetails": { "storeDetails" : [ { "storeReference": "YOUR_SUBMERCHANT_STORE_ID", "storeName": "Store Name", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "merchantCategoryCode": "7999", "address": { "city": "Store City", "country": "US", "houseNumberOrName": "1", "postalCode": "123", "stateOrProvince": "CA", "street": "Store Street" }, "fullPhoneNumber": "+31201234567" } ] } }' ``` The response contains various account holder details, including the `storeDetails` showing that the status of the store is **Pending**. **Response** ```json { "invalidFields": [], ... "accountHolderDetails":{ ... "storeDetails" : [ { "address": { "city": "Store City", "country": "US", "houseNumberOrName": "1", "postalCode": "123", "stateOrProvince": "CA", "street": "Store Street" }, "fullPhoneNumber": "+31201234567", "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "merchantCategoryCode": "7999", "status": "Pending", "store": "6db2bdbc-5e77-4388-9a6e-9e653905d3e5", "storeReference": "YOUR_SUBMERCHANT_STORE_ID", "storeName": "Store Name", } ], ... }, ... } ``` 3. Before processing point-of-sale (POS) payments, wait until you receive an `ACCOUNT_HOLDER_STORE_STATUS_CHANGE` notification showing that the new status of the store is **Active**. **Notification** ```json { "eventType":"ACCOUNT_HOLDER_STORE_STATUS_CHANGE", "eventDate":"2018-04-23T13:13:44+02:00", "executingUserKey":"ws", "live":true, "pspReference":"12312312313", "content":{ "accountHolderCode":"YOUR_UNIQUE_ACCOUNT_HOLDER_CODE", "store": "6db2bdbc-5e77-4388-9a6e-9e653905d3e5", "storeReference":"YOUR_SUBMERCHANT_STORE_ID", "newStatus":"Active", "oldStatus":"Pending", "reason":"Test Reason" } } ``` ## Assign a terminal to the store To process POS payments, the account holder's store needs to have one or more payment terminals. The process is as follows: 1. [Select a terminal](/point-of-sale/what-we-support/select-your-terminals) and inform the account holder of the [communication requirements](/point-of-sale/design-your-integration/choose-your-architecture). 2. [Order a terminal](/point-of-sale/managing-terminals/order-terminals#sales-order-steps) if you do not have the required terminal in your inventory. 3. Assign the terminal from your inventory to the store of the account holder in one of the following ways: * Assign terminals [using your Customer Area](/point-of-sale/managing-terminals/assign-terminals)\ or * Assign terminals in bulk [using API calls](/point-of-sale/automating-terminal-management/assign-terminals-api) The advantage of using the Terminal Management API over the Customer Area, is that API calls enable you to automate assigning terminals and retrieving an overview of terminal assignments. 4. Configure the terminals in the [Customer Area](https://ca-live.adyen.com/ca/ca/login.shtml), under **Point of Sale** > **Terminal settings**. 5. Ship the terminal to the physical store address and instruct the account holder to [board the terminal](/point-of-sale/managing-terminals/board-terminal). ## Split a payment To split a point-of-sale payment, you can: * Create a split configuration to automatically split payments processed through the store. For more information, refer to [How split configuration works](/classic-platforms/split-configuration-for-stores#how-split-configuration-works). * Send split instructions for every transaction at [time of payment](#make-pos-payment) or [at capture](#split-at-capture). When you use a split configuration, Adyen evaluates the rules in the split configuration for all the transactions processed through the store. If you need to change the commission fees for specific transactions, you can send split instructions in the payment or capture API request. Any split instructions that you send through the API overrides the automatic split. ### Make a split payment using the Terminal API To split a POS payment, you make a [Terminal API](/point-of-sale/design-your-integration/terminal-api) call. In the `PaymentRequest` you provide the split payment data in the `SaleToAcquirerData`, in key-value pair or Base64-encoded format. This credits payments directly to an account holder's account. To make the payment: 1. Make a POST request to a [Terminal API endpoint](/point-of-sale/design-your-integration/terminal-api#endpoints), specifying: * The standard [`SaleToPOIRequest.MessageHeader` ](/point-of-sale/design-your-integration/terminal-api#request-message-header)object, with `MessageClass` set to **Service** and `MessageCategory` set to **Payment**. | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ProtocolVersion` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **3.0** | | `MessageClass` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Service** | | `MessageCategory` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Payment** | | `MessageType` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Request** | | `ServiceID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (`POIID`) being used. | | `SaleID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for the POS system component to send this request from. | | `POIID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The unique ID of the terminal to send this request to. Format: *\[device model]-\[serial number]*. | - `PaymentRequest`: The request body. This must include: | Parameter | Required | Description | | ------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SaleData.SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: your reference to identify a payment. We recommend using a unique value per payment. In your Customer Area and Adyen reports, this will show as the **merchant reference** for the transaction. - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). | | `SaleData.SaleToAcquirerData` | | Provides the split payment data as concatenated key-value pairs separated by an ampersand (&) character, or in Base64-encoded format. See the tables below for details. | | `PaymentTransaction.AmountsReq` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `Currency`: the transaction [currency](/development-resources/currency-codes). - `RequestedAmount`: the transaction amount. | - To provide the split payment data in `PaymentRequest.SaleData.SaleToAcquirerData`, use the following fields: | Field | Description | Example | | -------------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------------- | | `split.api` | Version of the Split API: **1**. | **split.api=1** | | `split.totalAmount` | Amount to be split, in minor units. Must be equal to the transaction amount and to the sum of the split amounts. | **split.totalAmount=62000** | | `split.currencyCode` | Currency of the amount to be split. | **split.currencyCode=EUR** | | `split.nrOfItems` | Number of times you will split the payment. Must match the number of split items in the request. | **split.nrOfItems=2** | Specify each split as a `split.item{item#}` starting at **1**: `split.item1`, `split.item2`, and so on. Each split item includes: | Field | Description | Example | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | | `split.item{item#}.amount` | Amount of the split, in minor units. | **split.item1.amount=60000** and **split.item2.amount=2000** | | `split.item{item#}.type` | Split type. A type of **MarketPlace** or **VAT** sends the amount to the `account` specified. A type of **Commission** or **PaymentFee** sends the amount to your [liable account](/classic-platforms/account-structure). | **split.item1.type=MarketPlace** and **split.item2.type=Commission** | | `split.item{item#}.account` | Account that will receive the split. This is the `accountCode` of one of your account holder's accounts or your own liable account. You do not need to specify an account when `split.type` is **Commission**. |  **split.item1.account=8815628270908491** | | `split.item{item#}.reference` | The reference for that specific transaction split, which is returned in our reporting. We strongly recommend that you always include a reference for the split item. Required if the `split.type` is **MarketPlace**. |   | The following example shows how to split a EUR 620.00 payment into EUR 600.00 to be paid into the account holder's account with `accountCode` 8815628270908491 and EUR 20.00 commission to be paid to the platform. **Payment request with split instructions** ```json { "SaleToPOIRequest":{ "MessageHeader":{ "ProtocolVersion":"3.0", "MessageClass":"Service", "MessageCategory":"Payment", "MessageType":"Request", "SaleID":"POSSystemID12345", "ServiceID":"0207111104", "POIID":"V400m-324688179" }, "PaymentRequest":{ "SaleData":{ "SaleTransactionID":{ "TransactionID":"27908", "TimeStamp":"2019-03-07T10:11:04+00:00" }, "SaleToAcquirerData": "split.api=1&split.nrOfItems=2&split.totalAmount=62000&split.currencyCode=EUR&split.item1.amount=60000&split.item1.type=MarketPlace&split.item1.account=8815628270908491&split.item1.reference=test1&split.item2.amount=2000&split.item2.type=Commission&split.item2.reference=TestCommission" }, "PaymentTransaction":{ "AmountsReq":{ "Currency":"EUR", "RequestedAmount":620.00 } } } } } ``` The payment request is routed to the terminal, for the shopper to present their card and verify the payment. The payment is then sent to the Adyen payments platform for processing. 2. Receive the payment result. If your integration uses [asynchronous cloud communications](/point-of-sale/design-your-integration/choose-your-architecture/cloud#async), you must set up event notifications. We then send the Terminal API responses to your endpoint. If the payment is successful: * **Approved** is shown on the terminal display. * You receive a payment response containing: * `POIData.POITransactionID.TransactionID`: [Transaction identifier](/point-of-sale/design-your-integration/terminal-api#transaction-identifier) for the payment in the format `tenderReference.pspReference`. For example, **oLkO0012498220087000.981517998282382C**. * `PaymentResponse.Response.Result`: **Success** * `PaymentResponse.Response.AdditionalResponse`: A base64 string. When decoded, this is a JSON object with additional transaction data. * `PaymentReceipt`: Object containing data you can use to [generate a receipt](/point-of-sale/basic-tapi-integration/generate-receipts). You can also view the details of a payment in your [Customer Area](https://ca-test.adyen.com/), under **Transactions** > **Payments**. ### Split at capture using the API Some platforms do not know the final split amounts at the moment the payment request is made. If this applies to your account holder's POS payments, you need to [enable manual capture for POS payments](/point-of-sale/capturing-payments#enable-manual-capture) and follow up each authorised Terminal API payment with a [/payments/{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) API call. Splitting at capture is also the procedure to use for tipping (gratuity) and partial authorizations. Enabling manual capture for POS payments applies to all your point-of-sale account holders. Proceed as follows to split at capture: 1. From the [`transactionID` ](/point-of-sale/design-your-integration/terminal-api#transaction-identifier)field in the [payment response](/point-of-sale/basic-tapi-integration/make-a-payment#payment-response), get the `pspReference` of the authorization you want to capture. 2. To capture and split a payment at the same time, send a POST [/payments/{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) request, where `paymentPspReference` is the `pspReference` of the authorization you want to capture. In the body, include the [splits](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures#request-splits) array. For each item in the array, specify the following fields: | Parameter | Required | Description | | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [account](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures#request-splits-account) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The account that will receive (or be charged) the split amount. This is the `accountCode` of your account holder's accounts or your liable balance account. You do not need to specify this field when `type` is **Commission**. | | [amount.value](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures#request-amount-value) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The value of the split amount. You do not need to specify this field for transaction fees, since they are not known at the time of payment. | | [type](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures#request-type) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | Defines the part of the payment you want to book to a specific `account`. Possible values:- **Commission**: books the commission to your platform's liable account. - **MarketPlace**: books the sale amount to the specified account. - **PaymentFee**: books the transaction fees to your platform's liable account. - **VAT**: books the value-added tax for the sale amount to the specified account. | | [reference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures#request-reference) | | Required if `type` is **MarketPlace** Your reference for the split, which you can use to link the split to other operations and to reconcile payments. If the reference is not provided, the split is reported as part of the aggregated **TransferBalance** record in the [Marketplace Payments accounting report](/classic-platforms/reports-and-fees/marketplace-payments-accounting-report). | | [description](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures#request-description) | | Your description for that specific transaction split, which is returned in our reporting. | The example below shows how to capture a USD 80.00 authorization with `pspReference` 981517998282382C, and split it into USD 76.00 to be paid into the account holder's account with `accountCode` 8815628270908491 and USD 4.00 commission to be paid to your liable account. **Split funds at time of capture** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments/981517998282382C/captures \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "value": 8000, "currency": "USD" }, "reference": "YOUR_REFERENCE_NUMBER", "splits":[ { "amount":{ "value":7600 }, "type":"MarketPlace", "account":"8815628270908491", "reference":"YOUR_REFERENCE_TO_SPLIT_#1" }, { "amount":{ "value":400 }, "type":"Commission", "reference":"YOUR_REFERENCE_TO_SPLIT_#2" } ] }' ``` #### Java ```java // Adyen Java API Library v40.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the LIVE environment, also include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) SplitAmount splitAmount1 = new SplitAmount() .value(7600L); SplitAmount splitAmount2 = new SplitAmount() .value(400L); Amount amount = new Amount() .currency("USD") .value(8000L); Split split1 = new Split() .reference("YOUR_REFERENCE_TO_SPLIT_#1") .amount(splitAmount1) .type(Split.TypeEnum.MARKETPLACE) .account("8815628270908491"); Split split2 = new Split() .reference("YOUR_REFERENCE_TO_SPLIT_#2") .amount(splitAmount2) .type(Split.TypeEnum.COMMISSION); PaymentCaptureRequest paymentCaptureRequest = new PaymentCaptureRequest() .reference("YOUR_REFERENCE_NUMBER") .amount(amount) .splits(Arrays.asList(split1, split2)) .merchantAccount("YOUR_MERCHANT_ACCOUNT"); // Send the request ModificationsApi service = new ModificationsApi(client); PaymentCaptureResponse response = service.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, 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) $splitAmount1 = new SplitAmount(); $splitAmount1 ->setValue(7600); $splitAmount2 = new SplitAmount(); $splitAmount2 ->setValue(400); $amount = new Amount(); $amount ->setCurrency("USD") ->setValue(8000); $split1 = new Split(); $split1 ->setReference("YOUR_REFERENCE_TO_SPLIT_#1") ->setAmount($splitAmount1) ->setType("MarketPlace") ->setAccount("8815628270908491"); $split2 = new Split(); $split2 ->setReference("YOUR_REFERENCE_TO_SPLIT_#2") ->setAmount($splitAmount2) ->setType("Commission"); $paymentCaptureRequest = new PaymentCaptureRequest(); $paymentCaptureRequest ->setReference("YOUR_REFERENCE_NUMBER") ->setAmount($amount) ->setSplits(array($split1, $split2)) ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new ModificationsApi($client); $response = $service->captureAuthorisedPayment('paymentPspReference', $paymentCaptureRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v32.2.1 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the LIVE environment, also include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) SplitAmount splitAmount1 = new SplitAmount { Value = 7600 }; SplitAmount splitAmount2 = new SplitAmount { Value = 400 }; Amount amount = new Amount { Currency = "USD", Value = 8000 }; Split split1 = new Split { Reference = "YOUR_REFERENCE_TO_SPLIT_#1", Amount = splitAmount1, Type = Split.TypeEnum.MarketPlace, Account = "8815628270908491" }; Split split2 = new Split { Reference = "YOUR_REFERENCE_TO_SPLIT_#2", Amount = splitAmount2, Type = Split.TypeEnum.Commission }; PaymentCaptureRequest paymentCaptureRequest = new PaymentCaptureRequest { Reference = "YOUR_REFERENCE_NUMBER", Amount = amount, Splits = new List{ split1, split2 }, MerchantAccount = "YOUR_MERCHANT_ACCOUNT" }; // Send the request var service = new ModificationsService(client); var response = service.CaptureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v30.0.0 const { Client, CheckoutAPI } = require('@adyen/api-library'); // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const paymentCaptureRequest = { merchantAccount: "YOUR_MERCHANT_ACCOUNT", amount: { value: 8000, currency: "EUR" }, reference: "YOUR_REFERENCE_NUMBER", splits: [ { amount: { value: 7600 }, type: "MarketPlace", account: "8815628270908491", reference: "YOUR_REFERENCE_TO_SPLIT_#1" }, { amount: { value: 400 }, type: "Commission", reference: "YOUR_REFERENCE_TO_SPLIT_#2" } ] } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.1.0 import ( "context" "github.com/adyen/adyen-go-api-library/v21/src/common" "github.com/adyen/adyen-go-api-library/v21/src/adyen" "github.com/adyen/adyen-go-api-library/v21/src/checkout" ) // For the LIVE environment, also include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) splitAmount1 := checkout.SplitAmount{ Value: 7600, } splitAmount2 := checkout.SplitAmount{ Value: 400, } amount := checkout.Amount{ Currency: "USD", Value: 8000, } split1 := checkout.Split{ Reference: common.PtrString("YOUR_REFERENCE_TO_SPLIT_#1"), Amount: &splitAmount1, Type: "MarketPlace", Account: common.PtrString("8815628270908491"), } split2 := checkout.Split{ Reference: common.PtrString("YOUR_REFERENCE_TO_SPLIT_#2"), Amount: &splitAmount2, Type: "Commission", } paymentCaptureRequest := checkout.PaymentCaptureRequest{ Reference: common.PtrString("YOUR_REFERENCE_NUMBER"), Amount: amount, Splits: []checkout.Split{ split1, split2, }, MerchantAccount: "YOUR_MERCHANT_ACCOUNT", } // Send the request service := client.Checkout() req := service.ModificationsApi.CaptureAuthorisedPaymentInput("paymentPspReference").IdempotencyKey("UUID").PaymentCaptureRequest(paymentCaptureRequest) res, httpRes, err := service.ModificationsApi.CaptureAuthorisedPayment(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v14.0.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "amount": { "value": 8000, "currency": "USD" }, "reference": "YOUR_REFERENCE_NUMBER", "splits": [ { "amount": { "value": 7600 }, "type": "MarketPlace", "account": "8815628270908491", "reference": "YOUR_REFERENCE_TO_SPLIT_#1" }, { "amount": { "value": 400 }, "type": "Commission", "reference": "YOUR_REFERENCE_TO_SPLIT_#2" } ] } # Send the request result = adyen.checkout.modifications_api.capture_authorised_payment(request=json_request, paymentPspReference="paymentPspReference", idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.0.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the LIVE environment, also include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :merchantAccount => 'YOUR_MERCHANT_ACCOUNT', :amount => { :value => 8000, :currency => 'USD' }, :reference => 'YOUR_REFERENCE_NUMBER', :splits => [ { :amount => { :value => 7600 }, :type => 'MarketPlace', :account => '8815628270908491', :reference => 'YOUR_REFERENCE_TO_SPLIT_#1' }, { :amount => { :value => 400 }, :type => 'Commission', :reference => 'YOUR_REFERENCE_TO_SPLIT_#2' } ] } # Send the request result = adyen.checkout.modifications_api.capture_authorised_payment(request_body, 'paymentPspReference', headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.0.0 import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // For the LIVE environment, also include your liveEndpointUrlPrefix. const config = new Config({ apiKey: "ADYEN_API_KEY", environment: EnvironmentEnum.TEST }); const client = new Client(config); // Create the request object(s) const splitAmount1: Types.checkout.SplitAmount = { value: 7600 }; const splitAmount2: Types.checkout.SplitAmount = { value: 400 }; const amount: Types.checkout.Amount = { currency: "USD", value: 8000 }; const split1: Types.checkout.Split = { reference: "YOUR_REFERENCE_TO_SPLIT_#1", amount: splitAmount1, type: Types.checkout.Split.TypeEnum.MarketPlace, account: "8815628270908491" }; const split2: Types.checkout.Split = { reference: "YOUR_REFERENCE_TO_SPLIT_#2", amount: splitAmount2, type: Types.checkout.Split.TypeEnum.Commission }; const paymentCaptureRequest: Types.checkout.PaymentCaptureRequest = { reference: "YOUR_REFERENCE_NUMBER", amount: amount, splits: [split1, split2], merchantAccount: "YOUR_MERCHANT_ACCOUNT" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, { idempotencyKey: "UUID" }); ``` 3. In the capture response, note the following: * `paymentPspReference`: The PSP reference of the authorization. * `pspReference`: The PSP reference associated with this capture request. This is different from the PSP reference of the authorization. * `status`: **received** 4. Listen to the [CAPTURE webhook](/point-of-sale/capturing-payments#capture-webhook) to learn the outcome of the request. ## See also * [Adyen for Platforms](/platforms) * [Terminal API](/point-of-sale/design-your-integration/terminal-api) * [API Explorer - Capture](https://docs.adyen.com/api-explorer/#/Payment/latest/capture)