Testten canlıya geçmek
Entegrasyonunuzu önce test ortamındaki bağlantıyla dener, canlı bağlantıyı açtıktan sonra aynı kodu environment=live ile çalıştırırsınız. Test ortamında kesilen belge gerçek belge değildir ve yasal geçerliliği yoktur.
Adımlar
-
Test ortamında bağlantı açın Panel
API altyapısı › Çektiğimiz sekmesinde e-Dönüşüm sağlayıcı bağlantısını Ortam alanında Test seçerek açın ve Bağlantıyı sına'ya basın: Kılavuz › e-Dönüşüm sağlayıcısı bağlamak. Firma her ortamda tek bağlantı kullanır; test ve canlı bağlantı ayrı ayrı açılır.
-
Test ortamında belge kesin Sizin sisteminiz
POST/v1/edoc/documentsİstekte
environment=testverin. Kestiğiniz belge panelde Test rozetiyle görünür: Kılavuz › Test belgeleri. Okuma, durum yenileme ve indirme uçlarını da aynı ortamla deneyin: Fatura kesmek ve durumunu izlemek.Sonraki adımda kullanılan alan:
document.id. Ucun alanları, kuralları ve hataları: Firmanız adına yeni bir e-Fatura, e-Arşiv ya da e-İrsaliye belgesi keser ve gönderim sırasına alır.İstek
curl -X POST "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -H "Idempotency-Key: <IDEMPOTENCY_KEY>" \ -H "Content-Type: application/json" \ -d '{ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }'
// The key is read from an environment variable, never written into the code $apiKey = getenv('VERITAKIBI_API_KEY'); $body = '{ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }'; $ch = curl_init('https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>'); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, 'Idempotency-Key: <IDEMPOTENCY_KEY>', 'Content-Type: application/json', ], ]); $response = json_decode(curl_exec($ch), true); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Node 18+: built-in fetch; save as .mjs (import syntax) // The key is read from an environment variable, never written into the code const apiKey = process.env.VERITAKIBI_API_KEY; const res = await fetch('https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Idempotency-Key': '<IDEMPOTENCY_KEY>', 'Content-Type': 'application/json', }, body: JSON.stringify({ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }), }); const response = await res.json(); const status = res.status;
# Python 3.6+: standard library only (urllib, json) # The key is read from an environment variable, never written into the code import json, os, urllib.request api_key = os.environ['VERITAKIBI_API_KEY'] body = '''{ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }'''.encode() req = urllib.request.Request( 'https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>', data=body, method='POST', headers={ 'Authorization': f'Bearer {api_key}', 'Idempotency-Key': '<IDEMPOTENCY_KEY>', 'Content-Type': 'application/json', }, ) with urllib.request.urlopen(req) as res: status = res.status response = json.load(res)
// Go 1.18+: standard library only (net/http, encoding/json) // The key is read from an environment variable, never written into the code package main import ( "encoding/json" "net/http" "os" "strings" ) func main() { apiKey := os.Getenv("VERITAKIBI_API_KEY") body := `{ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }` req, err := http.NewRequest("POST", "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>", strings.NewReader(body)) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Idempotency-Key", "<IDEMPOTENCY_KEY>") req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() status := res.StatusCode var response map[string]any json.NewDecoder(res.Body).Decode(&response) _, _ = status, response }
// Java 11+: built-in java.net.http; file name Example.java // The key is read from an environment variable, never written into the code import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Example { public static void main(String[] args) throws Exception { String apiKey = System.getenv("VERITAKIBI_API_KEY"); String body = "{\"kind\": \"<VALUE>\", \"profile\": \"<VALUE>\", \"type_code\": \"<VALUE>\", \"issue_at\": \"<VALUE>\", \"pricing\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"exchange_rate\": \"<VALUE>\", \"rate_kind\": \"<VALUE>\", \"rate_date\": \"<VALUE>\", \"buyer\": {\"tax_id\": \"<VALUE>\", \"organization\": \"<VALUE>\", \"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"tax_office\": \"<VALUE>\", \"address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}, \"email\": \"<VALUE>\", \"alias\": \"<VALUE>\", \"phone\": \"<VALUE>\"}, \"references\": {\"orders\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"dispatches\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"returned\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"notes\": [], \"printed\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}]}, \"payee_iban\": \"<VALUE>\", \"series\": \"<VALUE>\", \"template\": \"<VALUE>\", \"internet_sale\": false, \"unshipped\": false, \"printed\": false, \"printed_number\": \"<VALUE>\", \"payment\": {\"url\": \"<VALUE>\", \"means\": \"<VALUE>\", \"method\": \"<VALUE>\", \"agent\": \"<VALUE>\", \"date\": \"<VALUE>\", \"due_date\": \"<VALUE>\", \"note\": \"<VALUE>\"}, \"delivery\": {\"carrier_tax_id\": \"<VALUE>\", \"carrier_name\": \"<VALUE>\", \"carrier_surname\": \"<VALUE>\", \"sent_at\": \"<VALUE>\"}, \"banks\": [{\"bank\": \"<VALUE>\", \"branch\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"number\": \"<VALUE>\", \"note\": \"<VALUE>\"}], \"public_payment\": {\"bank\": \"<VALUE>\", \"branch\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"payer_tax_id\": \"<VALUE>\"}, \"foreign_buyer\": {\"name\": \"<VALUE>\", \"country\": \"<VALUE>\", \"city\": \"<VALUE>\", \"address\": \"<VALUE>\", \"tax_id\": \"<VALUE>\"}, \"shipment\": {\"despatch_at\": \"<VALUE>\", \"plates\": [{\"scheme\": \"<VALUE>\", \"id\": \"<VALUE>\"}], \"drivers\": [{\"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"national_id\": \"<VALUE>\"}], \"carrier\": {\"tax_id\": \"<VALUE>\", \"organization\": \"<VALUE>\", \"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"tax_office\": \"<VALUE>\", \"address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}, \"email\": \"<VALUE>\", \"alias\": \"<VALUE>\", \"phone\": \"<VALUE>\"}, \"delivery_address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}}, \"lines\": [{\"name\": \"<VALUE>\", \"code\": \"<VALUE>\", \"unit\": \"<VALUE>\", \"quantity\": \"<VALUE>\", \"price\": \"<VALUE>\", \"discount\": \"<VALUE>\", \"discount_percent\": \"<VALUE>\", \"vat_rate\": \"<VALUE>\", \"exemption_code\": \"<VALUE>\", \"withholding\": {\"code\": \"<VALUE>\", \"rate_bp\": 0}, \"stoppage\": {\"code\": \"<VALUE>\", \"rate_bp\": 0}, \"export\": {\"terms\": \"<VALUE>\", \"city\": \"<VALUE>\", \"country\": \"<VALUE>\", \"customs_id\": \"<VALUE>\", \"transport_mode\": \"<VALUE>\", \"package_type\": \"<VALUE>\", \"package_count\": 0, \"origin\": \"<VALUE>\"}, \"medical\": {\"kind\": \"<VALUE>\", \"items\": [{\"product_trace_id\": \"<VALUE>\", \"lot_number\": \"<VALUE>\", \"serial_id\": \"<VALUE>\", \"expiry_date\": \"<VALUE>\", \"manufacture_date\": \"<VALUE>\"}]}, \"total\": \"<VALUE>\", \"amount\": \"<VALUE>\", \"taxes\": [{\"code\": \"<VALUE>\", \"rate\": \"<VALUE>\", \"per_unit\": \"<VALUE>\"}], \"special_base\": \"<VALUE>\", \"note\": \"<VALUE>\", \"pricing\": \"<VALUE>\", \"item_id\": 0, \"place_id\": 0}], \"subtotal_discount\": \"<VALUE>\", \"subtotal_discount_percent\": \"<VALUE>\"}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>")) .header("Authorization", "Bearer " + apiKey) .header("Idempotency-Key", "<IDEMPOTENCY_KEY>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString(body)) .build(); HttpResponse<String> res = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); // JSON text; Java has no built-in JSON parser, use a JSON library String response = res.body(); int status = res.statusCode(); } }
// .NET 6+: top-level statements; default console template (implicit usings on) // The key is read from an environment variable, never written into the code using System.Net.Http.Headers; using System.Text; using System.Text.Json; var apiKey = Environment.GetEnvironmentVariable("VERITAKIBI_API_KEY"); var body = "{\"kind\": \"<VALUE>\", \"profile\": \"<VALUE>\", \"type_code\": \"<VALUE>\", \"issue_at\": \"<VALUE>\", \"pricing\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"exchange_rate\": \"<VALUE>\", \"rate_kind\": \"<VALUE>\", \"rate_date\": \"<VALUE>\", \"buyer\": {\"tax_id\": \"<VALUE>\", \"organization\": \"<VALUE>\", \"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"tax_office\": \"<VALUE>\", \"address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}, \"email\": \"<VALUE>\", \"alias\": \"<VALUE>\", \"phone\": \"<VALUE>\"}, \"references\": {\"orders\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"dispatches\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"returned\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"notes\": [], \"printed\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}]}, \"payee_iban\": \"<VALUE>\", \"series\": \"<VALUE>\", \"template\": \"<VALUE>\", \"internet_sale\": false, \"unshipped\": false, \"printed\": false, \"printed_number\": \"<VALUE>\", \"payment\": {\"url\": \"<VALUE>\", \"means\": \"<VALUE>\", \"method\": \"<VALUE>\", \"agent\": \"<VALUE>\", \"date\": \"<VALUE>\", \"due_date\": \"<VALUE>\", \"note\": \"<VALUE>\"}, \"delivery\": {\"carrier_tax_id\": \"<VALUE>\", \"carrier_name\": \"<VALUE>\", \"carrier_surname\": \"<VALUE>\", \"sent_at\": \"<VALUE>\"}, \"banks\": [{\"bank\": \"<VALUE>\", \"branch\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"number\": \"<VALUE>\", \"note\": \"<VALUE>\"}], \"public_payment\": {\"bank\": \"<VALUE>\", \"branch\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"payer_tax_id\": \"<VALUE>\"}, \"foreign_buyer\": {\"name\": \"<VALUE>\", \"country\": \"<VALUE>\", \"city\": \"<VALUE>\", \"address\": \"<VALUE>\", \"tax_id\": \"<VALUE>\"}, \"shipment\": {\"despatch_at\": \"<VALUE>\", \"plates\": [{\"scheme\": \"<VALUE>\", \"id\": \"<VALUE>\"}], \"drivers\": [{\"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"national_id\": \"<VALUE>\"}], \"carrier\": {\"tax_id\": \"<VALUE>\", \"organization\": \"<VALUE>\", \"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"tax_office\": \"<VALUE>\", \"address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}, \"email\": \"<VALUE>\", \"alias\": \"<VALUE>\", \"phone\": \"<VALUE>\"}, \"delivery_address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}}, \"lines\": [{\"name\": \"<VALUE>\", \"code\": \"<VALUE>\", \"unit\": \"<VALUE>\", \"quantity\": \"<VALUE>\", \"price\": \"<VALUE>\", \"discount\": \"<VALUE>\", \"discount_percent\": \"<VALUE>\", \"vat_rate\": \"<VALUE>\", \"exemption_code\": \"<VALUE>\", \"withholding\": {\"code\": \"<VALUE>\", \"rate_bp\": 0}, \"stoppage\": {\"code\": \"<VALUE>\", \"rate_bp\": 0}, \"export\": {\"terms\": \"<VALUE>\", \"city\": \"<VALUE>\", \"country\": \"<VALUE>\", \"customs_id\": \"<VALUE>\", \"transport_mode\": \"<VALUE>\", \"package_type\": \"<VALUE>\", \"package_count\": 0, \"origin\": \"<VALUE>\"}, \"medical\": {\"kind\": \"<VALUE>\", \"items\": [{\"product_trace_id\": \"<VALUE>\", \"lot_number\": \"<VALUE>\", \"serial_id\": \"<VALUE>\", \"expiry_date\": \"<VALUE>\", \"manufacture_date\": \"<VALUE>\"}]}, \"total\": \"<VALUE>\", \"amount\": \"<VALUE>\", \"taxes\": [{\"code\": \"<VALUE>\", \"rate\": \"<VALUE>\", \"per_unit\": \"<VALUE>\"}], \"special_base\": \"<VALUE>\", \"note\": \"<VALUE>\", \"pricing\": \"<VALUE>\", \"item_id\": 0, \"place_id\": 0}], \"subtotal_discount\": \"<VALUE>\", \"subtotal_discount_percent\": \"<VALUE>\"}"; using var http = new HttpClient(); var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); request.Headers.Add("Idempotency-Key", "<IDEMPOTENCY_KEY>"); request.Content = new StringContent(body, Encoding.UTF8); request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var res = await http.SendAsync(request); var response = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); var status = (int)res.StatusCode;
// C++11+: requires libcurl (link with -lcurl) // The key is read from an environment variable, never written into the code #include <curl/curl.h> #include <cstdlib> #include <string> // Collects the response body into a string static size_t write_body(char* data, size_t size, size_t nmemb, void* out) { static_cast<std::string*>(out)->append(data, size * nmemb); return size * nmemb; } int main() { const char* api_key = std::getenv("VERITAKIBI_API_KEY"); std::string auth = std::string("Authorization: Bearer ") + (api_key ? api_key : ""); std::string body = R"({ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" })"; std::string response; long status = 0; curl_global_init(CURL_GLOBAL_DEFAULT); CURL* ch = curl_easy_init(); curl_slist* headers = nullptr; headers = curl_slist_append(headers, auth.c_str()); headers = curl_slist_append(headers, "Idempotency-Key: <IDEMPOTENCY_KEY>"); headers = curl_slist_append(headers, "Content-Type: application/json"); curl_easy_setopt(ch, CURLOPT_URL, "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>"); curl_easy_setopt(ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(ch, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(ch, CURLOPT_POSTFIELDS, body.c_str()); curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, write_body); curl_easy_setopt(ch, CURLOPT_WRITEDATA, &response); curl_easy_perform(ch); curl_easy_getinfo(ch, CURLINFO_RESPONSE_CODE, &status); curl_slist_free_all(headers); curl_easy_cleanup(ch); curl_global_cleanup(); }
Yanıt · 201 · değerler yer tutucudur
{ "environment": "<VALUE>", "document": { "id": 0, "kind": "<VALUE>", "direction": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "uid": "<VALUE>", "number": "<VALUE>", "issue_at": "<VALUE>", "created_at": "<VALUE>", "received_at": "<VALUE>", "reply_due_at": "<VALUE>", "status": "<VALUE>", "raw_status": "<VALUE>", "error_class": "<VALUE>", "error_code": "<VALUE>", "party_name": "<VALUE>", "party_tax_id": "<VALUE>", "currency": "<VALUE>", "archived": false, "reply": { "type": "<VALUE>", "note": "<VALUE>", "at": "<VALUE>", "number": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }, "environment": "<VALUE>" }, "actions": [] } -
Belgenin ortamını doğrulayın Sizin sisteminiz
GET/v1/edoc/documents/{id}Yanıttaki
document.environmenttestolur. Bir ortamda kesilen belge öteki ortamın isteklerinde bulunamaz: aynı{id}environment=liveile istenirseNOT_FOUNDdöner.Ucun alanları, kuralları ve hataları: Bir belgenin üst bilgisini, satırlarını, toplamlarını ve durum geçmişini verir.
İstek
curl "https://api.veritakibi.com/v1/edoc/documents/<id>?environment=<ENVIRONMENT>" \ -H "Authorization: Bearer <YOUR_API_KEY>"
// The key is read from an environment variable, never written into the code $apiKey = getenv('VERITAKIBI_API_KEY'); $ch = curl_init('https://api.veritakibi.com/v1/edoc/documents/<id>?environment=<ENVIRONMENT>'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, ], ]); $response = json_decode(curl_exec($ch), true); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Node 18+: built-in fetch; save as .mjs (import syntax) // The key is read from an environment variable, never written into the code const apiKey = process.env.VERITAKIBI_API_KEY; const res = await fetch('https://api.veritakibi.com/v1/edoc/documents/<id>?environment=<ENVIRONMENT>', { method: 'GET', headers: { 'Authorization': `Bearer ${apiKey}`, }, }); const response = await res.json(); const status = res.status;
# Python 3.6+: standard library only (urllib, json) # The key is read from an environment variable, never written into the code import json, os, urllib.request api_key = os.environ['VERITAKIBI_API_KEY'] req = urllib.request.Request( 'https://api.veritakibi.com/v1/edoc/documents/<id>?environment=<ENVIRONMENT>', method='GET', headers={ 'Authorization': f'Bearer {api_key}', }, ) with urllib.request.urlopen(req) as res: status = res.status response = json.load(res)
// Go 1.18+: standard library only (net/http, encoding/json) // The key is read from an environment variable, never written into the code package main import ( "encoding/json" "net/http" "os" ) func main() { apiKey := os.Getenv("VERITAKIBI_API_KEY") req, err := http.NewRequest("GET", "https://api.veritakibi.com/v1/edoc/documents/<id>?environment=<ENVIRONMENT>", nil) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer "+apiKey) res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() status := res.StatusCode var response map[string]any json.NewDecoder(res.Body).Decode(&response) _, _ = status, response }
// Java 11+: built-in java.net.http; file name Example.java // The key is read from an environment variable, never written into the code import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Example { public static void main(String[] args) throws Exception { String apiKey = System.getenv("VERITAKIBI_API_KEY"); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.veritakibi.com/v1/edoc/documents/<id>?environment=<ENVIRONMENT>")) .header("Authorization", "Bearer " + apiKey) .method("GET", HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse<String> res = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); // JSON text; Java has no built-in JSON parser, use a JSON library String response = res.body(); int status = res.statusCode(); } }
// .NET 6+: top-level statements; default console template (implicit usings on) // The key is read from an environment variable, never written into the code using System.Net.Http.Headers; using System.Text.Json; var apiKey = Environment.GetEnvironmentVariable("VERITAKIBI_API_KEY"); using var http = new HttpClient(); var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.veritakibi.com/v1/edoc/documents/<id>?environment=<ENVIRONMENT>"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); var res = await http.SendAsync(request); var response = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); var status = (int)res.StatusCode;
// C++11+: requires libcurl (link with -lcurl) // The key is read from an environment variable, never written into the code #include <curl/curl.h> #include <cstdlib> #include <string> // Collects the response body into a string static size_t write_body(char* data, size_t size, size_t nmemb, void* out) { static_cast<std::string*>(out)->append(data, size * nmemb); return size * nmemb; } int main() { const char* api_key = std::getenv("VERITAKIBI_API_KEY"); std::string auth = std::string("Authorization: Bearer ") + (api_key ? api_key : ""); std::string response; long status = 0; curl_global_init(CURL_GLOBAL_DEFAULT); CURL* ch = curl_easy_init(); curl_slist* headers = nullptr; headers = curl_slist_append(headers, auth.c_str()); curl_easy_setopt(ch, CURLOPT_URL, "https://api.veritakibi.com/v1/edoc/documents/<id>?environment=<ENVIRONMENT>"); curl_easy_setopt(ch, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, write_body); curl_easy_setopt(ch, CURLOPT_WRITEDATA, &response); curl_easy_perform(ch); curl_easy_getinfo(ch, CURLINFO_RESPONSE_CODE, &status); curl_slist_free_all(headers); curl_easy_cleanup(ch); curl_global_cleanup(); }
Yanıt · 200 · değerler yer tutucudur
{ "environment": "<VALUE>", "document": { "id": 0, "kind": "<VALUE>", "direction": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "uid": "<VALUE>", "number": "<VALUE>", "issue_at": "<VALUE>", "created_at": "<VALUE>", "received_at": "<VALUE>", "reply_due_at": "<VALUE>", "status": "<VALUE>", "raw_status": "<VALUE>", "error_class": "<VALUE>", "error_code": "<VALUE>", "party_name": "<VALUE>", "party_tax_id": "<VALUE>", "currency": "<VALUE>", "archived": false, "reply": { "type": "<VALUE>", "note": "<VALUE>", "at": "<VALUE>", "number": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }, "environment": "<VALUE>" }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "qty_milli": 0, "unit": "<VALUE>", "vat_rate_bp": 0, "exemption_code": "<VALUE>", "base": null, "vat": null, "gross": null, "discount": null, "withheld": null, "withholding": { "code": "<VALUE>", "rate_bp": 0 } } ], "totals": { "base": null, "vat": null, "gross": null, "discount": null, "withheld": null, "payable": null, "rates": [ { "rate_bp": 0, "base": null, "vat": null } ] }, "events": [ { "type": "<VALUE>", "from": "<VALUE>", "to": "<VALUE>", "raw_code": "<VALUE>", "error_class": "<VALUE>", "error_code": "<VALUE>", "detail": {}, "system": false, "at": "<VALUE>" } ], "actions": [] } -
Canlı bağlantıyı açın Panel
Aynı sekmede Ortam alanında Canlı seçerek ikinci bir bağlantı açın ve sınayın; bağlantının ortamı sonradan değiştirilemez. e-Dönüşüm Ayarlar ekranında kullanılan belge türlerini kontrol edin: kullanılmayan tür API'de
NOT_FOUNDdöner. -
Canlı ortamda belge kesin Sizin sisteminiz
POST/v1/edoc/documentsAynı isteği
environment=liveile gönderin; bu ortamda kesilen belge gerçek belgedir. Testte kullandığınızIdempotency-Keydeğerini canlıda yeniden kullanmayın: başka ortamda kullanılmış anahtarIDEMPOTENCY_KEY_REUSEDalır.Canlı bağlantı açık değilse istek
EDOC_ENVIRONMENT_NOT_CONNECTEDile reddedilir ve belge kesilmez.environmentverilmediyse ya datestveyalivedeğilse istekEDOC_ENVIRONMENT_REQUIREDalır.Ucun alanları, kuralları ve hataları: Firmanız adına yeni bir e-Fatura, e-Arşiv ya da e-İrsaliye belgesi keser ve gönderim sırasına alır.
İstek
curl -X POST "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -H "Idempotency-Key: <IDEMPOTENCY_KEY>" \ -H "Content-Type: application/json" \ -d '{ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }'
// The key is read from an environment variable, never written into the code $apiKey = getenv('VERITAKIBI_API_KEY'); $body = '{ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }'; $ch = curl_init('https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>'); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, 'Idempotency-Key: <IDEMPOTENCY_KEY>', 'Content-Type: application/json', ], ]); $response = json_decode(curl_exec($ch), true); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// Node 18+: built-in fetch; save as .mjs (import syntax) // The key is read from an environment variable, never written into the code const apiKey = process.env.VERITAKIBI_API_KEY; const res = await fetch('https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Idempotency-Key': '<IDEMPOTENCY_KEY>', 'Content-Type': 'application/json', }, body: JSON.stringify({ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }), }); const response = await res.json(); const status = res.status;
# Python 3.6+: standard library only (urllib, json) # The key is read from an environment variable, never written into the code import json, os, urllib.request api_key = os.environ['VERITAKIBI_API_KEY'] body = '''{ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }'''.encode() req = urllib.request.Request( 'https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>', data=body, method='POST', headers={ 'Authorization': f'Bearer {api_key}', 'Idempotency-Key': '<IDEMPOTENCY_KEY>', 'Content-Type': 'application/json', }, ) with urllib.request.urlopen(req) as res: status = res.status response = json.load(res)
// Go 1.18+: standard library only (net/http, encoding/json) // The key is read from an environment variable, never written into the code package main import ( "encoding/json" "net/http" "os" "strings" ) func main() { apiKey := os.Getenv("VERITAKIBI_API_KEY") body := `{ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" }` req, err := http.NewRequest("POST", "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>", strings.NewReader(body)) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Idempotency-Key", "<IDEMPOTENCY_KEY>") req.Header.Set("Content-Type", "application/json") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() status := res.StatusCode var response map[string]any json.NewDecoder(res.Body).Decode(&response) _, _ = status, response }
// Java 11+: built-in java.net.http; file name Example.java // The key is read from an environment variable, never written into the code import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class Example { public static void main(String[] args) throws Exception { String apiKey = System.getenv("VERITAKIBI_API_KEY"); String body = "{\"kind\": \"<VALUE>\", \"profile\": \"<VALUE>\", \"type_code\": \"<VALUE>\", \"issue_at\": \"<VALUE>\", \"pricing\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"exchange_rate\": \"<VALUE>\", \"rate_kind\": \"<VALUE>\", \"rate_date\": \"<VALUE>\", \"buyer\": {\"tax_id\": \"<VALUE>\", \"organization\": \"<VALUE>\", \"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"tax_office\": \"<VALUE>\", \"address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}, \"email\": \"<VALUE>\", \"alias\": \"<VALUE>\", \"phone\": \"<VALUE>\"}, \"references\": {\"orders\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"dispatches\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"returned\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"notes\": [], \"printed\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}]}, \"payee_iban\": \"<VALUE>\", \"series\": \"<VALUE>\", \"template\": \"<VALUE>\", \"internet_sale\": false, \"unshipped\": false, \"printed\": false, \"printed_number\": \"<VALUE>\", \"payment\": {\"url\": \"<VALUE>\", \"means\": \"<VALUE>\", \"method\": \"<VALUE>\", \"agent\": \"<VALUE>\", \"date\": \"<VALUE>\", \"due_date\": \"<VALUE>\", \"note\": \"<VALUE>\"}, \"delivery\": {\"carrier_tax_id\": \"<VALUE>\", \"carrier_name\": \"<VALUE>\", \"carrier_surname\": \"<VALUE>\", \"sent_at\": \"<VALUE>\"}, \"banks\": [{\"bank\": \"<VALUE>\", \"branch\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"number\": \"<VALUE>\", \"note\": \"<VALUE>\"}], \"public_payment\": {\"bank\": \"<VALUE>\", \"branch\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"payer_tax_id\": \"<VALUE>\"}, \"foreign_buyer\": {\"name\": \"<VALUE>\", \"country\": \"<VALUE>\", \"city\": \"<VALUE>\", \"address\": \"<VALUE>\", \"tax_id\": \"<VALUE>\"}, \"shipment\": {\"despatch_at\": \"<VALUE>\", \"plates\": [{\"scheme\": \"<VALUE>\", \"id\": \"<VALUE>\"}], \"drivers\": [{\"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"national_id\": \"<VALUE>\"}], \"carrier\": {\"tax_id\": \"<VALUE>\", \"organization\": \"<VALUE>\", \"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"tax_office\": \"<VALUE>\", \"address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}, \"email\": \"<VALUE>\", \"alias\": \"<VALUE>\", \"phone\": \"<VALUE>\"}, \"delivery_address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}}, \"lines\": [{\"name\": \"<VALUE>\", \"code\": \"<VALUE>\", \"unit\": \"<VALUE>\", \"quantity\": \"<VALUE>\", \"price\": \"<VALUE>\", \"discount\": \"<VALUE>\", \"discount_percent\": \"<VALUE>\", \"vat_rate\": \"<VALUE>\", \"exemption_code\": \"<VALUE>\", \"withholding\": {\"code\": \"<VALUE>\", \"rate_bp\": 0}, \"stoppage\": {\"code\": \"<VALUE>\", \"rate_bp\": 0}, \"export\": {\"terms\": \"<VALUE>\", \"city\": \"<VALUE>\", \"country\": \"<VALUE>\", \"customs_id\": \"<VALUE>\", \"transport_mode\": \"<VALUE>\", \"package_type\": \"<VALUE>\", \"package_count\": 0, \"origin\": \"<VALUE>\"}, \"medical\": {\"kind\": \"<VALUE>\", \"items\": [{\"product_trace_id\": \"<VALUE>\", \"lot_number\": \"<VALUE>\", \"serial_id\": \"<VALUE>\", \"expiry_date\": \"<VALUE>\", \"manufacture_date\": \"<VALUE>\"}]}, \"total\": \"<VALUE>\", \"amount\": \"<VALUE>\", \"taxes\": [{\"code\": \"<VALUE>\", \"rate\": \"<VALUE>\", \"per_unit\": \"<VALUE>\"}], \"special_base\": \"<VALUE>\", \"note\": \"<VALUE>\", \"pricing\": \"<VALUE>\", \"item_id\": 0, \"place_id\": 0}], \"subtotal_discount\": \"<VALUE>\", \"subtotal_discount_percent\": \"<VALUE>\"}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>")) .header("Authorization", "Bearer " + apiKey) .header("Idempotency-Key", "<IDEMPOTENCY_KEY>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString(body)) .build(); HttpResponse<String> res = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); // JSON text; Java has no built-in JSON parser, use a JSON library String response = res.body(); int status = res.statusCode(); } }
// .NET 6+: top-level statements; default console template (implicit usings on) // The key is read from an environment variable, never written into the code using System.Net.Http.Headers; using System.Text; using System.Text.Json; var apiKey = Environment.GetEnvironmentVariable("VERITAKIBI_API_KEY"); var body = "{\"kind\": \"<VALUE>\", \"profile\": \"<VALUE>\", \"type_code\": \"<VALUE>\", \"issue_at\": \"<VALUE>\", \"pricing\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"exchange_rate\": \"<VALUE>\", \"rate_kind\": \"<VALUE>\", \"rate_date\": \"<VALUE>\", \"buyer\": {\"tax_id\": \"<VALUE>\", \"organization\": \"<VALUE>\", \"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"tax_office\": \"<VALUE>\", \"address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}, \"email\": \"<VALUE>\", \"alias\": \"<VALUE>\", \"phone\": \"<VALUE>\"}, \"references\": {\"orders\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"dispatches\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"returned\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}], \"notes\": [], \"printed\": [{\"number\": \"<VALUE>\", \"date\": \"<VALUE>\"}]}, \"payee_iban\": \"<VALUE>\", \"series\": \"<VALUE>\", \"template\": \"<VALUE>\", \"internet_sale\": false, \"unshipped\": false, \"printed\": false, \"printed_number\": \"<VALUE>\", \"payment\": {\"url\": \"<VALUE>\", \"means\": \"<VALUE>\", \"method\": \"<VALUE>\", \"agent\": \"<VALUE>\", \"date\": \"<VALUE>\", \"due_date\": \"<VALUE>\", \"note\": \"<VALUE>\"}, \"delivery\": {\"carrier_tax_id\": \"<VALUE>\", \"carrier_name\": \"<VALUE>\", \"carrier_surname\": \"<VALUE>\", \"sent_at\": \"<VALUE>\"}, \"banks\": [{\"bank\": \"<VALUE>\", \"branch\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"number\": \"<VALUE>\", \"note\": \"<VALUE>\"}], \"public_payment\": {\"bank\": \"<VALUE>\", \"branch\": \"<VALUE>\", \"currency\": \"<VALUE>\", \"payer_tax_id\": \"<VALUE>\"}, \"foreign_buyer\": {\"name\": \"<VALUE>\", \"country\": \"<VALUE>\", \"city\": \"<VALUE>\", \"address\": \"<VALUE>\", \"tax_id\": \"<VALUE>\"}, \"shipment\": {\"despatch_at\": \"<VALUE>\", \"plates\": [{\"scheme\": \"<VALUE>\", \"id\": \"<VALUE>\"}], \"drivers\": [{\"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"national_id\": \"<VALUE>\"}], \"carrier\": {\"tax_id\": \"<VALUE>\", \"organization\": \"<VALUE>\", \"first_name\": \"<VALUE>\", \"last_name\": \"<VALUE>\", \"tax_office\": \"<VALUE>\", \"address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}, \"email\": \"<VALUE>\", \"alias\": \"<VALUE>\", \"phone\": \"<VALUE>\"}, \"delivery_address\": {\"street\": \"<VALUE>\", \"district\": \"<VALUE>\", \"city\": \"<VALUE>\", \"postal_code\": \"<VALUE>\", \"country\": \"<VALUE>\"}}, \"lines\": [{\"name\": \"<VALUE>\", \"code\": \"<VALUE>\", \"unit\": \"<VALUE>\", \"quantity\": \"<VALUE>\", \"price\": \"<VALUE>\", \"discount\": \"<VALUE>\", \"discount_percent\": \"<VALUE>\", \"vat_rate\": \"<VALUE>\", \"exemption_code\": \"<VALUE>\", \"withholding\": {\"code\": \"<VALUE>\", \"rate_bp\": 0}, \"stoppage\": {\"code\": \"<VALUE>\", \"rate_bp\": 0}, \"export\": {\"terms\": \"<VALUE>\", \"city\": \"<VALUE>\", \"country\": \"<VALUE>\", \"customs_id\": \"<VALUE>\", \"transport_mode\": \"<VALUE>\", \"package_type\": \"<VALUE>\", \"package_count\": 0, \"origin\": \"<VALUE>\"}, \"medical\": {\"kind\": \"<VALUE>\", \"items\": [{\"product_trace_id\": \"<VALUE>\", \"lot_number\": \"<VALUE>\", \"serial_id\": \"<VALUE>\", \"expiry_date\": \"<VALUE>\", \"manufacture_date\": \"<VALUE>\"}]}, \"total\": \"<VALUE>\", \"amount\": \"<VALUE>\", \"taxes\": [{\"code\": \"<VALUE>\", \"rate\": \"<VALUE>\", \"per_unit\": \"<VALUE>\"}], \"special_base\": \"<VALUE>\", \"note\": \"<VALUE>\", \"pricing\": \"<VALUE>\", \"item_id\": 0, \"place_id\": 0}], \"subtotal_discount\": \"<VALUE>\", \"subtotal_discount_percent\": \"<VALUE>\"}"; using var http = new HttpClient(); var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); request.Headers.Add("Idempotency-Key", "<IDEMPOTENCY_KEY>"); request.Content = new StringContent(body, Encoding.UTF8); request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var res = await http.SendAsync(request); var response = JsonDocument.Parse(await res.Content.ReadAsStringAsync()); var status = (int)res.StatusCode;
// C++11+: requires libcurl (link with -lcurl) // The key is read from an environment variable, never written into the code #include <curl/curl.h> #include <cstdlib> #include <string> // Collects the response body into a string static size_t write_body(char* data, size_t size, size_t nmemb, void* out) { static_cast<std::string*>(out)->append(data, size * nmemb); return size * nmemb; } int main() { const char* api_key = std::getenv("VERITAKIBI_API_KEY"); std::string auth = std::string("Authorization: Bearer ") + (api_key ? api_key : ""); std::string body = R"({ "kind": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "issue_at": "<VALUE>", "pricing": "<VALUE>", "currency": "<VALUE>", "exchange_rate": "<VALUE>", "rate_kind": "<VALUE>", "rate_date": "<VALUE>", "buyer": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "references": { "orders": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "dispatches": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "returned": [ { "number": "<VALUE>", "date": "<VALUE>" } ], "notes": [], "printed": [ { "number": "<VALUE>", "date": "<VALUE>" } ] }, "payee_iban": "<VALUE>", "series": "<VALUE>", "template": "<VALUE>", "internet_sale": false, "unshipped": false, "printed": false, "printed_number": "<VALUE>", "payment": { "url": "<VALUE>", "means": "<VALUE>", "method": "<VALUE>", "agent": "<VALUE>", "date": "<VALUE>", "due_date": "<VALUE>", "note": "<VALUE>" }, "delivery": { "carrier_tax_id": "<VALUE>", "carrier_name": "<VALUE>", "carrier_surname": "<VALUE>", "sent_at": "<VALUE>" }, "banks": [ { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "number": "<VALUE>", "note": "<VALUE>" } ], "public_payment": { "bank": "<VALUE>", "branch": "<VALUE>", "currency": "<VALUE>", "payer_tax_id": "<VALUE>" }, "foreign_buyer": { "name": "<VALUE>", "country": "<VALUE>", "city": "<VALUE>", "address": "<VALUE>", "tax_id": "<VALUE>" }, "shipment": { "despatch_at": "<VALUE>", "plates": [ { "scheme": "<VALUE>", "id": "<VALUE>" } ], "drivers": [ { "first_name": "<VALUE>", "last_name": "<VALUE>", "national_id": "<VALUE>" } ], "carrier": { "tax_id": "<VALUE>", "organization": "<VALUE>", "first_name": "<VALUE>", "last_name": "<VALUE>", "tax_office": "<VALUE>", "address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" }, "email": "<VALUE>", "alias": "<VALUE>", "phone": "<VALUE>" }, "delivery_address": { "street": "<VALUE>", "district": "<VALUE>", "city": "<VALUE>", "postal_code": "<VALUE>", "country": "<VALUE>" } }, "lines": [ { "name": "<VALUE>", "code": "<VALUE>", "unit": "<VALUE>", "quantity": "<VALUE>", "price": "<VALUE>", "discount": "<VALUE>", "discount_percent": "<VALUE>", "vat_rate": "<VALUE>", "exemption_code": "<VALUE>", "withholding": { "code": "<VALUE>", "rate_bp": 0 }, "stoppage": { "code": "<VALUE>", "rate_bp": 0 }, "export": { "terms": "<VALUE>", "city": "<VALUE>", "country": "<VALUE>", "customs_id": "<VALUE>", "transport_mode": "<VALUE>", "package_type": "<VALUE>", "package_count": 0, "origin": "<VALUE>" }, "medical": { "kind": "<VALUE>", "items": [ { "product_trace_id": "<VALUE>", "lot_number": "<VALUE>", "serial_id": "<VALUE>", "expiry_date": "<VALUE>", "manufacture_date": "<VALUE>" } ] }, "total": "<VALUE>", "amount": "<VALUE>", "taxes": [ { "code": "<VALUE>", "rate": "<VALUE>", "per_unit": "<VALUE>" } ], "special_base": "<VALUE>", "note": "<VALUE>", "pricing": "<VALUE>", "item_id": 0, "place_id": 0 } ], "subtotal_discount": "<VALUE>", "subtotal_discount_percent": "<VALUE>" })"; std::string response; long status = 0; curl_global_init(CURL_GLOBAL_DEFAULT); CURL* ch = curl_easy_init(); curl_slist* headers = nullptr; headers = curl_slist_append(headers, auth.c_str()); headers = curl_slist_append(headers, "Idempotency-Key: <IDEMPOTENCY_KEY>"); headers = curl_slist_append(headers, "Content-Type: application/json"); curl_easy_setopt(ch, CURLOPT_URL, "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>"); curl_easy_setopt(ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(ch, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(ch, CURLOPT_POSTFIELDS, body.c_str()); curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, write_body); curl_easy_setopt(ch, CURLOPT_WRITEDATA, &response); curl_easy_perform(ch); curl_easy_getinfo(ch, CURLINFO_RESPONSE_CODE, &status); curl_slist_free_all(headers); curl_easy_cleanup(ch); curl_global_cleanup(); }
Yanıt · 201 · değerler yer tutucudur
{ "environment": "<VALUE>", "document": { "id": 0, "kind": "<VALUE>", "direction": "<VALUE>", "profile": "<VALUE>", "type_code": "<VALUE>", "uid": "<VALUE>", "number": "<VALUE>", "issue_at": "<VALUE>", "created_at": "<VALUE>", "received_at": "<VALUE>", "reply_due_at": "<VALUE>", "status": "<VALUE>", "raw_status": "<VALUE>", "error_class": "<VALUE>", "error_code": "<VALUE>", "party_name": "<VALUE>", "party_tax_id": "<VALUE>", "currency": "<VALUE>", "archived": false, "reply": { "type": "<VALUE>", "note": "<VALUE>", "at": "<VALUE>", "number": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }, "environment": "<VALUE>" }, "actions": [] }
Sürüm öneki, sayfalama, zaman biçimi ve hata gövdesi: Sürümleme, sayfalama, limitler →