cURL Örnekleri
Komut satırından KolayBi API'sini kullanma örnekleri.
🔐 Yetkilendirme
Access Token Alma
curl -X POST "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/access_token" \
-H "Channel: YOUR_CHANNEL" \
-H "Content-Type: application/json" \
-d '{"api_key": "YOUR_API_KEY"}'
👥 Cari Hesap İşlemleri
Müşteri Listeleme
curl -X GET "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/associates" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Channel: YOUR_CHANNEL"
Müşteri Oluşturma
curl -X POST "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/associates" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Channel: YOUR_CHANNEL" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "name=Ahmet&surname=Yılmaz&identity_no=12345678901"
📦 Ürün İşlemleri
Ürün Listeleme
curl -X GET "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/products" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Channel: YOUR_CHANNEL"
Ürün Oluşturma
curl -X POST "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/products" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Channel: YOUR_CHANNEL" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "name=Test Ürün"
🧾 Fatura İşlemleri
Fatura Listeleme
curl -X GET "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/invoices" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Channel: YOUR_CHANNEL"
Fatura Oluşturma
curl -X POST "https://ofis-sandbox-api.kolaybi.com/kolaybi/v1/invoices" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Channel: YOUR_CHANNEL" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "contact_id=1&address_id=1&order_date=2024-01-01¤cy=TRY"