O2M Logo
One to Many
Requests and responses
Was this page helpful?

Requests and responses

The address, headers and data formats shared by every endpoint.

Overview

All endpoints use JSON over HTTPS and follow the same rules for headers, dates, money and IDs.

Address

Base URL
https://api.o2m.in/api/v1

Every request goes to this address over HTTPS. Paths such as /stock are added after it, so GET /stock means https://api.o2m.in/api/v1/stock.

Requests must come from your server. A page in a web browser cannot call the API: it would expose your secret key, and O2M refuses such a request with 403 and the message "This request came from a site that may not use the O2M API."

Headers

Headers you send

HeaderWhenValue
X-Access-KeyEvery requestYour access key.
X-Secret-KeyEvery requestYour secret key.
Content-TypeWith a bodyapplication/json
Idempotency-KeyOptional, on creating requestsMakes a retry safe. See Idempotency.
X-Request-IdOptionalYour own reference for the request: 8 to 128 letters, digits or ., _, :, -. O2M makes one if you do not.

Headers you get back

HeaderMeaning
X-Request-IdThe request's reference. Quote it when you contact support.
X-RateLimit-LimitHow many requests this key may make in a minute.
X-RateLimit-RemainingHow many it has left now.
Retry-AfterWith a 429: the seconds to wait.
Idempotent-Replaytrue when the answer is a saved copy of an earlier one.

Data formats

KindFormatExample
Requests and responsesJSON, up to 100 KB per requestSee any endpoint
IDsText, even when they look like numbers"4410"
Date and timeISO 8601. Responses are in UTC2026-10-02T10:00:00Z
DateYYYY-MM-DD2027-10-01
MoneyA number in rupees30.51
Empty valuenull"courier": null
  • SKUs are matched without regard to upper or lower case.
  • In a path, encode any special characters in a SKU, for example /stock/MUG%2FBLUE.
  • A filter value O2M does not recognise gives an empty list, not an error.

Versioning

This is version 1 of the API, and the version is part of the base URL. Within a version, fields are added but never renamed or removed. Write your code to ignore fields it does not know.