Checkout icon

In-Chat App Integration

Accept payments in your ChatGPT app using Adyen.

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:
  • Build your ChatGPT app, following the OpenAI Apps SDK documentation.
  • Set up your MCP server to connect ChatGPT with your backend.
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:

  1. 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.
  2. Server prepares session: Your MCP tool returns checkout session data (session ID, line items, totals, Adyen as the payment provider) in structuredContent.
  3. Widget previews cart: Your widget renders the line items and totals so that the shopper can review and confirm.
  4. 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.
  5. 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_checkout tool from your MCP server with the ACP token in payment_data.token.
  6. Server authorizes payment: Your complete_checkout tool uses the ACP token to make a payment request to Adyen. Adyen authorizes the payment and returns the result.
  7. 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.

CnNlcXVlbmNlRGlhZ3JhbQoKcGFydGljaXBhbnQgU2hvcHBlciBhcyBTaG9wcGVyCnBhcnRpY2lwYW50IFdpZGdldCBhcyBXaWRnZXQKcGFydGljaXBhbnQgU0RLIGFzIEFwcHMgU0RLCnBhcnRpY2lwYW50IE1DUCBhcyBZb3VyIE1DUCBTZXJ2ZXIKcGFydGljaXBhbnQgQWR5ZW4gYXMgQWR5ZW4KClNob3BwZXItPj5XaWRnZXQ6IFByb21wdCB0byBzdGFydCB0cmFuc2FjdGlvbgpXaWRnZXQtPj5TREs6IEludm9rZSBjaGVja291dCB0b29sClNESy0+Pk1DUDogQ2FsbCBjaGVja291dCB0b29sCk1DUC0tPj5TREs6IFJldHVybiBjaGVja291dCBzZXNzaW9uIGRhdGEgKHByb3ZpZGVyOiBhZHllbikKU0RLLS0+PldpZGdldDogUmV0dXJuIHN0cnVjdHVyZWQgY29udGVudApXaWRnZXQtLT4+U2hvcHBlcjogU2hvdyBwcm9kdWN0IHBhZ2UKU2hvcHBlci0+PldpZGdldDogU2VsZWN0IGJ1dHRvbiB0byBjb250aW51ZSB3aXRoIGNoZWNrb3V0CldpZGdldC0+PlNESzogQ2FsbCB3aW5kb3cub3BlbmFpLnJlcXVlc3RDaGVja291dApTREstLT4+U2hvcHBlcjogU2hvdyBwYXltZW50IHBhZ2UKU2hvcHBlci0+PlNESzogU2VsZWN0IHBheW1lbnQgbWV0aG9kClNESy0+Pk1DUDogQ2FsbCBjb21wbGV0ZV9jaGVja291dApNQ1AtPj5BZHllbjogTWFrZSBQT1NUIC9wYXltZW50cyByZXF1ZXN0CkFkeWVuLS0+Pk1DUDogUmV0dXJuIHBheW1lbnQgcmVzdWx0Ck1DUC0tPj5TREs6IFJldHVybiBvcmRlciBpbmZvcm1hdGlvbgpTREstLT4+V2lkZ2V0OiBSZXR1cm4gb3JkZXIgY29uZmlybWF0aW9uCldpZGdldC0tPj5TaG9wcGVyOiBTaG93IHBheW1lbnQgcmVzdWx0Cg==

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:

  1. Receive the checkout session data from your MCP tool via structuredContent.
  2. Render the cart (line items, totals, terms) so the shopper can review before paying.
  3. 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.

  1. Use your test Adyen merchant account and your test API credentials.

  2. Set payment_mode: test in your requestCheckout call.

  3. Use Adyen test card numbers, for example: 4111 1111 1111 1111.

  4. Verify that you receive test payments:

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:

  1. Switch to your live Adyen merchant account.
  2. Update your MCP server to use your live API credentials and an idempotency key for each request to Adyen.
  3. Set payment_mode: "live" in your requestCheckout call.
  4. Submit your ChatGPT app for review.