--- title: "Adjust an authorization" description: "Pre-authorize a payment, adjust the authorized amount, and capture the payment." url: "https://docs.adyen.com/online-payments/adjust-authorisation/adjust-with-preauth" source_url: "https://docs.adyen.com/online-payments/adjust-authorisation/adjust-with-preauth.md" canonical: "https://docs.adyen.com/online-payments/adjust-authorisation/adjust-with-preauth" last_modified: "2026-05-24T12:54:30+02:00" language: "en" --- # Adjust an authorization Pre-authorize a payment, adjust the authorized amount, and capture the payment. [View source](/online-payments/adjust-authorisation/adjust-with-preauth.md) ![](/user/pages/reuse/development-resources/additional-info-resources/postman-logo-vertical-orange-2021.svg?decoding=auto\&fetchpriority=auto)  [Postman collection](https://www.postman.com/adyendev/workspace/adyen-apis/collection/25716737-46ad970e-dc9e-4246-bac2-769c6083e7b5) **Implementation examples**\ ![](/user/pages/reuse/development-resources/additional-info-resources/java-original.svg?decoding=auto\&fetchpriority=auto)  [Java Spring](https://github.com/adyen-examples/adyen-java-spring-online-payments/tree/main/authorisation-adjustment-example)\ ![](/user/pages/reuse/development-resources/additional-info-resources/dot-net-original.svg?decoding=auto\&fetchpriority=auto)  [.NET](https://github.com/adyen-examples/adyen-dotnet-online-payments/tree/main/authorisation-adjustment-example)\ ![](/user/pages/reuse/development-resources/additional-info-resources/nodejs-original.svg?decoding=auto\&fetchpriority=auto)  [Node.js](https://github.com/adyen-examples/adyen-node-online-payments/tree/main/authorisation-adjustment-example) This page explains how to adjust [authorizations](/get-started-with-adyen/adyen-glossary/#authorization?target=_blank) for card payments, and for [Klarna](/payment-methods/klarna) payments. Be aware that: * You will rely on webhook events to know whether the capture succeeds. If you use asynchronous authorization adjustment, you will also rely on webhook events for the authorization adjustment result. * You need to implement logic on your end to decide when to use the pre-authorization flow, and to calculate the amount when you make an authorization adjustment. For information about use cases, asynchronous or synchronous adjustment, and restrictions, see [Authorization adjustment](/online-payments/adjust-authorisation). ## Requirements Before you begin, consider the following requirements, limitations, and preparations: | Requirements | Description | | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Integration type** | An [online payments integration](/online-payments/build-your-integration). | | **[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** | | **Limitations** | Note the following limitations:- [Support for authorization adjustment](/online-payments/adjust-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](/online-payments/adjust-authorisation/#validity). The length of an authorization's validity depends on the card scheme. - You can only adjust authorizations for payments acquired by Adyen. | ## (Optional) Configure your account If you plan to implement synchronous authorization adjustments, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to enable the **Synchronous authorization adjustment** setting. This setting allows you to receive the initial `adjustAuthorisationData` blob with your pre-authorization response, and to subsequently receive the authorization adjustment results synchronously when you make [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) requests. To capture payments in the authorization adjustment flow, [manual capture must be enabled](/online-payments/capture/#enable-manual-capture). You can set this for your account, but then all payments require manual capture. The alternative is to enable manual capture in the individual pre-authorization request. To make [multiple partial captures](/online-payments/capture#partial-capture), ask our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to enable that feature. ## 1. Pre-authorize a payment 1. Make a payment request that specifies: * [additionalData.authorisationType](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-additionalData-AdditionalDataCommon-authorisationType): **PreAuth** * [additionalData.manualCapture](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-additionalData-AdditionalDataCommon-manualCapture): **true**\ Manual capture is optional. You can also enable manual capture for your entire account. **Pre-authorization request** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "reference":"YOUR_ORDER_NUMBER", "merchantAccount":"ADYEN_MERCHANT_ACCOUNT", "paymentMethod": { "type": "scheme", "number":"4111111111111111", "cvc":"737", "expiryMonth":"03", "expiryYear":"2030", "holderName":"John Smith" }, "amount":{ "currency":"EUR", "value":1500 }, "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..", "additionalData":{ "authorisationType":"PreAuth" } }' ``` #### Java ```java Client client = new Client(System.getenv("API_KEY"), Environment.TEST); PaymentsApi checkout = new PaymentsApi(client); PaymentRequest paymentRequest = new PaymentRequest(); paymentRequest.setMerchantAccount(System.getenv("MERCHANT_ACCOUNT")); CardDetails cardDetails = new CardDetails(); cardDetails.encryptedCardNumber("test_4111111111111111") .encryptedSecurityCode("test_737") .encryptedExpiryMonth("test_03") .encryptedExpiryYear("test_2030") .holderName("John Smith"); paymentRequest.setPaymentMethod(new CheckoutPaymentMethod(cardDetails)); Amount amount = new Amount(); amount.setCurrency("EUR"); amount.setValue(1500L); paymentRequest.setAmount(amount); paymentRequest.setReference("YOUR_ORDER_NUMBER"); paymentRequest.setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy.."); Map additionalData = new HashMap<>(); additionalData.put("authorisationType", "PreAuth"); paymentRequest.setAdditionalData(additionalData); PaymentResponse response = checkout.payments(paymentRequest); ``` 2. From the response, save the following for later use when adjusting the authorization or capturing the payment: * `pspReference`: You will need this for authorization adjustment and capture requests. * `adjustAuthorisationData`: If your account is configured for synchronous authorization adjustment, you will receive this blob. Save it for use in your first [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request. **Pre-authorization response** ```json { "pspReference": "KHQC5N7G84BLNK43", "resultCode": "Authorised", "adjustAuthorisationData": "BQABAQA+fbc==..." } ``` ## 2. Adjust the pre-authorized amount To increase or decrease the pre-authorized amount or to [extend the authorization](#extend-authorization), make an authorization adjustment request: ### Tab: Asynchronous authorization adjustment 1. Make a POST [/payments/{paymentPspReference}/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request, including the following: Path parameters: | Parameter | Required | Description | | --------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | | `paymentPspReference` | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The PSP reference from the pre-authorization response. | Body parameters: | Parameter | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [merchantAccount](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates#request-merchantAccount) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The name of your merchant account that is used to process the payment. | | [amount](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates#request-amount) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | 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. | | [industryUsage](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates#request-industryUsage) | | Use the **delayedCharge** value for pre-authorizations. | | [reference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates#request-reference) | | Your reference to this payment modification, for use in your reconciliation process. | The following example shows how to add a charge of EUR 64.15 to a pre-authorized amount of EUR 150.00. **Asynchronous authorization adjustment request** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments/{paymentPspReference}/amountUpdates \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency":"EUR", "value":21415 }, "industryUsage": "delayedCharge", "reference": "YOUR_UNIQUE_REFERENCE" }' ``` #### Java ```java // Adyen Java API Library v26.3.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the live environment, additionally include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(21415L); PaymentAmountUpdateRequest paymentAmountUpdateRequest = new PaymentAmountUpdateRequest() .industryUsage(PaymentAmountUpdateRequest.IndustryUsageEnum.DELAYEDCHARGE) .reference("YOUR_UNIQUE_REFERENCE") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT"); // Send the request ModificationsApi service = new ModificationsApi(client); PaymentAmountUpdateResponse response = service.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v18.2.1 use Adyen\Client; use Adyen\Environment; use Adyen\Model\Checkout\LineItem; use Adyen\Model\Checkout\Amount; use Adyen\Model\Checkout\PaymentAmountUpdateRequest; use Adyen\Service\Checkout\ModificationsApi; $client = new Client(); $client->setXApiKey("ADYEN_API_KEY"); // For the live environment, additionally include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(21415); $paymentAmountUpdateRequest = new PaymentAmountUpdateRequest(); $paymentAmountUpdateRequest ->setIndustryUsage("delayedCharge") ->setReference("YOUR_UNIQUE_REFERENCE") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new ModificationsApi($client); $response = $service->updateAuthorisedAmount('paymentPspReference', $paymentAmountUpdateRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "EUR", Value = 21415 }; PaymentAmountUpdateRequest paymentAmountUpdateRequest = new PaymentAmountUpdateRequest { IndustryUsage = PaymentAmountUpdateRequest.IndustryUsageEnum.DelayedCharge, Reference = "YOUR_UNIQUE_REFERENCE", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT" }; // Send 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 v17.3.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentAmountUpdateRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", amount: { currency: "EUR", value: 21415 }, industryUsage: "delayedCharge", reference: "YOUR_UNIQUE_REFERENCE" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.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" ) // For the live environment, additionally include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 21415, } paymentAmountUpdateRequest := checkout.PaymentAmountUpdateRequest{ IndustryUsage: common.PtrString("delayedCharge"), Reference: common.PtrString("YOUR_UNIQUE_REFERENCE"), Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", } // Send 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.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "EUR", "value": 21415 }, "industryUsage": "delayedCharge", "reference": "YOUR_UNIQUE_REFERENCE" } # Send the request result = adyen.checkout.modifications_api.update_authorised_amount(request=json_request, paymentPspReference="paymentPspReference", idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :amount => { :currency => 'EUR', :value => 21415 }, :industryUsage => 'delayedCharge', :reference => 'YOUR_UNIQUE_REFERENCE' } # Send the request result = adyen.checkout.modifications_api.update_authorised_amount(request_body, 'paymentPspReference', headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v17.3.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 21415 }; const paymentAmountUpdateRequest: Types.checkout.PaymentAmountUpdateRequest = { lineItems: [lineItem1, lineItem2], industryUsage: Types.checkout.PaymentAmountUpdateRequest.IndustryUsageEnum.DelayedCharge, reference: "YOUR_UNIQUE_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, { idempotencyKey: "UUID" }); ``` 2. In the [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) response, note the following parameters: * `pspReference`: the PSP reference for this [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request.\ This is different from the PSP reference of 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": 21415 } } ``` 3. Wait for a webhook message with the `eventCode` [AUTHORISATION\_ADJUSTMENT](https://docs.adyen.com/api-explorer/Webhooks/latest/post/AUTHORISATION_ADJUSTMENT). This informs you whether the new amount has been authorized. ### Tab: Synchronous authorization adjustment []() 1. Make a POST [/payments/{paymentPspReference}/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request, including the following: Path parameters: | Parameter | Required | Description | | --------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | | `paymentPspReference` | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The PSP reference from the pre-authorization response. | Body parameters: | Parameter | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [merchantAccount](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates#request-merchantAccount) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The name of your merchant account that is used to process the payment. | | [amount](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates#request-amount) | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | 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. | | `adjustAuthorisationData` | ![Required](/user/pages/reuse/image-library/01.icons/required/required.svg?decoding=auto\&fetchpriority=auto) | The previous `adjustAuthorisationData` blob. For the first adjustment, this is the blob you received in the response to the pre-authorization request. 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](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates#request-reference) | | Your reference to this payment modification, for use in your reconciliation process. | The following example shows how to add a charge of EUR 64.15 to a pre-authorized amount of EUR 150.00. #### curl ```bash curl -X POST https://checkout-test.adyen.com/v72/payments/{paymentPspReference}/amountUpdates \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'idempotency-key: YOUR_IDEMPOTENCY_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency":"EUR", "value":21415 }, "reference": "YOUR_UNIQUE_REFERENCE", "adjustAuthorisationData": "BQABAQA+fbc==..." }' ``` #### Java ```java // Adyen Java API Library v32.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); // Create the request object(s) // Send the request paymentApi service = new paymentApi(client); ModificationResult response = service.adjustAuthorisation(adjustAuthorisationRequest, null); ``` #### PHP ```php setXApiKey("ADYEN_API_KEY"); $client->setEnvironment(Environment::TEST); // Create the request object(s) // Send the request $service = new ModificationsApi($client); $response = $service->adjustAuthorisation($adjustAuthorisationRequest); ``` #### C\# ```cs // Adyen .net API Library v26.0.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); // Create the request object(s) // Send the request var service = new PaymentService(client); var response = service.AdjustAuthorisation(adjustAuthorisationRequest); ``` #### NodeJS (JavaScript) ```js // Adyen Node API Library v22.1.0 // Require the parts of the module you want to use const { Client, PaymentAPI } = require('@adyen/api-library'); const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" }); // Create the request object(s) const adjustAuthorisationRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", originalReference: "KHQC5N7G84BLNK43", modificationAmount: { currency: "EUR", value: 21415 }, reference: "YOUR_MODIFICATION_REFERENCE", additionalData: { adjustAuthorisationData: "BQABAQA+fbc==..." } } // Send the request const paymentAPI = new PaymentAPI(client); const response = paymentAPI.adjustAuthorisation(adjustAuthorisationRequest); ``` #### Go ```go // Adyen Go API Library v16.1.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, }) // Create the request object(s) // Send 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 v13.2.0 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "originalReference": "KHQC5N7G84BLNK43", "modificationAmount": { "currency": "EUR", "value": 21415 }, "reference": "YOUR_MODIFICATION_REFERENCE", "additionalData": { "adjustAuthorisationData": "BQABAQA+fbc==..." } } # Send the request result = adyen.payment.modifications_api.adjust_authorisation(request=json_request) ``` #### Ruby ```rb # Adyen Ruby API Library v10.1.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 # Create the request object(s) request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :originalReference => 'KHQC5N7G84BLNK43', :modificationAmount => { :currency => 'EUR', :value => 21415 }, :reference => 'YOUR_MODIFICATION_REFERENCE', :additionalData => { :adjustAuthorisationData => 'BQABAQA+fbc==...' } } # Send the request result = adyen.payment.modifications_api.adjust_authorisation(request_body) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v22.1.0 // Require the parts of the module you want to use import { Client, PaymentAPI, Types } from "@adyen/api-library"; const client = new Client({ apiKey: "ADYEN_API_KEY", environment: "TEST" }); // Create the request object(s) // Send the request const paymentAPI = new PaymentAPI(client); const response = paymentAPI.adjustAuthorisation(adjustAuthorisationRequest); ``` 2. In the [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) response, note the following parameters: * `adjustAuthorisationData`: The new blob for the new authorized amount. Store this for subsequent adjustments. * `paymentPspReference`: The PSP reference of the original pre-authorization. * `pspReference`: The PSP reference for this [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request.\ This is different from the PSP reference of the pre-authorization request. * `status`: **Authorised**\ This indicates the new amount is authorized. **Synchronous authorization adjustment response** ```json { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "paymentPspReference": "KHQC5N7G84BLNK43", "pspReference": "NC6HT9CRT65ZGN82", "reference": "YOUR_UNIQUE_REFERENCE", "status": "Authorised", "adjustAuthorisationData": "BQABAQArqht7L...", "amount": { "currency": "EUR", "value": 21415 } } ``` 3. Store the `adjustAuthorisationData` blob you received in the [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) response. You will need this if you adjust the authorization again. ### Limitations * You cannot make a zero-value authorization when you adjust an authorization. * You can make a maximum of 50 adjustments to the pre-authorized amount on a single payment transaction. After that, all subsequent requests to adjust the pre-authorized amount will be declined. You will still be able to capture the transaction up to the last successfully pre-authorized amount. ### Extend the authorization To extend the authorization period, make a [/payments/{paymentPspReference}/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request with the same `amount` as the current balance on the authorization: * If you haven't adjusted the authorization yet, use the `amount` from the original pre-authorization request. * If you did adjust the authorization, use the `amount` from the last adjustment. See [Adjust the pre-authorized amount](#adjust-auth) for instructions. To check the status of the authorization (the original and the extension), make sure to consume webhook events. To extend authorizations, we strongly recommend using the asynchronous flow because Visa and Discover only support asynchronous adjustments for extending the validity period. If an issuer refuses to extend the authorization period, this ends the initially authorized payment. Make sure to consume webhook events to know what to do; for example, withhold shipment, or authorize the card again at a later time. With Mastercard, a request to adjust the pre-authorized amount automatically extends the validity period of the authorization. If you have adjusted the amount of an authorization, you do not immediately have to extend its validity. ## 3. Capture the payment After you make your last authorization adjustment, you must manually capture the payment to transfer the reserved funds to your account. Always double-check that you have completed all authorization adjustments for the payment before you capture it. Captures are done asynchronously, so it may seem that the payment hasn't been completely captured yet and that it is still possible to adjust the authorization. 1. Decide whether you are ready to capture the payment: * If there are additional charges to make, first [adjust the authorization](#adjust-auth). * If the customer wants to settle the bill using a different payment method than the one used for the pre-authorization, do not capture the payment. Instead, [cancel](/online-payments/cancel/#cancel-api) the pre-authorization by sending a POST [/payments/{paymentPspReference}/cancels](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/cancels) request, where `{paymentPspReference}` is the PSP reference from the pre-authorization response. 2. When you are ready to capture the payment, make a POST [/payments/{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) request, where `{paymentPspReference}` is the PSP reference 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` of the final amount and its `value` in [minor units](/development-resources/currency-codes). 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/v72/payments/{paymentPspReference}/captures \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "EUR", "value": 21415 }, "reference": "YOUR_UNIQUE_REFERENCE" }' ``` #### Java ```java // Adyen Java API Library v26.3.0 import com.adyen.Client; import com.adyen.enums.Environment; import com.adyen.model.checkout.*; import java.time.OffsetDateTime; import java.util.*; import com.adyen.model.RequestOptions; import com.adyen.service.checkout.*; // For the live environment, additionally include your liveEndpointUrlPrefix. Client client = new Client("ADYEN_API_KEY", Environment.TEST); // Create the request object(s) Amount amount = new Amount() .currency("EUR") .value(21415L); PaymentCaptureRequest paymentCaptureRequest = new PaymentCaptureRequest() .reference("YOUR_UNIQUE_REFERENCE") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT"); // Send the request ModificationsApi service = new ModificationsApi(client); PaymentCaptureResponse response = service.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, new RequestOptions().idempotencyKey("UUID")); ``` #### PHP ```php // Adyen PHP API Library v18.2.1 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"); // For the live environment, additionally include your liveEndpointUrlPrefix. $client->setEnvironment(Environment::TEST); // Create the request object(s) $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(21415); $paymentCaptureRequest = new PaymentCaptureRequest(); $paymentCaptureRequest ->setReference("YOUR_UNIQUE_REFERENCE") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new ModificationsApi($client); $response = $service->captureAuthorisedPayment('paymentPspReference', $paymentCaptureRequest, $requestOptions); ``` #### C\# ```cs // Adyen .net API Library v17.0.0 using Adyen; using Environment = Adyen.Model.Environment; using Adyen.Model; using Adyen.Model.Checkout; using Adyen.Service.Checkout; // For the live environment, additionally include your liveEndpointUrlPrefix. var config = new Config() { XApiKey = "ADYEN_API_KEY", Environment = Environment.Test }; var client = new Client(config); // Create the request object(s) Amount amount = new Amount { Currency = "EUR", Value = 21415 }; PaymentCaptureRequest paymentCaptureRequest = new PaymentCaptureRequest { Reference = "YOUR_UNIQUE_REFERENCE", Amount = amount, MerchantAccount = "ADYEN_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 v17.3.0 // Require the parts of the module you want to use const { Client, CheckoutAPI } = require('@adyen/api-library'); // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const paymentCaptureRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", amount: { currency: "EUR", value: 21415 }, reference: "YOUR_UNIQUE_REFERENCE" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v10.4.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" ) // For the live environment, additionally include your liveEndpointUrlPrefix. client := adyen.NewClient(&common.Config{ ApiKey: "ADYEN_API_KEY", Environment: common.TestEnv, }) // Create the request object(s) amount := checkout.Amount{ Currency: "EUR", Value: 21415, } paymentCaptureRequest := checkout.PaymentCaptureRequest{ Reference: common.PtrString("YOUR_UNIQUE_REFERENCE"), Amount: amount, MerchantAccount: "ADYEN_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 v12.5.1 import Adyen adyen = Adyen.Adyen() adyen.client.xapikey = "ADYEN_API_KEY" # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.client.platform = "test" # The environment to use library in. # Create the request object(s) json_request = { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "EUR", "value": 21415 }, "reference": "YOUR_UNIQUE_REFERENCE" } # 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 v9.5.1 require "adyen-ruby-api-library" adyen = Adyen::Client.new adyen.api_key = 'ADYEN_API_KEY' # For the live environment, additionally include your liveEndpointUrlPrefix. adyen.env = :test # Set to "live" for live environment # Create the request object(s) request_body = { :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT', :amount => { :currency => 'EUR', :value => 21415 }, :reference => 'YOUR_UNIQUE_REFERENCE' } # 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 v17.3.0 // Require the parts of the module you want to use import { Client, CheckoutAPI, Types } from "@adyen/api-library"; // Initialize the client object // For the live environment, additionally include your liveEndpointUrlPrefix. const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"}); // Create the request object(s) const amount: Types.checkout.Amount = { currency: "EUR", value: 21415 }; const paymentCaptureRequest: Types.checkout.PaymentCaptureRequest = { reference: "YOUR_UNIQUE_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, { idempotencyKey: "UUID" }); ``` 3. In the [/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) response, note the following parameters: * `pspReference`: The PSP reference associated with this [/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) request.\ 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 { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "paymentPspReference": "KHQC5N7G84BLNK43", "pspReference": "QJ7GWQ756L2GWR86", "reference": "YOUR_UNIQUE_REFERENCE", "status": "received", "amount": { "currency": "EUR", "value": 21415 } } ``` 4. 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 the capture fails, the webhook contains `success`: **false**. Review the `reason` you received in the webhook, fix the issue, and submit the `/captures` request again. If you need to charge the customer for an additional amount after they have left, and you [stored the customer's payment details](/online-payments/tokenization/make-token-payments) with your pre-authorisation request, you can apply these late charges in a recurring payment request using the token. ### Partial captures You can combine the above steps to suit your use case. For example, if you want to make multiple partial captures, modify the amount authorized after the first partial capture: 1. [Pre-authorize a payment](#pre-authorize). 2. Partially capture the payment. 3. [Adjust the authorization amount](#adjust-auth). The number of partial captures you can make depends on the issuer. Some issuers may flag multiple partial captures on a pre-authorization as a potential fraud risk, which can cause the capture to fail. ## Adjust a Klarna authorization [Klarna](/payment-methods/klarna) also supports authorization adjustments. However, there are a few differences compared to the flow for cards: * The authorization type for Klarna payments is pre-authorization by default. This means you do not need to specify the authorization type (`additionalData.authorisationType`) in the initial payment request. * Klarna only supports asynchronous authorization adjustment. You can adjust the authorization for any Klarna payment that has not been cancelled, expired, or fully captured. To increase the authorization amount, Klarna performs a second risk assessment or credit lookup on the customer. If this causes the transaction to be rejected, the customer must place a new order. The original authorization remains valid. ### Adjust the authorized amount After your Klarna payment request is authorized, make an asynchronous authorization adjustment request: 1. Make a POST [/payments/{paymentPspReference}/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request, where `{paymentPspReference}` is the PSP reference from the Klarna payment response. Specify: | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `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. | | `amount.currency` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The three-character [ISO currency code](/development-resources/currency-codes). | | `amount.value` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The amount of the transaction, in [minor units](/development-resources/currency-codes). This is the sum of the original, pre-authorized amount and all later adjustments.If an order is partially captured, the adjusted amount cannot be less than the already captured amount. | | `lineItems` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Price and product information about the purchased items, to be included on the invoice sent to the shopper.For an authorization adjustment, always specify every line item, including all captured or refunded items. See examples of Klarna-specific payment scenarios at [Invoice lines and discounts](/payment-methods/klarna/invoice-lines). | | `reference` | | A reference that you specify for this payment modification, for use in your reconciliation process.The `reference` you submitted in the initial authorization response remains the primary merchant reference, and this reference does not overwrite it. | The following example shows how to add a charge of EUR 64.15 to a pre-authorized amount of EUR 150.00. **Klarna authorization adjustment request** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments/{paymentPspReference}/amountUpdates \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency":"EUR", "value":21415 }, "lineItems": [ { "quantity": "1", "amountExcludingTax": "12500", "taxPercentage": "2000", "description": "Jacket", "id": "Item #1", "taxAmount": "2500", "amountIncludingTax": "15000" }, { "quantity": "1", "amountExcludingTax": "5346", "taxPercentage": "2000", "description": "Pants", "id": "Item #2", "taxAmount": "1069", "amountIncludingTax": "6415" } ], "industryUsage": "delayedCharge", "reference": "YOUR_UNIQUE_REFERENCE" }' ``` #### Java ```java // Adyen Java API Library v41.1.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) LineItem lineItem1 = new LineItem() .quantity(1L) .amountExcludingTax(12500L) .taxPercentage(2000L) .description("Jacket") .id("Item #1") .taxAmount(2500L) .amountIncludingTax(15000L); LineItem lineItem2 = new LineItem() .quantity(1L) .amountExcludingTax(5346L) .taxPercentage(2000L) .description("Pants") .id("Item #2") .taxAmount(1069L) .amountIncludingTax(6415L); Amount amount = new Amount() .currency("EUR") .value(21415L); PaymentAmountUpdateRequest paymentAmountUpdateRequest = new PaymentAmountUpdateRequest() .lineItems(Arrays.asList(lineItem1, lineItem2)) .industryUsage(PaymentAmountUpdateRequest.IndustryUsageEnum.DELAYEDCHARGE) .reference("YOUR_UNIQUE_REFERENCE") .amount(amount) .merchantAccount("ADYEN_MERCHANT_ACCOUNT"); // Send the request ModificationsApi service = new ModificationsApi(client); PaymentAmountUpdateResponse response = service.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, 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) $lineItem1 = new LineItem(); $lineItem1 ->setQuantity(1) ->setAmountExcludingTax(12500) ->setTaxPercentage(2000) ->setDescription("Jacket") ->setId("Item #1") ->setTaxAmount(2500) ->setAmountIncludingTax(15000); $lineItem2 = new LineItem(); $lineItem2 ->setQuantity(1) ->setAmountExcludingTax(5346) ->setTaxPercentage(2000) ->setDescription("Pants") ->setId("Item #2") ->setTaxAmount(1069) ->setAmountIncludingTax(6415); $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(21415); $paymentAmountUpdateRequest = new PaymentAmountUpdateRequest(); $paymentAmountUpdateRequest ->setLineItems(array($lineItem1, $lineItem2)) ->setIndustryUsage("delayedCharge") ->setReference("YOUR_UNIQUE_REFERENCE") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new ModificationsApi($client); $response = $service->updateAuthorisedAmount('paymentPspReference', $paymentAmountUpdateRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 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) LineItem lineItem1 = new LineItem { Quantity = 1, AmountExcludingTax = 12500, TaxPercentage = 2000, Description = "Jacket", Id = "Item #1", TaxAmount = 2500, AmountIncludingTax = 15000 }; LineItem lineItem2 = new LineItem { Quantity = 1, AmountExcludingTax = 5346, TaxPercentage = 2000, Description = "Pants", Id = "Item #2", TaxAmount = 1069, AmountIncludingTax = 6415 }; Amount amount = new Amount { Currency = "EUR", Value = 21415 }; PaymentAmountUpdateRequest paymentAmountUpdateRequest = new PaymentAmountUpdateRequest { LineItems = new List{ lineItem1, lineItem2 }, IndustryUsage = PaymentAmountUpdateRequest.IndustryUsageEnum.DelayedCharge, Reference = "YOUR_UNIQUE_REFERENCE", Amount = amount, MerchantAccount = "ADYEN_MERCHANT_ACCOUNT" }; // Send 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 v30.1.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 paymentAmountUpdateRequest = { merchantAccount: "ADYEN_MERCHANT_ACCOUNT", amount: { currency: "EUR", value: 21415 }, lineItems: [ { quantity: "1", amountExcludingTax: "12500", taxPercentage: "2000", description: "Jacket", id: "Item #1", taxAmount: "2500", amountIncludingTax: "15000" }, { quantity: "1", amountExcludingTax: "5346", taxPercentage: "2000", description: "Pants", id: "Item #2", taxAmount: "1069", amountIncludingTax: "6415" } ], industryUsage: "delayedCharge", reference: "YOUR_UNIQUE_REFERENCE" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.2.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) lineItem1 := checkout.LineItem{ Quantity: common.PtrInt64(1), AmountExcludingTax: common.PtrInt64(12500), TaxPercentage: common.PtrInt64(2000), Description: common.PtrString("Jacket"), Id: common.PtrString("Item #1"), TaxAmount: common.PtrInt64(2500), AmountIncludingTax: common.PtrInt64(15000), } lineItem2 := checkout.LineItem{ Quantity: common.PtrInt64(1), AmountExcludingTax: common.PtrInt64(5346), TaxPercentage: common.PtrInt64(2000), Description: common.PtrString("Pants"), Id: common.PtrString("Item #2"), TaxAmount: common.PtrInt64(1069), AmountIncludingTax: common.PtrInt64(6415), } amount := checkout.Amount{ Currency: "EUR", Value: 21415, } paymentAmountUpdateRequest := checkout.PaymentAmountUpdateRequest{ LineItems: []checkout.LineItem{ lineItem1, lineItem2, }, IndustryUsage: common.PtrString("delayedCharge"), Reference: common.PtrString("YOUR_UNIQUE_REFERENCE"), Amount: amount, MerchantAccount: "ADYEN_MERCHANT_ACCOUNT", } // Send 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 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": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "EUR", "value": 21415 }, "lineItems": [ { "quantity": "1", "amountExcludingTax": "12500", "taxPercentage": "2000", "description": "Jacket", "id": "Item #1", "taxAmount": "2500", "amountIncludingTax": "15000" }, { "quantity": "1", "amountExcludingTax": "5346", "taxPercentage": "2000", "description": "Pants", "id": "Item #2", "taxAmount": "1069", "amountIncludingTax": "6415" } ], "industryUsage": "delayedCharge", "reference": "YOUR_UNIQUE_REFERENCE" } # Send the request result = adyen.checkout.modifications_api.update_authorised_amount(request=json_request, paymentPspReference="paymentPspReference", idempotency_key="UUID") ``` #### Ruby ```rb # Adyen Ruby API Library v11.2.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 => 'ADYEN_MERCHANT_ACCOUNT', :amount => { :currency => 'EUR', :value => 21415 }, :lineItems => [ { :quantity => '1', :amountExcludingTax => '12500', :taxPercentage => '2000', :description => 'Jacket', :id => 'Item #1', :taxAmount => '2500', :amountIncludingTax => '15000' }, { :quantity => '1', :amountExcludingTax => '5346', :taxPercentage => '2000', :description => 'Pants', :id => 'Item #2', :taxAmount => '1069', :amountIncludingTax => '6415' } ], :industryUsage => 'delayedCharge', :reference => 'YOUR_UNIQUE_REFERENCE' } # Send the request result = adyen.checkout.modifications_api.update_authorised_amount(request_body, 'paymentPspReference', headers: { 'Idempotency-Key' => 'UUID' }) ``` #### NodeJS (TypeScript) ```ts // Adyen Node API Library v30.1.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 lineItem1: Types.checkout.LineItem = { quantity: 1, amountExcludingTax: 12500, taxPercentage: 2000, description: "Jacket", id: "Item #1", taxAmount: 2500, amountIncludingTax: 15000 }; const lineItem2: Types.checkout.LineItem = { quantity: 1, amountExcludingTax: 5346, taxPercentage: 2000, description: "Pants", id: "Item #2", taxAmount: 1069, amountIncludingTax: 6415 }; const amount: Types.checkout.Amount = { currency: "EUR", value: 21415 }; const paymentAmountUpdateRequest: Types.checkout.PaymentAmountUpdateRequest = { lineItems: [lineItem1, lineItem2], industryUsage: Types.checkout.PaymentAmountUpdateRequest.IndustryUsageEnum.DelayedCharge, reference: "YOUR_UNIQUE_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.updateAuthorisedAmount("paymentPspReference", paymentAmountUpdateRequest, { idempotencyKey: "UUID" }); ``` 2. Note that the [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) response contains: * `pspReference`: The PSP reference for this [/amountUpdates](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/amountUpdates) request.\ This is different from the PSP reference of the original Klarna payment request. * `status`: **received** **Klarna authorization adjustment response** ```json { "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "paymentPspReference": "KHQC5N7G84BLNK43", "pspReference": "NC6HT9CRT65ZGN82", "reference": "YOUR_UNIQUE_REFERENCE", "status": "received", "amount": { "currency": "EUR", "value": 21415 } } ``` 3. Wait for the [AUTHORISATION\_ADJUSTMENT](https://docs.adyen.com/api-explorer/Webhooks/latest/post/AUTHORISATION_ADJUSTMENT) webhook. This informs you whether the new amount has been authorized. ### Manually capture the payment After you make your last authorization adjustment, you must [manually capture the payment](/online-payments/capture#manual-capture) to transfer the reserved funds to your account: 1. Decide whether you are ready to capture the payment: * If there are additional charges to make, first [adjust the authorization](#adjust-auth). * If the customer wants to settle the bill using a different payment method than the one used for the pre-authorization, do not capture the payment. Instead, [cancel](/online-payments/cancel/#cancel-api) the authorization by sending a POST [/payments/{paymentPspReference}/cancels](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/cancels) request, where `{paymentPspReference}` is the PSP reference from the Klarna payment response. 2. When you are ready to capture the payment, make a POST [/payments/{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) request, where `{paymentPspReference}` is the PSP reference from the original payment (pre-authorization) response. Specify: | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `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. | | `amount.currency` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The three-character [ISO currency code](/development-resources/currency-codes). | | `amount.value` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The amount of the transaction, in [minor units](/development-resources/currency-codes). This is the sum of the original, pre-authorized amount and all later adjustments. | | `lineItems` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Price and product information about the purchased items, to be included on the invoice sent to the shopper.For an authorization adjustment, always specify every line item, including all captured or refunded items. See examples of Klarna-specific payment scenarios at [Invoice lines and discounts](/payment-methods/klarna/invoice-lines). | | `reference` | | A reference that you specify for this payment modification, for use in your reconciliation process.The `pspReference` you received in the initial authorization response remains the primary merchant reference, and this reference does not overwrite it. | **Klarna capture request** #### curl ```bash curl https://checkout-test.adyen.com/v72/payments/{paymentPspReference}/captures \ -H 'x-api-key: ADYEN_API_KEY' \ -H 'content-type: application/json' \ -d '{ "merchantAccount": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "EUR", "value": 21415 }, "lineItems": [ { "quantity": "1", "amountExcludingTax": "12500", "taxPercentage": "2000", "description": "Jacket", "id": "Item #1", "taxAmount": "2500", "amountIncludingTax": "15000" }, { "quantity": "1", "amountExcludingTax": "5346", "taxPercentage": "2000", "description": "Pants", "id": "Item #2", "taxAmount": "1069", "amountIncludingTax": "6415" } ], "reference": "YOUR_UNIQUE_REFERENCE" }' ``` #### Java ```java // Adyen Java API Library v41.1.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) LineItem lineItem1 = new LineItem() .quantity(1L) .amountExcludingTax(12500L) .taxPercentage(2000L) .description("Jacket") .id("Item #1") .taxAmount(2500L) .amountIncludingTax(15000L); LineItem lineItem2 = new LineItem() .quantity(1L) .amountExcludingTax(5346L) .taxPercentage(2000L) .description("Pants") .id("Item #2") .taxAmount(1069L) .amountIncludingTax(6415L); Amount amount = new Amount() .currency("EUR") .value(21415L); PaymentCaptureRequest paymentCaptureRequest = new PaymentCaptureRequest() .lineItems(Arrays.asList(lineItem1, lineItem2)) .reference("YOUR_UNIQUE_REFERENCE") .amount(amount) .merchantAccount("ADYEN_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) $lineItem1 = new LineItem(); $lineItem1 ->setQuantity(1) ->setAmountExcludingTax(12500) ->setTaxPercentage(2000) ->setDescription("Jacket") ->setId("Item #1") ->setTaxAmount(2500) ->setAmountIncludingTax(15000); $lineItem2 = new LineItem(); $lineItem2 ->setQuantity(1) ->setAmountExcludingTax(5346) ->setTaxPercentage(2000) ->setDescription("Pants") ->setId("Item #2") ->setTaxAmount(1069) ->setAmountIncludingTax(6415); $amount = new Amount(); $amount ->setCurrency("EUR") ->setValue(21415); $paymentCaptureRequest = new PaymentCaptureRequest(); $paymentCaptureRequest ->setLineItems(array($lineItem1, $lineItem2)) ->setReference("YOUR_UNIQUE_REFERENCE") ->setAmount($amount) ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT"); $requestOptions['idempotencyKey'] = 'UUID'; // Send the request $service = new ModificationsApi($client); $response = $service->captureAuthorisedPayment('paymentPspReference', $paymentCaptureRequest, $requestOptions); ``` #### C\# ```cs // Adyen .NET API Library v34.0.0 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) LineItem lineItem1 = new LineItem { Quantity = 1, AmountExcludingTax = 12500, TaxPercentage = 2000, Description = "Jacket", Id = "Item #1", TaxAmount = 2500, AmountIncludingTax = 15000 }; LineItem lineItem2 = new LineItem { Quantity = 1, AmountExcludingTax = 5346, TaxPercentage = 2000, Description = "Pants", Id = "Item #2", TaxAmount = 1069, AmountIncludingTax = 6415 }; Amount amount = new Amount { Currency = "EUR", Value = 21415 }; PaymentCaptureRequest paymentCaptureRequest = new PaymentCaptureRequest { LineItems = new List{ lineItem1, lineItem2 }, Reference = "YOUR_UNIQUE_REFERENCE", Amount = amount, MerchantAccount = "ADYEN_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.1.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: "ADYEN_MERCHANT_ACCOUNT", amount: { currency: "EUR", value: 21415 }, lineItems: [ { quantity: "1", amountExcludingTax: "12500", taxPercentage: "2000", description: "Jacket", id: "Item #1", taxAmount: "2500", amountIncludingTax: "15000" }, { quantity: "1", amountExcludingTax: "5346", taxPercentage: "2000", description: "Pants", id: "Item #2", taxAmount: "1069", amountIncludingTax: "6415" } ], reference: "YOUR_UNIQUE_REFERENCE" } // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, { idempotencyKey: "UUID" }); ``` #### Go ```go // Adyen Go API Library v21.2.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) lineItem1 := checkout.LineItem{ Quantity: common.PtrInt64(1), AmountExcludingTax: common.PtrInt64(12500), TaxPercentage: common.PtrInt64(2000), Description: common.PtrString("Jacket"), Id: common.PtrString("Item #1"), TaxAmount: common.PtrInt64(2500), AmountIncludingTax: common.PtrInt64(15000), } lineItem2 := checkout.LineItem{ Quantity: common.PtrInt64(1), AmountExcludingTax: common.PtrInt64(5346), TaxPercentage: common.PtrInt64(2000), Description: common.PtrString("Pants"), Id: common.PtrString("Item #2"), TaxAmount: common.PtrInt64(1069), AmountIncludingTax: common.PtrInt64(6415), } amount := checkout.Amount{ Currency: "EUR", Value: 21415, } paymentCaptureRequest := checkout.PaymentCaptureRequest{ LineItems: []checkout.LineItem{ lineItem1, lineItem2, }, Reference: common.PtrString("YOUR_UNIQUE_REFERENCE"), Amount: amount, MerchantAccount: "ADYEN_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": "ADYEN_MERCHANT_ACCOUNT", "amount": { "currency": "EUR", "value": 21415 }, "lineItems": [ { "quantity": "1", "amountExcludingTax": "12500", "taxPercentage": "2000", "description": "Jacket", "id": "Item #1", "taxAmount": "2500", "amountIncludingTax": "15000" }, { "quantity": "1", "amountExcludingTax": "5346", "taxPercentage": "2000", "description": "Pants", "id": "Item #2", "taxAmount": "1069", "amountIncludingTax": "6415" } ], "reference": "YOUR_UNIQUE_REFERENCE" } # 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.2.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 => 'ADYEN_MERCHANT_ACCOUNT', :amount => { :currency => 'EUR', :value => 21415 }, :lineItems => [ { :quantity => '1', :amountExcludingTax => '12500', :taxPercentage => '2000', :description => 'Jacket', :id => 'Item #1', :taxAmount => '2500', :amountIncludingTax => '15000' }, { :quantity => '1', :amountExcludingTax => '5346', :taxPercentage => '2000', :description => 'Pants', :id => 'Item #2', :taxAmount => '1069', :amountIncludingTax => '6415' } ], :reference => 'YOUR_UNIQUE_REFERENCE' } # 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.1.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 lineItem1: Types.checkout.LineItem = { quantity: 1, amountExcludingTax: 12500, taxPercentage: 2000, description: "Jacket", id: "Item #1", taxAmount: 2500, amountIncludingTax: 15000 }; const lineItem2: Types.checkout.LineItem = { quantity: 1, amountExcludingTax: 5346, taxPercentage: 2000, description: "Pants", id: "Item #2", taxAmount: 1069, amountIncludingTax: 6415 }; const amount: Types.checkout.Amount = { currency: "EUR", value: 21415 }; const paymentCaptureRequest: Types.checkout.PaymentCaptureRequest = { lineItems: [lineItem1, lineItem2], reference: "YOUR_UNIQUE_REFERENCE", amount: amount, merchantAccount: "ADYEN_MERCHANT_ACCOUNT" }; // Send the request const checkoutAPI = new CheckoutAPI(client); const response = checkoutAPI.ModificationsApi.captureAuthorisedPayment("paymentPspReference", paymentCaptureRequest, { idempotencyKey: "UUID" }); ``` 3. When you receive the [/payments/{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) response, note the following: * `pspReference`: The PSP reference associated with this `/captures` request.\ This is different from the PSP reference associated with the original payment (pre-authorization) request. * `status`: **received** * `reference`: Your reference to this payment modification, for use in your reconciliation process. **/captures response** ```json { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "paymentPspReference": "KHQC5N7G84BLNK43", "pspReference": "QJ7GWQ756L2GWR86", "reference": "YOUR_UNIQUE_REFERENCE", "status": "received", "amount": { "currency": "EUR", "value": 21415 } } ``` 4. Wait for the [webhook event](/development-resources/webhooks). This informs you whether the final amount has been captured.\ If the capture is successful, this event contains: * `eventCode`: **CAPTURE** * `originalReference`: The `pspReference` of the pre-authorization. * `pspReference`: The PSP reference associated with this [/payments/{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) request. * `success`: **true** If the capture fails, this event contains `success`: **false**. Review the `reason` you received in the webhook event, fix the issue, and submit the capture request again. See examples of other Klarna-specific payment scenarios at [Invoice lines and discounts](/payment-methods/klarna/invoice-lines). ## See also * [Authorization adjustment](/online-payments/adjust-authorisation) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments/{paymentPspReference}/amountUpdates) * [Capture](/online-payments/capture) * [Webhooks](/development-resources/webhooks)