comecerodocs

List cart promotions

GET
/carts/{cart_id}/promotions

Lists the promotions applied to the cart: its coupon, and the cross-sell and up-sell offers of its items. An offset-based list. sort_by takes date_created (the default), promotion_id, name or date_modified. Any token type may call it; a limited token only for a bound cart.

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

cart_id*string

The id of the cart.

Query Parameters

active?boolean

true for active promotions only, false for inactive only.

q?string

Search text. Matches a promotion_id exactly or part of a promotion name.

limit?integer

How many items to return on one page, from 1 to 100. The default is 100. A value outside 1 to 100, or one that is not a whole number, is a 400.

Range1 <= value <= 100
Default100
offset?integer

For offset-based lists, how many items to skip before the page starts. Use next_page_offset or previous_page_offset from the page you have. A value that is not a whole number is a 400.

Range0 <= value
Default0
sort_by?string

The field to sort by. Any other value sorts by date_created.

Default"date_created"
Value in"date_created""promotion_id""name""date_modified"
desc?boolean

Sort in descending order (newest, largest or last first) when true. The default is false. A value other than true or false is a 400.

Defaultfalse
show?string

Comma-separated fields to return; all others are left out. Use dot notation for child fields (customer.email). You cannot send show and hide together (400). See Customizing output.

hide?string

Comma-separated fields to leave out of the response. Use dot notation for child fields (customer.email). You cannot send show and hide together (400). See Customizing output.

formatted?boolean

When true, the object also has a formatted child with amounts and dates as display text in the shopper's language and currency (for example $19.99 or November 7, 2026). The default is false. See Localized formatting.

Defaultfalse

Response Body

The promotions on the cart.

application/json
  1. response

A page of promotions. An offset-based list.

total_items*integer

The number of items that match, across all pages.

total_pages*integer

The number of pages.

current_page*integer

The number of this page.

next_page_url*|

The URL of the next page, or null on the last page.

Formaturi
next_page_offset*|

The offset of the next page, or null on the last page.

previous_page_url*|

The URL of the previous page, or null on the first page.

Formaturi
previous_page_offset*|

The offset of the previous page, or null on the first page.

current_page_url*string

The URL of this page.

Formaturi
data*array<>

The items on this page.

Example Request
curl -X GET 'https://api.comecero.com/api/v1/carts/string/promotions'
Example Response
{  "total_items": 1,  "total_pages": 1,  "current_page": 1,  "next_page_url": null,  "next_page_offset": null,  "previous_page_url": null,  "previous_page_offset": null,  "current_page_url": "https://api.comecero.com/api/v1/carts/0091307952465CafhFSTa1/promotions?offset=0&limit=10",  "data": [    {      "object": "promotion",      "url": "https://api.comecero.com/api/v1/promotions/0070576784690PtKDqfI",      "promotion_id": "0070576784690PtKDqfI",      "name": "Ten percent off",      "test": true,      "account_id": "AB1234",      "date_created": "2026-11-02T20:13:16Z",      "date_modified": "2026-11-02T20:13:16Z",      "type": "coupon",      "active": true,      "apply_to_recurring": false,      "apply_to_recurring_count": null,      "use_count": 4,      "expires": "2026-12-31T23:59:59Z",      "comments": null,      "config": {        "type": "order",        "code": "SAVE10",        "generator_prefix": null,        "generator_secret_key": null,        "discount_percent": 0.1,        "discount_amount": null,        "product_ids": null,        "exclude_product_ids": false,        "max_uses_per_customer": 1,        "max_uses_global": null      }    }  ]}

Pay for a cart POST

Charges the cart total with the payment method you send, or the customer's default one. The amount and currency come from the cart, so do not send `total` or `currency` (`400`). Any token type may call it; a limited token only for a bound cart, and a limited test token only when its user may make test payments. A payment that succeeds at once closes the cart and makes the order: `status` is `completed`, or `pending` when it is only authorized. Events fire and the receipt email goes out. A payment that needs the shopper to act comes back `201` with `status` `initiated` and the next step in `response_data` (expand it): a `redirect_url` for PayPal or a 3-D Secure check, a `next_action` for a Comecero Express Payments 3-D Secure check you run on your own page, or the Stripe.js values for a `stripe` payment. When the shopper is done, get the payment and call `POST /payments/{payment_id}/commit` only while it is still `initiated` (the Comecero 3-D Secure page commits it itself). Until then the cart stays open. A declined payment is `402` with the payment in `error.meta.payment`. The same payment sent again soon after a success is `409` (code `duplicate`). A closed cart, an empty cart or a payment still being processed is `400`.

List related products for a cart GET

Lists up to 3 products set as related to the products in the cart. Products already in the cart are left out. One page; it takes no paging parameters. Any token type may call it; a limited token only for a bound cart.