CODFamilia
Features How it works Pricing Blog FAQ Academy Sign up Sign in

The REST API: driving COD orders from your own code

The seller API lets you create and track cash-on-delivery orders from your own code: API keys, reading the catalogue and cities, rate limits and error codes.

The essentials

What is it?
It is a JSON REST interface, authenticated by key, exposing what an integration needs: the orderable catalogue, the delivery cities and their fees, lead creation, and tracking of your own leads. It serves the same logic as the seller interface, with the same checks.
Who is it for?
Sellers who have a developer, or are one: a bespoke store, a mobile app, an internal back office, a home-made sales funnel. A seller who does not write code has no need for the API — connecting a store or linking a spreadsheet does the same job.
How does it work?
Every call carries an API key in its authorisation header. The seller is derived from the key, never from a parameter, so it is impossible to act on behalf of another account. Responses are JSON, errors name the offending field, and every call is logged so the developer can see what was actually sent.
What is it for?
Because a home-made integration needs two things no import provides: writing an order at the exact moment the customer confirms, and reading the state of its orders to feed its own display. It is the only route when the order source is a program you wrote.
How do you use it?
Create a key in the seller workspace, check it works with a first harmless call, then read the cities and the catalogue before sending your first lead. The full reference, with fields and error codes, lives in the developer documentation, which is public and needs no account.

The API is the interface that lets a program — a bespoke shop, a mobile app, an internal tool — create and track cash-on-delivery orders without going through a human interface.

What the API is for — and when it is useless

The API answers three situations, and roughly only three. The first is a bespoke store: at the moment the customer confirms the basket, your code creates the lead and immediately receives its reference, which it can show to the customer. The second is a mobile app, which has no web page to be called. The third is an internal tool — a dashboard, an accounting reconciliation, a reporting script — that needs to read order states to combine them with its own data.

Outside those three cases it is not much use, and that is better said before someone spends a week on it. If your orders come from an existing store, the store connection brings them in with no code and with a fallback re-read you would not have written. If they come from a form or a landing page, a spreadsheet is quicker to set up and easier to fix. If you simply want to be told when a parcel is delivered, what you need is an outgoing webhook, not a loop of API calls.

The useful rule is this: the API is justified when a program you control is what produces the order. In every other case, one of the three other routes does the same job for less effort and less maintenance.

The API key, and what it is worth

Authentication fits in one line: every call carries a key in its authorisation header. There is no login to transmit, no account parameter, no session to maintain. The seller is derived from the key, and that is as much a security decision as a convenience one: no call can reach another account's data, however the parameters are changed.

A key is created in the seller workspace, with a name saying what it is for. It is shown once only, at creation: only its digest is kept, and nobody — not even support — can read it back to you. If it is lost, create another. If it is revoked, it never becomes valid again.

  • One key per integration — One for the mobile app, another for the reporting script. Revoking one does not stop the other, and the call log says which did what.
  • A key can be attached to a store — Leads created with that key then automatically carry the matching store, without your code having to say so.
  • The key is a server secret — It must never ship inside a web page, a distributed mobile app or a code repository: whoever reads it can create orders in your name.
  • Last use is visible — A key that has not been used for a long time is a key to revoke.
  • The call log is yours — Method, address called, response code: that is what answers "why is this not working" without guesswork.

What can be read, what can be written, what stays untouched

The scope is deliberately narrow: the API exists to bring orders in and to find out where they are. Anything that commits money or alters a journey stays in the interface, because a programming mistake there would cost more than a human click.

  • Two possible answers on creation — An accepted lead answers "created". A doubtful one — unknown reference, unrecognised city, incoherent total, recent duplicate — answers "accepted" with the list of anomalies: it exists, as a damaged lead, waiting for a correction. It is never silently refused.
  • Cursor pagination — The lead list is walked by passing back the identifier returned with the previous page, not a page number. A page number would shift with every new lead, and the integration would skip orders without noticing.
  • Your own reference is kept — The external reference field is passed through as written and shown again in the interface: that is what lets you reconcile a lead with the original order in your system.
  • What the API does not do — It does not change a status, cancel an order, trigger a withdrawal or read anything belonging to another seller. Those actions live in the interface, where they are traced.
