Send the Invoice as a Model
var client = new RestClient("/einvoice/Send/Model");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "Bearer <API KEY>");
var body = @"{
"EInvoice": {
"InvoiceInfo": {
"UUID": "1f797839-fb10-45d3-818c-eaaeed533b76",
"TemplateUUID": "28c9920d-c85d-4d07-a3a3-1b5a1d819949",
"TemplateBase64String": null,
"InvoiceType": "SATIS",
"InvoiceSerieOrNumber": "EFT",
"IssueDate": "2022-07-02T01:10:14.1406414+03:00",
"CurrencyCode": "TRY",
"ExchangeRate": null,
"InvoiceProfile": "TICARIFATURA",
"DespatchDocumentReference": null,
"OrderReference": null,
"OrderReferenceDocument": null,
"AdditionalDocumentReferences": null,
"TaxExemptionReasonInfo": null,
"PaymentTermsInfo": null,
"PaymentMeansInfo": null,
"OKCInfo": null,
"ReturnInvoiceInfo": null,
"AccountingCost": null,
"InvoicePeriod": null,
"SGKInfo": null,
"LineExtensionAmount": 0,
"GeneralKDV1Total": 0,
"GeneralKDV8Total": 0,
"GeneralKDV18Total": 0,
"GeneralAllowanceTotal": 0,
"PayableAmount": 0,
"KdvTotal": 0
},
"CompanyInfo": {
"TaxNumber": "6310540565",
"Name": "Nilvera Yazılım ve Bilişim Hiz. Tic. Ltd. Şti.",
"TaxOffice": "Erciyes",
"PartyIdentifications": null,
"AgentPartyIdentifications": null,
"Address": "Adres",
"District": "Melikgazi",
"City": "Kayseri",
"Country": "Türkiye",
"PostalCode": "38038",
"Phone": "08502514010",
"Fax": null,
"Mail": "info@nilvera.com",
"WebSite": "htts://nilvera.com"
},
"CustomerInfo": {
"TaxNumber": "1234567801",
"Name": "AAA Anonim Şirketi",
"TaxOffice": null,
"PartyIdentifications": null,
"AgentPartyIdentifications": null,
"Address": "Papatya Caddesi Yasemin Sokak No21",
"District": "Melikgazi",
"City": "Kayseri",
"Country": "Türkiye",
"PostalCode": "38038",
"Phone": null,
"Fax": null,
"Mail": null,
"WebSite": null
},
"BuyerCustomerInfo": null,
"ExportCustomerInfo": null,
"TaxFreeInfo": null,
"InvoiceLines": [
{
"Index": null,
"SellerCode": null,
"BuyerCode": null,
"Name": "Laptop",
"Description": null,
"Quantity": 1,
"UnitType": "C62",
"Price": 100,
"AllowanceTotal": 0,
"KDVPercent": 18,
"KDVTotal": 0,
"Taxes": null,
"DeliveryInfo": null,
"ManufacturerCode": null,
"BrandName": null,
"ModelName": null,
"Note": null,
"OzelMatrahReason": null,
"OzelMatrahTotal": null
}
],
"Notes": [
"Note 1",
"Note 2"
]
},
"CustomerAlias": null
}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '//einvoice/Send/Model',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"EInvoice": {
"InvoiceInfo": {
"UUID": "9a60baa4-438b-477f-8aa8-5ccec3ffef37",
"TemplateUUID": "cd1aff46-00ac-4a4f-96a2-6d58a3cb84f9",
"TemplateBase64String": null,
"InvoiceType": "SATIS",
"InvoiceSerieOrNumber": "EFT",
"IssueDate": "2022-07-01T23:16:59.8456278+03:00",
"CurrencyCode": "TRY",
"ExchangeRate": null,
"InvoiceProfile": "TICARIFATURA",
"DespatchDocumentReference": null,
"OrderReference": null,
"OrderReferenceDocument": null,
"AdditionalDocumentReferences": null,
"TaxExemptionReasonInfo": null,
"PaymentTermsInfo": null,
"PaymentMeansInfo": null,
"OKCInfo": null,
"ReturnInvoiceInfo": null,
"AccountingCost": null,
"InvoicePeriod": null,
"SGKInfo": null,
"LineExtensionAmount": 0,
"GeneralKDV1Total": 0,
"GeneralKDV8Total": 0,
"GeneralKDV18Total": 0,
"GeneralAllowanceTotal": 0,
"PayableAmount": 0,
"KdvTotal": 0
},
"CompanyInfo": {
"TaxNumber": "6310540565",
"Name": "Nilvera Yazılım ve Bilişim Hiz. Tic. Ltd. Şti.",
"TaxOffice": "Erciyes",
"PartyIdentifications": null,
"AgentPartyIdentifications": null,
"Address": "Adres",
"District": "Melikgazi",
"City": "Kayseri",
"Country": "Türkiye",
"PostalCode": "38038",
"Phone": "08502514010",
"Fax": null,
"Mail": "info@nilvera.com",
"WebSite": "htts://nilvera.com"
},
"CustomerInfo": {
"TaxNumber": "1234567801",
"Name": "AAA Anonim Åžirketi",
"TaxOffice": null,
"PartyIdentifications": null,
"AgentPartyIdentifications": null,
"Address": "Papatya Caddesi Yasemin Sokak No21",
"District": "Melikgazi",
"City": "Kayseri",
"Country": "Türkiye",
"PostalCode": "38038",
"Phone": null,
"Fax": null,
"Mail": null,
"WebSite": null
},
"BuyerCustomerInfo": null,
"ExportCustomerInfo": null,
"TaxFreeInfo": null,
"InvoiceLines": [
{
"Index": null,
"SellerCode": null,
"BuyerCode": null,
"Name": "Laptop",
"Description": null,
"Quantity": 1,
"UnitType": "C62",
"Price": 100,
"AllowanceTotal": 0,
"KDVPercent": 18,
"KDVTotal": 0,
"Taxes": null,
"DeliveryInfo": null,
"ManufacturerCode": null,
"BrandName": null,
"ModelName": null,
"Note": null,
"OzelMatrahReason": null,
"OzelMatrahTotal": null
}
],
"Notes": [
"Note 1",
"Note 2"
]
},
"CustomerAlias": null
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: text/plain',
'Authorization: Bearer <API KEY>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var data = JSON.stringify({
"EInvoice": {
"InvoiceInfo": {
"UUID": "9a60baa4-438b-477f-8aa8-5ccec3ffef37",
"TemplateUUID": "cd1aff46-00ac-4a4f-96a2-6d58a3cb84f9",
"TemplateBase64String": null,
"InvoiceType": "SATIS",
"InvoiceSerieOrNumber": "EFT",
"IssueDate": "2022-07-01T23:16:59.8456278+03:00",
"CurrencyCode": "TRY",
"ExchangeRate": null,
"InvoiceProfile": "TICARIFATURA",
"DespatchDocumentReference": null,
"OrderReference": null,
"OrderReferenceDocument": null,
"AdditionalDocumentReferences": null,
"TaxExemptionReasonInfo": null,
"PaymentTermsInfo": null,
"PaymentMeansInfo": null,
"OKCInfo": null,
"ReturnInvoiceInfo": null,
"AccountingCost": null,
"InvoicePeriod": null,
"SGKInfo": null,
"LineExtensionAmount": 0,
"GeneralKDV1Total": 0,
"GeneralKDV8Total": 0,
"GeneralKDV18Total": 0,
"GeneralAllowanceTotal": 0,
"PayableAmount": 0,
"KdvTotal": 0
},
"CompanyInfo": {
"TaxNumber": "6310540565",
"Name": "Nilvera Yazılım ve Bilişim Hiz. Tic. Ltd. Şti.",
"TaxOffice": "Erciyes",
"PartyIdentifications": null,
"AgentPartyIdentifications": null,
"Address": "Adres",
"District": "Melikgazi",
"City": "Kayseri",
"Country": "Türkiye",
"PostalCode": "38038",
"Phone": "08502514010",
"Fax": null,
"Mail": "info@nilvera.com",
"WebSite": "htts://nilvera.com"
},
"CustomerInfo": {
"TaxNumber": "1234567801",
"Name": "AAA Anonim Åžirketi",
"TaxOffice": null,
"PartyIdentifications": null,
"AgentPartyIdentifications": null,
"Address": "Papatya Caddesi Yasemin Sokak No21",
"District": "Melikgazi",
"City": "Kayseri",
"Country": "Türkiye",
"PostalCode": "38038",
"Phone": null,
"Fax": null,
"Mail": null,
"WebSite": null
},
"BuyerCustomerInfo": null,
"ExportCustomerInfo": null,
"TaxFreeInfo": null,
"InvoiceLines": [
{
"Index": null,
"SellerCode": null,
"BuyerCode": null,
"Name": "Laptop",
"Description": null,
"Quantity": 1,
"UnitType": "C62",
"Price": 100,
"AllowanceTotal": 0,
"KDVPercent": 18,
"KDVTotal": 0,
"Taxes": null,
"DeliveryInfo": null,
"ManufacturerCode": null,
"BrandName": null,
"ModelName": null,
"Note": null,
"OzelMatrahReason": null,
"OzelMatrahTotal": null
}
],
"Notes": [
"Note 1",
"Note 2"
]
},
"CustomerAlias": null
});
var config = {
method: 'post',
url: '//einvoice/Send/Model',
headers: {
'Content-Type': 'application/json',
'Accept': 'text/plain',
'Authorization': 'Bearer <API KEY>'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});