Wholesale delivery of digital goods over an API: a catalogue with wholesale prices, availability,
orders, balance and events. Base address — https://kodrio.com, all paths below are appended to it.
Contract version — v1. An access key is issued in the dashboard; reading this page requires no login.
0. What this is and where to start
Partner API gives wholesale access to digital goods: a catalogue with prices and availability, orders,
balance and order events. There is one contract — v1; everything described below works on the base
address https://kodrio.com, paths are appended to it.
Access is opened by a key kodrio_live_…: you issue it in the dashboard after company verification and
send it only in the Authorization header. The key is shown once — save it immediately, it cannot be
recovered.
| What you need | Where it lives |
|---|---|
| catalogue and availability | GET /v1/catalog, GET /v1/stock, GET /v1/catalog/export |
| order and code delivery | POST /v1/orders, GET /v1/orders/{id} |
| money | GET /v1/balance, GET /v1/balance/entries |
| events | a webhook subscription and its registry |
There are two classes of money in the contract. Account money (available_minor, amount_minor and
other *_minor fields) is integer minor units of your company currency; the currency is named by the
currency_code field in the response. Catalogue prices (price, market_price, tiers) are integer
US dollar cents regardless of the account currency.
An order goes only to items in stock: before ordering, check available: true in GET /v1/stock.
A closed intake and an unavailable item answer 422 rejected without any charge — the refusal
branches are described in section 4. Intake changes are announced in the changelog.
The machine-readable contract is GET /v1/openapi.json (OpenAPI 3.1). It is opened by a key: without a
key the response is 401. The page you are reading is public and contains everything needed for
integration.
1. Quick start
The five steps below are walked in order; everything works on the live address https://kodrio.com.
1.1. Get access
The company is verified by an operator: without verification a live key is not issued. After verification you sign in to the dashboard via the link from the email — sign-in is confirmed by a one-time code, there is no password.
The key is issued in the dashboard, "Access keys" section. Scopes and the allowed address list are chosen at issue; the key is shown once, copy it immediately.
Choose scopes by integration task: catalog:read — catalogue and availability, balance:read —
balance and journal, orders:create and orders:read — orders, webhooks:manage — subscriptions.
1.2. First request
Check the key with a balance request:
curl -sS "https://kodrio.com/v1/balance" \
-H "Authorization: Bearer $KODRIO_API_KEY"Response: {"data":{"currency_code":"USD","available_minor":5000,"overdraft_limit_minor":0}}. If the
key is not accepted, 401 unauthorized arrives with a request_id.
The key is passed in the header only; it must not appear in the address or in the request body. A
403 forbidden_scope answer also means the key is alive: it lacks the right for this endpoint.
1.3. Catalogue
The catalogue is read in pages of 100 items, the brand filter is the ?brand= parameter:
curl -sS "https://kodrio.com/v1/catalog?brand=STEAM" \
-H "Authorization: Bearer $KODRIO_API_KEY"The next page is ?cursor= from meta.next_cursor; null means the page is the last one. The
available field answers whether the minimum batch can be ordered right now, while closed_for_sale
arrives only when the item is closed for sale.
The file price list is returned by GET /v1/catalog/export, bulk availability — by
GET /v1/stock?skus=. For client generation there is GET /v1/openapi.json.
1.4. Subscribe to events
POST /v1/webhooks creates a subscription: the receiver address and the event list. The response
carries the signing secret once — save it, it is not shown a second time. The subscription requires the
webhooks:manage scope and the right to read the data of the chosen events.
Order events require the orders:read right, the balance.low event — balance:read; without the
right the subscription is rejected with 403 forbidden_scope.
1.5. Place an order
Build an order from items in stock: check available: true with GET /v1/stock, take the price and
the recipient fields from the catalogue (GET /v1/recipients/fields?sku=), and send POST /v1/orders
with the Idempotency-Key header — without it the request is rejected with 400 validation_failed.
An accepted order answers 202; the outcome is read from GET /v1/orders/{id} and arrives as an
event at your webhook. A line refusal is 422 rejected with the reason in line_rejections; money is
not charged. The order body and intake rules are in section 4.
2. Authentication
2.1. Header and key format
Authorization: Bearer kodrio_live_…The scheme is parsed strictly: the word Bearer, one space, then the key. The key consists of the
prefix kodrio_live_ and 40 lowercase hexadecimal characters. Case matters: a key converted to upper
case answers 401.
2.2. Issuing, storing, rotation
The key is issued in the dashboard after company verification and is shown once; only its hash is stored. To change the key, issue a new one and revoke the previous one — revocation takes effect immediately.
The key is a bearer of your company money. Keep it in a secrets manager or environment variables, not in a repository, not in tickets and not in logs. In the examples the key is substituted from an environment variable.
2.3. Scopes
A key has a closed set of rights; each endpoint requires its own right. Without the right the answer is
403 forbidden_scope.
| Scope | What it opens |
|---|---|
catalog:read | catalogue, file price list, availability, recipient field set |
balance:read | balance and movement journal |
orders:create | order creation |
orders:read | reading an order and the order list |
webhooks:manage | registry of event subscriptions |
A subscription to events also requires the right to read the event data: for order events —
orders:read, for balance.low — balance:read. The reason field of the refusal lists the missing
scopes.
2.4. Allowed addresses
Each key has its own IP list. An empty list means there is no restriction; a filled one means requests
are accepted only from the listed addresses, the rest receive 403 ip_not_allowed. The list holds up
to 50 addresses; CIDR masks are not supported, addresses are listed one by one. An address is compared
in canonical form, so different spellings of one address match.
2.5. Access refusals
| Response | What happened | What to do |
|---|---|---|
401 unauthorized | the key is not accepted | check the header and the key itself |
403 forbidden_scope | the key lacks the right for the operation | issue a key with the required scope |
403 ip_not_allowed | the request came from an address outside the key list | verify the outgoing address; on an unexpected refusal — section 11 |
3. Catalogue and availability
3.1. GET /v1/catalog — product shelf
Scope catalog:read. Parameters: ?brand=, ?region=, ?cursor=; value case does not matter. A page
holds 100 items, the next cursor arrives in meta.next_cursor, null means the page is the last one.
Unknown request parameters are ignored.
Catalogue row fields:
| Field | Meaning |
|---|---|
sku | article, the key to everything else |
brand, region | brand and activation region |
region_strict | the region is strict: the code does not activate in another one |
region_countries | activation countries, ISO 3166-1 alpha-2 codes |
denomination | denomination; "VAR" — the product has no denomination |
currency | denomination currency, not the settlement one |
delivery_kind | delivery kind: key_code, game_key, topup_by_id, topup_by_login, gift_link |
min_batch | minimum batch |
max_batch | upper batch limit for a single order |
title_ru | title |
available | whether the minimum batch can be ordered right now |
closed_for_sale | the item is closed for sale; arrives only with true |
Money and format fields:
| Field | Meaning |
|---|---|
price | wholesale price per unit, US dollar cents; may be absent |
price_tiers | volume → price tiers; only where they exist |
market_price | retail market anchor, US dollar cents; may be absent |
code_formats | code formats, an array; only for items delivered as a code |
For dollar purchases the markup and wholesale discounts are calculated in USD, with no intermediate rounding into roubles. The per-unit price in CSV matches the price in the catalogue and in the order for the same partner and quantity. If a USDT/RUB rate is needed for the price or for checking the denomination and no confirmed rate exists, the item does not receive a price. The rouble retail market anchor is not published in this case either.
The delivery kind defines what arrives for an order:
delivery_kind | What arrives |
|---|---|
key_code | activation code |
game_key | game code with a regional restriction |
topup_by_id | confirmation of top-up to an account by number |
topup_by_login | confirmation of top-up to an account by login |
gift_link | gift link |
{
"data": [
{
"sku": "STEAM-TR-100TRY",
"brand": "STEAM",
"region": "TR",
"region_strict": true,
"denomination": 100,
"currency": "TRY",
"delivery_kind": "key_code",
"min_batch": 1,
"max_batch": 5,
"title_ru": "Steam Турция 100 TRY",
"available": true,
"price": 31900,
"market_price": 39900
}
],
"meta": { "next_cursor": null }
}An optional field is simply absent from the response: neither null nor 0 comes instead of it. An
absent price means the price is not determined, and an order for such an item will not pass on price.
An absent max_batch means there is no batch limit.
available: false and closed_for_sale: true answer different questions: the first is "cannot be
ordered now", the second is "the item is closed for sale". An item with available: false stays in the
catalogue: availability may return.
The price_tiers tiers arrive in ascending min_qty, the fields min_qty and unit_price_minor are
required. price is the per-unit price below the first tier. The quantity in an order line cannot
exceed this item's max_batch.
region is always included in region_countries. The list arrives only for items that have one; its
absence does not mean "activates nowhere".
When the catalogue declares code_formats, a delivered code must pass at least one format in the array.
Items delivered without a code (top-ups) never have this field. Use delivery_kind to identify them.
Examples of current alphabets in code_formats: {"alphabet": "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"}
and {"alphabet": "0123456789"}. Validate a particular code using its format from the catalog
response, not this example.
3.2. GET /v1/stock — availability in bulk
Scope catalog:read. The required parameter ?skus=A,B,C — up to 100 articles; without it the
endpoint answers 400 validation_failed. The response is
{"data":[{"sku","available"}],"meta":{"unknown_skus":[…]}}. An unknown article does not receive
available: false — it goes into meta.unknown_skus. The sku field in the response arrives in
canonical form, so match rows by the field, not by position in the array.
3.3. GET /v1/catalog/export — price list as a file
Scope catalog:read. Format — CSV, UTF-8 without BOM, comma separator, CRLF line ending. One file row
is one price: the base price goes in the row with min_qty=1, each tier goes in its own row. There is
no pagination; the ?brand= and ?region= filters work the same way as in the catalogue.
sku,brand,region,region_strict,denomination,currency,delivery_kind,min_batch,title_ru,available,closed_for_sale,min_qty,unit_price_minor,market_price,region_countriesAn item without a price stays in the file with an empty unit_price_minor cell. The
X-Kodrio-Snapshot header names the moment the snapshot was built: it matches between the catalogue
and the price list if both responses are built from one snapshot.
4. Orders
Order intake opens and closes as a whole; its state is announced in the changelog.
A closed intake answers 422 rejected with the line {"sku": "*", "code": "supplier-unavailable"}
before any charge. An order for an out-of-stock item gets the same 422 with that item's article and
its reason code. Order items with available: true: availability before an order is shown by GET /v1/stock.
4.1. Creating an order
POST /v1/orders, scope orders:create, the Idempotency-Key header is required.
POST /v1/orders
Authorization: Bearer kodrio_live_…
Idempotency-Key: zakaz-0001
Content-Type: application/json
{ "lines": [ { "sku": "STEAM-TR-100TRY", "quantity": 2, "unit_price_minor": 31900 } ] }Order line:
| Field | Required | Meaning |
|---|---|---|
sku | yes | article from the catalogue |
quantity | yes | quantity, up to 50 per line |
unit_price_minor | yes | price from the catalogue, an echo |
recipient | for top-ups by login | recipient as one string |
recipient_fields | for top-ups by fields | recipient as named fields |
lines is a non-empty array of up to 100 lines, duplicate sku values are forbidden.
unit_price_minor is an echo of the catalogue price: a mismatch is rejected before the charge. The
delivery region is set by the article, there is no separate region field in the line.
The response to an accepted order is 202 with {"order_id": …, "status": "accepted"}: the order is
executed asynchronously, the outcome is read by status. Orders and subscriptions belong to the company,
not to a key: a second key sees the same orders.
Not every item needs a recipient. The field set is answered by
GET /v1/recipients/fields — with the required parameter ?sku=, without it 400 validation_failed.
Forms are net, stroka, polya; fields are key, type, secret and options for lists. net means
there is no recipient, stroka — one string, polya — named fields; with secret: true the value must
not be shown or stored.
Idempotency-Key is a string of up to 255 characters, its own for every order; leading and trailing
spaces are trimmed, the sandbox: prefix is reserved.
4.2. Responses and retries
| Response | Meaning |
|---|---|
202 accepted | the order is accepted for processing |
200 | a repeat of the same key with the same body: the same response, no second charge |
409 processing | the key is held by an order whose outcome is not confirmed yet; safe to repeat |
409 idempotency_conflict | the key is held by an order with a different body |
422 rejected | the order is rejected, reasons in line_rejections[]; money is untouched |
429 rate_limited | the limit is exceeded, the pause is in Retry-After |
The answer while intake is closed:
{
"error": {
"code": "rejected",
"message": "Заказ отклонён. Причины — по строкам.",
"request_id": "9d4f2b1e-…",
"line_rejections": [
{ "sku": "*", "code": "supplier-unavailable", "reason": "закупка по этому заказу сейчас недоступна" }
]
}
}A missing required line field — the price echo, for example — answers 400 validation_failed before
the availability check; 422 rejected comes only for a checked line and names the reason in
line_rejections.
The line reason code is a closed set: no code outside this list ever appears. Every refusal arrives
before the charge; "sku": "*" means the reason applies to the whole order:
code | Meaning |
|---|---|
supplier-unavailable | there is nobody to buy from right now (redemption lines are not ready, or there is nobody to verify the recipient with); with sku: "*" — the whole order, retry later |
insufficient-balance | the company balance is not enough for the order; sku: "*", money is untouched — top up the balance and retry |
unknown-sku | the SKU is not in the catalogue — check it against GET /v1/catalog |
invalid-quantity | the quantity is not an integer or is below 1 |
invalid-price | the price echo is meaningless: not an integer, below 1, or above the line-total ceiling |
below-min-batch | the total quantity of the SKU's lines is below the catalogue min_batch |
above-max-batch | the total quantity of the SKU's lines is above the catalogue max_batch |
region-unknown | the item has a region restriction and no activation region is named in the order — there is nothing to check against |
region-mismatch | the named activation region is not among the item's activation countries |
not-enough-stock | the item is temporarily out of stock — stock may return, retry later |
closed-for-sale | the item is closed for sale — reordering it will not help |
kind-not-supported | the delivery kind is not orderable through the API; orderable kinds are visible in the catalogue |
recipient-required | a top-up needs a recipient: a string in recipient or named fields in recipient_fields |
recipient-invalid | the recipient is named in the wrong form: recipient and recipient_fields are mixed up, or the value breaks the line's rule |
recipient-unknown | the supplier did not confirm the recipient — check the account login |
price-changed | our price is different; the current one arrives in expected_unit_price_minor — retry with it |
A repeat with the same key and the same body returns the previous response: the order is not created a
second time and money is not charged again. The same key with a different body answers
409 idempotency_conflict. After 422 the key is free: the body can be fixed and retried. The key
lives together with the order and does not expire: use a new key for a new order.
There is no partial delivery: a rejection of any line rejects the whole order, an accepted order is delivered in full or the money is returned in full. An order must reach a terminal status.
4.3. Reading an order
GET /v1/orders/{id}, scope orders:read — the source of truth about an order.
| Field | Meaning |
|---|---|
order_id | order number |
status | processing, delivered or failed |
status_detail | with processing: queued or stuck; the field may be absent |
items | composition with codes; only with delivered |
items contains sku, quantity and codes. With processing and failed the field is absent
entirely — not an empty array: the codes are either not there yet or no longer there.
Another company's order and a non-existent one answer the same way — 404 not_found.
4.4. Listing orders
GET /v1/orders?cursor=, scope orders:read. Newest first, a page holds 50 rows, ?limit= up to 200,
the next cursor is in meta.next_cursor.
| Field | Meaning |
|---|---|
order_id | order number |
status, status_detail | the same as when reading one order |
created_at | the moment the order was accepted |
sandbox | test order marker |
currency_code, amount_minor | the amount; the pair may be absent when the amount cannot be named |
lines | composition without codes; may be absent |
?limit= defaults to 50; the cursor is an opaque value from meta.next_cursor. The order is by order
number descending, which is also the chronology.
4.5. Statuses and events
| What you see | Event |
|---|---|
processing + queued | none |
processing + stuck | none |
delivered | order.delivered |
failed | order.failed |
| a refund after delivery | order.refunded |
queued and stuck are not a rejection but a wait: read the status again later. A refund after
delivery arrives as the order.refunded event, while reading such an order answers failed.
One terminal event arrives per order; a second delivery is possible, so deduplication by event_id is
mandatory.
5. Webhooks
An event arrives at your address and notifies about an outcome; the source of truth is reading the order. Subscriptions belong to the company, not to a key.
5.1. Subscription
POST /v1/webhooks, scope webhooks:manage plus the right to read the data of every chosen event
(orders:read for order events, balance:read for balance.low).
{ "url": "https://hooks.example.com/kodrio", "events": ["order.delivered", "order.failed"] }The response is 201. It carries the secret field once — the signing secret; save it immediately, it
is not shown a second time. The secret is stored encrypted: it cannot be recovered, on loss create a new
subscription and revoke the old one.
| Event | data |
|---|---|
order.delivered | order_id, status, amount_minor, currency_code |
order.failed | order_id, status, amount_minor, currency_code |
order.refunded | order_id, status, amount_minor, currency_code |
balance.low | currency_code, available_minor, threshold_minor |
Event envelope:
{ "event_id": "pwev_…", "event": "order.delivered", "created_at": "<ISO-8601>", "data": { "order_id": "pord_…", "status": "delivered", "amount_minor": 63800, "currency_code": "USD" } }The event list is closed: a subscription to an unknown event is rejected with 400 validation_failed.
The address must be https:// and public only: private, loopback and link-local addresses are rejected
with 422 url_rejected and a reason code in reason, redirects are not followed.
A company may have up to 10 active subscriptions (409 webhook_limit), one address may have one active
subscription (409 webhook_duplicate_url).
The address is checked at registration and on every send: a DNS change does not bypass the check.
5.2. Signature
The header X-Kodrio-Signature: sha256=<HMAC-SHA256(secret, body)>: the HMAC is computed over the raw
body bytes before JSON parsing. Next to it go X-Kodrio-Event, X-Kodrio-Event-Id and
X-Kodrio-Attempt — they are not signed, make decisions from the body.
const crypto = require("crypto")
// Raw body before JSON.parse; the secret comes from an environment variable.
const expected = "sha256=" + crypto
.createHmac("sha256", process.env.KODRIO_WEBHOOK_SECRET)
.update(rawBody)
.digest("hex")
const got = String(req.headers["x-kodrio-signature"] || "")
if (expected.length !== got.length) return res.sendStatus(401)
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(got))) return res.sendStatus(401)5.3. Delivery
A 2xx answer within 10 seconds means delivered; everything else, including 3xx, is a failure.
Retries start with a 30 second pause, then the pause doubles up to one hour, with a ±20 % spread. The
retry window is 24 hours from the birth of the event; after that the event stays in the delivery journal
but will not arrive by itself.
Delivery is at-least-once: one event may arrive twice, deduplication by event_id from the body is
mandatory. Order is not guaranteed: sort by created_at. The delivery journal is kept for 30 days. The
event carries no product codes: they are returned by reading the order.
5.4. Registry and replay
GET /v1/webhooks returns the company subscriptions, including revoked ones; a live one is the one with
revoked_at: null.
| Field | Meaning |
|---|---|
id | subscription number |
sandbox | test subscription marker |
url | receiver address |
events | chosen events |
secret_prefix, secret_last4 | the edges of the secret; the secret itself is absent |
created_at | creation moment |
revoked_at | revocation moment; null for a live subscription |
last_success_at | the last successful delivery |
consecutive_failures | failures in a row |
last_http_status | the last HTTP response of the receiver |
last_failure_code | the code of the last failure |
consecutive_failures, last_http_status and last_failure_code show the health of the receiver: they
reveal a falling-apart channel without waiting for a complaint.
DELETE /v1/webhooks/{id} revokes a subscription and answers {"id": …, "revoked": true}. Events
already queued for a revoked channel are not sent.
POST /v1/webhooks/{id}/replay with the body {"event_id": …} queues the event for immediate sending
and answers {"event_id": …, "queued": true}. A delivered event or an event whose window is exhausted
can be replayed; an event still in the queue answers 409 replay_not_terminal. A replay gives one
attempt and does not reset the window.
6. Balance and movement journal
6.1. GET /v1/balance — balance
Scope balance:read. The currency is taken from the company profile, it is not passed in the request.
{ "data": { "currency_code": "USD", "available_minor": 150000, "overdraft_limit_minor": 0 } }| Field | Meaning |
|---|---|
currency_code | company account currency |
available_minor | available balance, minor units of the account currency |
overdraft_limit_minor | how far below zero is allowed; 0 by default |
6.2. GET /v1/balance/entries — movement journal
Scope balance:read. Entries go newest first, a page holds 50 rows, the next cursor arrives in
meta.next_cursor.
| Field | Meaning |
|---|---|
operation | debit — charge, credit — top-up or refund |
amount_minor | movement amount, minor units of the account currency |
reason | human-readable description; the wording changes, it does not need parsing |
order_id | the order the movement belongs to; only for movements on an order |
at | moment of the movement, ISO 8601 in UTC |
The cursor is an opaque value from meta.next_cursor: do not derive it from order_id or at. Read
the link between a movement and an order from order_id, the direction from operation.
The journal is append-only: entries are not changed or deleted, a new entry appears on top.
7. Rate limits
Quotas are counted per company, not per key: a second key does not increase the limit.
| Category | Endpoints | Limit |
|---|---|---|
| read | catalogue, availability, recipient field sets, balance, journal, order reads, subscription registry | 120/min |
| order creation | POST /v1/orders | 30/min |
| event replay | POST /v1/webhooks/{id}/replay | 10/min |
Order creation is counted separately from reading: reading a status does not spend the order quota.
The window is 60 seconds. Every response carries the quota headers:
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 118
X-RateLimit-Reset: 41X-RateLimit-Reset is seconds until the window resets, not a timestamp.
When the limit is exceeded, 429 rate_limited arrives with the Retry-After header in seconds — it is
present on every 429. Build the pace from X-RateLimit-Remaining, not from the rejection.
If the counter is unavailable, the headers do not arrive: treat the limit as unknown, not unlimited. A
429 is not a contract error: repeat the request after the pause.
8. Errors
An error arrives in one envelope: code, message, request_id and, where needed, reason. A
response without a key (live):
{"error":{"code":"unauthorized","message":"Ключ доступа отсутствует, неверен или отозван.","request_id":"9d4f2b1e-…"}}| HTTP | code | When |
|---|---|---|
401 | unauthorized | the key is absent, wrong or revoked |
403 | forbidden_scope | the key lacks the required right |
403 | ip_not_allowed | the address is outside the key list |
403 | verification_required | the company is not verified; the order is not accepted |
403 | currency_not_supported | the company account is not in US dollars |
400 | validation_failed | the body or parameters do not match the schema |
404 | not_found | the object is absent or belongs to another company; an unknown path answers the same |
409 | idempotency_conflict | the key is held by an order with a different body |
409 | processing | the key is held, the outcome is not confirmed yet |
409 | webhook_limit | there are already 10 active subscriptions |
409 | webhook_duplicate_url | an active subscription to this address already exists |
409 | replay_not_terminal | the event is still in the queue |
422 | rejected | the order is rejected, reasons in line_rejections[]; the line-code dictionary is in section 4.2 |
422 | url_rejected | the subscription address is not accepted |
429 | rate_limited | the limit is exceeded, the pause is in Retry-After |
500 | internal | a failure on our side |
503 | secret_not_configured | subscription issuing is unavailable, retry later |
503 | recipient-unavailable | the recipient field set could not be obtained, retry later |
503 | sandbox_not_available | the key is of a withdrawn type, issue a live one |
A 4xx answer means the request must be fixed. A 5xx answer means the request is correct and the
failure is on our side: retry later, an order — with the same Idempotency-Key. The reason field,
where present, is a code from a closed set, not free text.
500 and 503 differ like this: 500 is a failure worth reporting, 503 is temporary unavailability,
retry without changes. A 400 validation_failed answer does not name the line: per-line rejection
reasons arrive only in 422.
A closed order intake answers 422 rejected with the line {"sku": "*", "code": "supplier-unavailable"}
before any charge: money is untouched, the idempotency key is free. An order for an out-of-stock item
is the same 422 with the article in sku and the line's reason code.
Name the request_id when you write about a failure: it locates the specific request.
9. Compatibility and contract boundaries
9.1. Changes and deprecation
A breaking change is announced in the changelog and takes effect no earlier than 90 days after the announcement. Breaking means removing an endpoint or a field, narrowing allowed values, a new required request field, changing the meaning of an error code, as well as changing the unit or meaning of a field while its name and type stay the same.
See the changelog for removed fields.
9.2. What is not breaking
a new optional field in a response;
a new value in a list: brand, region, delivery kind;
a new error code within an existing HTTP class;
a new event you are not subscribed to.
9.3. What v1 does not have
| What is missing | What is used instead |
|---|---|
| a sandbox for partners | a live key and live orders |
| a machine check of the recipient | the catalogue declares the field set, the order checks the value |
| balance top-up over the API | top-up through the dashboard |
| an order status filter | the status field in every list row |
9.4. Versions
The version is in the path: /v1. A breaking change ships as a new version, not as an edit of v1;
both versions can work at the same time.
9.5. Changelog
Every contract change is recorded in the changelog: new endpoints, fields, codes and events. The changelog is the only place where timelines are announced.
10. Endpoint reference
| Method | Path | Scope |
|---|---|---|
GET | /v1/catalog | catalog:read |
GET | /v1/catalog/export | catalog:read |
GET | /v1/stock | catalog:read |
GET | /v1/recipients/fields | catalog:read |
GET | /v1/balance | balance:read |
GET | /v1/balance/entries | balance:read |
GET | /v1/webhooks | webhooks:manage |
POST | /v1/webhooks | webhooks:manage |
DELETE | /v1/webhooks/{id} | webhooks:manage |
POST | /v1/webhooks/{id}/replay | webhooks:manage |
POST | /v1/orders | orders:create |
GET | /v1/orders/{id} | orders:read |
GET | /v1/orders | orders:read |
GET | /v1/openapi.json | any live key |
Endpoints that are not in the table do not exist: an unknown path under /v1 answers 404 not_found
with the same error envelope.
| What arrives | Shape |
|---|---|
| success | {"data": …} and meta if present |
| error | {"error": {"code", "message", "request_id"}} |
GET /v1/openapi.json returns the same contract as an OpenAPI 3.1 file: a client can be generated from
it or imported into Postman. No scope is needed, any active key works. Without a key the endpoint
answers 401 unauthorized.
curl -sS "https://kodrio.com/v1/openapi.json" \
-H "Authorization: Bearer $KODRIO_API_KEY"The file arrives without the {"data": …} envelope — client generators accept it that way. The other
responses of the contract arrive in the envelope: success — {"data": …} with meta where needed,
error — {"error": …}.
11. If something went wrong
An error arrives in a single envelope: code, message, request_id. Name the request_id when you
write about a failure: it locates the specific request.
| What you see | What to check |
|---|---|
401 unauthorized | the Authorization header, key case and completeness |
403 forbidden_scope | key scopes and the reason field |
403 ip_not_allowed | the outgoing address and the key address list |
429 rate_limited | the pause from Retry-After, the request rate |
500 internal | the request_id and a retry of the request |
A 4xx answer means the request must be fixed; a 5xx answer means the request is correct and the
failure happened on our side, so the request should be retried later. Attach the request_id, the
request time in UTC, the endpoint and the request body without the key to your message.
Suspected key leak: 403 ip_not_allowed with an unchanged outgoing network, movements in the balance
journal you did not make, an event subscription you did not create.
Revoke the key in the dashboard — access stops immediately.
Check the subscription registry and revoke everything you did not create: subscriptions belong to the company and survive key revocation.
Reconcile the movement journal for the period since the key could have leaked, and write to us via the support channel in the dashboard.
The support channel is the "Support" section in the dashboard; when writing, name the request_id, the
time and the endpoint.