Address What it does
GET /v1/me Confirms the key works and which account it belongs to. The first call to make.
GET /v1/products The catalogue this seller can order from: public and private products, with the platform price, availability and variants.
GET /v1/cities The delivery cities and their delivery fees. Worth reading before sending a lead.
POST /v1/leads Creates a lead. The same checks as everywhere else apply.
GET /v1/leads Your leads, newest first, with filters by status and by date.

Rate limits and error codes

A rate limit applies per key, per minute. It exists for a simple reason: one seller's badly written loop must not slow the platform down for everyone else. The figure in force is not a constant to copy into your code — it is returned by the key-verification call, so it can be adapted without waiting for an announcement.

When the limit is reached, the response says so explicitly and states how long to wait. A properly written client honours that delay rather than retrying at once; retrying immediately only burns the next minute.

Response What it means What to do
400 The body is not valid JSON Check the content-type header and the stray comma
401 Key missing, invalid or revoked Send the key in the authorisation header; a revoked key never becomes valid again
404 Resource does not exist, or belongs to another seller Both cases give the same answer, deliberately
422 Required field missing or invalid The response names the offending field
429 Too many calls in the last minute Wait for the stated delay, then resume
500 An incident on our side Retry, and report it to support with the exact time of the call

Where the full reference lives

This page explains what the API is for and what it allows; it does not replace the reference. That lives in the developer documentation, which is public and needs no account — a seller's developer does not have their login, and demanding a sign-up to read an API contract would protect nothing.

There you will find the getting-started guide, the address reference with every expected field, the outgoing webhooks page, the list of errors and limits, and the version log. The description is written once and serves everything: the page a human reads, an OpenAPI file your tool imports to generate a client, and a collection ready to try. That is what guarantees the page and the file do not say two different things six months later.

The API version number is returned in the header of every response, and the version log says what changed. Added fields are common and break nothing: a well-written client ignores a field it does not know rather than failing on it.

Frequently asked questions about the API

I do not code — is the API for me?
No, and that is good news: the three other routes do the same job without code. A store connects in a few clicks, a spreadsheet is linked in minutes, and a webhook is pasted into the source tool. The API is aimed at someone who writes code.
Where can I find the full list of fields?
In the developer documentation, which is public and accessible without an account. It holds the address reference, the expected fields, the error codes, an OpenAPI file you can import into your tool, and a collection ready to try.
How do I check that a key works?
With a verification call that has no side effects, confirming the key is valid, which account it belongs to, which API version is answering and which rate limit applies. It is the first call to make, before writing anything else.
What happens if I send an incomplete lead?
It is not lost. The response says it was accepted with anomalies, and names them: unknown reference, unrecognised city, incoherent total. The lead then exists as a damaged lead awaiting correction, exactly as if it had come from an import.
Can I change or cancel an order through the API?
No. The API creates leads and lets you track them; it does not change statuses, cancel orders or move any money. Those actions happen in the interface, where they leave a trace attributable to a person.
Is there a limit on the number of calls?
Yes, per key and per minute, so that an accidental loop does not penalise other sellers. The figure in force is returned by the key-verification call, and exceeding it answers with an explicit error stating how long to wait.
How do I avoid creating the same order twice?
By sending your own order reference in the field provided: it is kept and shown again, which lets you reconcile a lead with its original order. A duplicate check also applies on the phone number and the product, flagging the lead rather than silently duplicating it.
Can I read the platform's purchase prices?
No. The catalogue returns the price at which you buy the product, which is what enters your profit calculation. Nothing else is exposed, and that is the same scope as in the interface.
Can the API tell me about a delivery?
That is not its job: polling an address in a loop to watch for a change is slow and expensive. To be told about a confirmation, a dispatch, a delivery or a return, register an outgoing webhook.

Also worth reading

One key, four calls, and your orders come in

A catalogue of 1 products and 65 cities readable through the API, leads created from your own code, and public developer documentation.

Sign up