comecerodocs

List cart payments

GET
/carts/{cart_id}/payments

Lists the payments made for a cart, failed ones included. An offset-based list. sort_by takes date_created (the default), date_modified or date_completed. 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

status?string

Only payments with this status.

Value in"initiated""processing""pending""completed""failed""cancelled""refunded""retry"
reference?string

Only payments with this reference.

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.

Default"date_created"
Value in"date_created""date_modified""date_completed"
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
expand?string

Comma-separated child objects to return in full instead of as a URL, for example customer,payments. Use dot notation for nested objects (items.product), up to four levels deep. A single object takes up to 12 paths; a list takes up to 2, applied to every item. Extra paths are dropped without an error. See Expanding objects.

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
timezone?string

An IANA time zone name, such as America/New_York or UTC. It sets how date_start and date_end are read and the time zone of every date in the response. The default is the account's time zone (Settings, Technical), or UTC when it has none. A name that is not known is a 400.

Response Body

The payments for the cart.

application/json
  1. response

An offset-based list of the payments made for a cart.

total_items*integer

The number of items in the whole list.

total_pages*integer

The number of pages.

current_page*integer

The page number of this page, starting at 1.

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 payments on this page.

Example Request
curl -X GET 'https://api.comecero.com/api/v1/carts/string/payments'
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/payments?offset=0&limit=10",  "data": [    {      "object": "payment",      "url": "https://api.comecero.com/api/v1/payments/0090460891496PyrYzd9DC",      "payment_id": "0090460891496PyrYzd9DC",      "account_id": "AB1234",      "success": true,      "status": "completed",      "date_created": "2026-11-07T19:25:02Z",      "date_modified": "2026-11-07T19:25:04Z",      "date_completed": "2026-11-07T19:25:04Z",      "test": true,      "currency": "USD",      "subtotal": 199.9,      "shipping": 0,      "tax": 14.99,      "total": 214.89,      "customer_ip_address": "203.0.113.44",      "customer_ip_country": "US",      "description": null,      "reference": null,      "merchant_descriptor": "EXAMPLE SHOP",      "merchant_contact": "shop.example.com",      "apply_to_balance": false,      "response_code": "OK",      "response_message": "OK",      "gateway_transaction_id": "test_ch_1029384756",      "gateway_error_code": null,      "gateway_error_message": null,      "risk_decline": false,      "gateway": "https://api.comecero.com/api/v1/gateways/0090100200300GwTest01",      "app_id": null,      "app_version": null,      "payment_method": "https://api.comecero.com/api/v1/payments/0090460891496PyrYzd9DC/payment_method",      "response_data": "https://api.comecero.com/api/v1/payments/0090460891496PyrYzd9DC/response_data",      "reporting_currency": "USD",      "reporting_subtotal": 199.9,      "reporting_shipping": 0,      "reporting_tax": 14.99,      "reporting_total": 214.89,      "reporting_fx_rate": 1,      "settlement_currency": "USD",      "settlement_subtotal": 199.9,      "settlement_shipping": 0,      "settlement_tax": 14.99,      "settlement_total": 214.89,      "fx_rate": 1,      "customer": "https://api.comecero.com/api/v1/customers/0091307952481CuXUhvCA1",      "order": "https://api.comecero.com/api/v1/orders/8352-CSGYX-348",      "cart": "https://api.comecero.com/api/v1/carts/0091307952465CafhFSTa1",      "invoice": null,      "refunds": "https://api.comecero.com/api/v1/payments/0090460891496PyrYzd9DC/refunds",      "fees": "https://api.comecero.com/api/v1/payments/0090460891496PyrYzd9DC/fees",      "fee_summary": "https://api.comecero.com/api/v1/payments/0090460891496PyrYzd9DC/fee_summary",      "commissions": "https://api.comecero.com/api/v1/payments/0090460891496PyrYzd9DC/commissions",      "failed_gateway_attempts": "https://api.comecero.com/api/v1/payments/0090460891496PyrYzd9DC/failed_gateway_attempts",      "meta": null    }  ]}

Retrieve cart options GET

Returns what the shopper can choose and must provide to pay for the cart: payment methods (with what the browser needs to set each up), card types, shipping quotes and the required customer fields. Read it again after the items, currency or customer change. You can also get it inside the cart with `expand=options`; the old `options=true` parameter is accepted but does nothing. Any token type may call it; a limited token only for a bound cart.

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`.