Merchant Onboarding API

Markdown

From onboarding to a searchable catalogue

  1. Build both required endpoints. Onboarding needs a Merchant Create Checkout endpoint and a Merchant OAuth Server; the Claude integration does not work without either.
  2. Onboard once. Register PSP credentials, your checkout URL and your OAuth server settings; receive a redacted configuration and an initial signed upload target.
  3. Add products. For a smaller catalogue, upsert up to 300 products per request; this is the simplest path. For a very large catalogue, such as a file of hundreds of MB, upload the file and start ingestion instead.
  4. Connect to claude. Add the MCP server issued to claude.

Claude showing a merchant catalogue

Hosted payment page

HTTP endpoints

The merchant-facing gateway exposes these routes under /api/v1/pa/agentic_commerce. Examples use the sandbox API host; use your environment's API host in production. The gateway forwards to the internal /merchant_onboarding and /product_feed JSON-RPC services. Merchant callers use the HTTP routes below, not the internal JSON-RPC wire format.

Method and path Action
POST /api/v1/pa/agentic_commerce/onboard Create configuration once; return it and the initial upload slot. Later calls return the existing config and ignore the request body.
GET /api/v1/pa/agentic_commerce/config Read redacted configuration and the current upload slot. Does not renew an expired URL.
POST /api/v1/pa/agentic_commerce/config/update Replace only the credential sections supplied in the body.
POST /api/v1/pa/agentic_commerce/products Synchronous product batch upsert, at most 300 products.
POST /api/v1/pa/agentic_commerce/product_file_ingest Issue a fresh signed upload slot; no request body required.
POST /api/v1/pa/agentic_commerce/product_file_ingest/start Start ingestion of the file in the current slot; returns 200 with an ingestion ID.
GET /api/v1/pa/agentic_commerce/product_file_ingest/{id} Read ingestion status, counts and any error-report link.

Authentication: every request requires an auth header with a bearer token: Authorization: Bearer <token>. Obtain the token from the Airwallex API access token login endpoint using an API key that has read access to Payment Acceptance APIs. The gateway derives the merchant identity from the token; do not send a merchant ID in request bodies. Your PSP API key and checkout secret are configuration data, not credentials for calling this API.

Create and update configuration

On first POST /onboard, provide both sections, including apis.oauth.acp and whitelisted_image_domains:

{
  "psp_config": {
    "api_key_data": {
      "client_id": "<psp-client-id>",
      "api_key": "<psp-api-key>"
    }
  },
  "apis": {
    "create_checkout": "https://merchant.example/checkout",
    "secret_key": "<checkout-hmac-secret>",
    "oauth": {
      "acp": {
        "oauth_base": "https://auth.merchant.example",
        "oauth_jwks": "https://auth.merchant.example/.well-known/jwks.json",
        "scopes": ["openid", "email"]
      }
    }
  },
  "whitelisted_image_domains": ["https://cdn.shopify.com"]
}

create_checkout must be an absolute HTTPS URL with a host and no embedded credentials. apis.secret_key is the HMAC-SHA256 shared secret for calls to your checkout API, separate from the PSP API key. apis.oauth.acp is required for the Claude integration; see Merchant OAuth Server. It is stored but not returned in the redacted response.

whitelisted_image_domains lists where your product images are served from. Each entry is the scheme plus the full host of your image URLs, with no path. For images at https://cdn.shopify.com/s/files/1/0681/1041/8059/files/c560cfbe-4f14-4a7d-966c-eba57c5c92db-Max.webp?v=1747802970:

With POST /config/update, a supplied list replaces the stored one, [] clears it, and omitting the field leaves it unchanged. GET /config returns the current list.
A later POST /onboard ignores the whole payload, even if it supplies new credentials. Use POST /config/update to change a section. An omitted psp_config or apis section stays unchanged; a supplied section replaces the whole section and must include both of its required values. Omitting only api_key or only secret_key does not keep the old secret.

// POST /api/v1/pa/agentic_commerce/config/update  -  replace the apis section (checkout and OAuth)
{
  "apis": {
    "create_checkout": "https://merchant.example/checkout-v2",
    "secret_key": "<new-checkout-hmac-secret>",
    "oauth": {
      "acp": {
        "oauth_base": "https://auth.merchant.example",
        "oauth_jwks": "https://auth.merchant.example/.well-known/jwks.json",
        "scopes": ["openid", "email"]
      }
    }
  }
}

