Skip to main content
Gr4vy Embed renders a PCI-compliant payment form inside the checkout widget. The integration has a server-side component (embed token generation) and a client-side component (loading the payment form).

Payment method support inside ChatGPT

ChatGPT renders each widget in a sandboxed iframe that cannot open popups or navigate the top-level page. Gr4vy Embed’s redirect handling—the redirectMode options—relies on one of those two capabilities. As a result, any payment method whose flow ends in an approval_url on a third-party domain cannot finish inside a ChatGPT app today.
A payment method works inside ChatGPT only when its entire authentication flow stays within the nested iframe, with no popup and no top-level redirect.
  • Card is fully supported. Secure Fields capture the card details in the iframe, and the 3-D Secure (3DS) challenge renders in the iframe.
  • Venmo is supported. Its approval flow uses a QR code that the buyer scans on a separate device, so nothing in the iframe needs to redirect.
  • Other methods may work when their flow never leaves the iframe. For example, Apple Pay uses the browser-native payment sheet, which the operating system presents rather than the iframe. This is not guaranteed—test each method before relying on it.
  • Redirect-based methods do not work. Methods that send the buyer to a third-party domain to authenticate, such as PayPal, cannot complete inside a ChatGPT app.
A stored (vaulted) payment method often works even when its first-time flow would not, because the redirect-based consent happened when the buyer first stored the method. A later charge against the stored token usually runs without a redirect. This is not guaranteed for every payment service provider, so test the stored-method flow as well.
1

Generate the embed token (server-side)

Use the Gr4vy SDK to generate a signed JWT embed token:
The JWT token pins the payment amount and cart items. If the checkout widget passes mismatched values to gr4vy.setup(), Gr4vy rejects the request. The values must match exactly.
2

Load Gr4vy Embed in the checkout widget

The checkout widget follows the same widget lifecycle as other widgets. After receiving the embed configuration from start_checkout, it loads the Gr4vy Embed script and initialises the payment form. This code runs inside the widget regardless of server language.Receive the embed configuration
Load the Gr4vy Embed scriptDynamically load the Gr4vy Embed library from your instance’s CDN:
Initialise Gr4vy EmbedCall gr4vy.setup() to render the payment form. The amount, currency, and merchantAccountId must match what was pinned in the JWT token:
Gr4vy Embed needs a <form> wrapper and a container <div> with id attributes matching gr4vy.setup():
Gr4vy Embed renders PCI-compliant input fields inside #embed-container. Your app handles the surrounding UI—order summary, result screens, and the submit button. See the reference implementation for a complete example.
3

Verify payment outcomes with webhooks

For production, verify payment outcomes via Gr4vy webhooks rather than relying on client-side callbacks:
Configure the webhook URL in your Gr4vy dashboard (https://your-domain.com/webhooks/gr4vy).
Continue to deploy your app to ChatGPT.