Konto-API2026-11Vorschau

Guthaben

Das Geld, aus dem deine Bestellungen bezahlt werden, in CN¥. Du lädst es auf ninjabuy.com auf; die API liest es und belastet nie eine Karte.
  • Eine Bestellung, die dein Guthaben nicht deckt, wartet als awaiting_payment und geht nach einer Aufladung von selbst weiter.
  • Erstattungen für eine stornierte Bestellung oder eine Position, die wir nicht kaufen konnten, gehen zurück aufs Guthaben. Gebühren listet jede Belastung.

Das Balance-Objekt

availablemoney
Was neue Bestellungen ausgeben können, in CN¥.
reservedmoney
Reserviert für Bestellungen, die gerade gekauft werden, und Pakete, die noch gewogen werden müssen.
top_up_urlstring
Wo du auflädst, angemeldet auf 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"
}

Das Guthaben abrufen

GET/v1/balance

Prüf es, bevor du einen großen Schwung Bestellungen schickst.

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"
}

Transaktionen auflisten

GET/v1/balance/transactions

Aufladungen, Bestell- und Versandbelastungen und Erstattungen, neueste zuerst. Beträge haben ein Vorzeichen: Eine Belastung ist negativ.

Scopebalance:read

Query-Parameter

typestring
Optional. top_up, order, shipping oder refund.
orderstring
Optional. Eine Bestell-ID: alles, was diese Bestellung bewegt hat.
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"
}