When a shopper uses an AI agent to make a purchase, the AI agent platform communicates with Adyen to initiate payments on behalf of shoppers. Adyen translates the information to be able to communicate with you. To enable Adyen to process payments for AI-agent-initiated transactions with you, you must create a server with endpoints that Adyen can make requests to. Adyen communicates with your server so that you do not need to integrate with multiple agent platforms.
Requirements
| Requirement | Description |
|---|---|
| Integration type | An existing online payments integration. |
How it works
For this integration, your server must do the following:
- Make requests to Adyen.
- Expose endpoints that Adyen makes requests to.
Adyen requests to your server
After you configure your server's endpoints, Adyen can make requests to them. You must set up your endpoints to do the following, so that Adyen can make requests to them:
- Create session: Initialize a checkout session with items, shopper, and fulfillment details.
- Update session (optional): Update items, address, or fulfillment selection and recalculate totals.
- Commit session (optional): Run a final price or stock check before Adyen authorizes the payment.
- Cancel session (optional): Release reserved inventory when the shopper abandons checkout.
- Finalize session: Receive the authorization result and trigger order creation.
- Complete session (optional): Receive the payment token and make the payment request to Adyen directly.
Response latency: Your server must respond to Adyen's requests within five seconds. Otherwise, we treat timeouts as errors.
Order events after the purchase
After a purchase is finished, you can optionally make requests to Adyen to give order information to the agent (for example, shipping tracking).
- Send order events after the purchase (optional): Send fulfillment updates to Adyen, such as shipping tracking information.
Possible flows
You can implement one of the following flows:
- Standard: Adyen makes a request to finalize the session, and you fulfill the order.
- Advanced: We strongly recommend that you only use this flow if you must have direct control of the payment request. Adyen makes a request to complete the session and gives you a payment token. You make a payment request to Adyen.
One-time configuration
Complete a one-time configuration to register your server's base URL and declare which endpoints Adyen should call. You can update this configuration at any time without downtime.
Use the following endpoint URL:
| Environment | Endpoint URL |
|---|---|
| Test | https://commerce-suite-test.adyen.com/commerce-suite/companies/v1/{CompanyAccount}/agentic/configuration |
| Live | https://commerce-suite-live.adyen.com/commerce-suite/companies/v1/{CompanyAccount}/agentic/configuration |
Make a POST /agentic/configuration request, including the following parameters:
Request headers:
| Header | Description |
|---|---|
x-api-key |
Your Adyen API key from your Adyen company account. |
Idempotency-Key |
A unique identifier for the request. |
Request body:
| Parameter | Type | Required | Description |
|---|---|---|---|
baseUrl |
String | Your server's base URL. Adyen appends endpoint paths to this URL. For example: your-agentic-server.example.com. | |
security.apiKey |
String | The API key that Adyen includes in the Authorization header on every callback to your server. Validate it on every inbound request and reject anything that does not match. |
|
features.enableCommitSession |
Boolean | If true, Adyen makes a request to POST /sessions/{sessionId}/commit before authorizing. Use this to run a final price or stock check before the card is charged. Default: false. |
|
features.enableCancelSession |
Boolean | If true, Adyen makes a request to POST /sessions/{sessionId}/cancel when an agent cancels a session. Use this to release reserved inventory. Default: false. |
|
features.enableFinalizeSession |
Boolean | If true, Adyen makes a request to POST /sessions/{sessionId}/finalize after successful authorization. This is your fulfillment trigger. Default: true. |
|
features.enableCompleteSession |
Boolean | Advanced flow only. If true, Adyen makes a request to POST /sessions/{sessionId}/complete with the raw payment token. Your server makes a POST /payments request directly. Leave false unless you need to own the authorization step. Default: false. |
Never expose your security.apiKey in agent-readable context or client-side code. This key is your primary mechanism for confirming that a request originates from Adyen.
Create session
Set up the following endpoint: POST /agentic/sessions/{sessionId}
Adyen makes a request to this endpoint when an AI agent initiates a new checkout session. This is the first request including the sessionId in the path. Your server must respond with authoritative totals, stock status, and available fulfillment options. Use the sessionId to create a draft order record in your system if needed.
Adyen request to your server
When Adyen makes a POST /agentic/sessions/{sessionId} request to your server, the request includes the following parameters:
Path parameter:
| Parameter | Description |
|---|---|
sessionId |
The unique session identifier assigned by Adyen. Use this to create or update a draft order in your system. |
Request headers:
| Header | Description |
|---|---|
Authorization |
Adyen-issued bearer token. Validate this token for every request your server receives. |
Request body:
| Parameter | Type | Required | Description |
|---|---|---|---|
currency |
String (ISO 4217) | The three-letter currency code, for example, USD, EUR, GBP. | |
lineItems |
MerchantItemRequest[]
|
Items requested by the agent. Each item requires an id and quantity of 1 or more. |
|
shoppingPlatform |
String | Agent platform identifier, for example, openai, google, meta. | |
deliveryAddress |
MerchantAddress
|
The shopper's delivery address. Required to compute shipping and address-level tax. | |
fulfillment |
MerchantFulfillment
|
Contains selectedFulfillmentOptionId if the shopper has selected a shipping tier. |
|
shopper |
MerchantShopper
|
Shopper contact details: email, firstName, lastName, phoneNumber. |
|
discounts |
MerchantDiscountsRequest
|
Discount codes submitted by the shopper. Validate and return applied or rejected results. | |
affiliateAttribution |
MerchantAffiliateAttribution
|
Affiliate attribution data passed through from the agent. | |
reference |
String | Your internal reference for this session. Echo back in the response. | |
lineItems[].quantity |
Integer | Units requested. Must be 1 or more. | |
lineItems[].id |
String | Product or SKU identifier. Echo back in MerchantLineItem.id. |
Your server response
Build the responses that your server responds to Adyen with.
The success HTTP 200 response includes the following. All fields are optional, but populate as much as possible because the agent presents these totals and options directly to the shopper.
| Parameter | Type | Description |
|---|---|---|
merchantAccount |
String | Your Adyen merchant account identifier. Adyen uses this to route the payment. |
reference |
String | Echo back the reference from the request. |
lineItems |
Object[] | Resolved line items with pricing, stock status, and discount breakdown. |
lineItems[].quantity |
Integer | Resolved quantity for this line item. |
lineItems[].id |
String | Echo back the product or SKU id from the request. |
lineItems[].status |
String | Stock status: IN_STOCK, OUT_OF_STOCK, or PARTIAL_STOCK. |
lineItems[].amount |
Object | Unit price multiplied by quantity in minor currency units. |
lineItems[].discount |
Object | Discount applied to this line in minor currency units. |
lineItems[].subtotal |
Object | Line subtotal after discount, before tax. |
lineItems[].taxAmount |
Object | Tax for this line in minor currency units. |
lineItems[].totalAmount |
Object | Final line total (subtotal + tax) in minor currency units. |
fulfillmentOptions |
Object[] | Available fulfillment options for the shopper to choose from. |
fulfillmentOptions[].id |
String | Unique identifier. The shopper's selection is sent back as fulfillment.selectedFulfillmentOptionId. |
fulfillmentOptions[].type |
String | Option type, for example, shipping, digital, pickup. |
fulfillmentOptions[].title |
String | Human-readable name shown to the shopper, for example, Express (1-2 days). |
fulfillmentOptions[].subtitle |
String | Additional description, for example, Delivered by FedEx. |
fulfillmentOptions[].carrier |
String | Carrier name, for example, UPS, DHL, FedEx. |
fulfillmentOptions[].amount |
Object | Shipping cost before tax in minor currency units. |
fulfillmentOptions[].taxAmount |
Object | Tax on this fulfillment option in minor currency units. |
fulfillmentOptions[].total |
Object | Total fulfillment cost (amount + taxAmount) in minor currency units. |
fulfillmentOptions[].earliestDeliveryTime |
String (date-time) | ISO 8601 timestamp for earliest expected delivery. |
fulfillmentOptions[].latestDeliveryTime |
String (date-time) | ISO 8601 timestamp for latest expected delivery. |
totals |
Object | Session totals. totals.total.value is the amount Adyen authorizes. |
totals.subtotal |
Object | Order subtotal before tax and fulfillment. |
totals.tax |
Object | Total tax for the order. |
totals.fulfillment |
Object | Total fulfillment cost. |
totals.total |
Object | Grand total (subtotal + tax + fulfillment). |
discounts |
MerchantDiscountsResponse | Discount processing results: applied and rejected codes with detail. |
marketingConsentOptions |
Object[] | Marketing consent channels to present to the shopper through the agent. |
messages |
Object[] | Structured messages. Include on all 422 responses. |
messages[].code |
String | Machine-readable reason code aligned with AgenticReasonCode, for example, OUT_OF_STOCK. |
messages[].content |
String | Human-readable message text. The agent shows this to the shopper when type is ERROR. |
messages[].type |
String | ERROR blocks checkout. INFO is advisory and does not block. |
links |
MerchantLink[] | Merchant policy URLs: terms of service, return policy, privacy policy. |
reason |
String | Machine-readable rejection reason on 422 responses. See Error handling and reason codes. |
Possible HTTP status codes
| HTTP | reason |
lineItems.status |
Description |
|---|---|---|---|
| 200 | None | IN_STOCK | Session valid. Return totals, lineItems, and fulfillmentOptions. The agent presents these to the shopper. |
| 422 | OUT_OF_STOCK | OUT_OF_STOCK | Requested items are fully unavailable. |
| 422 | PARTIAL_STOCK | PARTIAL_STOCK | The number of available items is less than the requested number. |
| 422 | INVALID_ADDRESS | — | Shipping options do not support the delivery location. |
(Optional) Update session
Set up the following endpoint: POST /agentic/sessions/{sessionId}
Adyen makes a request to this endpoint every time the cart changes after the initial create session request. This includes item quantity changes, delivery address updates, fulfillment option selection, or discount code application. The same endpoint path is used as Create session. Adyen distinguishes them by whether the sessionId already exists in your system.
Handle duplicate update requests gracefully. Adyen may retry on timeout. Return the same response for the same session state.
Adyen request to your server
When Adyen makes a POST /agentic/sessions/{sessionId} request to your server, the request includes the following parameters. The schema is identical to Create session. On update requests, fields that have not changed can be omitted.
Path parameter:
| Parameter | Description |
|---|---|
sessionId |
The unique session identifier assigned by Adyen. |
Request headers:
| Header | Description |
|---|---|
Authorization |
Adyen-issued bearer token. Validate this token for every request your server receives. |
Body parameters:
| Parameter | Type | Description |
|---|---|---|
currency |
String (ISO 4217) | The three-letter currency code. Must match the session currency if provided. |
lineItems |
Object[] | Updated item list. Revalidate stock and recompute totals for all items. |
lineItems[].quantity |
Integer | Units requested. Must be 1 or more. |
lineItems[].id |
String | Product or SKU identifier. |
shoppingPlatform |
String | Agent platform identifier. Usually unchanged from create. |
deliveryAddress |
MerchantAddress | Updated delivery address. Triggers recalculation of shipping costs and tax. |
fulfillment |
MerchantFulfillment | Updated fulfillment selection. Contains selectedFulfillmentOptionId chosen by the shopper. |
shopper |
MerchantShopper | Updated shopper contact details. |
discounts |
MerchantDiscountsRequest | Discount codes to apply or update. |
affiliateAttribution |
MerchantAffiliateAttribution | Affiliate attribution data. |
reference |
String | Session reference. |
Your server response
The response schema is identical to Create session. Always return the fully recalculated state — never return only the changed fields.
Possible HTTP status codes
| HTTP | reason |
lineItems.status |
Description |
|---|---|---|---|
| 200 | None | IN_STOCK | Session updated. Return fully recalculated state. The agent presents updated totals to the shopper. |
| 422 | OUT_OF_STOCK | OUT_OF_STOCK | Requested items are fully unavailable. |
| 422 | PARTIAL_STOCK | PARTIAL_STOCK | The number of available items is less than the requested number. |
| 422 | INVALID_ADDRESS | — | Shipping options do not support the delivery location. |
(Optional) Cancel session
Set up the following endpoint: POST /agentic/sessions/{sessionId}/cancel
Adyen makes a request to this endpoint when the shopper abandons checkout or the agent terminates the session before payment. Use this to release reserved inventory or discard draft orders.
Adyen request to your server
When Adyen makes a POST /agentic/sessions/{sessionId}/cancel request to your server, the request includes the following parameters:
Path parameter:
| Parameter | Description |
|---|---|
sessionId |
The unique session identifier assigned by Adyen. |
Request headers:
| Header | Description |
|---|---|
Authorization |
Adyen-issued bearer token. Validate this token for every request your server receives. |
Body parameters:
| Parameter | Type | Description |
|---|---|---|
reference |
String | Session reference from the original create or update request. Use to locate your internal session record. |
Your server response
No response body is expected. Return the appropriate HTTP status code.
Possible HTTP status codes
| HTTP | Meaning | Description |
|---|---|---|
| 204 | No Content | Session cancelled successfully. No response body expected. |
| 409 | Conflict | Session cannot be cancelled. The session may already be in a terminal state. |
(Optional) Commit session
Set up the following endpoint: POST /agentic/sessions/{sessionId}/commit
Adyen makes a request to this endpoint after the shopper confirms payment, but before Adyen executes authorization. Adyen sends the full session state and payment metadata. A 200 response is a binding commitment to fulfill the order at the stated totals — Adyen proceeds to authorization immediately after.
This endpoint is only called if you set features.enableCommitSession to true in your one-time configuration. If disabled, Adyen proceeds directly to authorization after the final update session request.
A 200 response is a commitment to fulfill the order at the stated totals. Adyen authorizes payment immediately after. Return 422 if you cannot guarantee fulfillment.
Adyen request to your server
When Adyen makes a POST /agentic/sessions/{sessionId}/commit request to your server, the request includes the following parameters:
Path parameter:
| Parameter | Description |
|---|---|
sessionId |
The unique session identifier assigned by Adyen. |
Request headers:
| Header | Description |
|---|---|
Authorization |
Adyen-issued bearer token. Validate this token for every request your server receives. |
X-Merchant-Account |
The Adyen merchant account for which this session was processed. |
Body parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
lineItems |
Object[] | Final resolved line items. | |
lineItems[].quantity |
Integer | Resolved quantity for this line item. | |
lineItems[].id |
String | Product or SKU identifier. | |
lineItems[].status |
String | Stock status: IN_STOCK, OUT_OF_STOCK, or PARTIAL_STOCK. | |
lineItems[].totalAmount |
Object | Final line total (subtotal + tax) in minor currency units. | |
billingAddress |
MerchantAddress | The shopper's billing address at checkout completion. | |
fulfillmentOptions |
MerchantFulfillment[] | Selected fulfillment options. | |
totals |
Object | Final session totals. Reconcile against your records — a mismatch should return PRICE_MISMATCH. | |
totals.subtotal |
Object | Order subtotal before tax and fulfillment. | |
totals.tax |
Object | Total tax for the order. | |
totals.fulfillment |
Object | Total fulfillment cost. | |
totals.total |
Object | Grand total (subtotal + tax + fulfillment). | |
shopper |
MerchantShopper | Final shopper details. | |
paymentMetadata |
Object | Payment instrument metadata. Use for risk checks. | |
paymentMetadata.bin |
String | Bank identification number (first 6 digits of the card). | |
paymentMetadata.cardAlias |
String | Hashed card alias for velocity checks. | |
paymentMetadata.paymentMethod |
String | Payment method type, for example, visa, mc, amex. | |
marketingConsents |
Object[] | Shopper's marketing consent choices at checkout. | |
messages |
Object[] | Any session messages. | |
links |
MerchantLink[] | Merchant policy links from the session. | |
reference |
String | Session reference. |
Your server response
The success HTTP 200 response includes the following:
| Parameter | Type | Required | Description |
|---|---|---|---|
lineItems |
Object[] | Updated line items if stock or pricing changed during commit. | |
messages |
Object[] | Structured messages. Errors block authorization. | |
order |
Object | If you pre-create the order at this point, return it here. | |
order.id |
String | Your unique order identifier. | |
order.checkoutSessionId |
String | The originating checkout sessionId. |
|
order.permalinkUrl |
String | Permanent URL to your order details page. The agent presents this to the shopper as their confirmation link. | |
reason |
String | Machine-readable rejection reason on 422 responses. See Error handling and reason codes. |
Possible HTTP status codes
| HTTP | reason |
lineItems.status |
Description |
|---|---|---|---|
| 200 | None | IN_STOCK | Commit accepted. Adyen proceeds to payment authorization immediately. |
| 422 | OUT_OF_STOCK | OUT_OF_STOCK | Requested items are fully unavailable. |
| 422 | PARTIAL_STOCK | PARTIAL_STOCK | The number of available items is less than the requested number. |
| 422 | PRICE_MISMATCH | — | Totals do not match your records. |
Finalize session
Set up the following endpoint: POST /agentic/sessions/{sessionId}/finalize
Adyen makes a request to this endpoint after successful authorization. This is the signal to create the final order and begin fulfillment.
If you already consume standard Adyen webhook messages with eventCode: AUTHORISATION, you can use those instead of this endpoint. The webhook message includes the same authorization result and additional agentic metadata including sessionId and shoppingPlatform in additionalData. Configure your preference in your one-time configuration.
Adyen request to your server
When Adyen makes a POST /agentic/sessions/{sessionId}/finalize request to your server, the request includes the following parameters:
Path parameter:
| Parameter | Description |
|---|---|
sessionId |
The unique session identifier assigned by Adyen. |
Request headers:
| Header | Description |
|---|---|
Authorization |
Adyen-issued bearer token. Validate this token for every request your server receives. |
X-Merchant-Account |
The Adyen merchant account for which this session was processed. |
Body parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
lineItems |
Object[] | Final authorized line items. | |
lineItems[].quantity |
Integer | Resolved quantity for this line item. | |
lineItems[].id |
String | Product or SKU identifier. | |
lineItems[].status |
String | Stock status: IN_STOCK, OUT_OF_STOCK, or PARTIAL_STOCK. | |
lineItems[].amount |
Object | Unit price multiplied by quantity in minor currency units. | |
lineItems[].taxAmount |
Object | Tax for this line in minor currency units. | |
lineItems[].totalAmount |
Object | Final line total (subtotal + tax) in minor currency units. | |
billingAddress |
MerchantAddress | The shopper's billing address associated with the authorized payment. | |
fulfillmentOptions |
Object[] | Selected fulfillment methods for this order. | |
fulfillmentOptions[].id |
String | Unique identifier for the fulfillment option. | |
fulfillmentOptions[].type |
String | Option type, for example, shipping, digital, pickup. | |
fulfillmentOptions[].title |
String | Human-readable name shown to the shopper. | |
fulfillmentOptions[].carrier |
String | Carrier name, for example, UPS, DHL, FedEx. | |
fulfillmentOptions[].amount |
Object | Shipping cost before tax in minor currency units. | |
totals |
Object | Final authorized totals. Use these to create your order record. | |
totals.subtotal |
Object | Order subtotal before tax and fulfillment. | |
totals.tax |
Object | Total tax for the order. | |
totals.fulfillment |
Object | Total fulfillment cost. | |
totals.total |
Object | Grand total (subtotal + tax + fulfillment). | |
shopper |
MerchantShopper | Shopper contact details. | |
paymentMetadata |
Object | Payment instrument metadata. | |
paymentMetadata.paymentMethod |
String | Payment method used, for example, visa, mc. | |
paymentMetadata.bin |
String | Bank identification number (first 6 digits of the card). | |
paymentMetadata.cardAlias |
String | Tokenized card alias. | |
messages |
Object[] | Any session messages. | |
links |
MerchantLink[] | Merchant policy links from the session. | |
reference |
String | Session reference. |
Your server response
No response body is expected. Return the appropriate HTTP status code.
Possible HTTP status codes
| HTTP | Meaning | Description |
|---|---|---|
| 204 | No Content | Finalization acknowledged. Create the final order record and begin fulfillment. |
(Optional) Complete session (advanced flow)
Set up the following endpoint: POST /agentic/sessions/{sessionId}/complete
If you implement the advanced flow, Adyen makes a request to this endpoint instead of the finalize session one. Adyen sends the raw payment token, and your server executes payment authorization directly with a POST /payments request and handles fulfillment synchronously in one step.
Adyen request to your server
When Adyen makes a POST /agentic/sessions/{sessionId}/complete request to your server, the request includes the following parameters:
Path parameter:
| Parameter | Description |
|---|---|
sessionId |
The unique session identifier assigned by Adyen. |
Request headers:
| Header | Description |
|---|---|
Authorization |
Adyen-issued bearer token. Validate this token for every request your server receives. |
Body parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
paymentData |
Object | The payment token. Pass paymentData.token as paymentMethod.storedPaymentMethodId in your POST /payments request. |
|
paymentData.provider |
String | Payment provider. Always adyen for this integration. | |
paymentData.token |
String | The ACP token from Adyen. Pass as paymentMethod.storedPaymentMethodId in your POST /payments request. |
|
lineItems |
Object[] | Final resolved line items. | |
lineItems[].quantity |
Integer | Resolved quantity for this line item. | |
lineItems[].id |
String | Product or SKU identifier. | |
lineItems[].status |
String | Stock status: IN_STOCK, OUT_OF_STOCK, or PARTIAL_STOCK. | |
lineItems[].amount |
Object | Unit price multiplied by quantity in minor currency units. | |
lineItems[].taxAmount |
Object | Tax for this line in minor currency units. | |
lineItems[].totalAmount |
Object | Final line total (subtotal + tax) in minor currency units. | |
totals |
Object | Final totals. Use totals.total.value and totals.total.currency as the amount in your POST /payments request. |
|
totals.subtotal |
Object | Order subtotal before tax and fulfillment. | |
totals.tax |
Object | Total tax for the order. | |
totals.fulfillment |
Object | Total fulfillment cost. | |
totals.total |
Object | Grand total (subtotal + tax + fulfillment). | |
selectedFulfillmentOptionId |
String | The fulfillment option the shopper selected. | |
billingAddress |
MerchantAddress | The shopper's billing address. | |
shopper |
MerchantShopper | Shopper contact details. | |
marketingConsents |
MerchantMarketingConsent[] | The shopper's marketing opt-in or opt-out choices. | |
affiliateAttribution |
MerchantAffiliateAttribution | Attribution data for tracking. | |
reference |
String | Session reference. |
- Get the information that you need to make a payment request to Adyen.
Your server response
The success HTTP 200 response includes the following:
| Parameter | Type | Description |
|---|---|---|
order |
Object | The order you created. |
order.id |
String | Your internal order identifier. |
order.checkoutSessionId |
String | The sessionId path parameter. |
order.permalinkUrl |
String | The URL where the shopper can view the order. |
lineItems |
Object[] | Final line items for the order. |
messages |
Object[] | Any messages to surface. |
reason |
String | Machine-readable failure reason if payment or fulfillment failed. |
Possible HTTP status codes
| HTTP | reason |
lineItems.status |
Description |
|---|---|---|---|
| 200 | None | IN_STOCK | Payment executed and order created. Return the response with the order object. |
| 422 | PAYMENT_FAILED | — | The payment was not successfully authorized. The POST /payments response included an unsuccessful authorization result. |
Make the payment request to Adyen
-
Make a POST /payments request, including the information from Adyen's request to your server:
Parameter in payment request Value paymentMethod.storedPaymentMethodIdThe value from paymentData.token.shopperReferenceThe sessionIdpath parameter.merchantAccountYour Adyen merchant account. amount.valueThe value from totals.total.value.amount.currencyThe value from totals.total.currency.shopperInteractionContAuth recurringProcessingModelUnscheduledCardOnFile referenceYour internal order reference.
(Optional) Order events after the purchase
Use the Order API to create an order after checkout and to send its current state after fulfillment or post-purchase changes. The AI shopping agent uses this data to answer shopper questions about their order, delivery, refunds, returns, and cancellations, for example "Where is my order?" or "Has my refund gone through?"
Send a complete order whenever its state changes. A request with the same id replaces the agent's view with the complete current order state.
Requirements
| Requirement | Description |
|---|---|
| Checkout integration | You have completed the Agentic Cart API integration. |
| Order identifier | You can provide a stable, unique identifier in id for each order. |
How it works
- Create an order after the shopper completes checkout.
- Send the complete order again when its fulfillment status changes, or when you refund, return, or cancel items.
- Retry the request if Adyen cannot relay the update to the shopping agent.
Use the following endpoint URL:
| Environment | Endpoint URL |
|---|---|
| Test | https://commerce-suite-test.adyen.com/commerce-suite/v1/orders |
| Live | https://commerce-suite-live.adyen.com/commerce-suite/v1/orders |
Create or update an order
Make a POST /agentic/orders request, including the following parameters:
To create or update an order:
- Send the order's complete current state in the request body.
- Check that you receive an HTTP 202 response.
Request headers:
| Header | Description |
|---|---|
X-API-Key |
Your Adyen API key. |
Content-Type |
Set to application/json. |
Request body:
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Your unique order identifier. | |
checkoutSessionId |
String | The sessionId from the checkout flow. |
|
label |
String | A human-readable order label. | |
permalinkUrl |
String | The URL of the order page on your website. | |
lineItems |
OrderLineItem[] | The items in the order. | |
fulfillment |
OrderFulfillment | How the items are delivered. | |
adjustments |
OrderAdjustment[] | Post-order changes, such as refunds, returns, or cancellations. | |
totals |
MerchantTotals | Financial summary for the order. | |
messages |
Message[] | Messages to show to the shopper or agent. |
Example request
Send fulfillment updates
When fulfillment progress changes, add the event to fulfillment.events and send the complete updated order. Events form an append-only log.
For example, add the following object to fulfillment.events when you ship a line item:
Send refunds, returns, and cancellations
When you make a post-purchase adjustment, add it to adjustments. Also update the affected line item's quantities.total and order totals as needed.
For example, add the following object to adjustments for a completed refund:
Adyen's response
Adyen relays your order synchronously to the shopping agent configured for the checkout session before responding to your request.
Responses:
| HTTP status | Meaning | What to do |
|---|---|---|
| 202 | Adyen relayed the order successfully. The response body is empty. | No further action is needed. |
| 409 | Another update for the same checkoutSessionId is being processed. |
Retry shortly after. |
| 422 | The referenced checkout session does not exist or does not belong to your company account. | Fix the request. Do not retry the same request. |
| 429 | You exceeded the rate limit for your company account. | Wait, then retry with a backoff strategy. |
| 500 or 503 | Adyen could not relay the order to the shopping agent. | Retry with a backoff strategy until you receive 202. |
Delivery and retries
When you call this endpoint, Adyen relays the order to the shopping agent configured for the checkout session synchronously, as part of the same request, before responding to you.
- If the relay to the agent succeeds, you get
202 Accepted. - If it fails (for example, the agent's endpoint is unreachable or times out), Adyen returns
503 Service Unavailable. Adyen does not queue the order or automatically retry the delivery.
It is your responsibility to retry the request until you receive a 202 Accepted response, using an appropriate backoff strategy. This endpoint does not use an Idempotency-Key, calling it again with the same id and checkoutSessionId updates the existing order rather than creating a duplicate, so retries are safe.
Test and go live
Use the Adyen sandbox to test your server's endpoints end-to-end before going live. The sandbox makes requests to your endpoints exactly like in the live environment.
Recommended test sequence
To verify your integration, follow these steps:
-
Register your test endpoints.
Make a POST
https://commerce-suite-test.adyen.com/commerce-suite/companies/v1/{CompanyAccount}/agentic/configurationrequest with your test base URL and enable the endpoints you want to test. -
Trigger a create session request.
Adyen makes a POST
/agentic/sessions/{sessionId}request. Your server responds withlineItems,fulfillmentOptions, andtotals. -
Test an update with address and fulfillment selection.
Adyen makes a POST
/agentic/sessions/{sessionId}request with an updated body. Confirm that your server returns recalculated totals. -
Test stock error handling.
Return a 422 response with
reason: OUT_OF_STOCK andmessages[]. -
Test commit (if enabled).
Adyen makes a POST
/agentic/sessions/{sessionId}/commitrequest. Your server responds with 200 OK to accept, or 422 withreason: RISK_REJECTED to reject. -
Test finalize.
Adyen makes a POST
/agentic/sessions/{sessionId}/finalizerequest. Your server responds with 204 No Content. Verify that the order is created in your system.
Go live
-
Before you go live, verify the following:
- You tested your integration end-to-end, including error scenarios.
- Your server validates the
Authorizationheader from each inbound request from Adyen. - Your server's endpoints respond within five seconds, under the load of the expected volume of requests in the live environment.
- Your server's create session and update session endpoints return 200 with the following:
lineItemsfulfillmentOptionstotals
- Your server's commit session endpoint validates the
X-Merchant-Accountheader in the request. - Your server's finalize session endpoint:
- Validates the
X-Merchant-Accountheader in the request. - Returns 204 No Content (no response body).
- Validates the
- Your server's cancel session endpoint returns:
- 204: For a successful request.
- 409: If the session cannot be cancelled.
- For each 422 response from your server:
- The response body includes the following
MerchantMessageparameters: codecontenttype- The response body includes the
AgenticReasonCodeobject.
- The response body includes the following
- Your server's complete session endpoint (advanced flow):
- Includes an
order.permalinkUrlthat is a stable and publicly accessible URL. - The
marketingConsentsobject that applies to shopper preferences is stored in a persistent way. - The
affiliateAttributiondata is stored for reporting.
- Includes an
-
Make the one-time configuration request to Adyen, using the live endpoint URL:
https://commerce-suite-live.adyen.com/commerce-suite/companies/v1/{CompanyAccount}/agentic/configuration.
Sequence diagrams
Standard flow (ACP):
Advanced flow (ACP):
Standard flow (UCP):
Schema reference
The following shows the objects used in the request and response bodies for /agentic/sessions.
MerchantItemRequest
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Product or SKU identifier. | |
quantity |
Integer | Units requested. Must be 1 or more. |
MerchantAddress
| Parameter | Type | Required | Description |
|---|---|---|---|
street |
String | Primary street name. | |
houseNumberOrName |
String | House number or building name. | |
city |
String | City name. | |
stateOrProvince |
String | State or province code (ISO 3166-2). | |
country |
String | ISO 3166-1 alpha-2 country code, for example, US, GB, NL. | |
postalCode |
String | ZIP or postal code. |
MerchantShopper
| Parameter | Type | Required | Description |
|---|---|---|---|
email |
String | The shopper's email address. | |
firstName |
String | The shopper's first name. | |
lastName |
String | The shopper's last name. | |
phoneNumber |
String | The shopper's phone number. |
MerchantFulfillment
| Parameter | Type | Required | Description |
|---|---|---|---|
selectedFulfillmentOptionId |
String | The id of the fulfillment option the shopper selected. |
MerchantDiscountsRequest
| Parameter | Type | Required | Description |
|---|---|---|---|
codes |
String[] | Discount or promo codes submitted by the shopper. |
MerchantDiscountsResponse
| Parameter | Type | Required | Description |
|---|---|---|---|
codes |
String[] | All submitted codes echoed back. | |
applied |
MerchantAppliedDiscount[] | Successfully applied discounts. | |
rejected |
MerchantRejectedDiscount[] | Rejected codes with reason. |
MerchantAppliedDiscount
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Unique identifier for this applied discount. | |
amount |
Integer (int64) | Total discount amount in minor currency units. | |
coupon |
MerchantCoupon | The coupon definition. | |
code |
String | The discount code string. | |
automatic |
Boolean | true if applied automatically without a code. | |
method |
String | How the discount is allocated: each (per line item) or across (proportional). | |
allocations |
MerchantDiscountAllocation[] | Per-line-item breakdown. Each entry has path (JSON pointer) and amount. |
|
start |
String (date-time) | Discount validity start. | |
end |
String (date-time) | Discount validity end. |
MerchantDiscountAllocation
| Parameter | Type | Required | Description |
|---|---|---|---|
amount |
Integer (int64) | Discount amount allocated to this line item in minor currency units. | |
path |
String | JSON pointer to the line item, for example, /lineItems/0. |
MerchantRejectedDiscount
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
String | The discount code that was rejected. | |
reason |
MerchantDiscountErrorCode | Machine-readable rejection reason. | |
message |
String | Human-readable explanation. Surface this to the shopper. |
MerchantDiscountErrorCode
| Value | Description |
|---|---|
| discount_code_expired | The discount code has passed its expiry date. |
| discount_code_invalid | The code does not exist or is malformed. |
| discount_code_already_applied | This code has already been applied to the session. |
| discount_code_combination_disallowed | This code cannot be combined with other active discounts. |
| discount_code_minimum_not_met | Cart total does not meet the minimum order value for this code. |
| discount_code_user_not_logged_in | Code requires the shopper to be authenticated. |
| discount_code_user_ineligible | The shopper does not qualify for this discount. |
| discount_code_usage_limit_reached | Maximum redemption count has been reached. |
MerchantCoupon
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Unique coupon identifier. | |
name |
String | Human-readable coupon name. | |
percentOff |
Integer (int32) | Percentage discount (0–100). | |
amountOff |
Integer (int64) | Fixed discount amount in minor currency units. | |
currency |
String | Currency of amountOff (ISO 4217). |
|
duration |
String | once, repeating, or forever. | |
durationInMonths |
Integer (int32) | Number of months when duration is repeating. |
|
maxRedemptions |
Integer (int32) | Maximum redemption count. | |
timesRedeemed |
Integer (int32) | How many times this coupon has been redeemed. | |
metadata |
Object | Arbitrary string key-value metadata. |
MerchantMarketingConsent
| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
String | Marketing channel, for example, email, sms, push. | |
optedIn |
Boolean | The shopper's consent decision. true = opted in; false = opted out. |
MerchantMarketingConsentOption
Return these in your session response to surface consent options to the shopper through the agent.
| Parameter | Type | Required | Description |
|---|---|---|---|
channel |
String | Channel identifier, for example, email, sms. | |
displayText |
String | Localized consent prompt to show to the shopper. | |
privacyPolicyUrl |
String | URL to your privacy policy for this channel. | |
isSubscribed |
Boolean | Pre-populated subscription state for returning shoppers. |
MerchantAffiliateAttribution
| Parameter | Type | Required | Description |
|---|---|---|---|
provider |
String | Attribution provider identifier, for example, impact.com. | |
token |
String | Provider-issued attribution token. | |
publisherId |
String | Affiliate or publisher identifier. | |
campaignId |
String | Campaign identifier. | |
creativeId |
String | Creative identifier. | |
subId |
String | Sub-tracking identifier. | |
touchpoint |
String | Attribution touchpoint: first (session create) or last (session complete). | |
source |
Object | Source context. Required field: type (url, platform, or unknown). Optional: url. |
|
issuedAt |
String (date-time) | When the attribution token was issued. | |
expiresAt |
String (date-time) | When the attribution token expires. | |
metadata |
Object | Arbitrary key-value metadata. |
MerchantLink
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
String | Link category, for example, terms_of_service, return_policy, privacy_policy. | |
url |
String | Fully qualified URL. |
The following shows the objects used in the request and response bodies for /agentic/orders.
OrderLineItem
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Your unique line item identifier. | |
item |
MerchantItem | The item that the shopper purchased. | |
quantities |
OrderQuantity | Quantity information for this line item. | |
status |
String | The line item status: processing, partial, fulfilled, or removed. | |
parentId |
String | The parent line item identifier when this item is part of a bundle. | |
amount |
MerchantAmount | Base amount before discount. | |
discount |
MerchantAmount | Discount applied to this line item. | |
subtotal |
MerchantAmount | Subtotal after discount. | |
taxAmount |
MerchantAmount | Tax applied to this line item. | |
totalAmount |
MerchantAmount | Total amount for this line item. |
OrderQuantity
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
Integer | Current active quantity. Reduce this value after cancellations or returns. | |
fulfilled |
Integer | Quantity fulfilled so far. | |
original |
Integer | Quantity originally ordered, before cancellations or returns. |
MerchantItem
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Item identifier. | |
title |
String | Item title. | |
price |
MerchantAmount | Item price. | |
imageUrl |
String | URL of the item image. |
MerchantAmount
| Parameter | Type | Required | Description |
|---|---|---|---|
value |
Integer (int64) | Amount in minor units. | |
currency |
String | ISO 4217 currency code. |
OrderFulfillment
| Parameter | Type | Required | Description |
|---|---|---|---|
expectations |
OrderExpectation[] | Delivery promises for the order line items. | |
events |
OrderFulfillmentEvent[] | Append-only log of fulfillment progress events. |
OrderExpectation
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Expectation identifier. | |
lineItems |
OrderLineItemRef[] | Line items covered by this expectation. | |
methodType |
String | Fulfillment method: shipping, pickup, digital, or other. | |
deliveryAddress |
MerchantAddress | Delivery destination. | |
description |
String | Human-readable delivery description, such as a delivery window. | |
fulfillableOn |
String | Set to now or custom. | |
fulfillableAt |
String (ISO 8601) | Required when fulfillableOn is custom. |
|
recipient |
MerchantShopper | Recipient contact details. |
OrderFulfillmentEvent
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Event identifier. | |
lineItems |
OrderLineItemRef[] | Line items affected by the event. | |
occurredAt |
String (ISO 8601) | Time when the event occurred. | |
type |
String | Event type: processing, shipped, in_transit, delivered, failed_attempt, canceled, undeliverable, returned_to_sender, or other. | |
carrier |
String | Carrier name. | |
trackingNumber |
String | Carrier tracking number. | |
trackingUrl |
String | URL where the shopper can track the shipment. | |
description |
String | Human-readable event description. |
OrderAdjustment
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Adjustment identifier. | |
type |
String | Adjustment type: refund, return, credit, dispute, or cancellation. | |
status |
String | Adjustment status: pending, completed, or failed. | |
occurredAt |
String (ISO 8601) | Time when the adjustment occurred. | |
lineItems |
OrderLineItemRef[] | Affected line items. Use negative quantities for reductions. | |
totals |
MerchantTotals | Signed financial effect of the adjustment. | |
description |
String | Human-readable reason for the adjustment. |
OrderLineItemRef
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
String | Referenced line item identifier. | |
quantity |
Integer | Referenced quantity. This value can be negative for an adjustment. |
MerchantTotals
| Parameter | Description |
|---|---|
subtotal |
Sum of line items before extras. |
itemsBaseAmount |
Base amount of items before discount. |
itemsDiscount |
Discount applied to items. |
discount |
Order-level discount. |
fulfillment |
Shipping or fulfillment cost. |
fee |
Fees applied. |
tax |
Tax amount. |
total |
Grand total. |
All MerchantTotals values are MerchantAmount objects.
MerchantAddress
| Parameter | Type | Description |
|---|---|---|
street |
String | Street name, excluding house number. |
houseNumberOrName |
String | House or apartment number or name. |
city |
String | City name. |
stateOrProvince |
String | State or province. |
postalCode |
String | Postal code. |
country |
String | Two-character ISO 3166-1 alpha-2 country code. |
MerchantShopper
| Parameter | Type | Description |
|---|---|---|
firstName |
String | First name. |
lastName |
String | Last name. |
email |
String | Email address. |
phoneNumber |
String | Phone number. |
Message
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
String | Message type: info, warning, or error. | |
code |
String | Structured message code. Valid values depend on the message type, for example, product_out_of_stock or shipping_destination_unsupported. | |
content |
String | Human-readable message. | |
path |
String | JSONPath to the related field. |