GET /config and POST /config/update return the same redacted response shape as onboarding:

// POST /api/v1/pa/agentic_commerce/onboard → 200 (example)
{
  "merchant_id": "ac-dummy-merchant",
  "status": "active",
  "psp_config": {
    "psp_name": "AIRWALLEX",
    "client_id": "<psp-client-id>",
    "api_key_configured": true,
    "managed_payment": true
  },
  "apis": {
    "create_checkout": "https://merchant.example/checkout",
    "secret_key_configured": true
  },
  "whitelisted_image_domains": ["https://cdn.shopify.com"],
  "mcp_endpoints": {
    "acp": "/pa/ai/ac-dummy-merchant/acp/mcp",
    "ucp": "/pa/ai/ac-dummy-merchant/ucp/mcp"
  },
  "product_upload": {
    "url": "<signed upload URL>",
    "method": "PUT",
    "headers": {"Content-Type": "application/octet-stream"},
    "expires_at": "<ISO-8601 expiry>"
  }
}

Secrets never appear in the response. mcp_endpoints are paths: prepend the host serving the MCP endpoint when configuring a client. product_upload is also returned on config reads and updates. If no slot has ever been issued, a read can create the initial slot; otherwise it returns the current one unchanged, even after its URL expires.

Direct product upserts

Direct upsert is the simplest way to add products when your catalogue is not too large. POST /api/v1/pa/agentic_commerce/products synchronously upserts up to 300 products per request. For a very large catalogue, or a single file of hundreds of MB, use file upload and ingestion instead.

Supply type: "gmc" with a nonempty gmc_products array. Each item follows the GMC product format in JSON form: snake_case attribute names, and GMC value encodings such as "51.99 USD" for money.

// POST /api/v1/pa/agentic_commerce/products → 200 (example)
{
  "type": "gmc",
  "gmc_products": [
    {
      "id": "dress_tropical_s",
      "title": "Tropical Printed Midi Summer Boho Dress",
      "description": "Lightweight viscose midi dress.",
      "link": "https://merchant.example/p/dress_tropical?size=S",
      "image_link": "https://cdn.example/dress_tropical.jpg",
      "availability": "in_stock",
      "price": "51.99 USD",
      "item_group_id": "dress_tropical"
    }
  ]
}
// Response (example with no row errors)
{
  "error_gcs_file_loc": null,
  "records_added": 1,
  "records_updated": 0,
  "records_failed": 0
}

GMC rows map to products and variants as in the GMC feed: a row with item_group_id becomes a variant under that product id; without it, id is both the product and its single variant. Products are matched by merchant and product id. A submitted product replaces its stored row, including variants; products absent from the batch remain unchanged. Individual row failures can be counted without rolling back successful rows. error_gcs_file_loc, when present, is an internal gs:// error-file location, not a signed download URL.

Upload and start ingestion

Use file ingestion for a very large catalogue, such as a file of hundreds of MB. It avoids sending the whole catalogue in API requests and lets the platform process it asynchronously.

  1. Use the product_upload returned by onboarding, or call POST /product_file_ingest to get a fresh url, method, headers and expires_at. This POST returns the upload object directly, not the whole config.
  2. PUT an uncompressed file in the GMC file format to the signed URL using the exact returned headers - a tab-separated file whose header row uses Google Merchant Center attribute names. Do not send Airwallex API credentials to the storage URL.
  3. After upload succeeds, POST /product_file_ingest/start with a JSON body. The service reads the current slot, gets its size from storage, detects its format from the file and queues a job.
  4. Poll GET /product_file_ingest/{id} until the job is completed or failed.

The upload URL defaults to a one-day lifetime; an expired URL does not prevent ingestion of an already uploaded file. For a new file or expired URL, issue a fresh slot; repeating onboard does not renew it. Upload only once to each slot and never overwrite a queued file: signed URLs are technically reusable, and the asynchronous worker does not pin an object version. Do not issue a slot concurrently with starting ingestion. Both operations reject a merchant already recorded as processing, but that check is not atomic.

// POST /api/v1/pa/agentic_commerce/product_file_ingest/start
{"ingestion_mode": "upsert"}
// 200 response (example; IDs are decimal strings)
{"ingestion_id": "42", "status": "processing"}

Default is full replacement. File ingestion without ingestion_mode uses replace and removes catalogue products absent from the file. Pass "upsert" to retain them.

