comecerodocs

Get an order

GET
/orders/{order_id}

Returns one order with its items.

PDF: send Accept: application/pdf to get the order as a PDF receipt instead of JSON. The PDF uses your account's order template in the customer's language and comes back as a file named <order_id>.pdf.

Secret and trusted tokens can read any order on the account. A limited token can read an order only when it belongs to the token's customer, and the settlement amounts and some item fields are left out for it.

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

order_id*string

The order id, for example 7393-GMRFY-954.

Query Parameters

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.

Header Parameters

Accept?string

Send application/pdf to get a PDF receipt instead of JSON.

Value in"application/json""application/pdf"

Response Body

The order, as JSON or as a PDF.

  1. response

What a paid cart or invoice becomes. You never create an order yourself: the API makes one when a payment on a cart or invoice succeeds or is authorized. Fields marked "not for limited tokens" are left out when a limited token reads the order. Links to other objects only appear when the token may read that object.

object*"order"

The object type. Always order.

Value in"order"
url*string

The full URL of the order.

Formaturi
order_id*string

The order id, for example 7393-GMRFY-954. A cart or invoice can set it before payment; otherwise the API makes one.

date_created*string

When the order was created.

Formatdate-time
date_modified*string

When the order was last changed.

Formatdate-time
test*boolean

True for a test order.

account_id*string

The account the order belongs to.

payment_status*string

pending while the payment is authorized but not captured, completed once captured, cancelled after the authorization was voided, and refunded once the whole order was refunded.

Value in"pending""completed""cancelled""refunded"
fulfilled*boolean

True when every item on the order is fulfilled.

currency*string

The currency the customer paid in (ISO 4217).

subtotal*number

The items after item discounts, without shipping and tax, in the order currency.

subtotal_original*number

The items before discounts, without shipping and tax, in the order currency.

shipping*number

Shipping after discounts, without tax, in the order currency.

shipping_original*number

Shipping before discounts, without tax, in the order currency.

discount*number

The discount on the whole order, apart from item discounts, in the order currency.

item_discounts*number

The sum of all item discounts, in the order currency.

total_discounts*number

discount plus item_discounts, in the order currency.

total_discounts_percent*number

total_discounts as a fraction of the original subtotal plus shipping, for example 0.1 for 10%.

tax*number

The tax after discounts, in the order currency.

tax_original*number

The tax before discounts, in the order currency.

total*number

What the customer paid, in the order currency.

total_original*number

subtotal_original plus shipping_original plus tax_original, in the order currency.

tax_inclusive*boolean

True when prices include tax.

discount_on_gross*boolean

True when the order discount was taken from the amount with tax, false when from the amount without tax.

settlement_currency?string

The currency the money settles to your account in. Not for limited tokens.

settlement_subtotal?number

subtotal in the settlement currency. Not for limited tokens.

settlement_subtotal_original?number

subtotal_original in the settlement currency. Not for limited tokens.

settlement_shipping?number

shipping in the settlement currency. Not for limited tokens.

settlement_shipping_original?number

shipping_original in the settlement currency. Not for limited tokens.

settlement_discount?number

discount in the settlement currency. Not for limited tokens.

settlement_item_discounts?number

item_discounts in the settlement currency. Not for limited tokens.

settlement_total_discounts?number

total_discounts in the settlement currency. Not for limited tokens.

settlement_tax?number

tax in the settlement currency. Not for limited tokens.

settlement_tax_original?number

tax_original in the settlement currency. Not for limited tokens.

settlement_total?number

total in the settlement currency. Not for limited tokens.

settlement_total_original?number

total_original in the settlement currency. Not for limited tokens.

customer_ip_address?|

The IP address the customer bought from.

customer_ip_country?|

The country of that IP address (ISO 3166-1 alpha-2).

referrer?|

Your own referrer value, copied from the cart or invoice.

affiliate_id?|

The affiliate or partner id, copied from the cart or invoice.

promotion_code?|

The coupon code the customer used, if any.

items_count*integer

The number of lines on the order.

items_quantity*number

The sum of the quantities of all lines.

items*array<>

The lines on the order.

shipping_item*|

The shipping line, or null when nothing ships.

customer?|

A link to the customer, or the customer when you send expand=customer.

cart?||

A link to the cart the order came from, or the cart when expanded. Null when the order came from an invoice. Carts are deleted after a while; an expanded deleted cart only has cart_id.

payments?|

A link to the order's payments, or the list when you send expand=payments on a single order.

payment?|Deprecated

Old field, kept for older integrations. A link to the order's payments, or the first payment when you send expand=payment. Use payments.

subscription?||

A link to the subscription that made this order (a renewal), or the subscription when expanded. Null otherwise.

refunds?|

A link to the order's refunds (successful, failed and pending), or the list when you send expand=refunds on a single order.

fee_summary?|

A link to the order's fee summary, or the summary when you send expand=fee_summary. Not for limited tokens.

invoice?||

A link to the invoice the order came from, or the invoice when expanded. Null when the order came from a cart.

promotions*|

