HızırYemekPOS Entegrasyonu

POS Entegrasyonu

POS sisteminizi HızırYemek altyapısına entegre edin. Siparişleri otomatik alın, durumlarını gerçek zamanlı güncelleyin.

Başvuru Yap

API Dokümantasyonu

Base URL

https://www.hiziryemek.com/api/v1/pos-webhook

Kimlik Doğrulama

Tüm isteklerde x-secret-key header'ı gereklidir. Bu anahtar başvurunuz onaylandıktan sonra size iletilecektir.

x-secret-key: YOUR_SECRET_KEY
POST/webhook

Sipariş Durumu Güncelleme

POS sisteminizden sipariş durumunu güncellemek için bu endpoint'i kullanın.

Request Body

AlanTipZorunluAçıklama
orderIdstring*HızırYemek sipariş ID
posOrderIdstring*POS tarafındaki sipariş ID
statusstringHayırYeni sipariş durumu

* orderId veya posOrderId alanlarından en az biri zorunludur.

Geçerli Status Değerleri

pendingconfirmedpreparingon_the_waydeliveredcancelled

Başarılı Yanıt

{
"success": true,
"message": "Webhook işlendi"
}
PUSHHızırYemek → POS

Yeni Sipariş Alımı

Yeni bir sipariş oluşturulduğunda HızırYemek, sizin API'nize aşağıdaki formatta bir POST isteği gönderir.

Endpoint

POST { posApiBaseUrl }/orders

x-secret-key header'ı ile gönderilir.

Payload Yapısı

{
"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"
}

Kod Örnekleri

cURL — Sipariş durumu güncelleme

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"
}'

JavaScript (fetch)

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' }

Hata Kodları

KodDurumAçıklama
401UnauthorizedGeçersiz veya eksik x-secret-key
400Bad RequestEksik veya geçersiz istek parametreleri
404Not FoundBelirtilen sipariş bulunamadı

Entegrasyon Başvurusu

Sipariş push için kullanılacak API adresi