* Happy Diwali *
New arrivals Videos How it works Login
API docs

OnlineKurtis API v1

Products, live stock, and order placing from your own website. Show our designs, prices and live stock on your own website.

How to get your API key

  1. Sign up free and finish your KYC.
  2. Ask us for API access on WhatsApp or from the Contact page.
  3. Your key then shows in your account, under API.
Sign up free Contact us

Have a Shopify store? Our Shopify Connector puts our products in your store and keeps price and stock updated, with no coding. It can also bring your new orders to us by themselves and send tracking back to Shopify. No developer needed. Use this API only if you want your own code to place orders (section 4); it is included in the Shopify Connector plan at no extra cost.

1. Basics

Base URL: https://www.onlinekurtis.com/api/v1. All responses are JSON. Every response has "ok": true or "ok": false with an error code and a plain message.

Send your key in the header on every call:

Authorization: Bearer ok_live_XXXXXXXXXXXXXXXXXXXXXXXX

Keep the key on your server. Never put it in a web page or app that customers download; anyone can read it there. If it leaks, press Regenerate on the API page and update your server.

Limit: 60 calls per minute. Over that you get 429 with a Retry-After header. Stock changes every few minutes, not every second, so pull it once a minute at most and cache it on your side.

2. Stock states

We never send stock counts. Each size has one of three states:

in_stockSell freely.
lowFewer than 5 pieces left. Sell, but expect it to run out.
outDo not sell. Hide the size or mark it sold out.

A product disappears from every list when we take it off the catalogue. If you stored it, treat a missing SKU as out.

3. Products and stock

GET /me

Checks your key. Returns your account name, plan end date and the list of endpoints.

curl https://www.onlinekurtis.com/api/v1/me \
  -H "Authorization: Bearer ok_live_..."

GET /products

The full live catalogue, 100 products a page. Optional page=2 and updated_since=2026-09-01T00:00:00Z (only products changed after that time, so a daily sync stays small).

{
  "ok": true, "page": 1, "per_page": 100, "total": 128, "pages": 2,
  "products": [
    {
      "sku": "OK-1043",
      "title": "Blue floral rayon kurti",
      "url": "https://www.onlinekurtis.com/product/blue-floral-rayon-kurti-ok-1043",
      "description": "...",
      "dropship_price": 625,
      "mrp": 1299,
      "weight_grams": 300,
      "badge": "new",
      "collections": ["Rayon kurtis", "Office wear"],
      "images": ["https://www.onlinekurtis.com/media/....webp", "..."],
      "sizes": [
        {"size": "M",  "stock": "in_stock"},
        {"size": "L",  "stock": "low"},
        {"size": "XL", "stock": "out"}
      ],
      "added_at": "2026-09-12T10:20:00+05:30",
      "updated_at": "2026-09-25T02:00:11+05:30"
    }
  ]
}

dropship_price is what you pay us per piece, in rupees, shipping extra by weight. mrp is the retail price we show on our own site; there is no price tag on the garment, so you are free to set your own selling price. added_at is when the design joined our catalogue, so you can run a "new arrivals" section; badge is the label we show for it (for example new), or null. Images are 1200 px wide; you may show them on your site.

GET /products/{sku}

One product, same shape. 404 if the SKU is not live.

GET /stock

Every live SKU with size states only, in one call. This is the one to poll. The answer is refreshed every 60 seconds on our side (as_of tells you when).

{
  "ok": true, "as_of": "2026-09-26T14:03:10+05:30", "count": 128, "cache_seconds": 60,
  "stock": [
    {"sku": "OK-1043", "sizes": [{"size": "M", "stock": "in_stock"}, {"size": "L", "stock": "low"}]},
    ...
  ]
}

GET /stock/{sku}

One SKU, live (no cache). Use it at the moment a customer checks out, before you accept their money.

4. Orders

Your website takes the order and the money from your customer. Then your server sends us the order. We create it on your account, waiting for your payment, and send you a payment link on WhatsApp. We pack and ship only after you pay. The parcel goes to your customer with your name on it.

Three things to get right on day one:

  1. Creating the order does not ship it. Paying the link does. You have 24 hours, then the order cancels itself.
  2. Always send an Idempotency-Key header. Use your own order number. If your call times out and you retry with the same key, you get the same order back, never a second one.
  3. size is the exact label from /products/{sku}, for example M (40). A bare M also works when it matches one size only.

POST /orders

Headers: Authorization, Content-Type: application/json, Idempotency-Key. Body:

