API reference

Orders

On this page

Read orders and move them along: change the status, add shipment details and add internal notes. The rules, the messages to the customer, the stock effects and the webhooks are exactly those of the admin. Every order says where it came from (the read-only source), and the full shape (?expand=full) also carries the read-only gift fields (gift, gift_message and packaging). Payment status, amounts, the source and the gift details can never be changed, and orders are never refunded or deleted through the API.

Order numbers and the order prefix#

An order number is text: the store's order prefix, the date as year, month and day (yymmdd), a dash and four letters or digits, for example GK-261008-7WNM. You put it in the address of the order calls, for example /api/v1/orders/GK-261008-7WNM, and you read it in the number field.

  • The prefix is a store setting (Settings > Store settings > Company & invoicing, the Order numbers card): 2 to 6 letters or digits followed by a dash, for example GK- or SHOP1-. Small letters are changed to capitals. A new store starts with GK-. Only a Super Admin can change it.
  • A new prefix applies to new orders only. Every order keeps the number it was given, and orders with an earlier prefix are still found by their number, in the API and in webhooks too.
  • Always treat the order number as text. Do not assume it starts with GK-, do not cut the prefix off, do not turn it into a number, and do not assume that all the orders of a store have the same prefix.

The order object#

The fields marked expand=full are only included when you add ?expand=full to the read calls. Answers to writes and webhooks always include them.

FieldTypeIncludedMeaning
idintegerAlwaysThe order id.
numberstringAlwaysThe order number: the store's order prefix, the date as yymmdd, a dash and four letters or digits. It is text, and it is what you put in the address of an order call.
statusstringAlwaysplaced, packed, shipped, out_for_delivery, delivered or cancelled.
payment_methodstringAlwaysHow the order is paid, for example cod for cash on delivery.
payment_statusstringAlwayspending, awaiting, paid, failed, partially_refunded or refunded. It cannot be changed through the API.
subtotalintegerAlwaysTotal of the item lines, in whole units of the store's currency.
discountintegerAlwaysDiscount applied, in whole units of the store's currency.
shippingintegerAlwaysShipping charge, in whole units of the store's currency.
totalintegerAlwaysAmount to pay, in whole units of the store's currency.
couponstring or nullAlwaysThe coupon code used, if any.
customerobjectAlwaysThe customer who placed the order.
customer.namestringAlwaysThe customer's name.
customer.emailstring or nullAlwaysThe customer's email address.
customer.phonestring or nullAlwaysThe customer's phone number.
addressobjectAlwaysThe delivery address.
address.line1stringAlwaysFirst address line.
address.line2string or nullAlwaysSecond address line.
address.citystring or nullAlwaysCity.
address.statestring or nullAlwaysState.
address.pincodestringAlwaysPincode.
courierstring or nullAlwaysThe courier, once shipment details are saved.
awbstring or nullAlwaysThe AWB (consignment) number.
itemsarrayAlwaysThe order lines. They cannot be changed through the API.
items[].product_idinteger or nullAlwaysThe product id.
items[].namestringAlwaysThe product name when it was ordered.
items[].variantstringAlwaysThe size label when it was ordered.
items[].priceintegerAlwaysPrice of one unit, in whole units of the store's currency.
items[].qtyintegerAlwaysUnits ordered.
created_atstringAlwaysWhen the order was placed (ISO 8601, with its UTC offset).
sourcestringAlwaysWhere the order came from: website, phone, whatsapp, counter, marketplace or other. Read only: it cannot be changed through the API. An order placed at the online checkout is always website.
tracking_urlstring or nullexpand=fullThe tracking link.
cancel_reasonstring or nullexpand=fullWhy the order was cancelled.
refund_statusstringexpand=fullnone when no refund is recorded. Other values describe the refund; order.refunded is sent when one is processed.
refunded_amountnumberexpand=fullAmount refunded, in the store's currency. 0 when nothing was refunded.
updated_atstringexpand=fullWhen the order was last changed (ISO 8601, UTC).
giftbooleanexpand=fulltrue when the shopper marked the order as a gift. Read only.
gift_messagestring or nullexpand=fullThe plain-text gift message the shopper wrote, or null. Read only. A webhook endpoint that is set not to include personal details always gets null here.
packagingobject or nullexpand=fullThe gift packaging chosen, as it was when the order was placed. null when none was chosen. Read only.
packaging.namestringexpand=fullThe name of the packaging option.
packaging.feeintegerexpand=fullThe packaging fee, in whole units of the store's currency. It is already inside the order total.
packaging.gst_ratenumber or nullexpand=fullThe GST rate of the packaging fee, in percent.

