> For the complete documentation index, see [llms.txt](https://developer.nilvera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.nilvera.com/en/api/e-expense-api/sending-expense-vouchers/downloads-previewed-document.md).

# Downloads Previewed Document

## POST /Send/Model/Download

> Ön izlenen belgeyi indirir.

```json
{"openapi":"3.0.1","info":{"title":"E-Gider Pusulasi API","version":"v1"},"servers":[{"url":"/expense"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"API anahtari giriniz","scheme":"Bearer","bearerFormat":"JWT"}},"schemas":{"DownloadXmlCommand":{"type":"object","properties":{"Expense":{"$ref":"#/components/schemas/ExpenseDto"}},"additionalProperties":false},"ExpenseDto":{"type":"object","properties":{"ExpenseInfo":{"$ref":"#/components/schemas/ExpenseInfoDto"},"CompanyInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"CustomerInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"ExpenseLines":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseLineDto"},"nullable":true},"Notes":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false},"ExpenseInfoDto":{"type":"object","properties":{"UUID":{"type":"string","format":"uuid"},"TemplateUUID":{"type":"string","format":"uuid"},"TemplateBase64String":{"type":"string","nullable":true},"DocumentType":{"$ref":"#/components/schemas/ExpenseTypeCode"},"ExpenseSerieOrNumber":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time"},"CurrencyCode":{"type":"string","nullable":true},"ExchangeRate":{"type":"number","format":"double","nullable":true},"IsCargoDelivery":{"type":"boolean"},"CarrierInfo":{"$ref":"#/components/schemas/ExpenseCarrierInfoDto"},"IsReturnerSameAsReceiver":{"type":"boolean"},"ReturnerInfo":{"$ref":"#/components/schemas/ReturnerInfoDto"},"ServiceProviderInfo":{"$ref":"#/components/schemas/ServiceProviderInfo"},"VerificationInfo":{"$ref":"#/components/schemas/ExpenseVerificationInfoDto"},"ReturnDocumentInfo":{"$ref":"#/components/schemas/ReturnDocumentInfoDto"},"AdditionalDocumentReferences":{"type":"array","items":{"$ref":"#/components/schemas/AdditionalDocumentReferenceDto"},"nullable":true}},"additionalProperties":false},"ExpenseTypeCode":{"enum":["SATIS","IADE"],"type":"string"},"ExpenseCarrierInfoDto":{"type":"object","properties":{"Address":{"type":"string","nullable":true},"District":{"type":"string","nullable":true},"City":{"type":"string","nullable":true},"PostalCode":{"type":"string","nullable":true},"Country":{"type":"string","nullable":true},"TaxNumber":{"type":"string","nullable":true},"Phone":{"type":"string","nullable":true},"TaxOffice":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"Email":{"type":"string","nullable":true},"WebSite":{"type":"string","nullable":true},"Fax":{"type":"string","nullable":true},"AuthCertificateNumber":{"type":"string","nullable":true}},"additionalProperties":false},"ReturnerInfoDto":{"type":"object","properties":{"Name":{"type":"string","nullable":true},"Surname":{"type":"string","nullable":true},"Identifier":{"type":"string","nullable":true},"Address":{"type":"string","nullable":true},"District":{"type":"string","nullable":true},"City":{"type":"string","nullable":true}},"additionalProperties":false},"ServiceProviderInfo":{"type":"object","properties":{"Name":{"type":"string","nullable":true},"TaxNumber":{"type":"string","nullable":true}},"additionalProperties":false},"ExpenseVerificationInfoDto":{"type":"object","properties":{"Type":{"$ref":"#/components/schemas/CustomerVerificationType"},"Phone":{"type":"string","nullable":true},"Code":{"type":"string","nullable":true}},"additionalProperties":false},"CustomerVerificationType":{"enum":["SMS","IADEKODU"],"type":"string"},"ReturnDocumentInfoDto":{"type":"object","properties":{"DocumentType":{"$ref":"#/components/schemas/ExpenseReturnDocumentType"},"DocumentNumber":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time"}},"additionalProperties":false},"ExpenseReturnDocumentType":{"enum":["EARSIV_FATURA","SATIS_FISI","BELGESIZ"],"type":"string"},"AdditionalDocumentReferenceDto":{"type":"object","properties":{"ID":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time","nullable":true},"DocumentType":{"type":"string","nullable":true},"DocumentTypeCode":{"type":"string","nullable":true},"DocumentDescription":{"type":"string","nullable":true},"Attachment":{"$ref":"#/components/schemas/AttachmentDto"}},"additionalProperties":false},"AttachmentDto":{"type":"object","properties":{"Base64Data":{"type":"string","nullable":true},"MimeCode":{"type":"string","nullable":true},"FileName":{"type":"string","nullable":true}},"additionalProperties":false},"PartyInfoDto":{"type":"object","properties":{"TaxNumber":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"TaxOffice":{"type":"string","nullable":true},"PartyIdentifications":{"type":"array","items":{"$ref":"#/components/schemas/IDTypeDto"},"nullable":true},"AgentPartyIdentifications":{"type":"array","items":{"$ref":"#/components/schemas/IDTypeDto"},"nullable":true},"Address":{"type":"string","nullable":true},"District":{"type":"string","nullable":true},"City":{"type":"string","nullable":true},"Country":{"type":"string","nullable":true},"PostalCode":{"type":"string","nullable":true},"Phone":{"type":"string","nullable":true},"Fax":{"type":"string","nullable":true},"Mail":{"type":"string","nullable":true},"WebSite":{"type":"string","nullable":true}},"additionalProperties":false},"IDTypeDto":{"type":"object","properties":{"SchemeID":{"type":"string","nullable":true},"Value":{"type":"string","nullable":true}},"additionalProperties":false},"ExpenseLineDto":{"type":"object","properties":{"Name":{"type":"string","nullable":true},"Quantity":{"type":"number","format":"double"},"UnitType":{"type":"string","nullable":true},"Price":{"type":"number","format":"double"},"KDVPercent":{"type":"number","format":"double"},"KDVTotal":{"type":"number","format":"double"},"GVWithholdingPercent":{"type":"number","format":"double"},"GVWithholdingAmount":{"type":"number","format":"double"}},"additionalProperties":false}}},"paths":{"/Send/Model/Download":{"post":{"tags":["Send"],"summary":"Ön izlenen belgeyi indirir.","requestBody":{"description":"","content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/DownloadXmlCommand"}},"application/json":{"schema":{"$ref":"#/components/schemas/DownloadXmlCommand"}},"text/json":{"schema":{"$ref":"#/components/schemas/DownloadXmlCommand"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/DownloadXmlCommand"}}}},"responses":{"200":{"description":"Ön izlenen belgeyi indirir.","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}},"400":{"description":"Geçersiz İstek | Gönderdiğiniz istekte geçersiz veriler bulunduğu anlamında gelmektedir | Detaylar için <a target=\"_blank\" href=\"https://developer.nilvera.com/hata-kodlari#badrequest-400\">tıklayınız</a>"},"403":{"description":"Yetkisiz Erişim | Bu uca erişmek için gerekli yetkiye sahip olmadığınız durumda dönülür"},"404":{"description":"Parametrede belirtilen kayıt bulunamadığında dönülür | Detaylar için <a target=\"_blank\" href=\"https://developer.nilvera.com/hata-kodlari#notfound-404\">tıklayınız</a>"},"409":{"description":"Gönderdiğiniz istek sistemde daha önce bulunduğunda dönülür | Detaylar için <a target=\"_blank\" href=\"https://developer.nilvera.com/hata-kodlari#conflict-409\">tıklayınız</a>"},"422":{"description":"Gönderdiğiniz istek geçerli fakat iş kuralları gereği geçersiz değerler içerdiğinde dönülür | Detaylar için <a target=\"_blank\" href=\"https://developer.nilvera.com/hata-kodlari#unprocessableentity-422\">tıklayınız</a>"}}}}}}
```

{% tabs %}
{% tab title="C#" %}

```csharp
var options = new RestClientOptions("https://apitest.nilvera.com")
{
    MaxTimeout = -1,
};

var client = new RestClient(options);
var request = new RestRequest("/expense/Send/Model/Download", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer APIKEY");

var body = @"{
  ""Expense"": {
    ""ExpenseInfo"": {
      ""UUID"": ""3fa85f64-5717-4562-b3fc-2c963f66afa6"",
      ""TemplateUUID"": ""3fa85f64-5717-4562-b3fc-2c963f66afa6"",
      ""TemplateBase64String"": ""string"",
      ""DocumentType"": ""SATIS"",
      ""ExpenseSerieOrNumber"": ""string"",
      ""IssueDate"": ""2026-01-01T00:00:00"",
      ""CurrencyCode"": ""string"",
      ""ExchangeRate"": 0,
      ""IsCargoDelivery"": true,
      ""CarrierInfo"": {
        ""Address"": ""string"",
        ""District"": ""string"",
        ""City"": ""string"",
        ""PostalCode"": ""string"",
        ""Country"": ""string"",
        ""TaxNumber"": ""string"",
        ""Phone"": ""string"",
        ""TaxOffice"": ""string"",
        ""Name"": ""string"",
        ""Email"": ""string"",
        ""WebSite"": ""string"",
        ""Fax"": ""string"",
        ""AuthCertificateNumber"": ""string""
      },
      ""IsReturnerSameAsReceiver"": true,
      ""ReturnerInfo"": {
        ""Name"": ""string"",
        ""Surname"": ""string"",
        ""Identifier"": ""string"",
        ""Address"": ""string"",
        ""District"": ""string"",
        ""City"": ""string""
      },
      ""ServiceProviderInfo"": {
        ""Name"": ""string"",
        ""TaxNumber"": ""string""
      },
      ""VerificationInfo"": {
        ""Type"": {},
        ""Phone"": ""string"",
        ""Code"": ""string""
      },
      ""ReturnDocumentInfo"": {
        ""DocumentType"": {},
        ""DocumentNumber"": ""string"",
        ""IssueDate"": ""2026-01-01T00:00:00""
      },
      ""AdditionalDocumentReferences"": [
        {}
      ]
    },
    ""CompanyInfo"": {
      ""TaxNumber"": ""string"",
      ""Name"": ""string"",
      ""TaxOffice"": ""string"",
      ""PartyIdentifications"": [
        {}
      ],
      ""AgentPartyIdentifications"": [
        {}
      ],
      ""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"": [
        {}
      ],
      ""AgentPartyIdentifications"": [
        {}
      ],
      ""Address"": ""string"",
      ""District"": ""string"",
      ""City"": ""string"",
      ""Country"": ""string"",
      ""PostalCode"": ""string"",
      ""Phone"": ""string"",
      ""Fax"": ""string"",
      ""Mail"": ""string"",
      ""WebSite"": ""string""
    },
    ""ExpenseLines"": [
      {
        ""Name"": ""string"",
        ""Quantity"": 0,
        ""UnitType"": ""string"",
        ""Price"": 0,
        ""KDVPercent"": 0,
        ""KDVTotal"": 0,
        ""GVWithholdingPercent"": 0,
        ""GVWithholdingAmount"": 0
      }
    ],
    ""Notes"": [
      ""string""
    ]
  }
}";

request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://apitest.nilvera.com/expense/Send/Model/Download',
  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 =>'{
  "Expense": {
    "ExpenseInfo": {
      "UUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "TemplateUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "TemplateBase64String": "string",
      "DocumentType": "SATIS",
      "ExpenseSerieOrNumber": "string",
      "IssueDate": "2026-01-01T00:00:00",
      "CurrencyCode": "string",
      "ExchangeRate": 0,
      "IsCargoDelivery": true,
      "CarrierInfo": {
        "Address": "string",
        "District": "string",
        "City": "string",
        "PostalCode": "string",
        "Country": "string",
        "TaxNumber": "string",
        "Phone": "string",
        "TaxOffice": "string",
        "Name": "string",
        "Email": "string",
        "WebSite": "string",
        "Fax": "string",
        "AuthCertificateNumber": "string"
      },
      "IsReturnerSameAsReceiver": true,
      "ReturnerInfo": {
        "Name": "string",
        "Surname": "string",
        "Identifier": "string",
        "Address": "string",
        "District": "string",
        "City": "string"
      },
      "ServiceProviderInfo": {
        "Name": "string",
        "TaxNumber": "string"
      },
      "VerificationInfo": {
        "Type": {},
        "Phone": "string",
        "Code": "string"
      },
      "ReturnDocumentInfo": {
        "DocumentType": {},
        "DocumentNumber": "string",
        "IssueDate": "2026-01-01T00:00:00"
      },
      "AdditionalDocumentReferences": [
        {}
      ]
    },
    "CompanyInfo": {
      "TaxNumber": "string",
      "Name": "string",
      "TaxOffice": "string",
      "PartyIdentifications": [
        {}
      ],
      "AgentPartyIdentifications": [
        {}
      ],
      "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": [
        {}
      ],
      "AgentPartyIdentifications": [
        {}
      ],
      "Address": "string",
      "District": "string",
      "City": "string",
      "Country": "string",
      "PostalCode": "string",
      "Phone": "string",
      "Fax": "string",
      "Mail": "string",
      "WebSite": "string"
    },
    "ExpenseLines": [
      {
        "Name": "string",
        "Quantity": 0,
        "UnitType": "string",
        "Price": 0,
        "KDVPercent": 0,
        "KDVTotal": 0,
        "GVWithholdingPercent": 0,
        "GVWithholdingAmount": 0
      }
    ],
    "Notes": [
      "string"
    ]
  }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer APIKEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="NodeJs - Axios" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "Expense": {
    "ExpenseInfo": {
      "UUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "TemplateUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "TemplateBase64String": "string",
      "DocumentType": "SATIS",
      "ExpenseSerieOrNumber": "string",
      "IssueDate": "2026-01-01T00:00:00",
      "CurrencyCode": "string",
      "ExchangeRate": 0,
      "IsCargoDelivery": true,
      "CarrierInfo": {
        "Address": "string",
        "District": "string",
        "City": "string",
        "PostalCode": "string",
        "Country": "string",
        "TaxNumber": "string",
        "Phone": "string",
        "TaxOffice": "string",
        "Name": "string",
        "Email": "string",
        "WebSite": "string",
        "Fax": "string",
        "AuthCertificateNumber": "string"
      },
      "IsReturnerSameAsReceiver": true,
      "ReturnerInfo": {
        "Name": "string",
        "Surname": "string",
        "Identifier": "string",
        "Address": "string",
        "District": "string",
        "City": "string"
      },
      "ServiceProviderInfo": {
        "Name": "string",
        "TaxNumber": "string"
      },
      "VerificationInfo": {
        "Type": {},
        "Phone": "string",
        "Code": "string"
      },
      "ReturnDocumentInfo": {
        "DocumentType": {},
        "DocumentNumber": "string",
        "IssueDate": "2026-01-01T00:00:00"
      },
      "AdditionalDocumentReferences": [
        {}
      ]
    },
    "CompanyInfo": {
      "TaxNumber": "string",
      "Name": "string",
      "TaxOffice": "string",
      "PartyIdentifications": [
        {}
      ],
      "AgentPartyIdentifications": [
        {}
      ],
      "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": [
        {}
      ],
      "AgentPartyIdentifications": [
        {}
      ],
      "Address": "string",
      "District": "string",
      "City": "string",
      "Country": "string",
      "PostalCode": "string",
      "Phone": "string",
      "Fax": "string",
      "Mail": "string",
      "WebSite": "string"
    },
    "ExpenseLines": [
      {
        "Name": "string",
        "Quantity": 0,
        "UnitType": "string",
        "Price": 0,
        "KDVPercent": 0,
        "KDVTotal": 0,
        "GVWithholdingPercent": 0,
        "GVWithholdingAmount": 0
      }
    ],
    "Notes": [
      "string"
    ]
  }
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://apitest.nilvera.com/expense/Send/Model/Download',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer APIKEY'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}
