Introduction

In an era of AI agents and automated commerce, there is a need for a standardized way for external systems to interact with merchant e-commerce platforms. This concept outlines an Open Commerce API that allows third-party services or autonomous agents to discover a merchant’s offerings, create orders, and execute payments in a consistent, secure manner. Key components include a discoverable manifest, standardized data schemas for products and orders, mechanisms to obtain full order details (including tax and shipping), robust payment handling (integrating cards, tokens, and crypto wallets), and flexible authentication. The goal is to enable seamless, interoperable transactions – any way a consumer and merchant want to transact – while leveraging emerging standards like schema.org for data and HTTP 402-based payment protocols for automation.

Discoverability via Well-Known URI

To facilitate easy discovery of a merchant’s capabilities, the API uses a well-known URI approach. Merchants host a manifest discovery file at a standardized path (e.g. https://merchant.com/.well-known/commerce-manifest). The .well-known URI prefix is a convention defined by IETF (RFC 8615) to expose site metadata or services at consistent locations across all servers. By using a well-known URL, any client or agent knows exactly where to look for the merchant’s API manifest without needing the merchant to embed custom HTML tags or headers.

The well-known URI can either directly serve the manifest (as a JSON file) or provide a redirect/pointer to the actual manifest’s location (whichever best fits the merchant’s infrastructure). For example, a request to /.well-known/commerce-manifest might return a short JSON with the real manifest URL, or simply return the manifest content. This indirection gives merchants flexibility to host the detailed manifest wherever it makes sense (e.g. on a CDN or subdomain) while still having a fixed discovery path.

Why .well-known? Using .well-known ensures that the manifest is available at a consistent, predictable path on any host. This eliminates the need for custom HTTP headers or HTML advertisements of the API; clients won’t have to scrape pages or look for <meta> tags. Instead, an AI agent or service (like an aggregator or Cloudflare worker) can directly query the well-known URL to retrieve or locate the manifest. This standardized discovery is analogous to how OpenID Connect uses /.well-known/openid-configuration for identity metadata, or how other protocols expose capabilities in a uniform way. By adopting .well-known for commerce, we enable a zero-configuration discovery – any merchant implementing this simply places their manifest file in the known location and any client can find it.

Manifest Structure and Schema Integration

The manifest is a JSON (or JSON-LD) document that describes the merchant’s commerce API endpoints and data formats. It effectively acts as a capability statement. Key elements of the manifest include:

All schema references in the manifest are hyperlinked to their official definitions for clarity. By using established schemas (Product, Offer, Order, etc.), the API’s data model is self-descriptive and compatible with other tools. It also ensures semantic clarity – any agent can interpret, for example, what an availability: InStock means or that priceCurrency follows ISO 4217 currency codes. The manifest basically ties these together by saying where and how to get the data, and what format it will be in.

Order Creation and Full Order Details

A core flow enabled by this API is creating an order (cart) and retrieving the full order details prior to payment. As noted, the agent will call the order creation endpoint with necessary inputs. Let’s break down how this works in practice and how we incorporate the requirement for full pricing details:

  1. Initiating the Order: The agent (or integrator) selects items to purchase, typically using product identifiers obtained from the product listing. It then makes a request (e.g. POST /api/orders) with a payload containing those item IDs and quantities. Additionally, the agent provides a shipping address or selects a shipping option if multiple are available (in some cases, an agent might call a separate endpoint like GET /api/shipping-options?dest=ZIP to get shipping choices and include the chosen one in the order create call). The manifest details what fields are expected – for example: { "items": [ { "sku": "...", "quantity": 2 }, ... ], "shippingAddress": { ... }, "shippingOption": "standard" }.

  2. Order Calculation: Upon receiving this, the merchant’s backend calculates the order. This involves summing item prices, applying any discounts or promo codes (if supported and provided), calculating tax based on the address and items (tax rules), and adding shipping cost based on the chosen method. The result is an Order record that is either created in a pending state or simply simulated if the API allows “estimates.” In our design, we assume the order is created and an order ID is generated (like a cart ID or order reference that will be used for payment).

  3. Response – Full Cost Breakdown: The response to the order creation call returns a JSON structure with all the computed details. This is where taxes and shipping show up. As highlighted earlier, the order response will include each line item’s details and cost, plus aggregate fields:

    This design ensures nothing is hidden. The agent doesn’t need to separately guess taxes or shipping – it’s clearly provided, enabling informed decision-making or user confirmation if a human is in the loop. It addresses the explicit requirement: “There needs to be a way to get the full order amount (Tax, Shipping, etc)”. Yes – it’s returned right after creating the order, before payment.