List orders#

GET/api/v1/ordersread:orders

Orders, newest first, with items, customer contact details and delivery address. Each order carries a read-only source (where it came from: website, phone, whatsapp, counter, marketplace or other). Otherwise the default answer is the one this API has always given; expand=full adds tracking_url, cancel_reason, refund_status, refunded_amount, updated_at, gift, gift_message and packaging.

Each order carries the read-only source: website, phone, whatsapp, counter, marketplace or other. An order that a staff member created for a customer is in the list like any other order. There is no filter by source: read the field.

The store may be set up to use any order prefix, so never rely on the first letters of number.

Query parameters

NameTypeMeaning
statusstringplaced, packed, shipped, out_for_delivery, delivered or cancelled.
One of: placed, packed, shipped, out_for_delivery, delivered, cancelled
payment_statusstringpending, awaiting, paid, failed, partially_refunded or refunded.
afterstringOnly orders placed at or after this date or time.
expandstringfull: add tracking_url, cancel_reason, refund_status, refunded_amount, updated_at, gift, gift_message and packaging.
One of: full
limitintegerRows per page, 1 to 100 (default 25). per_page works too.
pageintegerPage number, starting at 1.
updated_sincestringOnly rows changed at or after this time (ISO 8601, for example 2026-11-21T10:00:00Z, or a date).

Example request

curl -s "https://yourstore.example.com/api/v1/orders?status=placed&limit=25" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example answer (200 OK)

