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
/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
- MCP tool
- checkout_create
- Changes data
- Yes
Parameters
| Name | Type | Description |
|---|---|---|
linesbody · required | array of object | The products to buy, 1-25 |
return_urlbody · optional | string (uri) | Where the order confirmation links back to, on your site. It gets `?order=<number>` added. http only for localhost |
Request
curl -X POST "https://3commerce.com/api/v1/checkout" \
-H "Content-Type: application/json" \
-d '{
"lines": [
{}
]
}'Response
{
"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"
}