Geliştirici belgeleri
belgeniz API ile e-Fatura, e-Arşiv, e-İrsaliye, e-SMM ve e-MM belgelerinizi oluşturun, gönderin ve durumlarını izleyin.
Dene
Bir görev seçin; isteği kopyalayıp test ortamında çalıştırın. İstek ve yanıt gövdeleri kısaltılmış örneklerdir; tüm alanlar uç sayfasında.
POST
/v1/documentscurl -X POST "https://api-sandbox.belgeniz.com/v1/documents" \
-H "Authorization: Bearer bz_…" \
-H "X-Branch: <şube-uuid>" \
-H "Content-Type: application/json" \
-d '{
"documentType": "FATURA",
"document": {
"uuid": "c8053edc-678f-4b73-8f20-c3faa3beb5ab",
"profile": "TEMELFATURA",
"type": "SATIS",
"customer": {
"taxNumber": "9876543210",
"name": "Alıcı Ltd."
},
"lines": [
{
"name": "Palet",
"quantity": 4,
"unitCode": "C62",
"price": 150,
"kdvPercent": 20
}
]
}
}'// BELGENIZ_API_KEY=bz_…
const res = await fetch("https://api-sandbox.belgeniz.com/v1/documents", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.BELGENIZ_API_KEY}`,
"X-Branch": "<şube-uuid>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"documentType": "FATURA",
"document": {
"uuid": "c8053edc-678f-4b73-8f20-c3faa3beb5ab",
"profile": "TEMELFATURA",
"type": "SATIS",
"customer": {
"taxNumber": "9876543210",
"name": "Alıcı Ltd."
},
"lines": [
{
"name": "Palet",
"quantity": 4,
"unitCode": "C62",
"price": 150,
"kdvPercent": 20
}
]
}
}),
});
const data = await res.json();Yanıt
{
"ettn": "5f0c2b9e-8d1a-4c47-9b3e-2a6f1d7c9e30"
}POST
/v1/edocuments/draftscurl -X POST "https://api-sandbox.belgeniz.com/v1/edocuments/drafts" \
-H "Authorization: Bearer bz_…" \
-H "X-Branch: <şube-uuid>" \
-H "Content-Type: application/json" \
-d '{
"documentType": "FATURA",
"label": "Palet satışı",
"document": {
"uuid": "c8053edc-678f-4b73-8f20-c3faa3beb5ab",
"profile": "TEMELFATURA",
"type": "SATIS",
"customer": {
"taxNumber": "9876543210",
"name": "Alıcı Ltd."
},
"lines": [
{
"name": "Palet",
"quantity": 4,
"unitCode": "C62",
"price": 150,
"kdvPercent": 20
}
]
}
}'// BELGENIZ_API_KEY=bz_…
const res = await fetch("https://api-sandbox.belgeniz.com/v1/edocuments/drafts", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.BELGENIZ_API_KEY}`,
"X-Branch": "<şube-uuid>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"documentType": "FATURA",
"label": "Palet satışı",
"document": {
"uuid": "c8053edc-678f-4b73-8f20-c3faa3beb5ab",
"profile": "TEMELFATURA",
"type": "SATIS",
"customer": {
"taxNumber": "9876543210",
"name": "Alıcı Ltd."
},
"lines": [
{
"name": "Palet",
"quantity": 4,
"unitCode": "C62",
"price": 150,
"kdvPercent": 20
}
]
}
}),
});
const data = await res.json();Yanıt (kısaltıldı)
{
"data": {
"id": "5f0c2b9e-8d1a-4c47-9b3e-2a6f1d7c9e30",
"branchId": "5f0c2b9e-8d1a-4c47-9b3e-2a6f1d7c9e30",
"lock": {
"lockedAt": "örnek",
"lockedBy": {
"id": "5f0c2b9e-8d1a-4c47-9b3e-2a6f1d7c9e30",
"name": "örnek"
}
},
"assigneeUserId": "5f0c2b9e-8d1a-4c47-9b3e-2a6f1d7c9e30",
"assigneeName": "örnek",
"tags": [
…GET
/v1/documentscurl "https://api-sandbox.belgeniz.com/v1/documents?type=efatura" \
-H "Authorization: Bearer bz_…" \
-H "X-Branch: <şube-uuid>"// BELGENIZ_API_KEY=bz_…
const res = await fetch("https://api-sandbox.belgeniz.com/v1/documents?type=efatura", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.BELGENIZ_API_KEY}`,
"X-Branch": "<şube-uuid>",
},
});
const data = await res.json();Yanıt (kısaltıldı)
{
"items": [
{
"lock": {
"locked_at": "örnek",
"locked_by": {}
},
"id": "5f0c2b9e-8d1a-4c47-9b3e-2a6f1d7c9e30",
"ettn": "5f0c2b9e-8d1a-4c47-9b3e-2a6f1d7c9e30",
"number": "örnek",
"type": "efatura",
"direction": "in",
"profile": "örnek",
"issue_date": "örnek",
…POST
/v1/webhookscurl -X POST "https://api-sandbox.belgeniz.com/v1/webhooks" \
-H "Authorization: Bearer bz_…" \
-H "X-Branch: <şube-uuid>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://ornek.com/belgeniz/webhook",
"events": [
"document.received",
"document.reply_changed"
]
}'// BELGENIZ_API_KEY=bz_…
const res = await fetch("https://api-sandbox.belgeniz.com/v1/webhooks", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.BELGENIZ_API_KEY}`,
"X-Branch": "<şube-uuid>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://ornek.com/belgeniz/webhook",
"events": [
"document.received",
"document.reply_changed"
]
}),
});
const data = await res.json();Yanıt (kısaltıldı)
{
"subscription": {
"id": "5f0c2b9e-8d1a-4c47-9b3e-2a6f1d7c9e30",
"urlOrigin": "örnek",
"urlPathMasked": "örnek",
"events": [
"örnek"
],
"status": "active",
"createdAt": "örnek",
"flowIds": [
"örnek"
]
},
…