{
    "data": [
        {
            "id": 1024,
            "number": "GK-261008-7WNM",
            "status": "placed",
            "payment_method": "cod",
            "payment_status": "pending",
            "subtotal": 1197,
            "discount": 100,
            "shipping": 60,
            "total": 1217,
            "coupon": "WELCOME10",
            "customer": {
                "name": "Sample Customer",
                "email": "buyer@example.com",
                "phone": "9000000000"
            },
            "address": {
                "line1": "12 Sample Street",
                "line2": null,
                "city": "Sample City",
                "state": "Sample State",
                "pincode": "123456"
            },
            "courier": null,
            "awb": null,
            "items": [
                {
                    "product_id": 7,
                    "name": "Sample Product",
                    "variant": "250 g",
                    "price": 399,
                    "qty": 3
                }
            ],
            "created_at": "2026-11-21T10:15:00+00:00",
            "source": "website"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 25,
        "total": 1,
        "last_page": 1
    },
    "links": {
        "first": "https://yourstore.example.com/api/v1/orders?page=1",
        "last": "https://yourstore.example.com/api/v1/orders?page=1",
        "prev": null,
        "next": null
    }
}

Errors

StatusCodeWhen
401missing_api_key, invalid_api_key, revoked_api_key, expired_api_keyThe key is missing, not valid, revoked or expired.
403insufficient_scopeThe key does not have the read:orders scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
422validation_failedupdated_since could not be read as a date or time.
429rate_limitedMore requests than the key's limit in a minute. Wait for Retry-After.

Example error answer (403):

{
    "error": {
        "code": "insufficient_scope",
        "message": "This API key does not have the \"read:orders\" scope. Add it to the key in the admin (API & webhooks > API keys), or use a key that has it.",
        "required_scope": "read:orders"
    }
}

Get an order#

GET/api/v1/orders/{number}read:orders

One order by its order number (for example GK-261008-7WNM; it is text, a prefix, the date and four letters or digits). The order carries a read-only source (website, phone, whatsapp, counter, marketplace or other). Add expand=full for the extra fields, which include the read-only gift fields (gift, gift_message and packaging).

Put the order number in the address exactly as the store shows it. It is text.

Address parameters

NameTypeMeaning
numberstringThe order number, for example GK-261008-7WNM. The first letters are the store's order prefix (GK- by default). Use the number exactly as the store shows it.

Query parameters

NameTypeMeaning
expandstringfull: add tracking_url, cancel_reason, refund_status, refunded_amount, updated_at, gift, gift_message and packaging.
One of: full

Example request

curl -s "https://yourstore.example.com/api/v1/orders/GK-261008-7WNM?expand=full" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example answer (200 OK)

{
    "data": {
        "id": 1024,
        "number": "GK-261008-7WNM",
        "status": "placed",
        "payment_method": "cod",
        "payment_status": "pending",
        "subtotal": 1197,
        "discount": 100,
        "shipping": 60,
        "total": 1217,
        "coupon": "WELCOME10",
        "customer": {
            "name": "Sample Customer",
            "email": "buyer@example.com",
            "phone": "9000000000"
        },
        "address": {
            "line1": "12 Sample Street",
            "line2": null,
            "city": "Sample City",
            "state": "Sample State",
            "pincode": "123456"
        },
        "courier": null,
        "awb": null,
        "items": [
            {
                "product_id": 7,
                "name": "Sample Product",
                "variant": "250 g",
                "price": 399,
                "qty": 3
            }
        ],
        "created_at": "2026-11-21T10:15:00+00:00",
        "source": "website"
    },
    "meta": {}
}

Errors

StatusCodeWhen
401missing_api_key, invalid_api_key, revoked_api_key, expired_api_keyThe key is missing, not valid, revoked or expired.
403insufficient_scopeThe key does not have the read:orders scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
404not_foundThat order does not exist.
429rate_limitedMore requests than the key's limit in a minute. Wait for Retry-After.

Example error answer (403):

{
    "error": {
        "code": "insufficient_scope",
        "message": "This API key does not have the \"read:orders\" scope. Add it to the key in the admin (API & webhooks > API keys), or use a key that has it.",
        "required_scope": "read:orders"
    }
}

Change an order's status#

PATCH/api/v1/orders/{number}write:orders

Moves the order to another status with the same rules as the admin: a cancelled order cannot move on, an online order must be paid before it is packed, shipped, out for delivery or delivered, and cancelling needs a reason (it gives the stock back). The customer messages (email, SMS / WhatsApp), the stock, the audit log and the webhooks are exactly those of the admin. Payment status and amounts cannot be changed.

Moving an order to cancelled needs a reason and gives the stock back. A cancelled order cannot move on.

Address parameters

NameTypeMeaning
numberstringThe order number, for example GK-261008-7WNM. The first letters are the store's order prefix (GK- by default). Use the number exactly as the store shows it.

Request body (JSON)

FieldTypeRequiredLimitsMeaning
statusstringYesThe new status.
One of: placed, packed, shipped, out_for_delivery, delivered, cancelled
Example: packed
reasonstring or nullNoat most 500 charactersWhy the order is cancelled (required when status is cancelled).
Example: Customer asked to cancel
notestring or nullNoat most 2000 charactersAn internal note saved with the change.
Example: Packed by the warehouse system

Any field not listed here is refused with 422. Send an Idempotency-Key header so a retry is safe (see Requests).

Example request

curl -s -X PATCH "https://yourstore.example.com/api/v1/orders/GK-261008-7WNM" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0b3e-0d5a-4a52-9d5e-1f6c2a7b9e10" \
  -d '{
    "status": "packed",
    "note": "Packed by the warehouse system"
}'

Example answer (200 OK)