ingestion_mode accepts "upsert" or "replace"; an empty JSON object selects "replace". Replace stages the file and switches the whole merchant catalogue after successful processing, removing products absent from the file. Upsert changes submitted products and leaves others alone; some successful rows can remain committed if a later row fails. No file_format, size_bytes or upload path belongs in the start request.

Files must be nonempty and no larger than 500 MiB. A missing uploaded object yields UPLOAD_NOT_READY; empty, oversized or unrecognised files yield INVALID_UPLOAD. Completed files cannot be ingested again using the same slot, even after re-uploading to its URL: issue a new slot for another file. A failed ingestion can be retried on its current slot.

Ingestion status

// GET /api/v1/pa/agentic_commerce/product_file_ingest/42 → 200 (example)
{
  "ingestion_id": "42",
  "status": "completed",
  "progress": 100,
  "records_added": 1200,
  "records_updated": 80,
  "records_failed": 0,
  "error_report_url": null,
  "error_report_expires_at": null
}

Statuses are processing, completed and failed. Progress measures bytes read, not products processed. Counts are returned as zero when not yet available. When an error file exists, the status response supplies a signed download URL, valid for about 15 minutes by default; each status read can issue a new link. Failed upserts can have applied earlier rows. A replace failure before promotion leaves the live catalogue unchanged.

GMC product format

Both ways of adding products use the Google Merchant Center (GMC) product data format. Attribute names, value encodings and semantics follow Google's Product data specification, which is the source of truth for the full attribute list. You don't need a live Merchant Center connection, only data in this format. If you already use Merchant Center, exporting your products from it is often the fastest way to produce a valid file.

The same attributes are used in two encodings:

Products and variants

Each JSON object or file row is one offer, which becomes a variant. If item_group_id is set, its value is the parent product ID and the row is a variant under that product. If item_group_id is omitted, id is both the product ID and its single variant ID.

Required attributes

Conversion into the catalogue needs at least these attributes:

Attribute Notes
id Variant ID. Also the product ID when item_group_id is absent.
title (or structured_title) Offer title.
description (or structured_description) Offer description.
link Product or offer URL.
image_link Primary image URL.
availability Availability status, for example in_stock or out_of_stock.
price GMC money string, for example 19.99 USD.

Common optional attributes

The parser accepts many more GMC attributes. These are the most common:

Attribute Notes
item_group_id Groups rows into one product with multiple variants.
additional_image_link Extra image URLs. Can repeat or use comma-separated values.
sale_price Same money encoding as price.
brand Brand or manufacturer name.
gtin, mpn, sku Unique product identifiers, where conversion supports them.
color, size, material, pattern Variant attributes.
google_product_category Google product taxonomy ID or path.
product_type Merchant-specific product taxonomy. Can repeat.
condition Item condition, for example new, refurbished or used.
shipping(country:postal_code:price) Composite GMC shipping attribute.

JSON example (direct upsert)

Two sizes of one dress, grouped by item_group_id, and a standalone tote bag with no group:

// POST /api/v1/pa/agentic_commerce/products
{
  "type": "gmc",
  "gmc_products": [
    {
      "id": "dress_tropical_s",
      "title": "Tropical Printed Midi Summer Boho Dress",
      "description": "Lightweight viscose midi dress.",
      "link": "https://merchant.example/p/dress_tropical?size=S",
      "image_link": "https://cdn.example/dress_tropical.jpg",
      "availability": "in_stock",
      "price": "51.99 USD",
      "sale_price": "45.99 USD",
      "brand": "Example Apparel",
      "color": "Green",
      "size": "S",
      "condition": "new",
      "item_group_id": "dress_tropical"
    },
    {
      "id": "dress_tropical_m",
      "title": "Tropical Printed Midi Summer Boho Dress",
      "description": "Lightweight viscose midi dress.",
      "link": "https://merchant.example/p/dress_tropical?size=M",
      "image_link": "https://cdn.example/dress_tropical.jpg",
      "availability": "out_of_stock",
      "price": "51.99 USD",
      "sale_price": "45.99 USD",
      "brand": "Example Apparel",
      "color": "Green",
      "size": "M",
      "condition": "new",
      "item_group_id": "dress_tropical"
    },
    {
      "id": "tote_canvas",
      "title": "Canvas Tote Bag",
      "description": "Heavy cotton canvas tote with inner pocket.",
      "link": "https://merchant.example/p/tote_canvas",
      "image_link": "https://cdn.example/tote_canvas.jpg",
      "availability": "in_stock",
      "price": "24.00 USD",
      "brand": "Example Apparel",
      "color": "Natural",
      "condition": "new"
    }
  ]
}

