comecerodocs
Concepts

Concepts

The rules every Comecero API endpoint follows: tokens, errors, lists and paging, expanding objects, dates, metadata and more.

Read these once. Every endpoint in the API reference follows them.

API endpoint and requests

The base URL of the Comecero API, why every call must use HTTPS, and the headers and JSON body format that every request and response uses.

Authentication

The three Comecero API token types, how long each one lasts, how to create a secret token in the dashboard and how a browser gets a limited token.

Errors

The error object every failed Comecero API call returns, what each HTTP status code means, and what your code should do next, such as after a declined card.

Lists and pagination

How Comecero API lists return pages of up to 100 items, the difference between offset and cursor lists, and how to sort them and filter them by date.

Expanding objects

Use the expand query parameter to get related Comecero objects, such as an order's customer and payments, in the same API response instead of as URLs.

Customizing output

Use the show and hide query parameters to return only the fields you need from the Comecero API, which keeps responses small, especially for long lists.

Partial updates

How to update a Comecero object with a POST that holds only the fields you want to change, how null clears a field and which fields are replaced whole.

Meta data

Store your own data on Comecero carts, orders, customers, products and more with the meta field, and carry it from a cart or invoice to the order.

Dates and times

How the Comecero API writes dates in ISO 8601, how the timezone parameter changes them, and the full and shorthand date formats you can send in requests.

Localized formatting

Add formatted=true to a Comecero API call to get money amounts and dates as display text in the shopper's language, and choose the locale with user_locale.

API versioning

How the Comecero API is versioned, which changes can arrive without notice in version 1, and how to write code that keeps working as the API grows.

CORS

Call the Comecero API straight from a browser by adding your site's origin to the allowed CORS origins, and learn which origins are allowed without setup.

License services

Give buyers a license key after each sale, either from a list of keys you upload or from your own license server that Comecero calls with the order.