Skip to content
Create account or Sign in
The Stripe Docs logo
/
Ask AI
Create accountSign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
APIs & SDKsHelp
Overview
Get started with Connect
Design your integration
    Interactive platform guide
    SaaS platform
      Quickstart
      Essential tasks
        Create a connected account
        Set up Dashboard access
        Onboard a connected account
        Accept a payment
        Collect platform fees
        Charge service fees
        Pay out to connected accounts
        Handle refunds and disputes
        Enable in-context shopping on AI agents
    Marketplace
Integration fundamentals
Example integrations
Account management
Onboard accounts
Configure account Dashboards
Work with connected account types
Payment processing
Accept payments
Pay out to accounts
Platform administration
Manage your Connect platform
Tax forms for your Connect platform
United States
English (United States)
HomePlatforms and marketplacesDesign your integrationSaaS platformEssential tasks

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_management_manual_upload as 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.
Command Line
curl https://files.stripe.com/v1/files \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
: \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}" \ -F purpose=data_management_manual_upload \ -F file="@/path/to/your/file.csv;type=text/csv"

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 id returned
  • The preview header (for example,Stripe-Version: 2025-09-30.clover;udap_beta=v1)
Command Line
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
sk_test_BQokikJOvBiI2HlWgH4olfQ2
: \ -d file={{FILE_ID}} \ --data-urlencode standard_data_format="product_catalog_feed"

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_with_errors, pending_archive, or archived.

Command Line
curl https://api.stripe.com/v1/data_management/import_sets/{{IMPORT_SET_ID}} \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
: \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}"

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_with_errors, you can download the error report:

  1. Find the result.errors.file field in the response.
  2. Use the Files API to retrieve the error file by its ID.
  3. The downloaded CSV contains your original data with a leading column named stripe_error_message that describes why each row failed.
Command Line
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_error_message 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.session.completed and payment_intent.succeeded. 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.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl -X POST https://api.stripe.com/v1/payment_intents/pi_3MrPBM2eZvKYlo2C1TEMacFD/capture \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

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:

  1. Specify the endpoint in the Dashboard that Stripe calls.
  2. 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_data_format to inventory_feed:

Command Line
# Step 1: Upload your CSV using the Files API curl https://files.stripe.com/v1/files \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
: \ -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}}" \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
: \ -d file={{FILE_ID}} \ --data-urlencode standard_data_format="inventory_feed"

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.

Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc