Skip to main content
POST
/
store
/
carts
/
{id}
/
complete
curl -X POST 'http://localhost:9000/store/carts/cart_01JB2KB1CD/complete' \
  -H 'x-publishable-api-key: pk_01JB2K3XYZ'
{
  "type": "order_group",
  "order_group": {
    "id": "og_01JB2KE7NP",
    "customer_id": "cus_01JB2KE8QR",
    "cart_id": "cart_01JB2KB1CD",
    "seller_count": 2,
    "total": 9900,
    "created_at": "2026-05-01T10:05:00.000Z",
    "updated_at": "2026-05-01T10:05:00.000Z"
  }
}
Completes the cart with Mercur’s split-order workflow: items are grouped by seller, one order is created per seller, and all orders are attached to a single order group returned to the shopper.
On payment errors that need customer action (authorization failed or requires more), the route still returns 200 with type: "cart", the refreshed cart, and an error object; any other failure is thrown as an error response.

Path parameters

id
string
required
The cart’s ID.

Query parameters

fields
string
Comma-separated fields to include on the returned order group; prefix with +/- to add to or remove from the defaults.

Response

type
string
order_group on success, cart when payment requires further action.
order_group
object
Present when type is order_group.
cart
object
Present when type is cart; the refreshed cart with items, totals, and payment collection.
error
object
Present when type is cart.
curl -X POST 'http://localhost:9000/store/carts/cart_01JB2KB1CD/complete' \
  -H 'x-publishable-api-key: pk_01JB2K3XYZ'
{
  "type": "order_group",
  "order_group": {
    "id": "og_01JB2KE7NP",
    "customer_id": "cus_01JB2KE8QR",
    "cart_id": "cart_01JB2KB1CD",
    "seller_count": 2,
    "total": 9900,
    "created_at": "2026-05-01T10:05:00.000Z",
    "updated_at": "2026-05-01T10:05:00.000Z"
  }
}