Build an ecommerce experience that is native to ChatGPT, where your shoppers can make transactions directly inside of the chat interface. Using the OpenAI Apps SDK, you can create custom, interactive ecommerce interfaces where users can browse, select, and pay without leaving the AI chat. Adyen securely processes payments initiated by these interactions with AI agents, ensuring a seamless flow from chat to checkout.
Requirements
| Requirement | Description |
|---|---|
| Integration type | An online payments integration. |
| Setup steps | Before you begin:
|
| Limitations | Instant Checkout availability is limited. If it is not available to you, you can instead redirect shoppers to your own checkout page. By redirecting shoppers to your own checkout page, you have full control over the checkout experience and can use any online payments integration, like Drop-in/Components or Hosted Checkout. |
How it works
To accept payments in your ChatGPT app with Adyen, you need to implement the following components:
| Component | Description |
|---|---|
| Checkout session creation tool | An MCP tool that creates a checkout session with line items, totals, and Adyen as the payment provider. |
| Widget | Your ChatGPT app UI component that displays the cart and calls window.openai.requestCheckout to initiate payment. |
| complete_checkout tool | An MCP tool that receives the ACP token from OpenAI and calls Adyen to authorize the payment. |
Create MCP tools that correspond to the Agentic Checkout Spec (ACS) REST endpoints:
| MCP tool | ACS endpoint |
|---|---|
| Checkout session tool |
POST /checkout_sessions
|
| complete_checkout |
POST /checkout_sessions/{id}/complete
|
Transaction flow
When a shopper initiates a transaction in the chat interface, the following flow occurs:
- Shopper initiates transaction: The shopper prompts the AI agent to buy something from you, and the checkout session tool from your MCP server is invoked.
- Server prepares session: Your MCP tool returns checkout session data (session ID, line items, totals, Adyen as the payment provider) in
structuredContent. - Widget previews cart: Your widget renders the line items and totals so that the shopper can review and confirm.
- Widget calls requestCheckout: When the shopper selects the button to continue with checkout, your widget calls
window.openai.requestCheckout(session_data). ChatGPT opens the Instant Checkout UI and shows available payment methods. - Shopper selects payment method and pays: The shopper selects their payment method and clicks Pay. ChatGPT communicates with Adyen to register the Agentic Commerce Protocol (ACP) token, then calls the
complete_checkouttool from your MCP server with the ACP token inpayment_data.token. - Server authorizes payment: Your
complete_checkouttool uses the ACP token to make a payment request to Adyen. Adyen authorizes the payment and returns the result. - Order confirmation: Your MCP tool returns payment result to ChatGPT, which passes it to your widget. Your widget displays the payment result to the shopper.
The following diagram shows the interaction between the shopper in the chat interface, your app widget, the Apps SDK, your MCP server, and Adyen's server.
Build your checkout session tool
Create an MCP tool that returns the checkout session data in the payment_provider object in structuredContent. Include in the merchant_id field:
It must include the following:
| Field | Description |
|---|---|
provider |
adyen |
merchant_id |
Your Adyen merchant account. |
supported_payment_methods |
An array of supported payment methods. Example: [scheme] |
For the full checkout session payload structure, go to the Agentic Checkout Spec.
Build your widget
Create a widget that handles the checkout UI and initiates the payment flow. Your widget must:
- Receive the checkout session data from your MCP tool via
structuredContent. - Render the cart (line items, totals, terms) so the shopper can review before paying.
- Call
window.openai.requestCheckout(session_data)when the shopper clicks to proceed.
Call requestCheckout
When the shopper indicates that they are ready to pay, call window.openai.requestCheckout with your checkout session data. This opens the Instant Checkout UI where the shopper selects their payment method.
The function returns a promise that resolves with the order result or rejects on error or cancellation.
For further details on building widgets, go to the OpenAI Apps SDK monetization guide.
Build your complete_checkout tool
When the shopper selects a payment method and selects the pay button, OpenAI calls the complete_checkout tool from your MCP server with the ACP token in payment_data.token. Use this token to authorize the payment with Adyen.
For the Adyen API request details, go to Authorize a payment with the ACP token.
Handle errors
Your complete_checkout tool can return error messages to handle payment failures. The following error codes are displayed on the Instant Checkout UI:
| Error code | Description |
|---|---|
payment_declined |
The payment was declined by Adyen. |
requires_3ds |
The payment requires 3D Secure authentication. |
All other error messages are returned to your widget as a response to requestCheckout, where you can show them.
For the full list of error codes, go to the ACP error messages specification.
Testing
Use ChatGPT's test payment mode with the Adyen test environment to test your integration without processing real payments.
-
Use your test Adyen merchant account and your test API credentials.
-
Set
payment_mode: testin yourrequestCheckoutcall. -
Use Adyen test card numbers, for example: 4111 1111 1111 1111.
-
Verify that you receive test payments:
- In your test Customer Area, test payments show up in the payment list. Go to Transactions > Payments.
- For each test payment, we send you a webhook message.
Go live
After you submit your ChatGPT app, do not use test payment mode, because it is exposed to users in the live environment.
When you are ready to accept live payments:
- Switch to your live Adyen merchant account.
- Update your MCP server to use your live API credentials and an idempotency key for each request to Adyen.
- Set
payment_mode: "live"in yourrequestCheckoutcall. - Submit your ChatGPT app for review.