Requirements
Before you begin, take into account the following requirements, limitations, and preparations.| Requirement | Description |
|---|---|
| Integration type | An online payments integration that uses Checkout API v70 or later. |
| API credential roles | Make sure that you have the following role(s): Checkout webservice role Merchant Recurring role |
| Webhooks | Subscribe to the Recurring tokens life cycle events webhook. |
| Limitations | To forward network tokens, you must create a token with Adyen for the same payment details. This is to ensure that Adyen can forward the payment details by falling back to the Adyen token in case we cannot find a network token. |
| Setup steps | Before you begin: Create tokens with Adyen. If you want to forward network tokens, implement network tokenization. Contact our Support Team to enable forwarding card details or network tokens. Make sure that your live endpoint region matches your Adyen token vault storage region. If you are not sure about the region where your tokens are stored, contact our Support Team. |
How it works
- You make a POST /forward request, including placeholders for the payment details you want to forward and the destination.
- Adyen replaces the placeholders with the payment details and makes a request to the third party API on your behalf to forward the payment details.
- Adyen receives a response from the third party.
- You receive a response from Adyen that contains the third party response as a string.
Forward card details
We support the following flows to forward card details:- Forward a token: Forward the card details using a token, to share the stored payment details from the Adyen Vault with a third party.
- Forward a token, with CVC: Forward the card details using a token and the card CVC, to share the stored payment details from the Adyen Vault with a third party,
- Forward non-tokenized card details: Forward the card details (encrypted or unencrypted) directly to a third party to let the third party tokenize the card details. Optionally, you can choose to tokenize the card with Adyen using the same request.
- You make a request to Adyen including the payment details that you want to forward to the third party.
- Adyen makes a request to the third party that contains the payment details.
- Third party responds to Adyen, and we forward this response to you.
Make a forward request to Adyen
To forward the payment details you store with Adyen to a third party, inform Adyen about the payment details that you want to forward and the destination. Adyen uses the information in your request to make a request to the third party on your behalf. From your server, make a POST /forward request, specifying:| Parameter name | Required | Description |
|---|---|---|
merchantAccount | Your merchant account name. | |
shopperReference | Your unique reference for the shopper. | |
storedPaymentMethodId | Use case: Include when you are forwarding a token that you have already stored with Adyen. Skip this when forwarding non-tokenized card details. The unique identifier for the token. This is the storedPaymentMethodId you received in the recurring.token.created webhook when you created the token. | |
paymentMethod | Use cases: When forwarding non-tokenized card details, you can include the following fields. The required fields depend on the third party that is receiving the card details: holderName number / encryptedCardNumber expiryMonth / encryptedExpiryMonth expiryYear / encryptedExpiryYear cvc / encryptedSecurityCode When forwarding a token with CVC, you can include the CVC. You must also include the {{securityCode}} placeholder in the request.body. The object that contains the encrypted or unencrypted (if you are fully PCI compliant) details. | |
merchantReference | Your reference to uniquely identify the transaction. | |
baseUrl | The base URL of the third party API, where Adyen will send the request to forward the payment details. | |
request.httpMethod | The HTTP method to use for the request to the third party, for example, post, patch, or put.Use the documentation from the third party to learn about the HTTP method you must use. | |
request.urlSuffix | The suffix to append to the baseUrl to construct the destination URL for the request to the third party. This is usually the endpoint name for the request, for example, /payments. | |
request.credentials | Your credentials for the third party. | |
request.headers | The request headers to include in the request to the third party, for example, externalparty-version, or authorization. | |
request.body | The request body that you want Adyen to forward to the third party on your behalf, in string format. Include key value pairs to specify the payment details, and use placeholders for the values. Adyen replaces the placeholders with the payment details when making the request to the third party.Use the documentation from the third party to learn about the parameters you need to include in the request body. | |
options.tokenize | When you are forwarding non-tokenized card details, set to true to store the payment details with Adyen using the same request. When set to true you must provide the holder name, number, expiry month, and the expiry year of the card in the paymentMethod object. | |
options.dryRun | Set to true to receive the request body that is populated to forward to the third party in the response. Any sensitive information will be masked in the response you receive. This functionality is only available in the test environment to help you set up your integration, defaults to false. |
- Forward a token
- Forward a token, with CVC
- Forward card details
- Scenario 1
- Scenario 2
- Scenario 3
Example request to forward a token
curl https://checkout-test.adyen.com/v71/forward \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"shopperReference": "YOUR_SHOPPER_REFERENCE",
"storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
"merchantReference": "YOUR_UNIQUE_REFERENCE",
"baseUrl": "http://thirdparty.example.com",
"request": {
"httpMethod": "post",
"urlSuffix": "/payments",
"credentials": "YOUR_CREDENTIALS_FOR_THE_THIRD_PARTY",
"headers": {
"Authorization": "Basic {{credentials}}"
},
"body": "{
"amount": {
"value": 100,
"currency": "USD"
},
"paymentMethod": {
"creditCard": {
"holderName": "{{holderName}}",
"number": "{{number}}",
"expiryMonth": "{{expiryMonth}}",
"expiryYear": "{{expiryYear}}"
}
}
}"
}
}'
Example request to forward a token, with CVC
curl https://checkout-test.adyen.com/v71/forward \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"shopperReference": "YOUR_SHOPPER_REFERENCE",
"storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
"paymentMethod": {
"cvc": "737",
"baseUrl": "http://thirdparty.example.com",
"request": {
"httpMethod": "post",
"urlSuffix": "/payments",
"credentials": "YOUR_CREDENTIALS_FOR_THE_THIRD_PARTY",
"headers": {
"Authorization": "Basic {{credentials}}"
},
"body": "{
"amount": {
"value": 100,
"currency": "USD"
},
"paymentMethod": {
"creditCard": {
"holderName": "{{holderName}}",
"number": "{{number}}",
"expiryMonth": "{{expiryMonth}}",
"expiryYear": "{{expiryYear}}"
"cvc": "{{securityCode}}"
}
}
}"
}
}'
Example request to forward card details
Use the documentation from the third party to learn about the parameters you need to include in the request body. |
|
| Use case: Required to forward a network token. The object that enables forwarding network tokens, including:-
Required for all transactions.
Required for particular setups, or issuers and card schemes.
Recommended for all transactions, but not required.
Example request to forward a network token
curl https://checkout-test.adyen.com/v71/forward \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"shopperReference": "YOUR_SHOPPER_REFERENCE",
"merchantReference": "YOUR_UNIQUE_REFERENCE",
"paymentMethod": {
"type": "scheme",
"number": "4111111111111111",
"expiryMonth": "03",
"expiryYear": "2030",
"cvc": "737",
"holderName": "S. Hopper"
}
"baseUrl": "http://thirdparty.example.com",
"request": {
"httpMethod": "post",
"urlSuffix": "/payments",
"credentials": "YOUR_CREDENTIALS_FOR_THE_THIRD_PARTY",
"headers": {
"Authorization": "Basic {{credentials}}"
},
"body": "{
"amount": {
"value": 100,
"currency": "USD"
}
}"
}
}'
Adyen makes a request to the third party
We make a request to the third party on your behalf. To construct the endpoint URL, we use the baseUrl and request.urlSuffix you provided in your forwarding request. The code sample below shows the request Adyen would make to the third party for forwarding a token, without CVC.Example request from Adyen to third partycurl https://thirdparty.example.com/payments \
-H "Basic merchant:pass" \
-H 'content-type: application/json' \
-d '{
"amount": {
"value": 100,
"currency": "USD"
},
"paymentMethod": {
"creditCard": {
"holderName": "S. Hopper",
"number": "4111111111111111",
"expiryMonth": "12",
"expiryYear": "2025"
}
}
}'
Third party responds to Adyen
We receive a response from the third party that contains the outcome of the /forward request. The response structure and content can differ depending on the third party.Example response from third party to Adyen{
"data": {
"tokenizeCreditCard": {
"paymentMethod": {
"id": "PAYMENT_METHOD_ID"
}
}
}
}
Forward network tokens
To forward stored network tokens:- You make a POST /forward request, including the
options.networkTokenparameter to forward a network token. - In your request, you specify a fallback logic to ensure that Adyen can forward the payment details using the token you created with Adyen instead of the network token in case it cannot be found.
- Adyen makes a request to the third party that contains the payment details.
- Third party responds to Adyen, and we forward this response to you.
Make a request to Adyen
To forward the network tokens you store with Adyen to a third party, inform Adyen about the network token that you want to forward and the destination. Adyen uses the information in your request to make a request to the third party on your behalf.From your server, make a POST /forward request, specifying:| Parameter name | Required | Description |
|---|---|---|
merchantAccount | Your merchant account name. | |
shopperReference | Your unique reference for the shopper. | |
storedPaymentMethodId | Use case: Include when you are forwarding a token that you have already stored with Adyen. Skip this when forwarding non-tokenized card details. The unique identifier for the token. This is the storedPaymentMethodId you received in the recurring.token.created webhook when you created the token. | |
paymentMethod | Use cases: When forwarding non-tokenized card details, you can include the following fields. The required fields depend on the third party that is receiving the card details: holderName number / encryptedCardNumber expiryMonth / encryptedExpiryMonth expiryYear / encryptedExpiryYear cvc / encryptedSecurityCode When forwarding a token with CVC, you can include the CVC. You must also include the {{securityCode}} placeholder in the request.body. The object that contains the encrypted or unencrypted (if you are fully PCI compliant) details. | |
merchantReference | Your reference to uniquely identify the transaction. | |
baseUrl | The base URL of the third party API, where Adyen will send the request to forward the payment details. | |
request.httpMethod | The HTTP method to use for the request to the third party, for example, post, patch, or put.Use the documentation from the third party to learn about the HTTP method you must use. | |
request.urlSuffix | The suffix to append to the baseUrl to construct the destination URL for the request to the third party. This is usually the endpoint name for the request, for example, /payments. | |
request.credentials | Your credentials for the third party. | |
request.headers | The request headers to include in the request to the third party, for example, externalparty-version, or authorization. | |
request.body | The request body that you want Adyen to forward to the third party on your behalf, in string format. In the body, include: A condition that checks if the network token exists, and informs Adyen of which fields to send depending on the outcome. You must inform Adyen to forward card details in case the network token cannot be found. Use Mustache.java syntax for conditions. Key value pairs that use placeholders for the values that specify the payment details to be forwarded. Adyen replaces the placeholders with the payment details when making the request to the third party. |
options.networkToken | useNetworkToken: Set to true to enable forwarding network tokens.includeCryptogram: Set to true to enable forwarding network token cryptograms. | |options.dryRun| | Set to true to receive the request body that is populated to forward to the third party in the response. Any sensitive information will be masked in the response you receive. This functionality is only available in the test environment to help you set up your integration, defaults to false. |
Build logic for Adyen token fallback
For requests that include network tokens, you must add a conditional statement in your/forward request to Adyen.In your condition, you must build a logic that informs Adyen to check if the network token exists, and determine the fields to forward to the third party depending on the outcome. Your condition must introduce a fallback to forward the token you created for the same payment details with Adyen in case the network token cannot be found.The following table indicates the fields that must be forwarded to third party depending on different availability scenarios.| Network token | networkTxReference | Cryptogram | Fields to forward to the third party | |
|---|---|---|---|---|
| Scenario 1 | ![]() | ![]() | ![]() | Forward the network token, networkTxReference, and the network token cryptogram. |
| Scenario 2 | ![]() | ![]() | ![]() | Forward the network token. |
| Scenario 3 | ![]() | ![]() | ![]() | Fallback to the Adyen token. |
curl https://checkout-test.adyen.com/v71/forward \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"shopperReference": "YOUR_SHOPPER_REFERENCE",
"storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
"merchantReference": "YOUR_UNIQUE_REFERENCE",
"baseUrl": "http://thirdparty.example.com",
"options" : {
"networkToken":{
"useNetworkToken":true,
"includeCryptogram":true
}
},
"request": {
"httpMethod": "post",
"urlSuffix": "/payments",
"credentials": "YOUR_CREDENTIALS_FOR_THE_THIRD_PARTY",
"headers": {
"Authorization": "Basic {{credentials}}"
},
"body": "{
"amount": {
"value": 100,
"currency": "USD"
}
{{#networkTxReference}},
"reference": "{{networkTxReference}}"
{{/networkTxReference}}
{{#networkTokenExists}},
"networkToken": {
"number": "{{tokenNumber}}",
"expiryMonth": "{{tokenExpiryMonth}}",
"expiryYear": "{{tokenExpiryYear}}"
{{#cryptogram}}",
"eci": "{{ecommerceIndicator}}",
"cryptogram": "{{cryptogram}}"
{{/cryptogram}}"
}
{{/networkTokenExists}}
{{^networkTokenExists}},
"paymentMethod": {
"holderName": "{{holderName}}",
"number": "{{number}}",
"expiryMonth": "{{expiryMonth}}",
"expiryYear": "{{expiryYear}}"
}
{{/networkTokenExists}}
}"
}
}'
Adyen makes a request to the third party
We make a request to the third party on your behalf. To construct the endpoint URL, we use the baseUrl and request.urlSuffix you provided in your forwarding request.We use the condition you set in the /forward field to determine which details to forward to the third party.The network token,
networkTxReference, and the cryptogram are found. Adyen forwards all details to the third party.Example request from Adyen to third party including all detailscurl https://thirdparty.example.com/payments \
-H "Basic merchant:pass" \
-H 'content-type: application/json' \
-d '{
"amount": {
"value": 100,
"currency": "USD"
},
"reference": "5252520200034065",
"networkToken" : {
"expiryMonth" : "12",
"expiryYear" : "2024",
"number" : "4111111111111111",
"eci":"02",
"cryptogram":"123"
}
}'
The network token is found, but a
networkTxReference is not found. Adyen only forwards the network token to the third party.Example request from Adyen to third party including a network tokencurl https://thirdparty.example.com/payments \
-H "Basic merchant:pass" \
-H 'content-type: application/json' \
-d '{
"amount": {
"value": 100,
"currency": "USD"
},
"networkToken" : {
"expiryMonth" : "12",
"expiryYear" : "2024",
"number" : "4111111111111111",
}
}'
A network token is not found. Adyen uses the card details that you stored with Adyen tokenization to forward payment details to the third party.Example request from Adyen to third party including card detailsThe response contains:
curl https://thirdparty.example.com/payments \
-H "Basic merchant:pass" \
-H 'content-type: application/json' \
-d '{
"amount": {
"value": 100,
"currency": "USD"
},
"reference": "5252520200034065",
"paymentMethod": {
"holderName": "S. Hopper",
"number": "4111111111111111",
"expiryMonth": "12",
"expiryYear": "2025"
}
}'
Third party responds to Adyen
We receive a response from the third party, that contains the outcome of the forward request. The response structure and content can differ, depending on the third party.Example response from third party to Adyen{
"data": {
"tokenizeCreditCard": {
"paymentMethod": {
"id": "PAYMENT_METHOD_ID"
}
}
}
}
Handle the result
You receive a response from Adyen that informs you of the outcome of your /forward request, for example:Example /forward response from Adyen{
"storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
"pspReference": "XB7XNCQ8HXSKGK82",
"merchantReference": "YOUR_REFERENCE"
"response": {
"status": 200,
"headers": {
"thirdparty-version": "2023-10-16"
},
"body": "{\"success\": \"ok\",\"data\": {\"tokenizeCreditCard\": {\"paymentMethod\": {\"id\": \"PAYMENT_METHOD_ID\"}}}}"
}
}
pspReference: Our unique identifier for the transaction.merchantReference: The unique reference for the transaction that you included in your request to forward payment details.storedPaymentMethodId: The unique identifier for the stored payment details that were forwarded. This is the Adyen identifier.
This field is not returned if you forward non-tokenized card details, and setoptions.tokenizeto false.response.status: The HTTP status code Adyen received from the third party.response.body: The response that Adyen received from the third party. Adyen passes the response as a string without modifying it.
Errors
If Adyen’s request to share the token fails, you will receive a response with HTTP status code different from 2XX. In this response, you get an error code and message that help you diagnose and resolve the error.When you make a request to forward payment details, and an error occurs on the Adyen side, you will receive a response with HTTP status code different from 2XX.If an error occurs on the third party side, you can receive:- 502: Third party did not send a response to Adyen.
- 505: Third party experienced a time-out.
{
"status": 422,
"errorCode": "803",
"message": "PaymentDetail not found",
"errorType": "validation"
}
Placeholder reference
Use the documentation from the third party to determine the parameters you must include in your/forward request. You must send the parameters in key value pairs, where you use the keys specified by the third party, paired with the placeholder values that Adyen can replace with real values.The following is a list of placeholders that Adyen can map to real values and forward to a third party. The Use case(s) column specifies the placeholders that are relevant when forwarding card details and network tokens.| Placeholder | Use case(s) | Description |
|---|---|---|
{{credentials}} | Card details Network tokens | The credentials to authenticate the API request. |
{{number}} | Card details Network tokens | The card number. |
{{expiryMonth}} | Card details Network tokens | Expiry month of the card. |
{{expiryYear}} | Card details Network tokens | Expiry year of the card. |
{{expiryYearYY}} | Card details Network tokens | Expiry year of the card. Use this field if you want to send a two-digit value for the expiry year. |
{{securityCode}} | Card details Network tokens | The security code (CVC) of the card. |
{{billingaddress.street}} | Card details Network tokens | The billing address street stored along with the token. |
{{billingaddress.housenumberorname}} | Card details Network tokens | The billing address house number/name stored with the token. |
{{billingaddress.postalcode}} | Card details Network tokens | The billing address postcode/ZIP code stored with the token. |
{{billingaddress.stateorprovince}} | Card details Network tokens | The billing address state/province field stored with the token. |
{{billingaddress.city}} | Card details Network tokens | The billing address city stored with the token. |
{{billingaddress.countrycode}} | Card details Network tokens | The billing address country code stored with the token. |
{{billingaddress.addressline3}} | Card details Network tokens | The billing address additional line stored with the token. |
{{holderName}} | Card details | The card holder’s name. |
{{networkTxReference}} | Network tokens Card details | The transaction identifier from card schemes that allows you to link the transaction to the original or previous one for recurring payments. |
{{transactionLinkId}} | Network tokens Card details | The Mastercard Transaction Link Identifier. This identifier has the same purpose as the {{networkTxReference}}, but is used for Mastercard specifically. You can provide both identifiers in the same transaction, or provide one of them. |
{{tokenNumber}} | Network tokens | The 16-digit alternative for the Primary Account Number (PAN). |
{{tokenExpiryMonth}} | Network tokens | Expiry month of the network token. |
{{tokenExpiryYear}} | Network tokens | Expiry year of the network token. |
{{tokenExpiryYearYY}} | Network tokens | Expiry year of the network token. Use this field if you want to send a two-digit value for the expiry year. |
{{cryptogram}} | Network tokens | The single-use key that enables to use the network token for a transaction. |
{{ecommerceIndicator}} | Network tokens | The Electronic Commerce Indicator of the cryptogram, returned from the schemes. |

