İrsaliye PDF'i
Tamamlanmış bir irsaliyenin PDF adresini almak için bu endpoint kullanılır. Giden ve gelen irsaliyelerde aynı şekilde çalışır.
İstek
GET /api/waybills/{id}/pdf
Accept: application/json
Authorization: Bearer YOUR_API_KEY
PDF daha önce hazırlanmışsa kayıtlı adres hemen döner. Hazırlanmamışsa sağlayıcıdan çekilip kaydedilir. İrsaliyenin durumu completed değilse istek 422 ile reddedilir: PDF yalnızca tamamlanmış irsaliyeler için alınabilir. Gelen irsaliyeler completed olarak kaydedildiği için her zaman PDF'i alınabilir.
Örnek istekler
- 💻 cURL
- 🐘 PHP
- 🟢 Node.js
- 🐍 Python
curl -X GET "https://app.faturaentegrator.com/api/waybills/214/pdf" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY"
<?php
$ch = curl_init('https://app.faturaentegrator.com/api/waybills/214/pdf');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Accept: application/json', 'Authorization: Bearer YOUR_API_KEY'],
CURLOPT_RETURNTRANSFER => true,
]);
$url = json_decode(curl_exec($ch), true)['url'];
curl_close($ch);
const res = await fetch('https://app.faturaentegrator.com/api/waybills/214/pdf', {
headers: { Accept: 'application/json', Authorization: 'Bearer YOUR_API_KEY' },
});
const { url } = await res.json();
import requests
r = requests.get(
'https://app.faturaentegrator.com/api/waybills/214/pdf',
headers={'Accept': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'},
)
url = r.json()['url']
Örnek yanıt
{
"url": "https://app.faturaentegrator.com/storage/waybills/45/214.pdf"
}