ODINMAX

Guides

Everything you need to connect your shop: from your first call to signed webhooks.

Quick start in 5 minutes

  1. Turn on API access. In the seller center open API and ask for access. Once your shop is approved, the page lets you make keys.
  2. Create a key. Choose only the scopes your system needs, an expiry and your server addresses, then copy the key. It is shown once.
  3. Make your first call. Send the key in the Authorization header. GET /v1/shop/me answers with your shop, the key’s scopes and its limits.
  4. Receive webhooks. Add an https URL on a public host, pick the events, copy the whsec_ signing secret and press Send ping. Check the signature before you trust a request.

curl

curl https://api.odinmax.com/v1/shop/me \
  -H "Authorization: Bearer $ODINMAX_API_KEY"

Try everything on the sandbox first: https://demo-api.odinmax.com with test data (see Sandbox below).

Keys and scopes

Every request carries Authorization: Bearer odx_live_.... A key belongs to one shop and can never do more than the team member who made it: on every call we check both the key’s scope and that member’s current rights in the shop. If the member leaves the shop or loses the right, their keys stop working.

ScopeAllows
shop.readRead the shop profile and who the key belongs to
shop.writeChange the profile, opening hours and vacation
listings.readRead your listings and price suggestions
listings.writeCreate, edit, submit, copy and delete listings; upload images
stock.readRead delivery-code counts
stock.writeAdd and remove delivery codes
orders.readRead your orders (no buyer contact details)
orders.fulfillDeliver, cancel and answer cancel requests
chat.readRead order chats, buyer questions and quick replies
chat.writeReply in chats and keep quick replies
reviews.readRead reviews
reviews.writeReply to reviews
disputes.readRead reported problems
disputes.writeAppeal and settle warranty claims
promotions.readRead bumps and featured spots
promotions.writeBump listings
promotions.spendBuy featured spots with shop credit (off until switched on for your shop)
analytics.readRead sales figures
finance.readRead balances and the statement
finance.withdrawAsk for a withdrawal that the owner confirms (off until switched on for your shop)
team.readRead the shop team
webhooks.manageCreate webhooks, see deliveries and send them again
  • Expiry. Choose 30, 90 or 365 days. Only a key that can do nothing but read may have no expiry.
  • Server addresses. List the IP addresses or CIDR ranges your servers call from; calls from anywhere else get 403 API_KEY_IP_DENIED. Required for keys with finance.read, finance.withdraw or promotions.spend, and recommended for every key.
  • Scopes your shop can give. The scopes on offer grow with your shop rank. finance.withdraw and promotions.spend stay off until ODINMAX switches them on for your shop.
  • Keep keys on your server only: never in a browser, a mobile app or a public repository.
  • Give each system its own key with the fewest scopes, so you can revoke one without stopping the others.
  • If a key may have leaked, revoke it in the seller center at once and create a new one.

Rate limits

Each key starts at 120 requests a minute and gets more as your shop rank grows. All keys of one shop together get five times a key’s limit (at least 600 a minute), and one IP address gets 300 a minute. GET /v1/shop/me tells you your key’s limit. Over the limit you get 429 with code RATE_LIMITED. Wait and retry with growing delays and a little randomness.

Node.js

async function call(url, init, attempt = 0) {
  const res = await fetch(url, init);
  if ((res.status === 429 || res.status >= 500) && attempt < 5) {
    const wait = Math.min(60_000, 1000 * 2 ** attempt) + Math.random() * 500;
    await new Promise((r) => setTimeout(r, wait));
    return call(url, init, attempt + 1);
  }
  return res;
}
Coming soon

Every reply will carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset, so you can slow down before you hit the limit.

Safe retries

Every write to /v1/shop (POST, PUT, PATCH, DELETE) needs an Idempotency-Key header: any unique string of letters, digits and _ . : -, up to 255 characters. Use a new one for each change you mean to make, and the same one when you retry that change.

