الصلاحيات (Scopes)
كل مفتاح يحمل صلاحيات مثل read_products وread_orders وwrite_products. الطلب خارج صلاحيات المفتاح يُرفض، فامنح الحد الأدنى فقط.
المطورون
أنشئ زوج مفاتيح من لوحة التاجر ونفّذ أول طلب قراءة على متجرك بأمر curl واحد.
تحتاج إلى زوج مفاتيح: المعرّف (x-api-key) والسر (x-api-secret) معًا في كل طلب.
curl
curl https://<api-host>/api/v1/developer/store \ -H "x-api-key: <key-id>" \ -H "x-api-secret: <secret>"
fetch
const res = await fetch(
"https://<api-host>/api/v1/developer/products?page=1&perPage=25",
{
headers: {
"x-api-key": process.env.TAJER_API_KEY,
"x-api-secret": process.env.TAJER_API_SECRET,
},
},
);
const body = await res.json();
if (!body.success) throw new Error(body.error.code);
console.log(body.data, body.meta);كل مفتاح يحمل صلاحيات مثل read_products وread_orders وwrite_products. الطلب خارج صلاحيات المفتاح يُرفض، فامنح الحد الأدنى فقط.
كل المسارات والحقول موثقة في واجهة OpenAPI التفاعلية على /api/docs/ui في خادم الـ API.
/api/docs/ui
200
{ "success": true, "data": [ ... ], "meta": { ... } }القوائم تعيد meta للترقيم.
4xx / 5xx
{ "success": false, "message": "...", "error": { "code": "...", "message": "..." } }تحقق من success أولًا ثم تعامل مع error.code.