--- title: "Autonomous stores" description: "Use Adyen payment terminals to process payments and grant access to unattended stores." url: "https://docs.adyen.com/point-of-sale/autonomous-stores" source_url: "https://docs.adyen.com/point-of-sale/autonomous-stores.md" canonical: "https://docs.adyen.com/point-of-sale/autonomous-stores" last_modified: "2026-05-26T13:48:54+02:00" language: "en" --- # Autonomous stores Use Adyen payment terminals to process payments and grant access to unattended stores. [View source](/point-of-sale/autonomous-stores.md) Autonomous stores are stores without staff or checkout. A shopper presents their card to the payment terminal before entering the store, to pre-authorize a certain amount and gain entry. The shopper then takes some items and leaves the store. The purchase amount is adjusted and charged to the card that the shopper used to enter the store. ## Requirements Before you begin, take into account the following requirements, limitations, and preparations. | Requirement | Description | | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | A [Terminal API integration](/point-of-sale/basic-tapi-integration/) with payment terminals. | | **[API credentials](/development-resources/api-credentials)** | You must have an API credential with an API key and the following [roles, which are assigned by default](/development-resources/api-credentials/roles#roles-for-payments):- **Merchant PAL webservice role** - **Checkout webservice role** If you have a Terminal API integration with [cloud-based communications](/point-of-sale/design-your-integration/choose-your-architecture#cloud-communications), you can use the existing API key that you use for Terminal API requests. | | **[Webhooks](/development-resources/webhooks)** | Listen for [Standard webhook messages](/development-resources/webhooks/webhook-types#default-event-codes) with the following `eventCode` values:- **AUTHORISATION\_ADJUSTMENT** - **CAPTURE** - **CAPTURE\_FAILED** | | **Hardware** | Use a payment terminal model that is suitable for unattended use, like the **P400 Plus**, **S1U2**, or **UX300**. | | **Limitations** | Be aware of the following:- [Support for authorization adjustment](/point-of-sale/pre-authorisation/#availability) is limited to specific payment methods and Merchant Category Codes (MCC). It is ultimately up to the issuing bank whether they allow it. - Pre-authorizations and authorizations [eventually expire](/point-of-sale/pre-authorisation/#validity). The length of an authorization's validity depends on the card scheme. | | **Setup steps** | Before you begin:- Contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to configure your payment methods. If you plan to use synchronous authorization adjustment, also ask them to enable this for you. - If you plan to use tokenization, [enable receiving shopper identifiers](/point-of-sale/card-acquisition/identifiers#receiving-identifiers-in-responses) and check with our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) if your account is correctly configured for your tokenization use case. - [Enable manual capture](/point-of-sale/capturing-payments#enable-manual-capture), either for your account or for individual transactions. | ## How it works: 1. You make a card acquisition request on the terminal to [get the card details](#get-card-details). 2. The shopper presents their card to the payment terminal. 3. You use identifiers from the card acquisition response to check if you recognize the shopper. If it is a first-time shopper, you collect their details like phone number or email. You can use card identifiers to tokenize the card for future recurring payments. 4. You send a payment request to [pre-authorize an amount](#pre-auth-amount).\ We recommend that you also tokenize the card for future recurring payments. This enables you to recover the full payment in case an authorization adjustment fails. 5. The shopper enters the store, takes items, and leaves the store. 6. If the purchase amount is different from the pre-authorized amount, you send an [authorization adjustment request](#auth-adjustment), followed by a [capture request](#capture-purchase-amount). 7. If the authorization adjustment fails for any reason, you can capture the pre-authorized amount. After that: * If you tokenized the card, you can make a recurring online payment for the remaining amount. * If you collected the shopper's email or phone number, you can send them a payment link for the remaining amount. If you cannot charge the shopper for their purchase, you can put the card alias on the not-allowed list in your system to prevent the card from being used to enter the store again. Note that in the autonomous store flow, you need to rely on webhooks to know if the capture succeeded. If you use asynchronous authorization adjustment, you also need to rely on webhooks for the authorization adjustment result. Also note that you need to implement logic on your end, for example how to trigger card acquisition requests on the terminal, open the doors, or calculate the amount when you make an authorization adjustment. ## 1. Get the card details In your back-end, implement a trigger for the card acquisition request on the terminal to prompt the shopper to present a card. From the response, you can take certain details such as the card alias to determine if the shopper should be let in. 1. Create a `SaleToPOIData` JSON object with: * `Operation.Type`: **Payment** * `Operation.Variant`: **PreAuthToEnterShop**. Hides the pre-authorization amount specified in `CardAcquisitionTransaction.TotalAmount` from showing on the initial screen. This is to prevent shoppers from thinking they need to pay to enter the store. **Operation JSON object** ```json { "Operation":[ { "Type":"Payment", "Variant":"PreAuthToEnterShop" } ] } ``` 2. Encode the `Operation` JSON object to Base64. You will pass the resulting string in `SaleData.SaleToPOIData`. **Converted to a Base64-encoded string** ```raw ewogICAiT3BlcmF0aW9uIjpbCiAgICAgIHsKICAgICAgICAgIlR5cGUiOiJQYXltZW50IiwKICAgICAgICAgIlZhcmlhbnQiOiJQcmVBdXRoVG9FbnRlclNob3AiCiAgICAgIH0KICAgXQp9 ``` 3. Create a `SaleToAcquirerData` JSON object with: * `authorisationType`: **PreAuth**. Pre-authorizes the amount specified in `CardAcquisitionTransaction.TotalAmount`. * `recurringProcessingModel`: **UnscheduledCardOnFile**. Enforces cardholder authentication during pre-authorisation (if configured by our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other)). To tokenize the card, include this field in both the card acquisition and the follow-up pre-authorization payment request. If the [PSD2 SCA compliance rules](/online-payments/psd2-sca-compliance-and-implementation-guide#are-my-payments-affected) apply to your business, we recommend enforcing cardholder authentication. To enable this, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other). **JSON object** ```json { "authorisationType":"PreAuth", "recurringProcessingModel":"UnscheduledCardOnFile" } ``` 4. Encode the JSON object to Base64. You will pass the resulting string in `SaleData.SaleToAcquirerData`. **Converted to a Base64-encoded string** ```raw ewogICAgImF1dGhvcmlzYXRpb25UeXBlIjoiUHJlQXV0aCIsCiAgICAicmVjdXJyaW5nUHJvY2Vzc2luZ01vZGVsIjoiVW5zY2hlZHVsZWRDYXJkT25GaWxlIgp9 ``` 5. [Make a card acquisition request](/point-of-sale/card-acquisition#card-acquisition-request), including: * The [CardAcquisitionRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-SaleData) object with: | Parameter | Required | Description | | -------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SaleTransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object with:- `TransactionID`: your reference to identify the transaction. We recommend using a unique value. - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). | | `TokenRequestedType` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Customer**. Returns the card alias in the `TokenValue` field of the response. Note that the card alias is always returned in the `AdditionalResponse`. | | `SaleToPOIData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The Base64-encoded `Operation` JSON value from step 2. | | `SaleToAcquirerData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The Base64-encoded JSON value from step 4. | * The [CardAcquisitionRequest.CardAcquisitionTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#request-CardAcquisitionTransaction) object with: | Parameter | Required | Description | | ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `TotalAmount` | | The transaction amount you want to pre-authorize before entering the store. This amount needs to be equal to the `TotalAmount` in the pre-authorization request. | The following example shows a card acquisition request to get the card details. **Card acquisition request** ```json { "SaleToPOIRequest":{ "MessageHeader":{ "ProtocolVersion":"3.0", "MessageClass":"Service", "MessageCategory":"CardAcquisition", "MessageType":"Request", "ServiceID":"1020711110", "SaleID":"POSSystemID12345", "POIID":"V400m-346403161" }, "CardAcquisitionRequest":{ "SaleData":{ "SaleTransactionID":{ "TransactionID":"02072", "TimeStamp":"2020-01-07T14:14:04+00:00" }, "TokenRequestedType": "Customer", "SaleToPOIData":"ewogICAiT3BlcmF0aW9uIjpbCiAgICAgIHsKICAgICAgICAgIlR5cGUiOiJQYXltZW50IiwKICAgICAgICAgIlZhcmlhbnQiOiJQcmVBdXRoVG9FbnRlclNob3AiCiAgICAgIH0KICAgXQp9", "SaleToAcquirerData": "ewogICAgImF1dGhvcmlzYXRpb25UeXBlIjoiUHJlQXV0aCIsCiAgICAicmVjdXJyaW5nUHJvY2Vzc2luZ01vZGVsIjoiVW5zY2hlZHVsZWRDYXJkT25GaWxlIgp9" }, "CardAcquisitionTransaction":{ "TotalAmount": 10 } } } } ``` The following example shows a card acquisition response with an amount of EUR 10. **Card acquisition response** ```json { "SaleToPOIResponse": { "CardAcquisitionResponse": { "POIData": { "POIReconciliationID": "1000", "POITransactionID": { "TimeStamp": "2022-12-08T09:03:13.012Z", "TransactionID": "i495001670490193006" } }, "PaymentInstrumentData": { "CardData": { "CardCountryCode": "056", "MaskedPan": "541333 **** 9999", "PaymentBrand": "mc", "PaymentToken": { "TokenRequestedType": "Customer", "TokenValue": "F415978638738822" }, "SensitiveCardData": { "ExpiryDate": "0228" } }, "PaymentInstrumentType": "Card" }, "Response": { "AdditionalResponse": "tid=10502371&transactionType=GOODS_SERVICES&backendGiftcardIndicator=false&posadditionalamounts.originalAmountValue=1000&expiryYear=2028&alias=F415978638738822&giftcardIndicator=false&posAmountGratuityValue=0&paymentMethodVariant=mc&applicationPreferredName=mc%20en%20gbr%20gbp&store=BookStore&aliasType=Default&cardType=mc&iso8601TxDate=2022-12-08T09%3a03%3a13.012Z&posOriginalAmountValue=1000&txtime=10%3a03%3a13&paymentMethod=mc&txdate=08-12-2022&applicationLabel=mc%20en%20gbr%20gbp&cardSummary=9999&expiryMonth=02&merchantReference=203&posadditionalamounts.originalAmountCurrency=EUR&posAuthAmountCurrency=EUR&PaymentAccountReference=fFTJzjcI35iLWvHWIYrjuUmgFMqi9&message=CARD_ACQ_COMPLETED&cardIssuerCountryId=056&posAmountCashbackValue=0&posEntryMode=CLESS_CHIP&cardBin=541333&cardScheme=mc&issuerCountry=BE&posAuthAmountValue=1000", "Result": "Success" }, "SaleData": { "SaleTransactionID": { "TimeStamp": "2022-11-17T12:30:21.725Z", "TransactionID": "203" } } }, "MessageHeader": {...} } } ``` 6. From the [CardAcquisitionResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/cardacquisition#responses-200-Response), save the following details : * `POIData.POITransactionID`: since you are continuing with a payment, keep the `TimeStamp` and the `TransactionID` because you need these card acquisition details in your payment request. * `Response.AdditionalResponse.alias`: this is a value that uniquely represents the shopper's card number (PAN), for example **A37317672402294**. With this, you can recognize the card that a shopper is using and identify if they are returning customers. You cannot use the card alias for making payments. The format of the `AdditionalResponse` can be a Base64-encoded or URL-encoded. To always receive the `AdditionalResponse` in one of those formats, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other). If the shopper is entering the store for the first time, we recommend you [collect their details](#get-shopper-details). Otherwise, you can proceed with a [pre-authorization payment request](#pre-auth-amount). ## 2. Optional: Get the shopper's details If the shopper is entering the store for the first time, you can ask them to enter their contact details, or to provide consent to tokenize their card. 1. Ask the shopper's consent to save their details. For this, you can use [confirmation](/point-of-sale/shopper-engagement/shopper-input/confirmation) or [signature](/point-of-sale/shopper-engagement/shopper-input/signature) input requests. 2. Collect the shopper's contact details. For this you can use [phone number](/point-of-sale/shopper-engagement/shopper-input/phone-number) or [text](/point-of-sale/shopper-engagement/shopper-input/text) input requests. You can then use these details when tokenizing the card or to send the shopper a [payment link](/unified-commerce/pay-by-link). 3. Save the shopper's contact details and the card alias received in the `Response.AdditionalResponse.alias` of the card acquisition response. You can use the card alias to recognize the shopper the next time they present their card to enter the store. This way, the shopper does not have to enter their details again. ## 3. Pre-authorize an amount After you collect the card and shopper details, send a payment request to pre-authorize the amount specified in the card acquisition request. You can also tokenize the card with Adyen. This enables recurring payments with the shopper's card and allows you to recover failed payments in case the shopper has insufficient funds at the time of purchase. If you plan to tokenize the card, make sure that you [enable receiving shopper identifiers](/point-of-sale/card-acquisition/identifiers#receiving-identifiers-in-responses) and check with our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) if your account is correctly configured for your tokenization use case. 1. Prepare the `SaleData.SaleToAcquirerData` value for the pre-authorization payment request that you will make.\ Include the following data elements: * `authorisationType`: **PreAuth**. This indicates this is a pre-authorization request. * To tokenize the card, also include: * `shopperReference`: Your unique reference for this shopper. Minimum length: three characters. Note that the value is case-sensitive. Do not include personally identifiable information (PII), such as name or email address. * `recurringProcessingModel`: **UnscheduledCardOnFile**. Creates a recurring contract for transactions that occur on a non-fixed schedule and/or have variable amounts. Enforces cardholder authentication (if configured by our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other)). * `shopperEmail`: Optional. The shopper's email address, if you collected that. Format the `SaleData.SaleToAcquirerData` value in one of the following ways (refer to [Add information to a payment](/point-of-sale/add-data)): * Option 1: A JSON object converted to a Base64-encoded string. For example: **JSON object** ```json { "authorisationType": "PreAuth", "recurringProcessingModel": "UnscheduledCardOnFile", "shopperReference": "YOUR_UNIQUE_SHOPPER_ID", "shopperEmail": "S.Hopper@example.com" } ``` Encode the Operation JSON object to Base64. **Converted to a Base64-encoded string** ```raw ewogICAgImF1dGhvcmlzYXRpb25UeXBlIjogIlByZUF1dGgiLAogICAgInJlY3VycmluZ1Byb2Nlc3NpbmdNb2RlbCI6ICJVbnNjaGVkdWxlZENhcmRPbkZpbGUiLAogICAgInNob3BwZXJSZWZlcmVuY2UiOiAiWU9VUl9VTklRVUVfU0hPUFBFUl9JRCIsCiAgICAic2hvcHBlckVtYWlsIjogIlMuSG9wcGVyQGV4YW1wbGUuY29tIgp9 ``` * Option 2: Form-encoded key-value pairs (using **&** as a separator). For example: **Form-encoded key-value pairs** ```raw recurringProcessingModel=UnscheduledCardOnFile&shopperReference=12345&shopperEmail=S.Hopper@example.com ``` 2. Make a [pre-authorization payment request](/point-of-sale/pre-authorisation#pre-authorize), including: * The [PaymentRequest](https://docs.adyen.com/api-explorer/terminal-api/latest/post/payment) object with: | 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. - `TimeStamp`: date and time of the request in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). | | `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 pre-authorized transaction amount. This amount must be equal to the `TotalAmount` in the card acquisition request. | | `PaymentData.CardAcquisitionReference` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | An object referring to the card acquisition:- `TimeStamp`: The time stamp returned in the `POIData.POITransactionID` of the card acquisition response. - `TransactionID`: the transaction ID returned in the `POIData.POITransactionID` of the card acquisition response. | | `SaleData.SaleToAcquirerData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The Base64-encoded string or form-encoded key-value pairs you prepared. | The following example shows how to pre-authorize a payment of **EUR 10**: **Pre-authorization request with form-encoded key-value pairs** ```json { "SaleToPOIRequest":{ "MessageHeader":{ "ProtocolVersion":"3.0", "MessageClass":"Service", "MessageCategory":"Payment", "MessageType":"Request", "SaleID":"POSSystemID12345", "ServiceID":"0207111104", "POIID":"V400m-346403161" }, "PaymentRequest":{ "SaleData":{ "SaleTransactionID":{ "TransactionID":"27908", "TimeStamp":"2019-03-07T10:11:04+00:00" }, "SaleToAcquirerData":"authorisationType=PreAuth&recurringProcessingModel=UnscheduledCardOnFile&shopperReference=YOUR_UNIQUE_SHOPPER_ID&shopperEmail=S.Hopper@example.com" }, "PaymentTransaction":{ "AmountsReq":{ "Currency":"EUR", "RequestedAmount":10.00 } }, "PaymentData":{ "CardAcquisitionReference":{ "TimeStamp":"2022-12-15T14:53:52.977Z", "TransactionID":"CglQ001671116032011" } } } } } ``` The customer presents their card to the payment terminal. If the pre-authorization is successful, the terminals show the transaction is approved. 3. From the response, save the following details: | To do this | Use these parameters | | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Authorization adjustment and capture | * `POIData.POITransactionID.TransactionID`: [transaction identifier](/point-of-sale/design-your-integration/terminal-api#transaction-identifier) for the payment, in the format **Tender\_reference.PSP\_reference**. * `Response.AdditionalResponse.pspReference`: the PSP reference of your pre-authorization request. | | Calculating the amount for the authorization adjustment | - `PaymentResult.AmountsResp`: the `AuthorizedAmount` and `Currency` of the pre-authorized payment. - `Response.AdditionalResponse.authorisedAmountValue`: the pre-authorized amount in [minor units](/development-resources/currency-codes). | | Synchronous authorization adjustment | * `Response.AdditionalResponse.adjustAuthorisationData`: a blob with authorization data, if the synchronous flow is enabled for your account. | For easier shopper recognition and recovering failed payments, from the `Response.AdditionalResponse` save the following details: | Parameter | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | `alias` | The card alias. Also returned in `PaymentResult.PaymentInstrumentData.PaymentToken.TokenValue` if the request contains `TokenRequestedType`: **Customer**. | | `PaymentAccountReference` | A value that represents the payment account that the card and/or NFC wallet is linked to. | | `recurring.recurringDetailReference` or `tokenization.storedPaymentMethodId` | The token representing the shopper's payment method. | | `recurring.shopperReference` or `tokenization.shopperReference` | Your unique reference for this shopper. | | `shopperEmail` | The shopper's email address . | The following example shows the response to a EUR 10.00 pre-authorization request. **Pre-authorization response** ```json { "SaleToPOIResponse": { "PaymentResponse": { "POIData": "POITransactionID": { "TimeStamp": "2019-12-04T13:56:26.000Z", "TransactionID": "8ha5001575467786000.KHQC5N7G84BLNK43" } {...}, "SaleData": {...}, "PaymentReceipt": [...], "PaymentResult": { "AuthenticationMethod": [...], "OnlineFlag": true, "PaymentInstrumentData": { "CardData": { "EntryMode": [ "Contactless" ], "{hint:This is the card alias, not the token for future payments}PaymentToken{/hint}": { "TokenRequestedType": "Customer", "TokenValue": "M469509594859802" }, "PaymentBrand": "mc", "MaskedPan": "541333 **** 9999", "SensitiveCardData": { "CardSeqNumb": "83", "ExpiryDate": "0228" } }, "PaymentInstrumentData": {...}, "AmountsResp": { "AuthorizedAmount": 10.00, "Currency": "EUR" } }, "Response": { "Result": "Success", "AdditionalResponse": "...adjustAuthorisationData=BQABAQA+fbc==...&alias=M469509594859802...recurring.recurringDetailReference=7219687191761347&recurring.shopperReference=YOUR_UNIQUE_SHOPPER_ID...&shopperEmail=S.Hopper%40gmail.com...tokenization.shopperReference=12345&tokenization.store.operationType=alreadyExisting&tokenization.storedPaymentMethodId=7219687191761347..." } }, "MessageHeader": {...} } } ``` Note that the `PaymentToken` object contains the card alias. You cannot use this for making payments. It is intended only for recognizing the card. After a successful pre-authorization, you need to have logic implemented to open the door of the autonomous store. The shopper then enters the store, takes items, and leaves. ## 4. Adjust the pre-authorized amount If the purchase amount for items that shopper has taken differs from the pre-authorized amount, you need to send an authorization adjustment request. This is not a Terminal API request to the terminal itself or the Cloud endpoint for the terminal.\ Depending on your infrastructure and implementation, you may want to use the asynchronous or synchronous authorization adjustment. When building or testing the flow, make sure there is at least a 5 second delay between the pre-authorization and the authorization adjustment. ### Tab: Asynchronous authorization adjustment 1. Make a POST [/payments/{paymentPspReference}/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request, where `paymentPspReference` is the `pspReference` from the pre-authorization response. Specify: | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `amount` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The `currency` and `value` of the new amount **in minor units**. This is the sum of the pre-authorized amount and the additional amount. If this is not the first authorization adjustment, it is the sum of the pre-authorized amount plus all additional amounts. | | `merchantAccount` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The name of your merchant account that is used to process the payment. | | `industryUsage` | | **DelayedCharge** | | `reference` | | Your reference to this payment modification, for use in your reconciliation process. | The following example shows how to add a charge of EUR 4.15 to a pre-authorized amount of EUR 10.00. **Asynchronous authorization adjustment request** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments/KHQC5N7G84BLNK43/amountUpdates \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "amount": { "currency":"EUR", "value":1415 }, "industryUsage":"DelayedCharge", "reference":"YOUR_UNIQUE_REFERENCE" }' ``` #### Java ```java // Adyen Java API Library v25.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.*; Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Request objects Amount amount = new Amount() .currency("EUR") .value(1415L); PaymentAmountUpdateRequest paymentAmountUpdateRequest = new PaymentAmountUpdateRequest() .reference("YOUR_UNIQUE_REFERENCE") .industryUsage("DelayedCharge") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT"); // Make the request ModificationsApi service = new ModificationsApi(client); PaymentAmountUpdateResponse response = service.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v17.4.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\PaymentAmountUpdateRequest; use Adyen\Service\Checkout\ModificationsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); $client->setEnvironment(Environment::TEST); // Request objects $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1415); $paymentAmountUpdateRequest = new PaymentAmountUpdateRequest(); $paymentAmountUpdateRequest ->setReference("YOUR_UNIQUE_REFERENCE") ->setIndustryUsage("DelayedCharge") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT"); $requestOptions['idempotencyKey'] = 'UUID'; // Make the request $service = new ModificationsApi($client); $response = $service->updateAuthorisedAmount('paymentPspReference', $paymentAmountUpdateRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v14.3.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Fill in your request objects Amount amount = new Amount { Currency = "EUR", Value = 1415 }; PaymentAmountUpdateRequest paymentAmountUpdateRequest = new PaymentAmountUpdateRequest { Reference = "YOUR_UNIQUE_REFERENCE", IndustryUsage: "DelayedCharge", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT" }; // Make the request var service = new ModificationsService(client); var response = service.UpdateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"}); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v16.2.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object const paymentAmountUpdateRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", amount: { currency: "EUR", value: 1415 }, industryUsage: "DelayedCharge", reference: "YOUR_UNIQUE_REFERENCE" } // Make the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v9.2.0 import ( "context" "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" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Fill in your request objects amount := checkout.Amount{ Currency: "EUR", Value: 1415, } paymentAmountUpdateRequest := checkout.PaymentAmountUpdateRequest{ Reference: common.PtrString("YOUR_UNIQUE_REFERENCE"), IndustryUsage: "DelayedCharge", Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", } // Make the request service := client.Checkout() req := service.ModificationsApi.UpdateAuthorisedAmountInput("paymentPspReference").IdempotencyKey("UUID").PaymentAmountUpdateRequest(paymentAmountUpdateRequest) res, httpRes, err := service.ModificationsApi.UpdateAuthorisedAmount(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v12.2.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" adyen.client.platform = "test" # The environment to use library in. json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "EUR", "value": 1415 }, "industryUsage": "DelayedCharge", "reference": "YOUR_UNIQUE_REFERENCE" } result = adyen.checkout.modifications_api.update_authorised_amount(request=json_request, paymentPspReference="paymentPspReference", idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.2.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' adyen.env = :test # Set to "live" for live environment request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :amount => { :currency => 'EUR', :value => 1415 }, :industryUsage => 'DelayedCharge', :reference => 'YOUR_UNIQUE_REFERENCE' } result = adyen.checkout.modifications_api.update_authorised_amount(request_body, 'paymentPspReference', headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v16.2.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request objects const amount: Types.checkout.Amount = { currency: "EUR", value: 1415 }; const paymentAmountUpdateRequest: Types.checkout.PaymentAmountUpdateRequest = { reference: "YOUR_UNIQUE_REFERENCE", industryUsage: "DelayedCharge", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT" }; // Make the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, { idempotencyKey: "UUID" }); ``` 2. In the `/payments/{paymentPspReference}/amountUpdates` response, note the following parameters: * `pspReference`: The PSP reference associated with this `/payments/{paymentPspReference}/amountUpdates` request. Note that this is different from the PSP reference associated with the pre-authorization request. * `status`: **received** **Asynchronous authorization adjustment response** ```json { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "paymentPspReference": "KHQC5N7G84BLNK43", "pspReference": "NC6HT9CRT65ZGN82", "reference": "YOUR_UNIQUE_REFERENCE", "status": "received", "amount": { "currency": "EUR", "value": 1415 } } ``` 3. Wait for a webhook message with the `eventCode` **AUTHORISATION\_ADJUSTMENT**. This informs you whether the new amount has been authorized. ### Tab: Synchronous authorization adjustment []() 1. If this is the first adjustment after the pre-authorization: * If you received the `AdditionalResponse` in the initial Terminal API payment response as key-value pairs separated by ampersands (**&**), URL-decode the value of the `adjustAuthorisationData` key. To find a tool or instructions for URL-decoding, search the internet for *\ decode x-www-form-urlencoded*. * If you received the `AdditionalResponse` in the initial Terminal API payment response as a Base64-encoded string, Base64-decode the string and copy the value of the `adjustAuthorisationData` field. For adjustments after the first adjustment, skip the above step. 2. Make a POST [/adjustAuthorisation](https://docs.adyen.com/api-explorer/Payment/latest/post/adjustAuthorisation) request, specifying: | Parameter | Required | Description | | ---------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `originalReference` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The `pspReference` of the pre-authorization request. You received this in the response to your pre-authorization request. | | `modificationAmount` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The `currency` and `value` of the new amount **in minor units**. This is the sum of the pre-authorized amount and the additional amount. If this is not the first authorization adjustment, it is the sum of the pre-authorized amount plus all additional amounts. | | `additionalData.adjustAuthorisationData` | | The previous `adjustAuthorisationData` blob. For the **first adjustment**, that is the blob you received in the response to the pre-authorization request. You need to decode that first. For the second adjustment, it is the blob you received in the response to the first adjustment, and so on. Always use the latest blob. | | `reference` | | Your reference to this payment modification, for use in your reconciliation process. | | `merchantAccount` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The name of your merchant account that is used to process the payment. | The following examples shows how to add a charge of EUR 4.15 to a pre-authorized amount of EUR 10.00. **Synchronous authorization adjustment request** #### curl ```bash curl https://pal-test.adyen.com/pal/servlet/Payment/v68/adjustAuthorisation \ -H 'x-API-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "originalReference":"KHQC5N7G84BLNK43", "modificationAmount": { "currency":"EUR", "value":1415 }, "reference":"YOUR_MODIFICATION_REFERENCE", "additionalData":{ "adjustAuthorisationData":"BQABAQA+fbc==..." } }' ``` #### Java ```java // Adyen Java API Library v25.0.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.payment.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.service.*; Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Request objects Amount amount = new Amount() .currency("EUR") .value(1415L); AdjustAuthorisationRequest adjustAuthorisationRequest = new AdjustAuthorisationRequest() .originalReference("KHQC5N7G84BLNK43") .reference("YOUR_MODIFICATION_REFERENCE") .merchantAccount("ADYEN_MERCHANT_ACCOUNT") .modificationAmount(amount) .additionalData(new HashMap(Map.of( "adjustAuthorisationData", "BQABAQA+fbc==..." ))); // Make the request paymentApi service = new paymentApi(client); ModificationResult response = service.adjustAuthorisation(adjustAuthorisationRequest, null); ``` #### PHP ```php // Adyen PHP API Library v17.4.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Payments\Amount; use Adyen\Model\Payments\AdjustAuthorisationRequest; use Adyen\Service\Payments\ModificationsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); $client->setEnvironment(Environment::TEST); // Request objects $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1415); $adjustAuthorisationRequest = new AdjustAuthorisationRequest(); $adjustAuthorisationRequest ->setOriginalReference("KHQC5N7G84BLNK43") ->setReference("YOUR_MODIFICATION_REFERENCE") ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT") ->setModificationAmount($amount) ->setAdditionalData( array( "adjustAuthorisationData" => "BQABAQA+fbc==..." ) ); // Make the request $service = new ModificationsApi($client); $response = $service->adjustAuthorisation($adjustAuthorisationRequest); ``` #### C\# ```cs // Adyen .net API Library v14.3.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Payment; using Adyen.Service; var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Fill in your request objects Amount amount = new Amount { Currency = "EUR", Value = 1415 }; AdjustAuthorisationRequest adjustAuthorisationRequest = new AdjustAuthorisationRequest { OriginalReference = "KHQC5N7G84BLNK43", Reference = "YOUR_MODIFICATION_REFERENCE", MerchantAccount = "ADYEN_MERCHANT_ACCOUNT", ModificationAmount = amount, AdditionalData = new Dictionary { { "adjustAuthorisationData", "BQABAQA+fbc==..." } } }; // Make the request var service = new PaymentService(client); var response = service.AdjustAuthorisation(adjustAuthorisationRequest); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v16.2.0 // Require the parts of the module you want to use const { Client, PaymentAPI } = require('@adyen/api-library'); // Initialize the client object const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object const adjustAuthorisationRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", originalReference: "KHQC5N7G84BLNK43", modificationAmount: { currency: "EUR", value: 1415 }, reference: "YOUR_MODIFICATION_REFERENCE", additionalData: { adjustAuthorisationData: "BQABAQA+fbc==..." } } // Make the request const paymentAPI = new PaymentAPI(client); const response = paymentAPI.adjustAuthorisation(adjustAuthorisationRequest); ``` #### Go ```go // Adyen Go API Library v9.2.0 import ( "context" "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/payments" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Fill in your request objects amount := payments.Amount{ Currency: "EUR", Value: 1415, } adjustAuthorisationRequest := payments.AdjustAuthorisationRequest{ OriginalReference: "KHQC5N7G84BLNK43", Reference: common.PtrString("YOUR_MODIFICATION_REFERENCE"), MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", ModificationAmount: amount, AdditionalData: &map[string]string{ "adjustAuthorisationData": "BQABAQA+fbc==...", }, } // Make the request service := client.Payments() req := service.ModificationsApi.AdjustAuthorisationInput().AdjustAuthorisationRequest(adjustAuthorisationRequest) res, httpRes, err := service.ModificationsApi.AdjustAuthorisation(context.Background(), req) ``` #### Python ```py # Adyen Python API Library v12.2.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" adyen.client.platform = "test" # The environment to use library in. json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "originalReference": "KHQC5N7G84BLNK43", "modificationAmount": { "currency": "EUR", "value": 1415 }, "reference": "YOUR_MODIFICATION_REFERENCE", "additionalData": { "adjustAuthorisationData": "BQABAQA+fbc==..." } } result = adyen.payment.modifications_api.adjust_authorisation(request=json_request) ``` #### Ruby ```rb # Adyen Ruby API Library v9.2.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' adyen.env = :test # Set to "live" for live environment request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :originalReference => 'KHQC5N7G84BLNK43', :modificationAmount => { :currency => 'EUR', :value => 1415 }, :reference => 'YOUR_MODIFICATION_REFERENCE', :additionalData => { :adjustAuthorisationData => 'BQABAQA+fbc==...' } } result = adyen.payment.modifications_api.adjust_authorisation(request_body) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v16.2.0 // Require the parts of the module you want to use import { Client, PaymentAPI, Types } from "@adyen/api-library"; // Initialize the client object const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request objects const amount: Types.payment.Amount = { currency: "EUR", value: 1415 }; const adjustAuthorisationRequest: Types.payment.AdjustAuthorisationRequest = { originalReference: "KHQC5N7G84BLNK43", reference: "YOUR_MODIFICATION_REFERENCE", merchantAccount: "ADYEN_MERCHANT_ACCOUNT", modificationAmount: amount, additionalData: { "adjustAuthorisationData": "BQABAQA+fbc==..." } }; // Make the request const paymentAPI = new PaymentAPI(client); const response = paymentAPI.adjustAuthorisation(adjustAuthorisationRequest); ``` 3. In the `/adjustAuthorisation` response, note the following parameters: * `additionalData.adjustAuthorisationData`: The new blob, for the new authorized amount. This blob is not URL-encoded. * `merchantReference`: Your reference to this payment modification, for use in your reconciliation process. We recommend using the reference from the response in the previous step. * `pspReference`: The PSP reference associated with this `/adjustAuthorisation` request. Note that this is different from the PSP reference associated with the pre-authorisation request. * `response`: **Authorised**. Indicates the new amount is authorized. **Synchronous authorization adjustment response** ```json { "additionalData": { "adjustAuthorisationData": "BQABAQArqht7L...", "merchantReference": "YOUR_MODIFICATION_REFERENCE" }, "pspReference": "NC6HT9CRT65ZGN82", "response": "Authorised" } ``` 4. Store the `adjustAuthorisationData` blob you received in the `/adjustAuthorisation` response. You will need this if you later adjust the authorization again. This blob is not URL-encoded, so you can use it as-is. ## 5. Capture the amount After you make the authorization adjustment, [capture the payment manually](/point-of-sale/capturing-payments#capture-a-payment) to ensure the reserved funds are transferred to your account. Make sure that you have [enabled manual capture](/point-of-sale/capturing-payments#enable-manual-capture), either for your account or for an individual transaction. 1. Make 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 being captured. You received this as part of the `transactionID` field in the response to your payment request. See [Transaction identifier](/point-of-sale/design-your-integration/terminal-api#transaction-identifier). In your request, include: | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | `amount` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The `currency` and `value` of the final amount **in minor units**. This is the sum of the original, pre-authorized amount and all later adjustments. | | `merchantAccount` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The name of your merchant account that is used to process the payment. | | `reference` | | Your reference to this payment modification, for use in your reconciliation process. | **Capture request** #### curl ```bash curl https://checkout-test.adyen.com/v68/payments/KHQC5N7G84BLNK43/captures \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -X POST \ -d '{ "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "amount":{ "currency":"EUR", "value":1415 }, "reference":"YOUR_UNIQUE_REFERENCE" }' ``` #### Java ```java // Adyen Java API Library v25.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.*; Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Request objects Amount amount = new Amount() .currency("EUR") .value(1415L); PaymentCaptureRequest paymentCaptureRequest = new PaymentCaptureRequest() .reference("YOUR_UNIQUE_REFERENCE") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT"); // Make the request ModificationsApi service = new ModificationsApi(client); PaymentCaptureResponse response = service.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v17.4.0 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\PaymentCaptureRequest; use Adyen\Service\Checkout\ModificationsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); $client->setEnvironment(Environment::TEST); // Request objects $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(1415); $paymentCaptureRequest = new PaymentCaptureRequest(); $paymentCaptureRequest ->setReference("YOUR_UNIQUE_REFERENCE") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT"); $requestOptions['idempotencyKey'] = 'UUID'; // Make the request $service = new ModificationsApi($client); $response = $service->captureAuthorisedPayment('paymentPspReference', $paymentCaptureRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v14.3.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Fill in your request objects Amount amount = new Amount { Currency = "EUR", Value = 1415 }; PaymentCaptureRequest paymentCaptureRequest = new PaymentCaptureRequest { Reference = "YOUR_UNIQUE_REFERENCE", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT" }; // Make 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 v16.2.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object const paymentCaptureRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", amount: { currency: "EUR", value: 1415 }, reference: "YOUR_UNIQUE_REFERENCE" } // Make the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v9.2.0 import ( "context" "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" ) client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Fill in your request objects amount := checkout.Amount{ Currency: "EUR", Value: 1415, } paymentCaptureRequest := checkout.PaymentCaptureRequest{ Reference: common.PtrString("YOUR_UNIQUE_REFERENCE"), Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", } // Make 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 v12.2.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" adyen.client.platform = "test" # The environment to use library in. json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "EUR", "value": 1415 }, "reference": "YOUR_UNIQUE_REFERENCE" } result = adyen.checkout.modifications_api.capture_authorised_payment(request=json_request, paymentPspReference="paymentPspReference", idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.2.0 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' adyen.env = :test # Set to "live" for live environment request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :amount => { :currency => 'EUR', :value => 1415 }, :reference => 'YOUR_UNIQUE_REFERENCE' } result = adyen.checkout.modifications_api.capture_authorised_payment(request_body, 'paymentPspReference', headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v16.2.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request objects const amount: Types.checkout.Amount = { currency: "EUR", value: 1415 }; const paymentCaptureRequest: Types.checkout.PaymentCaptureRequest = { reference: "YOUR_UNIQUE_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT" }; // Make the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, { idempotencyKey: "UUID" }); ``` 2. In the capture response, note the following parameters: * `pspReference`: The PSP reference associated with this capture request. Note that this is different from the PSP reference associated with the pre-authorization request. * `status`: **received**. * `reference`: Your reference to this payment modification, for use in your reconciliation process. **Capture response** ```json { "reference": "YOUR_MODIFICATION_REFERENCE", "pspReference": "QJ7GWQ756L2GWR86", "status": "received" } ``` 3. Wait for a webhook message with the `eventCode` [CAPTURE](https://docs.adyen.com/api-explorer/Webhooks/latest/post/CAPTURE). This informs you whether the final amount has been captured.\ If `success` is **false** then your capture request failed. Review the `reason` you received in the webhook message, fix the issue, and submit the capture request again. ## Recover failed payments If the authorization adjustment fails for any reason, for example because of a technical issue or insufficient funds on the cardholder’s bank account, there are several things you can do: * Send the capture request to collect the pre-authorized amount. * [Make a recurring online payment](/point-of-sale/recurring-payments#recurring-online) for the remaining amount using the token you created in the pre-authorization payment request. * Send a [payment link](/unified-commerce/pay-by-link/create-payment-links) for the remaining amount to the shopper's email or phone number that you collected before the shopper entered the store. You can also enable our [Auto Rescue](/online-payments/auto-rescue/cards) feature that automatically retries shopper-not-present card transactions when they are refused. If all rescue attempts fail, you can put the card alias on the not-allowed list in your system to prevent the card from being used to enter the store again. ## See also * [Card acquisition](/point-of-sale/card-acquisition) * [Pre-authorization and authorization adjustment](/point-of-sale/pre-authorisation) * [Recurring payments](/point-of-sale/recurring-payments) * [Manual capture](/point-of-sale/capturing-payments#manual-capture) * [Shopper loyalty](/point-of-sale/loyalty) * [Webhooks](/development-resources/webhooks)