curl

curl -X PATCH https://api.odinmax.com/v1/shop/listings/AB12CD34 \
  -H "Authorization: Bearer $ODINMAX_API_KEY" \
  -H "Idempotency-Key: price-AB12CD34-2026-12-07" \
  -H "Content-Type: application/json" \
  --data '{"price":{"amount":"35500","currency":"THB"}}'
  • Within 24 hours, a repeat with the same key and the same request returns the first reply, with the header Idempotent-Replayed: true, and the work is not done twice.
  • The same key with a different request gets 422 IDEMPOTENCY_KEY_REUSED.
  • If the first request is still running you get 409 IDEMPOTENCY_IN_PROGRESS: wait a moment and send it again.
  • Older /v1/public routes accept the header too, but do not require it.
  • Webhook deliveries can arrive more than once: keep the X-Odinmax-Delivery id and skip repeats.

Lists and pages

Long lists come in pages: { "items": [...], "nextCursor": "..." }. Send nextCursor back as cursor for the next page; when it is null you have everything. limit is 1 to 100 (default 50). Orders come newest first.

Node.js

let cursor = null;
do {
  const url = new URL('https://api.odinmax.com/v1/shop/orders');
  url.searchParams.set('limit', '100');
  if (cursor) url.searchParams.set('cursor', cursor);
  const res = await fetch(url, { headers: { Authorization: `Bearer ${key}` } });
  const { items, nextCursor } = await res.json();
  for (const order of items) await save(order);
  cursor = nextCursor;
} while (cursor);
  • GET /v1/shop/orders and GET /v1/shop/webhook-deliveries page this way. A chat thread pages back in time with before (the id of the oldest message you have). Each route in the reference says how it pages.
  • Ignore fields you do not know: new fields can be added at any time without a new version.

Errors

Errors are JSON with a stable code, never a sentence. Decide in your system on the code; show your own text to your team.

HTTP

HTTP/1.1 404 Not Found
Content-Type: application/json

{ "code": "LISTING_NOT_FOUND" }
StatusCodeMeaning
400VALIDATION_FAILEDThe body or a parameter is not valid
400IDEMPOTENCY_KEY_REQUIREDA write without an Idempotency-Key
401API_KEY_INVALIDThe key is wrong or revoked
401API_KEY_EXPIREDThe key passed its expiry date
401API_KEY_WRONG_ENVIRONMENTA sandbox key on production, or the reverse
403API_KEY_IP_DENIEDThe call came from an address the key does not allow
403API_SCOPE_MISSINGThe key lacks the scope this route needs
403API_SCOPE_NOT_ALLOWEDYour shop can no longer give keys this scope
403API_KEY_CREATOR_FORBIDDENThe team member who made the key no longer has this right in the shop
403API_ACCESS_NOT_APPROVEDAPI access for your shop is not approved yet
403SHOP_API_SUSPENDEDAPI access for your shop is on hold
403SHOP_RESTRICTEDThe shop is closed or restricted
403SHOP_PAUSEDThe shop is paused: reading only
404LISTING_NOT_FOUNDNo such listing in your shop
404ORDER_NOT_FOUNDNo such order in your shop
409IDEMPOTENCY_IN_PROGRESSThe first request with this key is still running
409STOCK_NOT_AUTOThe listing does not deliver automatically
422IDEMPOTENCY_KEY_REUSEDThe same Idempotency-Key with a different request
429RATE_LIMITEDToo many requests: wait and retry
503API_READ_ONLYWrites are paused for a short time: reads still work
503API_DISABLEDThe API is paused for a short time

Retry 429 and 5xx with a delay. Do not retry other 4xx replies unchanged: fix the request first.

Money amounts

Every amount is an object with amount in the currency’s minor unit as a string and an ISO 4217 currency. {"amount":"35500","currency":"THB"} is 355.00 baht. Never turn amounts into floating-point numbers.

