Downloads Previewed Invoice as PDF
var options = new RestClientOptions("https://apitest.nilvera.com")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/earchive/Send/Model/Download/Pdf", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer <API KEY>");
var body = @"{
""ArchiveInvoice"": {
""InvoiceInfo"": {
""UUID"": ""3fa85f64-5717-4562-b3fc-2c963f66afa6"",
""TemplateUUID"": ""3fa85f64-5717-4562-b3fc-2c963f66afa6"",
""TemplateBase64String"": ""string"",
""InvoiceType"": ""SATIS"",
""InvoiceSerieOrNumber"": ""string"",
""IssueDate"": ""2024-04-03T07:58:33.397Z"",
""CurrencyCode"": ""string"",
""ExchangeRate"": 0,
""DespatchDocumentReference"": [
{
""IssueDate"": ""2024-04-03T07:58:33.397Z"",
""Value"": ""string""
}
],
""OrderReference"": {
""IssueDate"": ""2024-04-03T07:58:33.397Z"",
""Value"": ""string""
},
""OrderReferenceDocument"": {
""ID"": ""string"",
""IssueDate"": ""2024-04-03T07:58:33.397Z"",
""DocumentType"": ""string"",
""DocumentTypeCode"": ""string"",
""DocumentDescription"": ""string"",
""Attachment"": {
""Base64Data"": ""string"",
""MimeCode"": ""string"",
""FileName"": ""string""
}
},
""AdditionalDocumentReferences"": [
{
""ID"": ""string"",
""IssueDate"": ""2024-04-03T07:58:33.397Z"",
""DocumentType"": ""string"",
""DocumentTypeCode"": ""string"",
""DocumentDescription"": ""string"",
""Attachment"": {
""Base64Data"": ""string"",
""MimeCode"": ""string"",
""FileName"": ""string""
}
}
],
""TaxExemptionReasonInfo"": {
""KDVExemptionReasonCode"": ""string"",
""OTVExemptionReasonCode"": ""string"",
""AccommodationTaxExemptionReasonCode"": ""string""
},
""PaymentTermsInfo"": {
""Percent"": 0,
""Amount"": 0,
""Note"": ""string""
},
""PaymentMeansInfo"": {
""Code"": ""string"",
""ChannelCode"": ""string"",
""DueDate"": ""2024-04-03T07:58:33.397Z"",
""PayeeFinancialAccountID"": ""string"",
""Note"": ""string""
},
""OKCInfo"": {
""ID"": ""string"",
""IssueDate"": ""2024-04-03T07:58:33.397Z"",
""Time"": ""string"",
""ZNo"": ""string"",
""EndPointID"": ""string"",
""DocumentDescription"": ""string""
},
""ReturnInvoiceInfo"": [
{
""InvoiceNumber"": ""string"",
""IssueDate"": ""2024-04-03T07:58:33.397Z""
}
],
""Expenses"": [
{
""ExpenseType"": ""HKSKOMISYON"",
""Percent"": 0,
""Amount"": 0
}
],
""ISDespatch"": true,
""SalesPlatform"": ""NORMAL"",
""SendType"": ""KAGIT"",
""InternetInfo"": {
""WebSite"": ""string"",
""PaymentMethod"": ""string"",
""PaymentMethodName"": ""string"",
""PaymentDate"": ""2024-04-03T07:58:33.397Z"",
""TransporterName"": ""string"",
""TransporterRegisterNumber"": ""string"",
""TransportDate"": ""2024-04-03T07:58:33.397Z""
},
""AccountingCost"": ""string"",
""LineExtensionAmount"": 0,
""GeneralKDV1Total"": 0,
""GeneralKDV8Total"": 0,
""GeneralKDV18Total"": 0,
""GeneralKDV10Total"": 0,
""GeneralKDV20Total"": 0,
""GeneralAllowanceTotal"": 0,
""PayableAmount"": 0,
""KdvTotal"": 0
},
""CompanyInfo"": {
""TaxNumber"": ""string"",
""Name"": ""string"",
""TaxOffice"": ""string"",
""PartyIdentifications"": [
{
""SchemeID"": ""string"",
""Value"": ""string""
}
],
""AgentPartyIdentifications"": [
{
""SchemeID"": ""string"",
""Value"": ""string""
}
],
""Address"": ""string"",
""District"": ""string"",
""City"": ""string"",
""Country"": ""string"",
""PostalCode"": ""string"",
""Phone"": ""string"",
""Fax"": ""string"",
""Mail"": ""string"",
""WebSite"": ""string""
},
""CustomerInfo"": {
""TaxNumber"": ""string"",
""Name"": ""string"",
""TaxOffice"": ""string"",
""PartyIdentifications"": [
{
""SchemeID"": ""string"",
""Value"": ""string""
}
],
""AgentPartyIdentifications"": [
{
""SchemeID"": ""string"",
""Value"": ""string""
}
],
""Address"": ""string"",
""District"": ""string"",
""City"": ""string"",
""Country"": ""string"",
""PostalCode"": ""string"",
""Phone"": ""string"",
""Fax"": ""string"",
""Mail"": ""string"",
""WebSite"": ""string""
},
""InvoiceLines"": [
{
""Index"": ""string"",
""SellerCode"": ""string"",
""BuyerCode"": ""string"",
""Name"": ""string"",
""Description"": ""string"",
""Quantity"": 0,
""UnitType"": ""string"",
""Price"": 0,
""AllowanceTotal"": 0,
""KDVPercent"": 0,
""KDVTotal"": 0,
""Taxes"": [
{
""TaxCode"": ""string"",
""Total"": 0,
""Percent"": 0,
""ReasonCode"": ""string"",
""ReasonDesc"": ""string""
}
],
""ManufacturerCode"": ""string"",
""BrandName"": ""string"",
""ModelName"": ""string"",
""Note"": ""string"",
""OzelMatrahReason"": ""string"",
""OzelMatrahTotal"": 0,
""VatAmountWithoutTevkifat"": 0,
""AdditionalItemIdentification"": {
""TagNumber"": ""string"",
""OwnerName"": ""string"",
""OwnerTaxNumber"": ""string""
}
}
],
""Notes"": [
""string""
]
}
}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://apitest.nilvera.com/earchive/Send/Model/Download/Pdf',
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 =>'{
"ArchiveInvoice": {
"InvoiceInfo": {
"UUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"TemplateUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"TemplateBase64String": "string",
"InvoiceType": "SATIS",
"InvoiceSerieOrNumber": "string",
"IssueDate": "2024-04-03T07:58:33.397Z",
"CurrencyCode": "string",
"ExchangeRate": 0,
"DespatchDocumentReference": [
{
"IssueDate": "2024-04-03T07:58:33.397Z",
"Value": "string"
}
],
"OrderReference": {
"IssueDate": "2024-04-03T07:58:33.397Z",
"Value": "string"
},
"OrderReferenceDocument": {
"ID": "string",
"IssueDate": "2024-04-03T07:58:33.397Z",
"DocumentType": "string",
"DocumentTypeCode": "string",
"DocumentDescription": "string",
"Attachment": {
"Base64Data": "string",
"MimeCode": "string",
"FileName": "string"
}
},
"AdditionalDocumentReferences": [
{
"ID": "string",
"IssueDate": "2024-04-03T07:58:33.397Z",
"DocumentType": "string",
"DocumentTypeCode": "string",
"DocumentDescription": "string",
"Attachment": {
"Base64Data": "string",
"MimeCode": "string",
"FileName": "string"
}
}
],
"TaxExemptionReasonInfo": {
"KDVExemptionReasonCode": "string",
"OTVExemptionReasonCode": "string",
"AccommodationTaxExemptionReasonCode": "string"
},
"PaymentTermsInfo": {
"Percent": 0,
"Amount": 0,
"Note": "string"
},
"PaymentMeansInfo": {
"Code": "string",
"ChannelCode": "string",
"DueDate": "2024-04-03T07:58:33.397Z",
"PayeeFinancialAccountID": "string",
"Note": "string"
},
"OKCInfo": {
"ID": "string",
"IssueDate": "2024-04-03T07:58:33.397Z",
"Time": "string",
"ZNo": "string",
"EndPointID": "string",
"DocumentDescription": "string"
},
"ReturnInvoiceInfo": [
{
"InvoiceNumber": "string",
"IssueDate": "2024-04-03T07:58:33.397Z"
}
],
"Expenses": [
{
"ExpenseType": "HKSKOMISYON",
"Percent": 0,
"Amount": 0
}
],
"ISDespatch": true,
"SalesPlatform": "NORMAL",
"SendType": "KAGIT",
"InternetInfo": {
"WebSite": "string",
"PaymentMethod": "string",
"PaymentMethodName": "string",
"PaymentDate": "2024-04-03T07:58:33.397Z",
"TransporterName": "string",
"TransporterRegisterNumber": "string",
"TransportDate": "2024-04-03T07:58:33.397Z"
},
"AccountingCost": "string",
"LineExtensionAmount": 0,
"GeneralKDV1Total": 0,
"GeneralKDV8Total": 0,
"GeneralKDV18Total": 0,
"GeneralKDV10Total": 0,
"GeneralKDV20Total": 0,
"GeneralAllowanceTotal": 0,
"PayableAmount": 0,
"KdvTotal": 0
},
"CompanyInfo": {
"TaxNumber": "string",
"Name": "string",
"TaxOffice": "string",
"PartyIdentifications": [
{
"SchemeID": "string",
"Value": "string"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "string",
"Value": "string"
}
],
"Address": "string",
"District": "string",
"City": "string",
"Country": "string",
"PostalCode": "string",
"Phone": "string",
"Fax": "string",
"Mail": "string",
"WebSite": "string"
},
"CustomerInfo": {
"TaxNumber": "string",
"Name": "string",
"TaxOffice": "string",
"PartyIdentifications": [
{
"SchemeID": "string",
"Value": "string"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "string",
"Value": "string"
}
],
"Address": "string",
"District": "string",
"City": "string",
"Country": "string",
"PostalCode": "string",
"Phone": "string",
"Fax": "string",
"Mail": "string",
"WebSite": "string"
},
"InvoiceLines": [
{
"Index": "string",
"SellerCode": "string",
"BuyerCode": "string",
"Name": "string",
"Description": "string",
"Quantity": 0,
"UnitType": "string",
"Price": 0,
"AllowanceTotal": 0,
"KDVPercent": 0,
"KDVTotal": 0,
"Taxes": [
{
"TaxCode": "string",
"Total": 0,
"Percent": 0,
"ReasonCode": "string",
"ReasonDesc": "string"
}
],
"ManufacturerCode": "string",
"BrandName": "string",
"ModelName": "string",
"Note": "string",
"OzelMatrahReason": "string",
"OzelMatrahTotal": 0,
"VatAmountWithoutTevkifat": 0,
"AdditionalItemIdentification": {
"TagNumber": "string",
"OwnerName": "string",
"OwnerTaxNumber": "string"
}
}
],
"Notes": [
"string"
]
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer <API KEY>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
const axios = require('axios');
let data = JSON.stringify({
"ArchiveInvoice": {
"InvoiceInfo": {
"UUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"TemplateUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"TemplateBase64String": "string",
"InvoiceType": "SATIS",
"InvoiceSerieOrNumber": "string",
"IssueDate": "2024-04-03T07:58:33.397Z",
"CurrencyCode": "string",
"ExchangeRate": 0,
"DespatchDocumentReference": [
{
"IssueDate": "2024-04-03T07:58:33.397Z",
"Value": "string"
}
],
"OrderReference": {
"IssueDate": "2024-04-03T07:58:33.397Z",
"Value": "string"
},
"OrderReferenceDocument": {
"ID": "string",
"IssueDate": "2024-04-03T07:58:33.397Z",
"DocumentType": "string",
"DocumentTypeCode": "string",
"DocumentDescription": "string",
"Attachment": {
"Base64Data": "string",
"MimeCode": "string",
"FileName": "string"
}
},
"AdditionalDocumentReferences": [
{
"ID": "string",
"IssueDate": "2024-04-03T07:58:33.397Z",
"DocumentType": "string",
"DocumentTypeCode": "string",
"DocumentDescription": "string",
"Attachment": {
"Base64Data": "string",
"MimeCode": "string",
"FileName": "string"
}
}
],
"TaxExemptionReasonInfo": {
"KDVExemptionReasonCode": "string",
"OTVExemptionReasonCode": "string",
"AccommodationTaxExemptionReasonCode": "string"
},
"PaymentTermsInfo": {
"Percent": 0,
"Amount": 0,
"Note": "string"
},
"PaymentMeansInfo": {
"Code": "string",
"ChannelCode": "string",
"DueDate": "2024-04-03T07:58:33.397Z",
"PayeeFinancialAccountID": "string",
"Note": "string"
},
"OKCInfo": {
"ID": "string",
"IssueDate": "2024-04-03T07:58:33.397Z",
"Time": "string",
"ZNo": "string",
"EndPointID": "string",
"DocumentDescription": "string"
},
"ReturnInvoiceInfo": [
{
"InvoiceNumber": "string",
"IssueDate": "2024-04-03T07:58:33.397Z"
}
],
"Expenses": [
{
"ExpenseType": "HKSKOMISYON",
"Percent": 0,
"Amount": 0
}
],
"ISDespatch": true,
"SalesPlatform": "NORMAL",
"SendType": "KAGIT",
"InternetInfo": {
"WebSite": "string",
"PaymentMethod": "string",
"PaymentMethodName": "string",
"PaymentDate": "2024-04-03T07:58:33.397Z",
"TransporterName": "string",
"TransporterRegisterNumber": "string",
"TransportDate": "2024-04-03T07:58:33.397Z"
},
"AccountingCost": "string",
"LineExtensionAmount": 0,
"GeneralKDV1Total": 0,
"GeneralKDV8Total": 0,
"GeneralKDV18Total": 0,
"GeneralKDV10Total": 0,
"GeneralKDV20Total": 0,
"GeneralAllowanceTotal": 0,
"PayableAmount": 0,
"KdvTotal": 0
},
"CompanyInfo": {
"TaxNumber": "string",
"Name": "string",
"TaxOffice": "string",
"PartyIdentifications": [
{
"SchemeID": "string",
"Value": "string"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "string",
"Value": "string"
}
],
"Address": "string",
"District": "string",
"City": "string",
"Country": "string",
"PostalCode": "string",
"Phone": "string",
"Fax": "string",
"Mail": "string",
"WebSite": "string"
},
"CustomerInfo": {
"TaxNumber": "string",
"Name": "string",
"TaxOffice": "string",
"PartyIdentifications": [
{
"SchemeID": "string",
"Value": "string"
}
],
"AgentPartyIdentifications": [
{
"SchemeID": "string",
"Value": "string"
}
],
"Address": "string",
"District": "string",
"City": "string",
"Country": "string",
"PostalCode": "string",
"Phone": "string",
"Fax": "string",
"Mail": "string",
"WebSite": "string"
},
"InvoiceLines": [
{
"Index": "string",
"SellerCode": "string",
"BuyerCode": "string",
"Name": "string",
"Description": "string",
"Quantity": 0,
"UnitType": "string",
"Price": 0,
"AllowanceTotal": 0,
"KDVPercent": 0,
"KDVTotal": 0,
"Taxes": [
{
"TaxCode": "string",
"Total": 0,
"Percent": 0,
"ReasonCode": "string",
"ReasonDesc": "string"
}
],
"ManufacturerCode": "string",
"BrandName": "string",
"ModelName": "string",
"Note": "string",
"OzelMatrahReason": "string",
"OzelMatrahTotal": 0,
"VatAmountWithoutTevkifat": 0,
"AdditionalItemIdentification": {
"TagNumber": "string",
"OwnerName": "string",
"OwnerTaxNumber": "string"
}
}
],
"Notes": [
"string"
]
}
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://apitest.nilvera.com/earchive/Send/Model/Download/Pdf',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <API KEY>'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});