TSV example (file ingestion)

The same three products as a TSV file. Separate columns with a single tab character. Leave a cell empty when a product has no value; the tote bag has no sale_price, size or item_group_id.

id title description link image_link availability price sale_price brand color size condition item_group_id
dress_tropical_s Tropical Printed Midi Summer Boho Dress Lightweight viscose midi dress. https://merchant.example/p/dress_tropical?size=S https://cdn.example/dress_tropical.jpg in_stock 51.99 USD 45.99 USD Example Apparel Green S new dress_tropical
dress_tropical_m Tropical Printed Midi Summer Boho Dress Lightweight viscose midi dress. https://merchant.example/p/dress_tropical?size=M https://cdn.example/dress_tropical.jpg out_of_stock 51.99 USD 45.99 USD Example Apparel Green M new dress_tropical
tote_canvas Canvas Tote Bag Heavy cotton canvas tote with inner pocket. https://merchant.example/p/tote_canvas https://cdn.example/tote_canvas.jpg in_stock 24.00 USD Example Apparel Natural new

File parsing rules

Errors and retries

HTTP status Onboarding / ingestion error codes Meaning
400 INVALID_REQUEST, INVALID_UPLOAD Invalid configuration, ingestion mode or uploaded file.
404 MERCHANT_CONFIG_NOT_FOUND, CATALOGUE_INGESTION_NOT_FOUND Unknown merchant configuration or ingestion ID for this merchant.
409 UPLOAD_NOT_READY, INGESTION_IN_PROGRESS, FILE_ALREADY_PROCESSED Upload missing, another job processing, or slot already ingested.

The gateway converts service domain errors to HTTP responses with a code and message; malformed request JSON also returns 400. No Idempotency-Key replay store is implemented for these operations. Repeating onboard reads the original config; repeating slot issuance creates a different slot. A start request for a processing or completed file returns a conflict, while a failed file can be retried. Direct upserts match by product ID, but repeated submissions count as updates.

Merchant Create Checkout

Airwallex calls your create_checkout URL (apis.create_checkout from onboarding) when the shopper starts or updates checkout. It is the only checkout API you build: confirm stock, quote fulfillment and return totals. Airwallex runs the rest of the checkout lifecycle and sends the shopper's final choice on the PaymentIntent webhook. The merchant does not need to call the payment intent API, our MCP will call them on your behalf.
Checkout sequence between the agent, Airwallex, and the merchant

Request

POST, JSON body in snake_case. Every call is signed with apis.secret_key; verify the signature before trusting the body.

Header Value
Content-Type application/json
x-timestamp Epoch milliseconds, as a decimal string
x-signature Hex HMAC-SHA256 of x-timestamp + raw body, keyed with apis.secret_key

Verify the signature exactly as you would an Airwallex webhook signature: compute the HMAC-SHA256 hex digest of x-timestamp followed by the raw request body, keyed with apis.secret_key, and compare it with x-signature. Use the raw body before parsing, and reject timestamps outside your tolerance.
Body fields:

Field Required Description
line_items[] Yes id (Airwallex line item id), item_id (your variant id), requested_quantity
currency Yes ISO 4217, for example USD
customer No id (Airwallex customer id, logged-in shoppers only), email, first_name, last_name, phone_number
shipping_address No street, city, state, postcode, country_code. Use it to price fulfillment.
{
  "line_items": [{ "id": "li_1", "item_id": "sku_shirt", "requested_quantity": 1 }],
  "currency": "USD",
  "customer": { "id": "cus_hkpdxxxxxxxx", "email": "jane@example.com" },
  "shipping_address": {
    "street": "123 Market Street", "city": "San Francisco",
    "state": "CA", "postcode": "94103", "country_code": "US"
  }
}

Response

Response fields:

