🏢واجهة برمجة تطبيقات حالة التاجر
This endpoint returns the status of the merchant that owns the API key. A key cannot inspect another merchant.
ملحوظة:
تأكد من اجتياز صالحةmerchant_idعند تقديم الطلب. إذا كان التاجر غير موجود أو لم يتم العثور عليه، فسوف تتلقى رسالة404 Not Foundخطأ.
- 🔹 تتطلب واجهة برمجة التطبيقاتمفتاح واجهة برمجة التطبيقاتللمصادقة.
- 🔹 الmerchant_idيجب أن يتم تمريرها كمعلمة استعلام في الطلب.
Server-to-server
Backend integration examples
Choose your backend language. Every example reads secret credentials only from environment variables.
API key stays server-side
Node.js 18+ · native fetch
const response = await fetch("https://api.dinakel.com/api/gateway/v1/merchants/<merchant_id>/status", {
method: "GET"
headers: {
Authorization: `Bearer ${process.env.DINAKEL_API_KEY}`,
Accept: "application/json"
}
});
const result = await response.json();
if (!response.ok) throw new Error(result.message || "Dinakel request failed");
console.log(result);DINAKEL_API_KEYMerchant secret API key; keep it on the server only
💡 طلب مثال
GET https://api.dinakel.com/api/gateway/v1/merchants/<merchant_id>/status
Headers:
Authorization: Bearer <your_api_key>
🔍 الرد المثالى
{
"status": true,
"statusCode": 200,
"data": {
"merchantStatus": "active"
}
}
⚠️ معالجة الأخطاء
توفر واجهة برمجة التطبيقات استجابات الخطأ التالية:
{
"status": false,
"statusCode": 400,
"message": "Invalid or missing merchant_id"
}
400 Bad Request:معلمة Merchant_id غير صالحة. تأكد من استخدام تنسيق المعرف الصحيح.
{
"status": false,
"statusCode": 403,
"message": "API key is not authorized for this merchant"
}
403 Forbidden: The key does not belong to the requested merchant.
{
"status": false,
"statusCode": 404,
"message": "Merchant not found"
}
404 Not Found:التاجر صاحب المعرف المقدم غير موجود في النظام. تحقق مرة أخرى من معرف التاجر.
{
"status": false,
"statusCode": 500,
"message": "Internal server error"
}
500 Internal Server Error:حدث خطأ غير متوقع على الخادم. حاول مرة أخرى لاحقًا أو اتصل بالدعم.