{
    "data": {
        "id": 1024,
        "number": "GK-261008-7WNM",
        "status": "placed",
        "payment_method": "cod",
        "payment_status": "pending",
        "subtotal": 1197,
        "discount": 100,
        "shipping": 60,
        "total": 1217,
        "coupon": "WELCOME10",
        "customer": {
            "name": "Sample Customer",
            "email": "buyer@example.com",
            "phone": "9000000000"
        },
        "address": {
            "line1": "12 Sample Street",
            "line2": null,
            "city": "Sample City",
            "state": "Sample State",
            "pincode": "123456"
        },
        "courier": null,
        "awb": null,
        "items": [
            {
                "product_id": 7,
                "name": "Sample Product",
                "variant": "250 g",
                "price": 399,
                "qty": 3
            }
        ],
        "created_at": "2026-11-21T10:15:00+00:00",
        "source": "website",
        "tracking_url": null,
        "cancel_reason": null,
        "refund_status": "none",
        "refunded_amount": 0,
        "updated_at": "2026-11-21T10:15:00Z",
        "gift": true,
        "gift_message": "Happy celebrations! With best wishes.",
        "packaging": {
            "name": "Sample Packaging",
            "fee": 60,
            "gst_rate": 18
        }
    },
    "meta": {}
}

Errors

StatusCodeWhen
401missing_api_key, invalid_api_key, revoked_api_key, expired_api_keyThe key is missing, not valid, revoked or expired.
403insufficient_scopeThe key does not have the write:orders scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
404not_foundThat order does not exist.
422validation_failedA field is missing or wrong. error.fields says which and why.
422transition_not_allowedThe order cannot move to that status (cancelled orders are final; online orders must be paid first). The message is the admin's.
422order_not_cancellableA delivered or already cancelled order cannot be cancelled.
409idempotency_key_reuse, idempotency_in_progressThe Idempotency-Key was used for a different request, or the first request with it is still running.
429rate_limitedMore requests than the key's limit in a minute. Wait for Retry-After.

Example error answer (422):

{
    "error": {
        "code": "validation_failed",
        "message": "The request could not be accepted. See \"fields\" for what to fix.",
        "fields": {
            "status": [
                "The status field is required."
            ]
        }
    }
}

Add shipment details#

POST/api/v1/orders/{number}/shipmentwrite:orders

Saves the courier, AWB and tracking link, and moves a placed or packed order to shipped when that is allowed (an online order must be paid first). The "Shipped" message to the customer is sent as in the admin. If the tracking link is left out it is built from the courier and AWB when the courier is listed in Settings > Shipping. Calling it again on a shipped order only updates the details.

Moves a placed or packed order to shipped when that is allowed. Calling it again on a shipped order only updates the details.

Address parameters

NameTypeMeaning
numberstringThe order number, for example GK-261008-7WNM. The first letters are the store's order prefix (GK- by default). Use the number exactly as the store shows it.

Request body (JSON)

FieldTypeRequiredLimitsMeaning
courierstringYesat most 100 charactersCourier name, for example Sample Courier.
Example: Sample Courier
awbstringYesat most 100 charactersAWB / consignment number.
Example: 38472910
tracking_urlstring or nullNoat most 500 charactersTracking link (an http or https address).
Example: https://courier.example.com/track/38472910

Any field not listed here is refused with 422. Send an Idempotency-Key header so a retry is safe (see Requests).

Example request

curl -s -X POST "https://yourstore.example.com/api/v1/orders/GK-261008-7WNM/shipment" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0b3e-0d5a-4a52-9d5e-1f6c2a7b9e10" \
  -d '{
    "courier": "Sample Courier",
    "awb": "38472910"
}'

Example answer (200 OK)

{
    "data": {
        "id": 1024,
        "number": "GK-261008-7WNM",
        "status": "placed",
        "payment_method": "cod",
        "payment_status": "pending",
        "subtotal": 1197,
        "discount": 100,
        "shipping": 60,
        "total": 1217,
        "coupon": "WELCOME10",
        "customer": {
            "name": "Sample Customer",
            "email": "buyer@example.com",
            "phone": "9000000000"
        },
        "address": {
            "line1": "12 Sample Street",
            "line2": null,
            "city": "Sample City",
            "state": "Sample State",
            "pincode": "123456"
        },
        "courier": null,
        "awb": null,
        "items": [
            {
                "product_id": 7,
                "name": "Sample Product",
                "variant": "250 g",
                "price": 399,
                "qty": 3
            }
        ],
        "created_at": "2026-11-21T10:15:00+00:00",
        "source": "website",
        "tracking_url": null,
        "cancel_reason": null,
        "refund_status": "none",
        "refunded_amount": 0,
        "updated_at": "2026-11-21T10:15:00Z",
        "gift": true,
        "gift_message": "Happy celebrations! With best wishes.",
        "packaging": {
            "name": "Sample Packaging",
            "fee": 60,
            "gst_rate": 18
        }
    },
    "meta": {}
}

