# Sends the Despatch as a Model

## İrsaliyeyi model olarak gönderir.

> İrsaliyeyi model olarak göndermek için bu uç kullanılır.

```json
{"openapi":"3.0.1","info":{"title":"E-Despatch API","version":"v1"},"servers":[{"url":"/edespatch"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"API anahtar� giriniz","scheme":"Bearer","bearerFormat":"JWT"}},"schemas":{"SendModelCommand":{"type":"object","properties":{"EDespatch":{"$ref":"#/components/schemas/EDespatchDto"},"CustomerAlias":{"type":"string","nullable":true}},"additionalProperties":false},"EDespatchDto":{"type":"object","properties":{"DespatchInfo":{"$ref":"#/components/schemas/DespatchInfoDto"},"DespatchSupplierInfo":{"$ref":"#/components/schemas/DespatchSupplierInfoDto"},"DeliveryCustomerInfo":{"$ref":"#/components/schemas/DeliveryCustomerInfoDto"},"BuyerCustomerInfo":{"$ref":"#/components/schemas/BuyerCustomerInfoDto"},"SellerSupplierInfo":{"$ref":"#/components/schemas/SellerSupplierInfoDto"},"OriginatorCustomerInfo":{"$ref":"#/components/schemas/OriginatorCustomerInfoDto"},"Notes":{"type":"array","items":{"type":"string"},"nullable":true},"DespatchLines":{"type":"array","items":{"$ref":"#/components/schemas/DespatchLineDto"},"nullable":true},"ShipmentDetail":{"$ref":"#/components/schemas/ShipmentDetailDto"},"AdditionalDocumentReference":{"type":"array","items":{"$ref":"#/components/schemas/AdditionalDocumentReferenceDto"},"nullable":true},"OrderReference":{"$ref":"#/components/schemas/OrderReferenceDto"}},"additionalProperties":false},"DespatchInfoDto":{"type":"object","properties":{"UUID":{"type":"string","format":"uuid"},"IssueDate":{"type":"string","format":"date-time"},"TemplateBase64String":{"type":"string","nullable":true},"TemplateUUID":{"type":"string","format":"uuid"},"ActualDespatchDateTime":{"type":"string","format":"date-time"},"PayableAmount":{"type":"number","format":"double"},"CurrencyCode":{"type":"string","nullable":true},"DespatchType":{"$ref":"#/components/schemas/DespatchType"},"DespatchProfile":{"$ref":"#/components/schemas/DespatchProfile"},"DespatchSerieOrNumber":{"type":"string","nullable":true},"MatbuIssueDate":{"type":"string","format":"date-time","nullable":true},"MatbuNumber":{"type":"string","nullable":true}},"additionalProperties":false},"DespatchType":{"enum":["MATBUDAN","SEVK"],"type":"string"},"DespatchProfile":{"enum":["TEMELIRSALIYE","HKSIRSALIYE"],"type":"string"},"DespatchSupplierInfoDto":{"type":"object","properties":{"PartyIdentifications":{"type":"array","items":{"$ref":"#/components/schemas/IDTypeDto"},"nullable":true},"WebSite":{"type":"string","nullable":true},"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},"TaxOffice":{"type":"string","nullable":true},"Phone":{"type":"string","nullable":true},"Email":{"type":"string","nullable":true},"Fax":{"type":"string","nullable":true},"TaxNumber":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true}},"additionalProperties":false},"IDTypeDto":{"type":"object","properties":{"SchemeID":{"type":"string","nullable":true},"Value":{"type":"string","nullable":true}},"additionalProperties":false},"DeliveryCustomerInfoDto":{"type":"object","properties":{"PartyIdentifications":{"type":"array","items":{"$ref":"#/components/schemas/IDTypeDto"},"nullable":true},"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},"TaxOffice":{"type":"string","nullable":true},"TaxNumber":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"Phone":{"type":"string","nullable":true},"Email":{"type":"string","nullable":true},"Fax":{"type":"string","nullable":true},"WebSite":{"type":"string","nullable":true}},"additionalProperties":false},"BuyerCustomerInfoDto":{"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},"TaxOffice":{"type":"string","nullable":true},"Phone":{"type":"string","nullable":true},"Email":{"type":"string","nullable":true},"Fax":{"type":"string","nullable":true},"TaxNumber":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"WebSite":{"type":"string","nullable":true}},"additionalProperties":false},"SellerSupplierInfoDto":{"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},"TaxOffice":{"type":"string","nullable":true},"Phone":{"type":"string","nullable":true},"Email":{"type":"string","nullable":true},"Fax":{"type":"string","nullable":true},"TaxNumber":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"WebSite":{"type":"string","nullable":true}},"additionalProperties":false},"OriginatorCustomerInfoDto":{"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},"TaxOffice":{"type":"string","nullable":true},"Phone":{"type":"string","nullable":true},"Email":{"type":"string","nullable":true},"Fax":{"type":"string","nullable":true},"TaxNumber":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"WebSite":{"type":"string","nullable":true}},"additionalProperties":false},"DespatchLineDto":{"type":"object","properties":{"DeliveredUnitType":{"type":"string","nullable":true},"DeliveredUnitName":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"SellerCode":{"type":"string","nullable":true},"BuyerCode":{"type":"string","nullable":true},"Description":{"type":"string","nullable":true},"DeliveredQuantity":{"type":"number","format":"double"},"QuantityPrice":{"type":"number","format":"double"},"LineTotal":{"type":"number","format":"double"},"AdditionalItemIdentification":{"type":"string","nullable":true},"OutstandingQuantity":{"type":"number","format":"double"},"OutstandingUnitType":{"type":"string","nullable":true},"OutstandingUnitName":{"type":"string","nullable":true},"OutstandingReason":{"type":"string","nullable":true},"ManufacturerCode":{"type":"string","nullable":true},"BrandName":{"type":"string","nullable":true},"ModelName":{"type":"string","nullable":true}},"additionalProperties":false},"ShipmentDetailDto":{"type":"object","properties":{"ShipmentInfo":{"$ref":"#/components/schemas/ShipmentInfoDto"},"Delivery":{"$ref":"#/components/schemas/DeliveryDto"},"TransportEquipment":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false},"ShipmentInfoDto":{"type":"object","properties":{"DriverPerson":{"type":"array","items":{"$ref":"#/components/schemas/DriverPersonDto"},"nullable":true},"LicensePlateID":{"type":"string","nullable":true}},"additionalProperties":false},"DriverPersonDto":{"type":"object","properties":{"FirstName":{"type":"string","nullable":true},"LastName":{"type":"string","nullable":true},"TaxNumber":{"type":"string","nullable":true}},"additionalProperties":false},"DeliveryDto":{"type":"object","properties":{"AddressInfo":{"$ref":"#/components/schemas/AddressInfoDto"},"CarrierInfo":{"$ref":"#/components/schemas/CarrierInfoDto"}},"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},"CarrierInfoDto":{"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}},"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},"OrderReferenceDto":{"type":"object","properties":{"ID":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time","nullable":true},"DocumentReference":{"$ref":"#/components/schemas/AdditionalDocumentReferenceDto"}},"additionalProperties":false},"SendResponse":{"type":"object","properties":{"UUID":{"type":"string","nullable":true},"DespatchNumber":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/Send/Model":{"post":{"tags":["Send"],"summary":"İrsaliyeyi model olarak gönderir.","description":"İrsaliyeyi model olarak göndermek için bu uç kullanılır.","requestBody":{"description":"","content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/SendModelCommand"}},"application/json":{"schema":{"$ref":"#/components/schemas/SendModelCommand"}},"text/json":{"schema":{"$ref":"#/components/schemas/SendModelCommand"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/SendModelCommand"}}}},"responses":{"200":{"description":"İrsaliyeyi model olarak gönderir.","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SendResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SendResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SendResponse"}}}},"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>","content":{"text/plain":{"schema":{"type":"array","items":{"type":"string"}}},"application/json":{"schema":{"type":"array","items":{"type":"string"}}},"text/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"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 client = new RestClient("https://apitest.nilvera.com/edespatch/Send/Model");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <API KEY>");
request.AddHeader("Content-Type", "application/json");
var body = @"{
"EDespatch": {
"DespatchInfo": {
"UUID": "9dc0807f-4847-415b-a960-4a52ce585496",
"IssueDate": "2023-01-09T15:13:36.9376458+03:00",
"TemplateBase64String": null,
"TemplateUUID": "a2d5d0dd-a5b5-4a8a-a1e1-0a245caf5fd6",
"ActualDespatchDateTime": "2023-01-09T15:13:36.9376467+03:00",
"PayableAmount": 0,
"CurrencyCode": "TRY",
"DespatchType": "SEVK",
"DespatchProfile": "TEMELIRSALIYE",
"DespatchSerieOrNumber": "IRS",
"MatbuIssueDate": null,
"MatbuNumber": null},
"DespatchSupplierInfo": null,
"DeliveryCustomerInfo"": {
"PartyIdentifications": null,
"Address": "Papatya Caddesi Yasemin Sokak No21",
"District": "Melikgazi",
"City": "Kayseri",
"PostalCode": "38038",
"Country": "Türkiye",
"TaxOffice": null,
"TaxNumber": "1288331521",
"Name": "AAA Anonim Şirketi",
"Phone": null,
"Email": null,
"Fax": null,
"WebSite": null},
"BuyerCustomerInfo": null,
"SellerSupplierInfo": null,
"OriginatorCustomerInfo": null,
"Notes": null,
"DespatchLines": [{
"DeliveredUnitType": "C62",
"DeliveredUnitName": "Adet",
"Name": "Laptop",
"SellerCode": null,
"BuyerCode": null,
"Description": null,
"DeliveredQuantity": 1,
"QuantityPrice": 0,
"LineTotal": 0,
"AdditionalItemIdentification": null,
"OutstandingQuantity": 0,
"OutstandingUnitType": null,
"OutstandingUnitName": null,
"OutstandingReason": null,
"ManufacturerCode": null,
"BrandName": null,
"ModelName": null"ShipmentDetail": 
{"ShipmentInfo": {"DriverPerson"": null,
"LicensePlateID": "00 AAA 000"},
"Delivery": {"AddressInfo": {"Address": "Teslimat Adresi",
"District": "Melikgazi",
"City": "Kayseri",
"Country": "Türkiye",
"PostalCode": "38038",
"Phone": null,
"Fax": null,
"Mail": null,
"WebSite": null,
"CarrierInfo": {"Address": "carrier address",
"District": "Melikgazi",
"City": "Kayseri",
"PostalCode": "38038",
"Country": "Türkiye",
"TaxNumber": ""1288331521",
"Phone": null,
"TaxOffice": null,
"Name": "AAA Anonim Şirket",
"Email": null,
"WebSite": null,
"Fax": null,
"TransportEquipment": null",
AdditionalDocumentReference": null,
"OrderReference": null,
,,CustomerAlias": null}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

{% endtab %}

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

```
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://apitest.nilvera.com/edespatch/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 =>'{
  "EDespatch": {
    "DespatchInfo": {
      "UUID": "9dc0807f-4847-415b-a960-4a52ce585496",
      "IssueDate": "2023-01-09T15:13:36.9376458+03:00",
      "TemplateBase64String": null,
      "TemplateUUID": "a2d5d0dd-a5b5-4a8a-a1e1-0a245caf5fd6",
      "ActualDespatchDateTime": "2023-01-09T15:13:36.9376467+03:00",
      "PayableAmount": 0,
      "CurrencyCode": "TRY",
      "DespatchType": "SEVK",
      "DespatchProfile": "TEMELIRSALIYE",
      "DespatchSerieOrNumber": "IRS",
      "MatbuIssueDate": null,
      "MatbuNumber": null
    },
    "DespatchSupplierInfo": null,
    "DeliveryCustomerInfo": {
      "PartyIdentifications": null,
      "Address": "Papatya Caddesi Yasemin Sokak No21",
      "District": "Melikgazi",
      "City": "Kayseri",
      "PostalCode": "38038",
      "Country": "Türkiye",
      "TaxOffice": null,
      "TaxNumber": "1288331521",
      "Name": "AAA Anonim Şirketi",
      "Phone": null,
      "Email": null,
      "Fax": null,
      "WebSite": null
    },
    "BuyerCustomerInfo": null,
    "SellerSupplierInfo": null,
    "OriginatorCustomerInfo": null,
    "Notes": null,
    "DespatchLines": [
      {
        "DeliveredUnitType": "C62",
        "DeliveredUnitName": "Adet",
        "Name": "Laptop",
        "SellerCode": null,
        "BuyerCode": null,
        "Description": null,
        "DeliveredQuantity": 1,
        "QuantityPrice": 0,
        "LineTotal": 0,
        "AdditionalItemIdentification": null,
        "OutstandingQuantity": 0,
        "OutstandingUnitType": null,
        "OutstandingUnitName": null,
        "OutstandingReason": null,
        "ManufacturerCode": null,
        "BrandName": null,
        "ModelName": null
      }
    ],
    "ShipmentDetail": {
      "ShipmentInfo": {
        "DriverPerson": null,
        "LicensePlateID": "00 AAA 000"
      },
      "Delivery": {
        "AddressInfo": {
          "Address": "Teslimat Adresi",
          "District": "Melikgazi",
          "City": "Kayseri",
          "Country": "Türkiye",
          "PostalCode": "38038",
          "Phone": null,
          "Fax": null,
          "Mail": null,
          "WebSite": null
        },
        "CarrierInfo": {
          "Address": "carrier address",
          "District": "Melikgazi",
          "City": "Kayseri",
          "PostalCode": "38038",
          "Country": "Türkiye",
          "TaxNumber": "1288331521",
          "Phone": null,
          "TaxOffice": null,
          "Name": "AAA Anonim Şirket",
          "Email": null,
          "WebSite": null,
          "Fax": null
        }
      },
      "TransportEquipment": null
    },
    "AdditionalDocumentReference": null,
    "OrderReference": null
  },
  "CustomerAlias": null
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <API KEY>',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

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

