منصة B2B للسلع الرقمية

توثيق API

مرجع REST للشراء: المفاتيح، الكتالوج، الطلبات بـ product_id، الحالات، الرموز.

Base URL: https://public-api.foxreload.com

البدء السريع في 10 دقائق

المصادقة

يُمرّر كل طلب `X-API-Key: YOUR_API_KEY`. تُصدر المفاتيح في `لوحة التحكم → API` وتُعرض مرة واحدة فقط. يمكن تحديد IP allowlist للمفتاح. HTTPS مطلوب.

curl https://public-api.foxreload.com/api/products/?category_id_or_slug=steam \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Accept: application/json"

نقاط النهاية الأساسية

MethodPathDescription
GET/api/categories/List categories (tree via parent_id_or_slug).
GET/api/products/List products in a category. The product id is the itemId for orders.
GET/api/products/searchSearch products by query.
POST/api/orders/Create an order by product_id (itemId). 1–10 items.
GET/api/orders/{order_id}Order status; codes in items[].externalData when completed.
GET/api/orders/Paginated order history with status filter.
POST/api/orders/{order_id}/payCreate a payment for an order.
POST/api/topups/crypto/Top up balance with crypto.

إنشاء طلب

تُنشأ الطلبات بـ `product_id` (الحقل `itemId`) — لا يكشف API العام عن العروض. من 1 إلى 10 عناصر لكل طلب. `totalPrice` اختياري: بدونه يُستخدم سعر المنتج الحالي. إذا احتاج المنتج بيانات إضافية (مثل معرّف اللاعب)، أرسلها في `note`.

POST https://public-api.foxreload.com/api/orders/
X-API-Key: YOUR_API_KEY
Content-Type: application/json

{
  "items": [
    { "itemId": "product_01krgfgww8eth9xvvysd6y7r4j", "quantity": 5 }
  ]
}

سحب الرموز

لا يوجد webhooks في API العام — استطلع `GET /api/orders/{order_id}`. عندما تصبح الحالة `completed`، يحتوي كل `items[].externalData` على رموز المنتج.

GET https://public-api.foxreload.com/api/orders/{order_id}
X-API-Key: YOUR_API_KEY

{
  "id": "order-uuid",
  "status": "completed",
  "items": [
    {
      "product": { "id": "product_01krg...", "name": "Steam 500 RUB" },
      "quantity": 5,
      "externalData": ["XXXX-YYYY-ZZZZ", "..."],
      "error": null
    }
  ]
}

الموثوقية

استخدم التراجع الأسي عند أخطاء الشبكة و`HTTP 429`. افحص حالة الطلب قبل إعادة إنشائه لتجنب الشراء المضاعف.

مواصفة OpenAPI 3.1 الكاملة

https://public-api.foxreload.com/openapi.json · OpenAPI 3.1 / JSON. Compatible with swagger-ui, redoc, insomnia, postman.