Account API2026-11Preview

Balance

The money your orders are paid from, in CN¥. You add to it on ninjabuy.com; the API reads it and never charges a card.
  • An order your balance cannot cover waits as awaiting_payment and goes ahead by itself after a top-up.
  • Refunds, for a cancelled order or a line we could not buy, go back to the balance. Fees lists every charge.

The Balance object

availablemoney
What new orders can spend, in CN¥.
reservedmoney
Held for orders being bought and parcels waiting to be weighed.
top_up_urlstring
Where you add money, signed in on ninjabuy.com.
balance
{
  "available": { "amount": "2140.00", "currency": "CNY" },
  "reserved": { "amount": "264.20", "currency": "CNY" },
  "top_up_url": "https://www.ninjabuy.com/me/balance/top-up",
  "updated_at": "2026-11-04T09:20:03Z"
}

Retrieve the balance

GET/v1/balance

Check it before you send a large batch of orders.

Scopebalance:read

curl "https://www.ninjabuy.com/api/v1/balance" \
  -H "Authorization: Bearer $NINJABUY_API_KEY" \
  -H "NinjaBuy-Version: 2026-11"
Response 200
HTTP/2 200 OK

{
  "available": { "amount": "2140.00", "currency": "CNY" },
  "reserved": { "amount": "264.20", "currency": "CNY" },
  "top_up_url": "https://www.ninjabuy.com/me/balance/top-up",
  "updated_at": "2026-11-04T09:20:03Z"
}

List transactions

GET/v1/balance/transactions

Top-ups, order and shipping charges, and refunds, newest first. Amounts are signed: a charge is negative.

Scopebalance:read

Query parameters

typestring
Optional. top_up, order, shipping or refund.
orderstring
Optional. An order id: everything that order moved.
limit, cursor
Pagination
curl "https://www.ninjabuy.com/api/v1/balance/transactions?limit=3" \
  -H "Authorization: Bearer $NINJABUY_API_KEY" \
  -H "NinjaBuy-Version: 2026-11"
Response 200
HTTP/2 200 OK

{
  "data": [
    {
      "id": "txn_k22a",
      "type": "shipping",
      "order": "ord_3n7q",
      "amount": { "amount": "-134.52", "currency": "CNY" },
      "created_at": "2026-11-03T05:58:00Z"
    },
    {
      "id": "txn_k21d",
      "type": "order",
      "order": "ord_3n7q",
      "amount": { "amount": "-57.00", "currency": "CNY" },
      "created_at": "2026-11-01T09:14:02Z"
    },
    {
      "id": "txn_k1zz",
      "type": "top_up",
      "order": null,
      "amount": { "amount": "2000.00", "currency": "CNY" },
      "created_at": "2026-10-31T16:40:12Z"
    }
  ],
  "has_more": true,
  "cursor": "c_k1zz"
}