Node.js

// "35500" THB = 355.00 baht. Keep amounts as BigInt; never parse them as floats.
const amount = BigInt(order.subtotal.amount);
const total = amount * 2n;

Python

from decimal import Decimal
amount = int(order["subtotal"]["amount"])   # 35500 (satang), exact
baht = Decimal(amount) / 100                 # Decimal('355.00') for display only

Withdrawals

With finance.withdraw your system can ask for a withdrawal, but it can never take money out on its own. The scope stays off until ODINMAX switches it on for your shop, and the key must list your server addresses.

  1. POST /v1/shop/withdrawals with the amount, currency and one of your saved payout accounts. The reply has status PENDING_OWNER.
  2. The shop owner gets an email with a code and confirms the withdrawal in the seller center within 24 hours.
  3. Once confirmed, the withdrawal goes through the same checks as one made in the seller center. If the owner declines or does nothing, it ends as DECLINED or EXPIRED.

Follow each request with GET /v1/shop/withdrawals, and the payout.paid and payout.failed events.

Webhooks and signatures

We send a POST with a JSON body to your URL when something happens. Make webhooks in the seller center or with POST /v1/shop/webhooks, and choose the events each one gets.

EventWhen
order.createdA buyer placed an order (not paid yet)
order.paidThe order is paid: deliver now
order.deliveredThe order was marked delivered
order.completedThe buyer confirmed, or the order completed on its own
order.cancelledThe order was cancelled
order.refundedThe buyer got the money back
dispute.openedThe buyer reported a problem
dispute.updatedSomething changed in a reported problem, such as an appeal
dispute.resolvedA reported problem has a final outcome
warranty.claimedThe buyer made a warranty claim
chat.messageA new chat message for your shop
review.createdA buyer left a review
listing.approvedA listing passed review and is on sale
listing.rejectedA listing did not pass review
listing.out_of_stockA listing sold out
stock.lowFew delivery codes are left on a listing
payout.paidA withdrawal reached your account
payout.failedA withdrawal could not be sent
shop.restrictedYour shop was restricted
shop.reinstatedYour shop is open again
api_key.revokedOne of your keys stopped working
pingThe test you send yourself
HeaderMeaning
X-Odinmax-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256> of the text t.body with your whsec_ secret
X-Odinmax-EventThe event name, the same as type in the body
X-Odinmax-DeliveryUnique per delivery: use it to skip repeats
  1. Read the raw body before any JSON parsing.
  2. Compute HMAC-SHA256 of t + "." + body with your secret and compare it with v1 in constant time.
  3. Reject the request if t is more than 5 minutes away from your clock.
  4. Reply 2xx within 10 seconds, then do the slow work in the background.

A delivery that fails is tried again up to 8 times over about two days (after 1 minute, 5 minutes, 30 minutes, then 2, 6, 12 and 24 hours). After 50 failures in a row the webhook is switched off and the shop owner is told; switch it back on with POST /v1/shop/webhooks/{id}/enable.

  • GET /v1/shop/webhook-deliveries lists the last 30 days of deliveries. Filter by webhookId, status (PENDING, DELIVERED, FAILED) or event.
  • POST /v1/shop/webhook-deliveries/{id}/redeliver sends one again with the same body and a fresh signature, for example after you fixed your server.
  • POST /v1/shop/webhooks/{id}/test sends a ping.

curl (send yourself a signed test)