{% endtab %}

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

```
var axios = require('axios');
var data = JSON.stringify({
  "EDespatch": {
    "DespatchInfo": {
      "UUID": "9dc0807f-4847-415b-a960-4a52ce585496",
      "IssueDate": "2023-01-09T15:13:36.9376458+03:00",
      "TemplateBase64String": null,
      "TemplateUUID": "a2d5d0dd-a5b5-4a8a-a1e1-0a245caf5fd6",
      "ActualDespatchDateTime": "2023-01-09T15:13:36.9376467+03:00",
      "PayableAmount": 0,
      "CurrencyCode": "TRY",
      "DespatchType": "SEVK",
      "DespatchProfile": "TEMELIRSALIYE",
      "DespatchSerieOrNumber": "IRS",
      "MatbuIssueDate": null,
      "MatbuNumber": null
    },
    "DespatchSupplierInfo": null,
    "DeliveryCustomerInfo": {
      "PartyIdentifications": null,
      "Address": "Papatya Caddesi Yasemin Sokak No21",
      "District": "Melikgazi",
      "City": "Kayseri",
      "PostalCode": "38038",
      "Country": "Türkiye",
      "TaxOffice": null,
      "TaxNumber": "1288331521",
      "Name": "AAA Anonim Şirketi",
      "Phone": null,
      "Email": null,
      "Fax": null,
      "WebSite": null
    },
    "BuyerCustomerInfo": null,
    "SellerSupplierInfo": null,
    "OriginatorCustomerInfo": null,
    "Notes": null,
    "DespatchLines": [
      {
        "DeliveredUnitType": "C62",
        "DeliveredUnitName": "Adet",
        "Name": "Laptop",
        "SellerCode": null,
        "BuyerCode": null,
        "Description": null,
        "DeliveredQuantity": 1,
        "QuantityPrice": 0,
        "LineTotal": 0,
        "AdditionalItemIdentification": null,
        "OutstandingQuantity": 0,
        "OutstandingUnitType": null,
        "OutstandingUnitName": null,
        "OutstandingReason": null,
        "ManufacturerCode": null,
        "BrandName": null,
        "ModelName": null
      }
    ],
    "ShipmentDetail": {
      "ShipmentInfo": {
        "DriverPerson": null,
        "LicensePlateID": "00 AAA 000"
      },
      "Delivery": {
        "AddressInfo": {
          "Address": "Teslimat Adresi",
          "District": "Melikgazi",
          "City": "Kayseri",
          "Country": "Türkiye",
          "PostalCode": "38038",
          "Phone": null,
          "Fax": null,
          "Mail": null,
          "WebSite": null
        },
        "CarrierInfo": {
          "Address": "carrier address",
          "District": "Melikgazi",
          "City": "Kayseri",
          "PostalCode": "38038",
          "Country": "Türkiye",
          "TaxNumber": "1288331521",
          "Phone": null,
          "TaxOffice": null,
          "Name": "AAA Anonim Şirket",
          "Email": null,
          "WebSite": null,
          "Fax": null
        }
      },
      "TransportEquipment": null
    },
    "AdditionalDocumentReference": null,
    "OrderReference": null
  },
  "CustomerAlias": null
});

var config = {
  method: 'post',
  url: 'https://apitest.nilvera.com/edespatch/Send/Model',
  headers: { 
    'Authorization': 'Bearer <API KEY>', 
    'Content-Type': 'application/json'
  },
  data : data
};

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

{% endtab %}
{% endtabs %}
