# Taslağın Modeli Getirilir

## GET /Draft/{UUID}/model

> Model olarak indirir.

```json
{"openapi":"3.0.1","info":{"title":"E-Invoice API","version":"v1"},"servers":[{"url":"/einvoice"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"API Key Giriniz","scheme":"Bearer","bearerFormat":"JWT"}},"schemas":{"EInvoiceDto":{"type":"object","properties":{"InvoiceInfo":{"$ref":"#/components/schemas/InvoiceInfoDto"},"CompanyInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"CustomerInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"BuyerCustomerInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"ExportCustomerInfo":{"$ref":"#/components/schemas/ExportCustomerInfoDto"},"InvoiceLines":{"type":"array","items":{"$ref":"#/components/schemas/EInvoiceLineDto"},"nullable":true},"Notes":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false},"InvoiceInfoDto":{"type":"object","properties":{"UUID":{"type":"string","format":"uuid"},"TemplateUUID":{"type":"string","format":"uuid"},"TemplateBase64String":{"type":"string","nullable":true},"InvoiceType":{"$ref":"#/components/schemas/InvoiceType"},"InvoiceSerieOrNumber":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time"},"CurrencyCode":{"type":"string","nullable":true},"ExchangeRate":{"type":"number","format":"double","nullable":true},"InvoiceProfile":{"$ref":"#/components/schemas/InvoiceProfile"},"DespatchDocumentReference":{"type":"array","items":{"$ref":"#/components/schemas/KeyValueDto"},"nullable":true},"OrderReference":{"$ref":"#/components/schemas/KeyValueDto"},"OrderReferenceDocument":{"$ref":"#/components/schemas/AdditionalDocumentReferenceDto"},"AdditionalDocumentReferences":{"type":"array","items":{"$ref":"#/components/schemas/AdditionalDocumentReferenceDto"},"nullable":true},"TaxExemptionReasonInfo":{"$ref":"#/components/schemas/TaxExemptionReasonInfoDto"},"PaymentTermsInfo":{"$ref":"#/components/schemas/PaymentTermsDto"},"PaymentMeansInfo":{"$ref":"#/components/schemas/PaymentMeansDto"},"OKCInfo":{"$ref":"#/components/schemas/OKCInfoDto"},"ESUReportInfo":{"$ref":"#/components/schemas/ESUReportInfoDto"},"ReturnInvoiceInfo":{"type":"array","items":{"$ref":"#/components/schemas/ReturnInvoiceInfoDto"},"nullable":true},"AccountingCost":{"type":"string","nullable":true},"InvoicePeriod":{"$ref":"#/components/schemas/InvoicePeriodDto"},"SGKInfo":{"$ref":"#/components/schemas/SGKInfoDto"},"Expenses":{"type":"array","items":{"$ref":"#/components/schemas/ExpensesDto"},"nullable":true},"InvestmentIncentive":{"$ref":"#/components/schemas/InvestmentIncentiveDto"},"ShipmentNumber":{"type":"string","nullable":true},"LineExtensionAmount":{"type":"number","format":"double"},"GeneralKDV1Total":{"type":"number","format":"double"},"GeneralKDV8Total":{"type":"number","format":"double"},"GeneralKDV18Total":{"type":"number","format":"double"},"GeneralKDV10Total":{"type":"number","format":"double"},"GeneralKDV20Total":{"type":"number","format":"double"},"GeneralAllowanceTotal":{"type":"number","format":"double"},"PayableAmount":{"type":"number","format":"double"},"KdvTotal":{"type":"number","format":"double"},"InsuranceValueAmount":{"type":"number","format":"double"},"DeclaredForCarriageValueAmount":{"type":"number","format":"double"}},"additionalProperties":false},"InvoiceType":{"enum":["SATIS","IADE","ISTISNA","TEVKIFAT","IHRACKAYITLI","IPTAL","OZELMATRAH","SGK","TEVKIFATIADE","KOMISYONCU","HKSSATIS","HKSKOMISYONCU","KONAKLAMAVERGISI","SARJ","SARJANLIK","TEKNOLOJIDESTEK","YTBSATIS","YTBISTISNA","YTBIADE","YTBTEVKIFAT","YTBTEVKIFATIADE"],"type":"string"},"InvoiceProfile":{"enum":["TEMELFATURA","TICARIFATURA","IHRACAT","YOLCUBERABERFATURA","EARSIVFATURA","KAMU","HKS","ENERJI","ILAC_TIBBICIHAZ","OZELFATURA","YATIRIMTESVIK","IDIS"],"type":"string"},"KeyValueDto":{"type":"object","properties":{"IssueDate":{"type":"string","format":"date-time","nullable":true},"Value":{"type":"string","nullable":true}},"additionalProperties":false},"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},"TaxExemptionReasonInfoDto":{"type":"object","properties":{"KDVExemptionReasonCode":{"type":"string","nullable":true},"OTVExemptionReasonCode":{"type":"string","nullable":true},"AccommodationTaxExemptionReasonCode":{"type":"string","nullable":true}},"additionalProperties":false},"PaymentTermsDto":{"type":"object","properties":{"Percent":{"type":"number","format":"double","nullable":true},"Amount":{"type":"number","format":"double","nullable":true},"Note":{"type":"string","nullable":true}},"additionalProperties":false},"PaymentMeansDto":{"type":"object","properties":{"Code":{"type":"string","nullable":true},"ChannelCode":{"type":"string","nullable":true},"DueDate":{"type":"string","format":"date-time","nullable":true},"PayeeFinancialAccountID":{"type":"string","nullable":true},"Note":{"type":"string","nullable":true}},"additionalProperties":false},"OKCInfoDto":{"type":"object","properties":{"ID":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time","nullable":true},"Time":{"type":"string","nullable":true},"ZNo":{"type":"string","nullable":true},"EndPointID":{"type":"string","nullable":true},"DocumentDescription":{"type":"string","nullable":true}},"additionalProperties":false},"ESUReportInfoDto":{"type":"object","properties":{"ID":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false},"ReturnInvoiceInfoDto":{"type":"object","properties":{"InvoiceNumber":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time"}},"additionalProperties":false},"InvoicePeriodDto":{"type":"object","properties":{"StartDate":{"type":"string","format":"date-time","nullable":true},"StartTime":{"type":"string","nullable":true},"EndDate":{"type":"string","format":"date-time","nullable":true},"EndTime":{"type":"string","nullable":true},"DurationMeasureValue":{"type":"number","format":"double","nullable":true},"Description":{"type":"string","nullable":true}},"additionalProperties":false},"SGKInfoDto":{"type":"object","properties":{"RegisterName":{"type":"string","nullable":true},"DocumentNumber":{"type":"string","nullable":true},"RegisterCode":{"type":"string","nullable":true}},"additionalProperties":false},"ExpensesDto":{"type":"object","properties":{"ExpenseType":{"$ref":"#/components/schemas/ExpenseType"},"Percent":{"type":"number","format":"double"},"Amount":{"type":"number","format":"double"}},"additionalProperties":false},"ExpenseType":{"enum":["HKSKOMISYON","HKSKOMISYONKDV","HKSNAVLUN","HKSNAVLUNKDV","HKSHAMMALIYE","HKSHAMMALIYEKDV","HKSNAKLIYE","HKSNAKLIYEKDV","HKSGVTEVKIFAT","HKSBAGKURTEVKIFAT","HKSRUSUM","HKSRUSUMKDV","HKSTICBORSASI","HKSTICBORSASIKDV","HKSMILLISAVUNMAFON","HKSMSFONKDV","HKSDIGERMASRAFLAR","HKSDIGERKDV"],"type":"string"},"InvestmentIncentiveDto":{"type":"object","properties":{"DocumentNumber":{"type":"string","nullable":true},"DocumentDate":{"type":"string","format":"date-time"}},"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},"ExportCustomerInfoDto":{"type":"object","properties":{"TaxNumber":{"type":"string","nullable":true},"LegalRegistrationName":{"type":"string","nullable":true},"PersonName":{"type":"string","nullable":true},"PersonSurName":{"type":"string","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},"EInvoiceLineDto":{"type":"object","properties":{"Index":{"type":"string","nullable":true},"SellerCode":{"type":"string","nullable":true},"BuyerCode":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"Description":{"type":"string","nullable":true},"Quantity":{"type":"number","format":"double"},"UnitType":{"type":"string","nullable":true},"Price":{"type":"number","format":"double"},"AllowanceTotal":{"type":"number","format":"double"},"KDVPercent":{"type":"number","format":"double"},"KDVTotal":{"type":"number","format":"double"},"Taxes":{"type":"array","items":{"$ref":"#/components/schemas/TaxDto"},"nullable":true},"DeliveryInfo":{"$ref":"#/components/schemas/DeliveryInfoDto"},"ManufacturerCode":{"type":"string","nullable":true},"BrandName":{"type":"string","nullable":true},"ModelName":{"type":"string","nullable":true},"Note":{"type":"string","nullable":true},"AdditionalInfoId":{"type":"string","nullable":true},"SerialID":{"type":"string","nullable":true},"ProductTraceID":{"type":"string","nullable":true},"InvestmentIncentiveExpenseType":{"$ref":"#/components/schemas/InvestmentIncentiveExpenseType"},"LabelNumber":{"type":"string","nullable":true},"BuyerDIBLineCode":{"type":"string","nullable":true},"SellerDIBLineCode":{"type":"string","nullable":true},"GTIPNo":{"type":"string","nullable":true},"OzelMatrahReason":{"type":"string","nullable":true},"OzelMatrahTotal":{"type":"number","format":"double","nullable":true},"VatAmountWithoutTevkifat":{"type":"number","format":"double","nullable":true},"MedicineAndMedicalDevice":{"$ref":"#/components/schemas/MedicineAndMedicalDeviceDto"},"AdditionalItemIdentification":{"$ref":"#/components/schemas/AdditionalItemIdentificationDto"}},"additionalProperties":false},"TaxDto":{"type":"object","properties":{"TaxCode":{"type":"string","nullable":true},"Total":{"type":"number","format":"double","nullable":true},"Percent":{"type":"number","format":"double","nullable":true},"ReasonCode":{"type":"string","nullable":true},"ReasonDesc":{"type":"string","nullable":true}},"additionalProperties":false},"DeliveryInfoDto":{"type":"object","properties":{"GTIPNo":{"type":"string","nullable":true},"DeliveryTermCode":{"type":"string","nullable":true},"TransportModeCode":{"type":"string","nullable":true},"PackageBrandName":{"type":"string","nullable":true},"ProductTraceID":{"type":"string","nullable":true},"PackageID":{"type":"string","nullable":true},"PackageQuantity":{"type":"number","format":"double","nullable":true},"PackageTypeCode":{"type":"string","nullable":true},"DeliveryAddress":{"$ref":"#/components/schemas/AddressInfoDto"}},"additionalProperties":false},"AddressInfoDto":{"type":"object","properties":{"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},"InvestmentIncentiveExpenseType":{"enum":["MachineAndSoftware","Construction","LandAndPlotSale","Other"],"type":"string"},"MedicineAndMedicalDeviceDto":{"type":"object","properties":{"Medicine":{"type":"array","items":{"$ref":"#/components/schemas/MedicineDto"},"nullable":true},"MedicalDevice":{"type":"array","items":{"$ref":"#/components/schemas/MedicalDeviceDto"},"nullable":true},"ProductType":{"$ref":"#/components/schemas/ProductType"}},"additionalProperties":false},"MedicineDto":{"type":"object","properties":{"GTIN":{"type":"string","nullable":true},"BatchNumber":{"type":"string","nullable":true},"SerialNumber":{"type":"string","nullable":true},"ExpirationDate":{"type":"string","format":"date-time"}},"additionalProperties":false},"MedicalDeviceDto":{"type":"object","properties":{"ProductNumber":{"type":"string","nullable":true},"LotNumber":{"type":"string","nullable":true},"SerialNumber":{"type":"string","nullable":true},"ProductionDate":{"type":"string","format":"date-time"}},"additionalProperties":false},"ProductType":{"enum":["MEDICINE","MEDICALDEVICE","OTHER"],"type":"string"},"AdditionalItemIdentificationDto":{"type":"object","properties":{"TagNumber":{"type":"string","nullable":true},"OwnerName":{"type":"string","nullable":true},"OwnerTaxNumber":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/Draft/{UUID}/model":{"get":{"tags":["Draft"],"summary":"Model olarak indirir.","parameters":[{"name":"UUID","in":"path","description":"","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Model olarak indirir.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EInvoiceDto"}}}},"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>"},"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 client = new RestClient("//einvoice/Draft/8ab80d6a-4bd3-ef1a-48a1-8fa1f76d9e62/model");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "Bearer <API KEY>");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

{% endtab %}

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

```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => '//einvoice/Draft/8ab80d6a-4bd3-ef1a-48a1-8fa1f76d9e62/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 => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Accept: text/plain',
    'Authorization: Bearer <API KEY>'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

{% endtab %}

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

```javascript
var axios = require('axios');
var config = {
  method: 'get',
  url: '//einvoice/Draft/8ab80d6a-4bd3-ef1a-48a1-8fa1f76d9e62/model',
  headers: { 
    'Accept': 'text/plain', 
    'Authorization': 'Bearer <API KEY>'
  }
};
axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}
