Enable in-context shopping on AI agentsPrivate preview
Learn how to let your businesses sell their products on AI chat agents.
Private preview
If you’re interested in using agentic commerce to sell your businesses’ products through AI agents, including Instant Checkout in ChatGPT, or to manage transactions between buyers and businesses, join the waitlist.
Share information about your business
To configure your platform and connected accounts for in-context agentic selling, provide the following details:
- Platform Stripe account ID.
- Connected account IDs. Provide a list of connected account IDs to enable for in-context agentic selling. You can send a spreadsheet or a plain text file with one account ID per row.
Upload your product catalog data to Stripe
Prepare your product catalog
Create a CSV file that conforms to the Stripe product catalog specification for each connected account. Stripe shares the specification separately.
Upload the catalog data to Stripe
Deliver the feed through the Stripe APIs. You can send updates every 15 minutes.
Use the sandbox to validate parsing, field mappings, and data quality before enabling live updates.
First, upload your product catalog CSV using the Files API. A successful request returns a File object, which includes the id.
- Specify
data_asmanagement_ manual_ upload purpose. - Make sure the MIME type matches the file format. Acceptable formats include CSV and TSV, where each row represents one product or variant.
- The maximum file size is 200 MB.
curl https://files.stripe.com/v1/files \ -u: \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}" \ -F purpose=data_management_manual_upload \ -F file="@/path/to/your/file.csv;type=text/csv"sk_test_BQokikJOvBiI2HlWgH4olfQ2
Then, use the Data Management API to create an ImportSet. This call starts catalog processing and makes the data available in the Dashboard. Include the following:
- The file
idreturned - The preview header (for example,
Stripe-Version: 2025-09-30.)clover;udap_ beta=v1
curl https://api.stripe.com/v1/data_management/import_sets \ -H "Stripe-Version: 2025-09-30.clover;udap_beta=v1" \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}" \ -u: \ -d file={{FILE_ID}} \ --data-urlencode standard_data_format="product_catalog_feed"sk_test_BQokikJOvBiI2HlWgH4olfQ2
Monitor feed status
Stripe processes the catalog data, validating and cleaning it before indexing in a format Stripe validates and cleans the catalog data, indexes it, and converts it to a format for AI agents. Monitor indexing progress using the status field on the import set. The status can be pending, failed, succeeded, succeeded_, pending_, or archived.
curl https://api.stripe.com/v1/data_management/import_sets/{{IMPORT_SET_ID}} \ -u: \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}"sk_test_BQokikJOvBiI2HlWgH4olfQ2
The response includes the status and any errors:
{ "id": "impset_7MabcdZ8b617780e5145413", "object": "data_management.import_set", "created": 1643992696, "livemode": true, "result": { "errors": { "file": "file_234923sIENc", "row_count": 30 }, "rows_processed": 120, "successes": { "row_count": 90 } }, "status": "succeeded_with_errors" }
If your import status is succeeded_, you can download the error report:
- Find the
result.field in the response.errors. file - Use the Files API to retrieve the error file by its ID.
- The downloaded CSV contains your original data with a leading column named
stripe_that describes why each row failed.error_ message
curl https://files.stripe.com/v1/files/{{ERROR_FILE_ID}}/contents \ -u:sk_test_BQokikJOvBiI2HlWgH4olfQ2
The API returns a CSV file containing only the rows that failed, with a stripe_ column describing each error.
Respond to purchases and fulfill orders
Listen to Stripe webhooks to monitor orders made on AI chat agents.
When an order is confirmed, Stripe emits webhook events that your server can handle to run fulfillment logic. Set up an endpoint on your server to accept, process, and acknowledge these events. See the webhooks guide for step-by-step instructions on integrating with and testing Stripe webhooks.
Stripe emits checkout. and payment_. If your fulfillment logic already handles these events, you don’t need additional integration changes. You can customize your fulfillment logic for in-context agentic selling (for example, by noting in your order confirmation email that the checkout occurred through an agent).
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY); // Use the secret provided by Stripe CLI for local testing // or your webhook endpoint's secret const endpointSecret = 'whsec_...'; app.post('/webhook', (request, response) => { const sig = request.headers['stripe-signature']; let event; try { event = stripe.webhooks.constructEvent(request.body, sig, endpointSecret); } catch (err) { response.status(400).send(`Webhook Error: ${err.message}`); return; } if (event.type === 'checkout.session.completed') { const session = event.data.object; // Fulfill the order using the session data fulfillCheckout(session.id); } response.status(200).send(); });
OptionalManual capture
By default, payments are captured immediately when a purchase is made. To set up manual capture, configure it in the Dashboard. When you enable manual capture, call the capture method on the PaymentIntent returned in the webhook described in the previous section.
OptionalManual approval hook
By default, before confirming a payment, Stripe checks inventory based on your product catalog data and runs fraud checks with Radar. If you need additional control over whether to complete a purchase, configure a manual approval hook. Before completing checkout, Stripe sends an approval request to your service. You then approve or decline the request.
To set up a manual approval hook:
- Specify the endpoint in the Dashboard that Stripe calls.
- Implement your logic at the endpoint and use the following request and response formats.
Here’s an example approval request that Stripe sends to your service:
POST /stripe/v1/approve HTTP/1.1 Host: api.my-xyz.com Stripe-Version: V1 Stripe-Signature: CFweQMS7wvH4VHUuRbYHsuOJEzx9pCd5eMLBDPR8zAtLF4bgGF3Zo4pzhXR5c7/uCQeg4OnRC8ZjF3GCMuDNDQ== { "id": "cs_123", "created_at": 1663048712, "livemode": false, "amount_total": 2900, "currency": "usd", "line_items": { ... }, "payment_method_details": { "type": "card", "billing_details": { ... }, "card": { "brand": "discover", ... } } }
Here are example responses to approve or reject the request:
HTTP/1.1 200 OK Stripe-Version: V1 { "id": "cs_123", "result": { "type": "approved" } }
HTTP/1.1 200 OK Stripe-Version: V1 { "id": "cs_123", "result": { "type": "declined", "declined": { "reason": "low_inventory" } } }
OptionalEmbedded component
Note
This embedded component is in active development. The code snippets are for illustrative purposes only and are subject to change.
Stripe offers an embedded component to help onboard connected accounts to agentic commerce. This Stripe-hosted component lets connected accounts manage which AI agents can sell their products and customize how their business appears across agent platforms.
The following code example shows how your platform can integrate with this embedded component. For details on how to embed dashboard functionality into your website, see Get started with Connect embedded components.
// server.js const stripe = require("stripe")( 'sk_123', { apiVersion: 'YYYY-MM-DD'} ); // POST /account_session_token const accountSession = await stripe.accountSessions.create({ account: '{{CONNECTED_ACCOUNT_ID}}', components: { agentic_commerce: { enabled: true, }, }, }, { apiVersion: `${STRIPE_API_VERSION}; embedded_connect_beta=v2`, }); response.json({ accountSessionToken: accountSession.client_secret });
// App.jsx import { ConnectAgenticCommerce, ConnectComponentsProvider, } from "@stripe/react-connect-js"; import { loadConnectAndInitialize } from "@stripe/connect-js"; const AgenticCommerce = () => { const [stripeConnectInstance] = React.useState(() => { const fetchClientSecret = async () => { const response = await fetch('/account_session', { method: "POST" }); if (!response.ok) { const {error} = await response.json(); console.log('An error occurred: ', error); return undefined; } else { const {client_secret: clientSecret} = await response.json(); return clientSecret; } }; return loadConnectAndInitialize({ publishableKey: "pk_123", fetchClientSecret: fetchClientSecret, }) }); return ( <div> <ConnectComponentsProvider connectInstance={stripeConnectInstance}> <ConnectAgenticCommerce /> </ConnectComponentsProvider> </div> ) }
OptionalSend incremental inventory updates
In addition to uploading your product catalog, you can send individual product inventory updates using the Inventory Feed API. Use the same upload process as catalog uploads, but set standard_ to inventory_:
# Step 1: Upload your CSV using the Files API curl https://files.stripe.com/v1/files \ -u: \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}" \ -F purpose=data_management_manual_upload \ -F file="@/path/to/your/file.csv;type=text/csv" # Step 2: Create an ImportSet object curl https://api.stripe.com/v1/data_management/import_sets \ -H "Stripe-Version: 2025-09-30.clover;udap_beta=v1" \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}" \ -usk_test_BQokikJOvBiI2HlWgH4olfQ2: \ -d file={{FILE_ID}} \ --data-urlencode standard_data_format="inventory_feed"sk_test_BQokikJOvBiI2HlWgH4olfQ2
OptionalHandle refunds and disputes
If you already use the PaymentIntents or Checkout Sessions API, your existing refunds and disputes integration doesn’t require changes for in-context agentic selling. PaymentIntents are still created for in-context agentic selling flows. As long as you associate the PaymentIntent ID with your order, your refunds and disputes integration continues to work.
After checkout succeeds, you can initiate a refund if a customer cancels the order from your website or through customer service. If you already use the Checkout Sessions or PaymentIntents API, your existing refund flow works without changes for in-context agentic selling.
Manage refunds and disputes without code in the Dashboard from the Transactions page.
To handle refunds programmatically, integrate with the Refunds API for post-checkout cancellation or refund requests.