Hızlı Başlangıç¶
5 dakikada ilk test siparişinizi alın.
Adım 1: Hesap Bilgilerinizi Alın¶
MuditaPOS ekibinden şu bilgileri alacaksınız:
- Customer ID (UUID)
- API Key (webhook'larda gönderilir)
- API Secret (imza doğrulama)
- Internal API Key (durum güncellemesi için)
Adım 2: Webhook Endpoint Oluşturun¶
Sipariş almak için bir HTTP endpoint oluşturun:
// Express.js örneği
const express = require('express');
const app = express();
app.use(express.json());
app.post('/webhooks/new-order', (req, res) => {
console.log('Yeni sipariş geldi:', req.body);
const order = req.body;
console.log(`
Sipariş ID: ${order.id}
Platform: ${order.provider}
Müşteri: ${order.customerName}
Toplam: ${order.totalAmount} TL
Ürünler: ${order.items.length} adet
`);
// 200 döndürmeniz ÇOK ÖNEMLİ — aksi halde retry yapılır
res.json({ status: 'received' });
});
app.listen(3001, () => console.log('Webhook server ready on :3001'));
Adım 3: Webhook URL'nizi Bildirin¶
MuditaPOS ekibine endpoint URL'lerinizi bildirin:
| Webhook | URL Örneği |
|---|---|
| Yeni Sipariş | https://api.sizinfirma.com/webhooks/new-order |
| İptal | https://api.sizinfirma.com/webhooks/cancel-order |
| Durum Güncelleme | https://api.sizinfirma.com/webhooks/order-status |
Adım 4: Test Edin¶
Stage ortamına test siparişi gönderin:
curl -X POST https://stage.pos.muditakurye.com.tr/internal/orders/new \
-H "Content-Type: application/json" \
-H "X-Internal-Api-Key: sizin-internal-key" \
-H "X-Platform: YEMEK_POS" \
-d '{
"providerOrderId": "test-001",
"providerRestaurantId": "sizin-rest-id",
"customerName": "Test Müşteri",
"customerPhone": "05551112233",
"customerAddress": "Test Mah. Test Sok. No:1",
"latitude": 41.0082,
"longitude": 28.9784,
"totalAmount": 150.00,
"paymentMethod": "ONLINE",
"note": "Test siparişi",
"isPickup": false,
"items": [
{
"name": "Karışık Pizza",
"quantity": 1,
"unitPrice": 120.00,
"totalPrice": 120.00,
"options": []
},
{
"name": "Kola",
"quantity": 2,
"unitPrice": 15.00,
"totalPrice": 30.00,
"options": []
}
]
}'
Başarılı yanıt:
Adım 5: Webhook'u Kontrol Edin¶
Birkaç saniye içinde tanımladığınız webhook URL'nize sipariş iletilecektir. Server loglarınızda normalize edilmiş siparişi göreceksiniz.
Tebrikler! 🎉
İlk test siparişinizi aldınız. Artık Webhook Formatı sayfasından gelen verinin tüm alanlarını inceleyebilirsiniz.
Sonraki Adımlar¶
- [x] Hesap bilgilerini al
- [x] Webhook endpoint oluştur
- [x] Test siparişi gönder
- [ ] İmza doğrulamayı ekle
- [ ] Durum güncellemelerini entegre et
- [ ] Production'a geç