# Send a signed test delivery to your own endpoint (bash + openssl)
SECRET="whsec_..."
BODY='{"id":"evt_test","type":"ping","createdAt":"2026-12-06T12:00:00.000Z","data":{}}'
T=$(date +%s)
SIG=$(printf '%s.%s' "$T" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //')
curl -X POST https://your-server.example/odinmax/webhook \
  -H "Content-Type: application/json" \
  -H "X-Odinmax-Event: ping" \
  -H "X-Odinmax-Delivery: test-1" \
  -H "X-Odinmax-Signature: t=$T,v1=$SIG" \
  --data "$BODY"

Node.js (Express)

import crypto from 'node:crypto';
import express from 'express';

const app = express();
const secret = process.env.ODINMAX_WEBHOOK_SECRET; // whsec_...

// Read the raw body: the signature covers the bytes exactly as sent.
app.post('/odinmax/webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const parts = Object.fromEntries(
    (req.get('X-Odinmax-Signature') ?? '').split(',').map((p) => p.split('=')),
  );
  const body = req.body.toString('utf8');
  const expected = crypto.createHmac('sha256', secret).update(`${parts.t}.${body}`).digest('hex');
  const given = Buffer.from(parts.v1 ?? '', 'hex');
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  const valid =
    fresh && given.length === 32 && crypto.timingSafeEqual(given, Buffer.from(expected, 'hex'));
  if (!valid) return res.status(400).end();

  // Skip a delivery you have already handled (store the id in your database).
  const deliveryId = req.get('X-Odinmax-Delivery');
  handleOnce(deliveryId, JSON.parse(body));
  res.status(200).end();
});

Python (Flask)

import hashlib, hmac, os, time
from flask import Flask, request

app = Flask(__name__)
SECRET = os.environ["ODINMAX_WEBHOOK_SECRET"].encode()  # whsec_...

@app.post("/odinmax/webhook")
def odinmax_webhook():
    header = request.headers.get("X-Odinmax-Signature", "")
    parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
    t = parts.get("t", "")
    body = request.get_data()  # raw bytes, exactly as received
    expected = hmac.new(SECRET, t.encode() + b"." + body, hashlib.sha256).hexdigest()
    fresh = t.isdigit() and abs(time.time() - int(t)) < 300
    if not fresh or not hmac.compare_digest(expected, parts.get("v1", "")):
        return "", 400

    # Skip a delivery you have already handled (store the id in your database).
    handle_once(request.headers["X-Odinmax-Delivery"], request.get_json())
    return "", 200

PHP

<?php
$secret = getenv('ODINMAX_WEBHOOK_SECRET'); // whsec_...
$body = file_get_contents('php://input');   // raw body, exactly as received

$parts = [];
foreach (explode(',', $_SERVER['HTTP_X_ODINMAX_SIGNATURE'] ?? '') as $p) {
    [$k, $v] = array_pad(explode('=', $p, 2), 2, '');
    $parts[$k] = $v;
}
$t = $parts['t'] ?? '';
$expected = hash_hmac('sha256', $t . '.' . $body, $secret);
$fresh = ctype_digit($t) && abs(time() - (int) $t) < 300;
if (!$fresh || !hash_equals($expected, $parts['v1'] ?? '')) {
    http_response_code(400);
    exit;
}

// Skip a delivery you have already handled (store the id in your database).
handle_once($_SERVER['HTTP_X_ODINMAX_DELIVERY'], json_decode($body, true));
http_response_code(200);

Sandbox

The sandbox at https://demo-api.odinmax.com works like production with test data: no real money, no real buyers. Create sandbox keys in the sandbox seller center at https://demo.odinmax.com.

  • Keys show where they work: odx_live_ for production and odx_test_ for the sandbox. A key used in the wrong place gets 401 API_KEY_WRONG_ENVIRONMENT.
  • Sandbox data can be reset at any time. Do not keep anything there you need.
  • Point your webhook to a test URL so sandbox events never reach your live system.

Versions and changes

  • The /v1 path stays stable. A breaking change gets a new path (/v2), and both run side by side for at least 6 months.
  • New fields and new events can appear at any time and are listed in the changelog.
  • An endpoint that will be retired first sends Deprecation and Sunset headers.

Terms of use

Using the API means you accept the API terms of use: fair use of the limits, keeping keys secret, and handling order data only to run your shop.