{
  "your_ref": "8831",
  "buyer": {
    "name": "Pooja Sharma",
    "phone": "9876543210",
    "address": "12 Gokul Nagar, near Shiv Mandir",
    "landmark": "opp. SBI ATM",
    "city": "Jaipur",
    "state": "Rajasthan",
    "pincode": "302012"
  },
  "items": [
    { "sku": "DK-1058", "size": "M (40)", "qty": 1 },
    { "sku": "DK-1072", "size": "L (42)", "qty": 2 }
  ],
  "note": "leave with security if not home"
}

your_ref is your own order number (up to 60 characters, optional but recommended; you can fetch the order by it later). landmark and note are optional. phone is a 10 digit Indian mobile. India only. Up to 20 lines, qty 1 to 50 each. Do not send prices; we charge what /products shows at that moment, plus shipping by weight.

Response 201:

{
  "ok": true,
  "order": {
    "order_no": "OK-2611-0042",
    "your_ref": "8831",
    "status": "awaiting_payment",
    "items_rs": 1875,
    "shipping_rs": 129,
    "total_rs": 2004,
    "pieces": 3,
    "pay_url": "https://www.onlinekurtis.com/pay/s/7fk2Qm...",
    "pay_by": "2026-11-07T18:30:00+05:30",
    "paid_at": null,
    "courier": null, "awb": null, "tracking_url": null,
    "dispatched_at": null, "delivered_at": null,
    "buyer": { "name": "Pooja Sharma", "city": "Jaipur", "pincode": "302012" },
    "items": [
      { "sku": "DK-1058", "size": "M (40)", "qty": 1, "unit_rs": 625, "status": "ok" },
      { "sku": "DK-1072", "size": "L (42)", "qty": 2, "unit_rs": 625, "status": "ok" }
    ],
    "created_at": "2026-11-06T18:30:00+05:30",
    "updated_at": "2026-11-06T18:30:00+05:30"
  }
}

The same request again with the same Idempotency-Key returns 200 with "duplicate": true and the same order. Nothing new is created.

If any line cannot be fulfilled, the whole order is refused and nothing is created (we never ship half a parcel):

HTTP 409
{
  "ok": false,
  "error": "out_of_stock",
  "message": "DK-1072 size L (42): only 1 left, you asked 2. The whole order was refused; nothing was created.",
  "sku": "DK-1072", "size": "L (42)", "available": 1
}

GET /orders/{order_no}

One order, same shape. {order_no} can be our number (OK-2611-0042) or your your_ref. Use this to show tracking to your customer if you do not use webhooks.

curl https://www.onlinekurtis.com/api/v1/orders/OK-2611-0042 -H "Authorization: Bearer ok_live_..."

GET /orders

All orders on your account, newest first, 100 a page. Optional since=2026-11-01T00:00:00Z (only orders changed after that) and page=2.

POST /orders/{order_no}/cancel

Cancels an order that is still awaiting_payment. Once paid, cancel is not possible by API; message us on WhatsApp before it is packed. Returns the order with "status": "cancelled", or 409 order_locked.

5. How an order moves

awaiting_paymentCreated. Payment link sent to you on WhatsApp (pay_url in the response too). Reminders at 3, 6 and 12 hours. Cancelled by itself after 24 hours.
paidYour payment landed. We pick and pack (packing is included in this state).
packedPacked on camera, label printed with your name as sender.
dispatchedHanded to the courier. courier, awb and tracking_url are filled. Send the tracking link to your customer.
deliveredCourier marked it delivered.
rtoCame back to us undelivered. The return charge applies as per our policy.
cancelledNot paid in time, or cancelled by you or by us before packing.
refundedMoney returned to you.

Pay several orders in one go: open your orders page, or use the latest pay_url; a link always shows every open order and lets you pay all of them together.

6. Webhooks (optional)

Set a URL on your API page and we POST to it when an order you placed by API changes: paid, packed, dispatched, tracking_changed, delivered, rto, cancelled, refunded. The body is the same order object as above, plus event and at:

POST https://yourstore.com/onlinekurtis-webhook
Content-Type: application/json
X-OK-Event: dispatched
X-OK-Delivery: 5120
X-OK-Signature: 3f1c9a...   (HMAC SHA-256 of the raw body, with your signing secret)

{
  "event": "dispatched",
  "at": "2026-11-07T13:40:00+05:30",
  "order_no": "OK-2611-0042",
  "your_ref": "8831",
  "status": "dispatched",
  "courier": "Delhivery",
  "awb": "1490812345678",
  "tracking_url": "https://www.delhivery.com/track-v2/package/1490812345678",
  ...
}

