توثيق API
اربط أنظمتك مع SHNAX: العملاء والمنتجات والفواتير والمدفوعات عبر واجهة REST بسيطة.
1. المصادقة
أنشئ مفتاح API من حسابك (الإعدادات ← API). أرسله مع كل طلب في ترويسة X-API-KEY. احفظه سرًا: فهو يعمل باسم نشاطك. الطلبات محدودة المعدل وكل طلب يُحتسب من حصة API في باقتك.
curl -H "X-API-KEY: your-key" -H "Accept: application/json" https://syss.shnax.ly/api/v1/invoices
العنوان الأساسي: https://syss.shnax.ly/api/v1 · الردود بصيغة JSON. الأخطاء بحالة HTTP (401 مفتاح خاطئ، 403 غير مسموح في باقتك، 404 غير موجود، 422 تحقق مع الحقول في "errors"، 429 طلبات كثيرة).
2. نقاط النهاية
| الطريقة | المسار | الوظيفة |
|---|---|---|
| DELETE | /api/v1/clients/{id} | Delete a client |
| PUT | /api/v1/clients/{id} | Update a client |
| GET | /api/v1/clients | List your clients (paginated, ?search=) |
| POST | /api/v1/clients | Create a client |
| PATCH | /api/v1/invoices/{id}/status | Change an invoice's status |
| DELETE | /api/v1/invoices/{id} | Delete an invoice |
| GET | /api/v1/invoices/{id} | One invoice with its lines |
| GET | /api/v1/invoices | List invoices (?status=, ?client_id=) |
| POST | /api/v1/invoices | Create an invoice |
| POST | /api/v1/login | Exchange an account's e-mail and password for a token (apps) |
| GET | /api/v1/payments | List payments received |
| POST | /api/v1/payments | Record a payment against an invoice |
| DELETE | /api/v1/products/{id} | Delete a product |
| PUT | /api/v1/products/{id} | Update a product |
| GET | /api/v1/products | List your products and services |
| POST | /api/v1/products | Create a product |
3. مثال: إنشاء فاتورة
curl -X POST https://syss.shnax.ly/api/v1/invoices \
-H "X-API-KEY: your-key" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"client_id": 12, "invoice_date": "2026-11-07", "due_date": "2026-11-21",
"items": [{"description": "Consulting", "quantity": 2, "unit_price": 150}]}'
كل فاتورة تحمل رمز QR موقّعًا: من يمسحه يرى إن كانت الفاتورة أصلية وإن كانت النسخة المطبوعة مطابقة للسجل.
4. Webhooks والتكاملات
الباقات التي تتضمن إضافة التكاملات تستطيع تسجيل نقاط Webhook (موقّعة بسر) وربط WooCommerce وZapier من الحساب.
أسئلة؟ اتصل بنا