---
title: "POST /cart"
method: POST
path: "/cart"
---

# POST /cart

`POST /cart`

Add one or more products to a user's merchant cart.

## Request body

- object
  - `external_user_id` string, required — Your unique identifier for the user.
  - `merchant_id` integer, required — Unique identifier for the merchant.
  - `products` object[], required — List of products to add to the cart.
    - `external_id` string, required — Merchant's identifier for the product. Format varies by merchant.
    - `fulfillment` object
      - `id` string, required — Unique identifier for the fulfillment option sent in [`SYNC_CART_SUCCEEDED`](https://docs.knotapi.com/shopping/webhook-events#sync-cart-succeeded).
  - `delivery_location` object
    - `address` object, required
      - `line1` string, required — First line of the delivery address.
      - `line2` string — Second line of the delivery address.
      - `city` string, required — City portion of the delivery address.
      - `region` string, required — Region portion of the delivery address, usually a state abbreviation. Must be an ISO 3166-2 sub-division code.
      - `postal_code` string, required — Postal code of the delivery address.
      - `country` string, required — Country portion of the delivery address. Must be an ISO 3166-1 alpha-2 code.
    - `first_name` string, required — First name for the delivery address.
    - `last_name` string, required — Last name for the delivery address.
    - `phone_number` string, required — Phone number for the delivery address in E.164 format.
    - `set_as_default` boolean, required — Whether the delivery address should be saved as the user's default in the merchant account.
  - `simulate` 'failed' — The sync cart attempt fails.

## Response `202`

Successful request.

- object
  - `message` string — Success message.

## Other responses

- `400` — Bad request.
- `401` — Unauthorized request.
- `403` — Forbidden request.
- `500` — Internal server error.

---

[API](https://skmtc.net/knotapi/apis/knot-api.md) · [All operations](https://skmtc.net/knotapi/apis/knot-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/knotapi/knot-api/versions/4610832c2087/schema)
