How to Place Orders on Merchant Sites from an AI Agent

To place an order on a merchant website from an AI agent or an app, you send one API call with the product, the customer details and a payment session. An agentic checkout platform then completes the order on the merchant’s own site and reports the result by webhook. This guide walks through the full flow with CartAI.

The short answer

An agent can find a product on its own. Buying it is harder, because checkout sits behind carts, forms, logins, payment fields and fraud checks that are different on every merchant site. An agentic checkout API takes that work off your agent. You describe the order in one request and the platform runs the checkout on the merchant’s site, from cart through payment to the confirmation page.

With CartAI the merchant does not integrate anything, the merchant stays the merchant of record, and your customer never leaves your product.

Three ways an agent can place an order today

  1. Merchant protocols and feeds. Some merchants expose a checkout protocol or an API that agents can call directly. This is clean where it exists. Coverage is limited to the merchants that have built it.

  2. Browser automation you build yourself. You give your agent a browser and write the checkout logic for each merchant. You then own payments, logins, bot detection, retries and every site change. See Browser automation vs agentic checkout for what that involves.

  3. A checkout API. You send one request and a platform completes the order on the merchant’s own site. No merchant integration is needed, so it works on merchant sites worldwide. This is what the rest of this guide covers.

What you need before the first order

  • A CartAI API key. The key is free and signup is self serve at portal.cartai.ai.

  • A product page URL, or a product name and the merchant’s website.

  • The customer’s contact details and shipping address.

  • A payment session, which you create in step 2.

Every request goes to https://api.cartai.ai and carries your key in the x-api-key header.

Step 1. Find and price the product

This step is optional. If you already have the product page URL, skip to step 2. Search returns ranked products across merchants with a name, merchant, image, starting price and a direct URL.

curl https://api.cartai.ai/product/search \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "running shoes"}'
curl https://api.cartai.ai/product/search \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "running shoes"}'
curl https://api.cartai.ai/product/search \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "running shoes"}'

Two more calls help before you buy. POST /product/details returns variants with price and availability for a product URL. POST /checkout-estimates returns subtotal, shipping, tax and total for a destination, so your customer sees the real price before the order is placed.

Step 2. Let the customer authorize payment

Create a payment session and send your customer to the secure page it returns. The customer authorizes their card once. The session runs on Visa Intelligent Commerce, Mastercard Agent Pay or a Stripe Link wallet, and card data never touches your servers or your agent.

curl https://api.cartai.ai/payment/session \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "price": "120",
    "purpose": "Running shoes order"
  }'
curl https://api.cartai.ai/payment/session \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "price": "120",
    "purpose": "Running shoes order"
  }'
curl https://api.cartai.ai/payment/session \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "price": "120",
    "purpose": "Running shoes order"
  }'

The response includes a url for the customer and a sessionId that you pass into the checkout request.

Step 3. Create the checkout

Send the product, the customer and the payment session in one request. Checkout is asynchronous. The call returns right away with a task ID, and the order runs in the background.

curl https://api.cartai.ai/checkout \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "contact": {
        "firstName": "Jane",
        "lastName": "Doe",
        "phone": "+1 555 010 0000",
        "email": "jane@example.com"
      },
      "shippingAddress": {
        "addressLine1": "123 Main St",
        "city": "Austin",
        "province": "TX",
        "postalCode": "78701",
        "country": "US"
      },
      "payment": { "data": { "sessionId": "SESSION_ID" } }
    },
    "tasks": [
      {
        "url": "https://merchant.example/products/running-shoe",
        "quantity": 1,
        "selectedVariant": { "color": "Black", "size": "10" }
      }
    ],
    "options": { "allowInteraction": true }
  }'
curl https://api.cartai.ai/checkout \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "contact": {
        "firstName": "Jane",
        "lastName": "Doe",
        "phone": "+1 555 010 0000",
        "email": "jane@example.com"
      },
      "shippingAddress": {
        "addressLine1": "123 Main St",
        "city": "Austin",
        "province": "TX",
        "postalCode": "78701",
        "country": "US"
      },
      "payment": { "data": { "sessionId": "SESSION_ID" } }
    },
    "tasks": [
      {
        "url": "https://merchant.example/products/running-shoe",
        "quantity": 1,
        "selectedVariant": { "color": "Black", "size": "10" }
      }
    ],
    "options": { "allowInteraction": true }
  }'
curl https://api.cartai.ai/checkout \
  -H "x-api-key: $CARTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "contact": {
        "firstName": "Jane",
        "lastName": "Doe",
        "phone": "+1 555 010 0000",
        "email": "jane@example.com"
      },
      "shippingAddress": {
        "addressLine1": "123 Main St",
        "city": "Austin",
        "province": "TX",
        "postalCode": "78701",
        "country": "US"
      },
      "payment": { "data": { "sessionId": "SESSION_ID" } }
    },
    "tasks": [
      {
        "url": "https://merchant.example/products/running-shoe",
        "quantity": 1,
        "selectedVariant": { "color": "Black", "size": "10" }
      }
    ],
    "options": { "allowInteraction": true }
  }'

One request can hold several products from more than one merchant. CartAI creates one task per merchant and returns a groupId plus a taskId and a live view link for each task.

If you have a product name and not a URL, use POST /search-checkout. You pass the merchant’s website and a list of item names, and CartAI finds each item on the merchant’s site, builds the cart and completes the order in the same call.

Step 4. Track the order

Set a webhook in the CartAI portal and you get a status update every time the task changes state, through to the order confirmation. You can also read a task at any time.

curl https://api.cartai.ai/checkout/TASK_ID \
  -H "x-api-key: $CARTAI_API_KEY"
curl https://api.cartai.ai/checkout/TASK_ID \
  -H "x-api-key: $CARTAI_API_KEY"
curl https://api.cartai.ai/checkout/TASK_ID \
  -H "x-api-key: $CARTAI_API_KEY"

The task returns its current status, the final pricing with shipping and tax, and the order details from the merchant.

What happens when a checkout needs something it does not have

Real checkouts hit surprises. A merchant asks for a verification code, an address fails validation or a shipping option is no longer offered. CartAI handles this in two modes.

  • Programmatic. You send everything up front and the order runs start to finish with no human involved.

  • Interactive. Set allowInteraction to true. If the checkout needs a login or verification code, an address, payment details or a shipping choice, CartAI pauses the order, asks the customer and finishes the checkout once the answer arrives.

Login gated merchants work too. The customer can save their credentials for a merchant once, and CartAI uses them to sign in at checkout.

What to expect

  • No merchant integration. The order is placed on the merchant’s own site, so the merchant keeps the customer relationship, fulfillment and returns.

  • Checkout works on merchant sites worldwide, on guest and login gated flows.

  • In a November 2026 benchmark, CartAI completed 95.88% of checkouts across 97 live merchants on the first attempt, from product page through payment.

  • Checkout runs on supported merchants. A merchant can choose not to allow agent checkouts, and CartAI respects that choice.

  • Checkout is asynchronous. Build around webhooks, not a blocking call.

Use it from an agent with MCP

If your agent speaks the Model Context Protocol, you do not need to write the HTTP calls. The open source CartAI MCP server exposes search, pricing, payment sessions and checkout as tools. It is published on npm as cartai-mcp-server.

Get started

Get a free API key at portal.cartai.ai and read the full reference at docs.cartai.ai. If you run a platform that needs orders placed at volume, talk to us.

© 2026 All rights reserved.

© 2026 All rights reserved.

© 2026 All rights reserved.