دمج Hisab في تطبيقك باستخدام REST API الشامل الخاص بنا. قم بإنشاء وإدارة وإرسال الفواتير المتوافقة مع DGI بشكل برمجي.
Hisab API هي REST API التي تسمح لك بإدارة الفواتير والعملاء والعناصر بشكل برمجي. تعيد جميع نقاط النهاية استجابات JSON، بما في ذلك الأخطاء.
https://hisab.ma/api/v1يستخدم Hisab API مفاتيح API للمصادقة. قم بتضمين مفتاح API الخاص بك في رأس Authorization كـ Bearer token:
hisab_live_xxxxxxxxxxxxxnot yet developedيستخدم Hisab API رموز استجابة HTTP التقليدية للإشارة إلى نجاح أو فشل طلب API.
400401403404429500تسمح لك Webhooks بتلقي إشعارات HTTP في الوقت الفعلي عند حدوث أحداث معينة في حساب Hisab الخاص بك.
invoice.createdتم إنشاء فاتورة جديدة
invoice.finalizedتم إنهاء فاتورة
invoice.sentتم إرسال فاتورة إلى العميل
invoice.paidتم وضع علامة على الفاتورة كمدفوعة
invoice.payment_failedفشل الدفع للفاتورة
invoice.canceledتم إلغاء فاتورة
customer.createdتم إنشاء عميل جديد
customer.updatedتم تحديث تفاصيل العميل
يوفر Hisab مكتبات رسمية لتبسيط التكامل:
npm install hisab-sdkOfficial SDK with full TypeScript support, auto-pagination, and webhook verification.
composer require hisab/phppip install hisabgem install hisabإنشاء فاتورة جديدة مع عناصر السطر والتفاصيل الضريبية.
curl -X POST https://hisab.ma/api/v1/invoices \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "d8e6b416-e946-48f8-994d-309906db0fe4",
"issue_date": "2025-11-27",
"due_date": "2025-12-27",
"currency": "MAD",
"payment_terms": "Net 30",
"notes": "Thank you for your business",
"items": [
{
"description": "Web Development Services",
"quantity": 10,
"unit_price": 500.00,
"tax_rate": 20
},
{
"description": "Hosting - Annual Plan",
"quantity": 1,
"unit_price": 1200.00,
"tax_rate": 20
}
]
}'