Errors

StatusCodeWhen
401missing_api_key, invalid_api_key, revoked_api_key, expired_api_keyThe key is missing, not valid, revoked or expired.
403insufficient_scopeThe key does not have the write:orders scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
404not_foundThat order does not exist.
422validation_failedA field is missing or wrong. error.fields says which and why.
422transition_not_allowedThe order cannot move to that status (cancelled orders are final; online orders must be paid first). The message is the admin's.
409idempotency_key_reuse, idempotency_in_progressThe Idempotency-Key was used for a different request, or the first request with it is still running.
429rate_limitedMore requests than the key's limit in a minute. Wait for Retry-After.

Example error answer (422):

{
    "error": {
        "code": "validation_failed",
        "message": "The request could not be accepted. See \"fields\" for what to fix.",
        "fields": {
            "courier": [
                "The courier field is required."
            ]
        }
    }
}

Add an internal note#

POST/api/v1/orders/{number}/noteswrite:orders

Adds a note to the order history. Notes are internal: the customer never sees them.

Notes are internal. The customer never sees them.

Address parameters

NameTypeMeaning
numberstringThe order number, for example GK-261008-7WNM. The first letters are the store's order prefix (GK- by default). Use the number exactly as the store shows it.

Request body (JSON)

FieldTypeRequiredLimitsMeaning
notestringYesat most 2000 charactersThe note.
Example: Customer called to confirm the address.

Any field not listed here is refused with 422. Send an Idempotency-Key header so a retry is safe (see Requests).

Example request

curl -s -X POST "https://yourstore.example.com/api/v1/orders/GK-261008-7WNM/notes" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0b3e-0d5a-4a52-9d5e-1f6c2a7b9e10" \
  -d '{
    "note": "Customer called to confirm the address."
}'

Example answer (201 Created)

{
    "data": {
        "id": 1024,
        "number": "GK-261008-7WNM",
        "status": "placed",
        "payment_method": "cod",
        "payment_status": "pending",
        "subtotal": 1197,
        "discount": 100,
        "shipping": 60,
        "total": 1217,
        "coupon": "WELCOME10",
        "customer": {
            "name": "Sample Customer",
            "email": "buyer@example.com",
            "phone": "9000000000"
        },
        "address": {
            "line1": "12 Sample Street",
            "line2": null,
            "city": "Sample City",
            "state": "Sample State",
            "pincode": "123456"
        },
        "courier": null,
        "awb": null,
        "items": [
            {
                "product_id": 7,
                "name": "Sample Product",
                "variant": "250 g",
                "price": 399,
                "qty": 3
            }
        ],
        "created_at": "2026-11-21T10:15:00+00:00",
        "source": "website",
        "tracking_url": null,
        "cancel_reason": null,
        "refund_status": "none",
        "refunded_amount": 0,
        "updated_at": "2026-11-21T10:15:00Z",
        "gift": true,
        "gift_message": "Happy celebrations! With best wishes.",
        "packaging": {
            "name": "Sample Packaging",
            "fee": 60,
            "gst_rate": 18
        }
    },
    "meta": {}
}

Errors

StatusCodeWhen
401missing_api_key, invalid_api_key, revoked_api_key, expired_api_keyThe key is missing, not valid, revoked or expired.
403insufficient_scopeThe key does not have the write:orders scope. error.required_scope names it. (api_key_disabled and ip_not_allowed also give 403.)
404not_foundThat order does not exist.
422validation_failedA field is missing or wrong. error.fields says which and why.
409idempotency_key_reuse, idempotency_in_progressThe Idempotency-Key was used for a different request, or the first request with it is still running.
429rate_limitedMore requests than the key's limit in a minute. Wait for Retry-After.

Example error answer (422):

{
    "error": {
        "code": "validation_failed",
        "message": "The request could not be accepted. See \"fields\" for what to fix.",
        "fields": {
            "note": [
                "The note field is required."
            ]
        }
    }
}