Gelen belgeye yanıt vermek
Gelen ticari e-Faturaları ve e-İrsaliyeleri listeler, belgeyi okur ve yanıtı kendi sisteminizden verirsiniz: faturada kabul ya da ret, irsaliyede kalemli yanıt. Yanıt e-belge sistemine gönderilir.
Adımlar
-
Anahtarda iki kutuyu işaretleyin Panel
API altyapısı › Sunulan sekmesi › Anahtar üret. Erişebileceği uygulamalar altında e-Dönüşüm (
EDOC: listeleme ve okuma) ve e-Dönüşüm — Belge kesme, iptal, yeniden gönderme ve yanıt (EDOC.issue: yanıt) kutularını işaretleyin. YalnızEDOCtaşıyan anahtar yanıt ucundaFORBIDDENalır: Kılavuz › API anahtarı oluşturma. -
Gelen belgeleri listeleyin Sizin sisteminiz
GET/v1/edoc/documentsenvironment,kind=einvoice(irsaliyedekind=edespatch) vebox=incomingverin; durum sekmesi (tab), dönem ve öteki süzgeçler isteğe bağlıdır. Sonuç sayfa sayfadır: yanıttakinext_cursordeğerini sonraki istektecursorolarak gönderin; boşsa son sayfadır.Her belgede
reply_due_atyanıtın son anını verir (süreli yanıt yoksanull; irsaliyede süreli yanıt yoktur); yanıtlanmış belgedereplybulunur. Firmanızın e-Dönüşüm Ayarlar ekranında kullanmadığı belge türüNOT_FOUNDdöner.Sonraki adımda kullanılan alan:
documents[].id. Ucun alanları, kuralları ve hataları: Belgeleri kutu kutu, sayfa sayfa listeler.İstek
curl "https://api.veritakibi.com/v1/edoc/documents?environment=<ENVIRONMENT>&kind=<KIND>&box=<BOX>" \ -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?environment=<ENVIRONMENT>&kind=<KIND>&box=<BOX>'); 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?environment=<ENVIRONMENT>&kind=<KIND>&box=<BOX>', { 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?environment=<ENVIRONMENT>&kind=<KIND>&box=<BOX>', 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?environment=<ENVIRONMENT>&kind=<KIND>&box=<BOX>", 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?environment=<ENVIRONMENT>&kind=<KIND>&box=<BOX>")) .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?environment=<ENVIRONMENT>&kind=<KIND>&box=<BOX>"); 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?environment=<ENVIRONMENT>&kind=<KIND>&box=<BOX>"); 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>", "documents": [ { "id": 0, "number": "<VALUE>", "uid": "<VALUE>", "issue_at": "<VALUE>", "profile": "<VALUE>", "status": "<VALUE>", "party_name": "<VALUE>", "party_tax_id": "<VALUE>", "total": null, "payable": null, "reply_due_at": "<VALUE>", "type_code": "<VALUE>", "archived_at": "<VALUE>", "actions": [], "error_class": "<VALUE>", "error_code": "<VALUE>", "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>", "plate": "<VALUE>", "driver": "<VALUE>", "despatch_at": "<VALUE>", "line_count": 0 } ], "next_cursor": "<VALUE>" } -
Belgeyi okuyun Sizin sisteminiz
GET/v1/edoc/documents/{id}Satırları (
lines) ve toplamları (totals) okuyup kararınızı verin. Yanıt verilebilen belgedeactionslistesinderespondbulunur; anahtarEDOC.issuetaşımıyorsa bu eylem listede yer almaz. İrsaliyedelinesdizisinin sırası yanıtın kalem sırasıdır (1'den) ve her kalemin sevk edilen miktarıqty_millialanındadır.Sonraki adımda kullanılan alan:
actions. 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": [] } -
Faturaya kabul ya da ret yanıtı verin Sizin sisteminiz
POST/v1/edoc/documents/{id}/respondTicari faturada gövdede
type(acceptya dareject) venotegider; not zorunludur. Not boşsa ya da çok uzunsa istekINVALID_REQUESTile reddedilir, sebepdetail.reasonalanındadır.Belge zaten yanıtlandıysa ya da yanıt süresi dolduysa istek
EDOC_ACTION_REFUSEDile reddedilir;detail.reasonrepliedya daexpiredolur. Yanıt e-belge sistemine gönderilir; sonucu belgenindocument.statusvedocument.replyalanlarında ve durum geçmişinde, belgeyi yeniden okuyarak izleyin.Ucun alanları, kuralları ve hataları: Gelen belgeye yanıt verir: ticari faturada kabul ya da ret, e-İrsaliyede kalemli yanıt (`lines`.
İstek
curl -X POST "https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -H "Content-Type: application/json" \ -d '{ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }'
// The key is read from an environment variable, never written into the code $apiKey = getenv('VERITAKIBI_API_KEY'); $body = '{ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }'; $ch = curl_init('https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>'); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, '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/<id>/respond?environment=<ENVIRONMENT>', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<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 = '''{ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }'''.encode() req = urllib.request.Request( 'https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>', data=body, method='POST', headers={ 'Authorization': f'Bearer {api_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 := `{ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }` req, err := http.NewRequest("POST", "https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>", strings.NewReader(body)) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer "+apiKey) 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 = "{\"type\": \"<VALUE>\", \"note\": \"<VALUE>\", \"lines\": [{\"line\": 0, \"received_milli\": 0, \"short_milli\": 0, \"rejected_milli\": 0, \"oversupply_milli\": 0, \"reason\": \"<VALUE>\"}]}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>")) .header("Authorization", "Bearer " + apiKey) .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 = "{\"type\": \"<VALUE>\", \"note\": \"<VALUE>\", \"lines\": [{\"line\": 0, \"received_milli\": 0, \"short_milli\": 0, \"rejected_milli\": 0, \"oversupply_milli\": 0, \"reason\": \"<VALUE>\"}]}"; using var http = new HttpClient(); var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); 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"({ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<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, "Content-Type: application/json"); curl_easy_setopt(ch, CURLOPT_URL, "https://api.veritakibi.com/v1/edoc/documents/<id>/respond?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 · 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>" }, "actions": [] } -
İrsaliyeye kalemli yanıt verin Sizin sisteminiz
POST/v1/edoc/documents/{id}/respondİrsaliyede
typeverilmez; gövdedenotevelinesgider.linesirsaliyenin her kalemini bir kez taşır:line(kalemin sırası, 1'den),received_milli(teslim alınan miktarın bin katı) veshort_milli(eksik miktarın bin katı). Teslim alınan ile eksiğin toplamı kaleminqty_millideğerine eşit olmalıdır.Yanıtın niteliği miktarlardan çıkar: her kalem tam teslim alındıysa kabul, hiçbir kalem teslim alınmadıysa ret, öteki durumlarda kısmi kabul. Not yalnız eksik ya da ret taşıyan yanıtta zorunludur; tam kabulde isteğe bağlıdır. Kalemler irsaliyeyle tutmuyorsa istek
INVALID_REQUESTile reddedilir; sebep ve öteki kalem alanları ucun sayfasındadır.Ucun alanları, kuralları ve hataları: Gelen belgeye yanıt verir: ticari faturada kabul ya da ret, e-İrsaliyede kalemli yanıt (`lines`.
İstek
curl -X POST "https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>" \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -H "Content-Type: application/json" \ -d '{ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }'
// The key is read from an environment variable, never written into the code $apiKey = getenv('VERITAKIBI_API_KEY'); $body = '{ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }'; $ch = curl_init('https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>'); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, '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/<id>/respond?environment=<ENVIRONMENT>', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<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 = '''{ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }'''.encode() req = urllib.request.Request( 'https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>', data=body, method='POST', headers={ 'Authorization': f'Bearer {api_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 := `{ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<VALUE>" } ] }` req, err := http.NewRequest("POST", "https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>", strings.NewReader(body)) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer "+apiKey) 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 = "{\"type\": \"<VALUE>\", \"note\": \"<VALUE>\", \"lines\": [{\"line\": 0, \"received_milli\": 0, \"short_milli\": 0, \"rejected_milli\": 0, \"oversupply_milli\": 0, \"reason\": \"<VALUE>\"}]}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>")) .header("Authorization", "Bearer " + apiKey) .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 = "{\"type\": \"<VALUE>\", \"note\": \"<VALUE>\", \"lines\": [{\"line\": 0, \"received_milli\": 0, \"short_milli\": 0, \"rejected_milli\": 0, \"oversupply_milli\": 0, \"reason\": \"<VALUE>\"}]}"; using var http = new HttpClient(); var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.veritakibi.com/v1/edoc/documents/<id>/respond?environment=<ENVIRONMENT>"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); 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"({ "type": "<VALUE>", "note": "<VALUE>", "lines": [ { "line": 0, "received_milli": 0, "short_milli": 0, "rejected_milli": 0, "oversupply_milli": 0, "reason": "<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, "Content-Type: application/json"); curl_easy_setopt(ch, CURLOPT_URL, "https://api.veritakibi.com/v1/edoc/documents/<id>/respond?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 · 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>" }, "actions": [] }
Sürüm öneki, sayfalama, zaman biçimi ve hata gövdesi: Sürümleme, sayfalama, limitler →