Account API2026-11إصدار تجريبي

الرصيد

المال الذي تُدفع منه طلباتك، بـ CN¥. تضيف إليه من ninjabuy.com؛ والـ API يقرؤه ولا يخصم من بطاقة أبدًا.
  • الطلب الذي لا يغطيه رصيدك ينتظر بحالة awaiting_payment ويتابع تلقائيًا بعد شحن الرصيد.
  • المبالغ المستردة، لطلب ملغى أو بند لم نستطع شراءه، تعود إلى الرصيد. الرسوم تذكر كل تكلفة.

كائن Balance

availablemoney
ما يمكن للطلبات الجديدة إنفاقه، بـ CN¥.
reservedmoney
محجوز للطلبات قيد الشراء والطرود التي تنتظر الوزن.
top_up_urlstring
حيث تضيف الرصيد، بعد تسجيل الدخول في 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"
}

جلب الرصيد

GET/v1/balance

راجعه قبل إرسال دفعة كبيرة من الطلبات.

النطاقbalance: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"
}

عرض المعاملات

GET/v1/balance/transactions

عمليات شحن الرصيد، ورسوم الطلبات والشحن، والمبالغ المستردة، الأحدث أولًا. المبالغ بإشارة: الخصم سالب.

النطاقbalance:read

معاملات الاستعلام

typestring
اختياري. top_up أو order أو shipping أو refund.
orderstring
اختياري. معرّف طلب: كل ما حرّكه ذلك الطلب.
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"
}