WhatsApp Fatura
WhatsApp üzerinden fatura kesme, ekstre sorgulama ve ödeme hatırlatma API'leri.
POST
/api/v1/whatsapp-fatura/mesaj-al
Mesaj Al ve İşle
WhatsApp'tan gelen mesajı alır, fatura komutu olarak parse eder ve işler. Metin veya sesli mesaj destekler.
Kimlik doğrulama gerektirir
Parametreler
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
from |
string | Zorunlu | Gönderen telefon numarası (905xxxxxxxxx formatında) |
body |
string | Zorunlu | Mesaj içeriği (FATURA, EKSTRE, EVET, HAYIR komutları) |
type |
string | Opsiyonel | Mesaj tipi: text veya audio (varsayılan: text) |
audio_base64 |
string | Opsiyonel | Sesli mesaj için base64 encoded audio verisi (type=audio ise zorunlu) |
Request Body
{
"from": "905321234567",
"body": "FATURA Ahmet Market 3kg Beyaz Peynir 150",
"type": "text"
}
Response
200
{
"ok": true,
"reply": "📋 Fatura Özeti:\n👤 Cari: Ahmet Market\n📦 Ürün: Beyaz Peynir (3 kg)\n💰 Tutar: 150,00 ₺\n\n✅ Onaylamak için EVET yazın",
"log_id": 42,
"durum": "bekliyor"
}
GET
/api/v1/whatsapp-fatura/durum
Servis Durumu
WhatsApp Fatura servisinin durumunu ve istatistiklerini döner.
Kimlik doğrulama gerektirir
Response
200
{
"ok": true,
"aktif": true,
"servis_durumu": "connected",
"toplam_islem": 1842,
"bugun_islem": 23
}
cURL Örneği
POST /api/v1/whatsapp-fatura/mesaj-al
curl -X POST https://api.pratikesnaf.com/api/v1/whatsapp-fatura/mesaj-al \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"from": "905321234567", "body": "FATURA Ahmet Market 3kg Beyaz Peynir 150", "type": "text"}'