Field Required Description
id Yes Your checkout or order id
line_items[] No Echo each requested item and add available_quantity: 0 means unavailable, lower than requested means adjusted, equal means OK
fulfillment.methods[] No id, type, line_item_ids, destinations[] (id, name, address) and options[] (id, title, cost, optional carrier, description, earliest_delivery_at, latest_delivery_at)
totals[] No type (subtotal, tax, fee or total), amount, display_text. Include at least subtotal and total.
permalink_url No Link to the checkout on your site
{
  "id": "chk_merchant_1",
  "line_items": [{ "id": "li_1", "item_id": "sku_shirt", "requested_quantity": 1, "available_quantity": 1 }],
  "fulfillment": {
    "methods": [{
      "id": "ship",
      "type": "SHIPPING",
      "line_item_ids": ["li_1"],
      "destinations": [{ "id": "dest_home", "address": { "street": "123 Market Street", "city": "San Francisco", "state": "CA", "postcode": "94103", "country_code": "US" } }],
      "options": [
        { "id": "std", "title": "Standard shipping (4-5 days)", "carrier": "USPS", "cost": 500 },
        { "id": "exp", "title": "Express shipping (1-2 days)", "carrier": "FedEx", "cost": 1500 }
      ]
    }]
  },
  "totals": [
    { "type": "subtotal", "amount": 4000, "display_text": "Subtotal" },
    { "type": "tax", "amount": 360, "display_text": "Tax" },
    { "type": "total", "amount": 4360, "display_text": "Total" }
  ],
  "permalink_url": "https://merchant.example/checkout/chk_merchant_1"
}

Fulfillment rules

A response that breaks these rules fails the checkout with one of these codes: multiple_fulfillment_methods_per_type, fulfillment_does_not_cover_cart, duplicate_fulfillment_id, unsupported_fulfillment_method_type.

Shopper's choice

The selection is not sent back to create_checkout. After payment it arrives on the PaymentIntent webhook under agentic_payment_data.fulfillment (one element for now), echoing the ids from your response:

"agentic_payment_data": {
  "fulfillment": [{
    "id": "ship",
    "type": "shipping",
    "line_item_ids": ["li_1"],
    "selected_destination_id": "dest_home",
    "selected_option_id": "std"
  }]
}

Receive the selection

  1. In the Airwallex web app, go to Developer > Webhooks and create a webhook for payment_intent.succeeded that points at your endpoint.
  2. Verify each delivery with that webhook's own secret key (shown in the web app, not apis.secret_key) and return 200 immediately.
  3. Read data.object.agentic_payment_data.fulfillment from the event and fulfil the order.

Full setup, signature code samples and IP allowlist: Listen for webhook events.

Merchant OAuth Server

Required for the Claude integration (ACP). Claude signs the shopper in through your OAuth server, then calls Airwallex's MCP with the access token. Claude discovers your server through Airwallex's MCP metadata, so you only register it with us.
OAuth sequence between the chat host, Airwallex MCP, and the merchant

Configure at onboarding

Add apis.oauth.acp to POST /onboard, or send it with POST /config/update. POST /config/update replaces the whole apis section, so include create_checkout and secret_key too.

Field Required Description
oauth_base Yes Issuer URL of your authorization server.
oauth_jwks Yes Public JWKS URL used to verify access-token signatures. Without it every Bearer token is rejected.
scopes No Scopes advertised to Claude in scopes_supported. ACP does not enforce them.
{
  "apis": {
    "create_checkout": "https://merchant.example/checkout",
    "secret_key": "<checkout-hmac-secret>",
    "oauth": {
      "acp": {
        "oauth_base": "https://auth.merchant.example",
        "oauth_jwks": "https://auth.merchant.example/.well-known/jwks.json",
        "scopes": ["openid", "email"]
      }
    }
  }
}

These values are stored but not returned by GET /config.

What your OAuth server must provide

Connecting Claude Desktop

Connect to the ACP endpoint: your environment's MCP host plus mcp_endpoints.acp. The UCP endpoint is not ready for the hackathon, so we recommend ACP. Claude Desktop reaches the remote server through mcp-remote, a community bridge.

  1. Install the current Node.js LTS from https://nodejs.org, and check that node --version and npx --version work.
  2. Open or create the Claude Desktop config file and add the configuration shown after these steps. On macOS it is ~/Library/Application Support/Claude/claude_desktop_config.json; on Windows, %APPDATA%\Claude\claude_desktop_config.json. Keep any existing settings and merge mcpServers at the top level.
  3. Fully quit and reopen Claude Desktop (closing the window is not enough). Complete the OAuth sign-in in your browser, then start a new chat and check that the tools are listed.
{
  "mcpServers": {
    "agentic-commerce": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.sandbox.airwallex.com/pa/ai/<merchantId>/acp/mcp"
      ]
    }
  }
}

If the connection fails, check ~/Library/Logs/Claude/mcp-server-agentic-commerce.log on macOS.