A link to the promotions used on the order, or the list when you send expand=promotions on a single order.

shipments?|

A link to the order's shipments, or the list when you send expand=shipments on a single order.

meta*||

Your own data for the order, copied from the cart or invoice. A string or an object.

formatted?

The amounts and dates as display text in the shopper's language. Only present when you send formatted=true.

Example Request
curl -X GET 'https://api.comecero.com/api/v1/orders/string'
Example Response
{  "object": "order",  "url": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954",  "order_id": "7393-GMRFY-954",  "date_created": "2026-11-02T16:46:16Z",  "date_modified": "2026-11-02T16:46:38Z",  "test": true,  "account_id": "AB1234",  "payment_status": "completed",  "fulfilled": true,  "currency": "USD",  "subtotal": 49.95,  "subtotal_original": 49.95,  "shipping": 0,  "shipping_original": 0,  "discount": 0,  "item_discounts": 0,  "total_discounts": 0,  "total_discounts_percent": 0,  "tax": 0,  "tax_original": 0,  "total": 49.95,  "total_original": 49.95,  "tax_inclusive": false,  "discount_on_gross": false,  "settlement_currency": "USD",  "settlement_subtotal": 49.95,  "settlement_subtotal_original": 49.95,  "settlement_shipping": 0,  "settlement_shipping_original": 0,  "settlement_discount": 0,  "settlement_item_discounts": 0,  "settlement_total_discounts": 0,  "settlement_tax": 0,  "settlement_tax_original": 0,  "settlement_total": 49.95,  "settlement_total_original": 49.95,  "customer_ip_address": "203.0.113.24",  "customer_ip_country": "US",  "referrer": null,  "affiliate_id": null,  "promotion_code": null,  "items_count": 1,  "items_quantity": 1,  "items": [    {      "object": "order_item",      "url": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954/items/1",      "item_id": "1",      "cross_sell_id": null,      "up_sell_id": null,      "bundle_id": null,      "bundle_group_id": null,      "date_created": "2026-11-02T16:46:16Z",      "date_modified": "2026-11-02T16:46:16Z",      "product_id": "pdf-pro.test",      "order_id": "7393-GMRFY-954",      "name": "PDF Viewer Pro",      "type": "digital",      "quantity": 1,      "currency": "USD",      "price": 49.95,      "price_original": 49.95,      "reference_price": 49.95,      "reference_currency": "USD",      "subtotal": 49.95,      "subtotal_original": 49.95,      "discount": 0,      "discount_percent": 0,      "tax": 0,      "tax_original": 0,      "total": 49.95,      "total_original": 49.95,      "tax_rate": 0,      "tax_code": null,      "settlement_currency": "USD",      "settlement_price": 49.95,      "settlement_price_original": 49.95,      "settlement_subtotal": 49.95,      "settlement_subtotal_original": 49.95,      "settlement_discount": 0,      "settlement_tax": 0,      "settlement_tax_original": 0,      "settlement_total": 49.95,      "settlement_total_original": 49.95,      "fulfilled": true,      "product": "https://api.comecero.com/api/v1/products/pdf-pro.test",      "subscription": null,      "subscription_terms": null,      "shipments": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954/items/1/shipments",      "license": null,      "download": "https://api.comecero.com/api/v1/downloads/0093717990011DlR4kQp2a",      "meta": null    }  ],  "shipping_item": null,  "customer": "https://api.comecero.com/api/v1/customers/0093717976099CuAiEBXu4",  "cart": "https://api.comecero.com/api/v1/carts/0093717976083CaO5bXdLA",  "payments": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954/payments",  "payment": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954/payments",  "subscription": null,  "refunds": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954/refunds",  "fee_summary": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954/fee_summary",  "invoice": null,  "promotions": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954/promotions",  "shipments": "https://api.comecero.com/api/v1/orders/7393-GMRFY-954/shipments",  "meta": null}

List orders GET

Lists your orders, oldest first unless you send `desc=true`. There is no way to create an order directly: the API makes one when a payment on a cart or an invoice succeeds or is authorized. The list is cursor-based: use `after_item` and `before_item` (or the `next_page_url` and `previous_page_url` in the response). It is ordered by the date named in `date_type` (`date_created` by default; `date_modified` and `date_completed` also work). `sort_by` is ignored. Needs a secret or trusted token. Limited tokens get `403`; a customer reads their own orders with `GET /customers/{customer_id}/orders`.

Capture an order POST

Captures the money that was only authorized on the order's pending payments. Money moves. To capture all of it, send no body at all: a JSON body without `total`, `items` or `shipping` (even `{}`) captures nothing and releases the rest. To capture part, send a `total`, or `items` and `shipping`. The part you do not capture is written down as a record-only refund (no money moves for it), so the order shows what was really charged. When the order has more than one pending payment, the largest is captured first and any payment left over once the amount is reached is voided. Returns `201` with a `payment_list` holding each payment and its result. When every capture fails, the API answers with an error instead and puts the `payment_list` in the error's `meta.payment_list`. Needs a secret or trusted token that may create or update payments. A token without that permission gets `401`, not `403`.