Skip to content

API reference

Checkout

Send a shopper from your own storefront to a hosted 3Commerce checkout. No key needed, and with your key the sale earns you commission.

Start a hosted checkout

POST/api/v1/checkout

Prices the products a shopper chose and returns a `checkout_url` on 3Commerce, where they pay and pick delivery. Send them there; each shop gets its order and the supplier ships it. No key needed; call it with your shop’s key from your server to earn the commission other shops offer on their products.

Scope
Public, no key
MCP tool
checkout_create
Changes data
Yes

Parameters

NameTypeDescription
linesbody · requiredarray of objectThe products to buy, 1-251-25 items
return_urlbody · optionalstring (uri)Where the order confirmation links back to, on your site. It gets `?order=<number>` added. http only for localhostmax 500 chars

Request

curl -X POST "https://3commerce.com/api/v1/checkout" \
  -H "Content-Type: application/json" \
  -d '{
  "lines": [
    {}
  ]
}'

Response

201 Created
{
  "checkout_url": "https://3commerce.com/checkout/start?cart=eyJsIjpb…&storefront=7c2e…",
  "seller_shop_id": "0b6e…",
  "lines": [
    {
      "slug": "merino-crew-sweater",
      "title": "Merino crew sweater",
      "options": [
        {
          "label": "Size",
          "value": "M"
        }
      ],
      "quantity": 1,
      "unit_price": 128,
      "line_total": 128
    }
  ],
  "subtotal": 128,
  "currency": "USD"
}