Check the signature before trusting the message, so nobody can fake a "paid" or "dispatched" to your site:

// PHP
$raw = file_get_contents('php://input');
$ok  = hash_equals(hash_hmac('sha256', $raw, $secret), $_SERVER['HTTP_X_OK_SIGNATURE'] ?? '');
if (! $ok) { http_response_code(401); exit; }
$data = json_decode($raw, true);

// Node
const sig = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
if (sig !== req.headers['x-ok-signature']) return res.status(401).end();

Answer with any 2xx within 10 seconds. Anything else, or no answer, and we retry after 5 minutes, 30 minutes and 2 hours, then give up on that one message (the next event is still sent). The last 10 deliveries and their result show on your API page. X-OK-Delivery is unique per message; if you see the same one twice (a slow 2xx on your side), ignore the repeat.

The URL must be https:// on your own domain. Webhooks tell you what happened; they never ask you to do anything, and they never carry our prices beyond what you already see in the order.

Testing with the sandbox

Use your test key (ok_test_...) to build and check everything before you go live. Get it on your API page. It works without a paid plan.

  • Same base URL and the same endpoints as the live key. Every response from a test key has the header X-OK-Mode: test.
  • Products and stock are real. Only reading, so nothing changes.
  • POST /orders is checked exactly like a live order (SKU, size, stock, PIN code, phone, price and shipping) and answers with the same shape, with "test": true and an order number like TEST-2611-0001. Nothing is packed, charged, held from stock or shown to our team, and no WhatsApp is sent.
  • Test orders are kept for 7 days, then deleted.

POST /test/orders/{order_no}/advance

Moves a test order one step and sends the matching webhook to your URL, so you can test your whole flow. Body is optional: {"to": "paid"}. Without a body it moves to the next normal step.

FromCan move to
awaiting_paymentpaid (default), cancelled
paidpacked (default), refunded
packeddispatched (default, with a test AWB and tracking URL)
dispatcheddelivered (default), rto
curl -X POST https://www.onlinekurtis.com/api/v1/test/orders/TEST-2611-0001/advance \
  -H "Authorization: Bearer ok_test_..." \
  -H "Content-Type: application/json" -d '{"to":"paid"}'

The answer has the updated order and a webhook block: whether your server answered 2xx, and the HTTP code. Test webhooks carry the header X-OK-Test: 1 and "test": true in the body, and are signed the same way as live ones. They are tried once only.

When everything works, switch your server to the live key. Nothing else changes.

7. Errors

400 bad_requestSomething missing or wrong in the body; message says what.
400 bad_jsonBody is not valid JSON, or Content-Type is not application/json.
400 missing_idempotency_keyPOST /orders without an Idempotency-Key header.
401 missing_keyNo Authorization header.
403 test_key_only/test/... was called with the live key. Use your test key.
401 invalid_keyKey not recognised. Check for spaces; regenerate if unsure.
402 subscription_expiredYour plan has ended. Renew on the API page; the same key works again.
403 key_disabledAPI access is off for your account. Talk to us.
403 orders_closedOrder placing by API is paused. Reading still works.
403 india_onlyThe order API ships inside India only.
404 not_foundSKU is not live, or no such order on your account.
409 out_of_stockA line has fewer pieces than you asked. Whole order refused. sku, size, available tell you which.
409 order_lockedCancel asked on an order that is already paid or further along.
422 unknown_skuThat SKU is not live in the catalogue.
422 bad_sizeNo such size for that SKU. sizes lists the valid labels.
422 bad_address / bad_pincode / bad_phoneBuyer details incomplete or malformed; field names the one.
429 rate_limitedToo many calls this minute. Wait for Retry-After seconds.

8. A simple setup that works

Catalogue

  1. Once a day: /products?updated_since=<yesterday>, update titles, prices, images.
  2. Every minute: /stock, update size availability on your site.
  3. At checkout: /stock/{sku} for that one SKU, and refuse the size if it is out.

Orders

  1. Your customer pays you on your site. Save their order.
  2. Your server calls POST /orders with Idempotency-Key: <your order number>. Save our order_no against your order.
  3. Got 409 out_of_stock? Refund or offer another size; nothing was created with us.
  4. Pay the link we sent on WhatsApp (or pay_url). Do it the same day; one link can cover several orders.
  5. On the dispatched webhook (or when GET /orders/{order_no} shows it), send your customer the tracking_url.
  6. On delivered or rto, close the order on your side.
Chat with us