POS sisteminizi HızırYemek altyapısına entegre edin. Siparişleri otomatik alın, durumlarını gerçek zamanlı güncelleyin.
Başvuru Yaphttps://www.hiziryemek.com/api/v1/pos-webhookTüm isteklerde x-secret-key header'ı gereklidir. Bu anahtar başvurunuz onaylandıktan sonra size iletilecektir.
x-secret-key: YOUR_SECRET_KEY/webhookPOS sisteminizden sipariş durumunu güncellemek için bu endpoint'i kullanın.
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| orderId | string | * | HızırYemek sipariş ID |
| posOrderId | string | * | POS tarafındaki sipariş ID |
| status | string | Hayır | Yeni sipariş durumu |
* orderId veya posOrderId alanlarından en az biri zorunludur.
{"success": true,"message": "Webhook işlendi"}
HızırYemek → POSYeni bir sipariş oluşturulduğunda HızırYemek, sizin API'nize aşağıdaki formatta bir POST isteği gönderir.
POST { posApiBaseUrl }/ordersx-secret-key header'ı ile gönderilir.
{"orderId": "507f1f77bcf86cd799439011","orderNumber": "HY-1234","items": [{"name": "Adana Kebap","quantity": 2,"unitPrice": 250,"totalPrice": 500,"options": ["Acılı","Bol soğanlı"]}],"totals": {"subtotal": 500,"deliveryFee": 20,"total": 520},"address": {"full": "Atatürk Cad. No:1 D:5, Merkez/Şehir","note": "3. kat, zili çalın"},"note": "Lütfen çatal bıçak koymayın"}
curl -X POST https://www.hiziryemek.com/api/v1/pos-webhook/webhook \-H "Content-Type: application/json" \-H "x-secret-key: YOUR_SECRET_KEY" \-d '{"orderId": "507f1f77bcf86cd799439011","status": "preparing"}'
const response = await fetch('https://www.hiziryemek.com/api/v1/pos-webhook/webhook', {method: 'POST',headers: {'Content-Type': 'application/json','x-secret-key': 'YOUR_SECRET_KEY',},body: JSON.stringify({orderId: '507f1f77bcf86cd799439011',status: 'preparing',}),});const data = await response.json();console.log(data);// { success: true, message: 'Webhook işlendi' }
| Kod | Durum | Açıklama |
|---|---|---|
| 401 | Unauthorized | Geçersiz veya eksik x-secret-key |
| 400 | Bad Request | Eksik veya geçersiz istek parametreleri |
| 404 | Not Found | Belirtilen sipariş bulunamadı |