# Sends the document as Model

## POST /Send/Model

> SKG Belgesini model olarak gönderir.

```json
{"openapi":"3.0.1","info":{"title":"E-Sigorta Komisyon Gider Belgesi API","version":"v1"},"servers":[{"url":"/einvoice"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"API anahtar� giriniz","scheme":"Bearer","bearerFormat":"JWT"}},"schemas":{"SendModelCommand":{"required":["Insurance"],"type":"object","properties":{"Insurance":{"$ref":"#/components/schemas/InsuranceDto"}},"additionalProperties":false},"InsuranceDto":{"required":["CustomerInfo","InsuranceInfo","InsuranceLines"],"type":"object","properties":{"InsuranceInfo":{"$ref":"#/components/schemas/InsuranceInfoDto"},"CompanyInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"CustomerInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"InsuranceLines":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/EInsuranceLineDto"}},"Notes":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false},"InsuranceInfoDto":{"required":["CurrencyCode","InsuranceSerieOrNumber","IssueDate"],"type":"object","properties":{"UUID":{"type":"string","format":"uuid"},"TemplateUUID":{"type":"string","format":"uuid"},"TemplateBase64String":{"type":"string","nullable":true},"InsuranceSerieOrNumber":{"minLength":1,"type":"string","allOf":[{"pattern":"(?:(\\b[A-Z0-9]{3}[0-9]{4}[0-9]{9}$\\b)|\\b^[A-Z0-9]{3}$\\b).*$"},{"pattern":"(?:(\\b[A-Z0-9]{3}[0-9]{4}[0-9]{9}$\\b)|\\b^[A-Z0-9]{3}$\\b).*$"},{"pattern":"(?:(\\b[A-Z0-9]{3}[0-9]{4}[0-9]{9}$\\b)|\\b^[A-Z0-9]{3}$\\b).*$"},{"pattern":"(?:(\\b[A-Z0-9]{3}[0-9]{4}[0-9]{9}$\\b)|\\b^[A-Z0-9]{3}$\\b).*$"},{"pattern":"(?:(\\b[A-Z0-9]{3}[0-9]{4}[0-9]{9}$\\b)|\\b^[A-Z0-9]{3}$\\b).*$"},{"pattern":"(?:(\\b[A-Z0-9]{3}[0-9]{4}[0-9]{9}$\\b)|\\b^[A-Z0-9]{3}$\\b).*$"}]},"IssueDate":{"minLength":1,"type":"string","format":"date-time"},"CurrencyCode":{"maxLength":3,"minLength":3,"type":"string"},"ExchangeRate":{"type":"number","format":"double","nullable":true},"InvoicePeriod":{"$ref":"#/components/schemas/InvoicePeriodDto"}},"additionalProperties":false},"InvoicePeriodDto":{"required":["Description","EndDate","StartDate"],"type":"object","properties":{"StartDate":{"minLength":1,"type":"string","format":"date-time"},"StartTime":{"type":"string","nullable":true},"EndDate":{"minLength":1,"type":"string","format":"date-time"},"EndTime":{"type":"string","nullable":true},"DurationMeasureValue":{"type":"number","format":"double","nullable":true},"Description":{"minLength":1,"type":"string"}},"additionalProperties":false},"PartyInfoDto":{"required":["Address","City","Country","District","Name","TaxNumber"],"type":"object","properties":{"TaxNumber":{"maxLength":11,"minLength":10,"type":"string","allOf":[{"pattern":"^[\\d]+$"},{"pattern":"^[\\d]+$"},{"pattern":"^[\\d]+$"},{"pattern":"^[\\d]+$"},{"pattern":"^[\\d]+$"},{"pattern":"^[\\d]+$"}]},"Name":{"minLength":1,"type":"string"},"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":{"minLength":1,"type":"string"},"District":{"minLength":1,"type":"string"},"City":{"minLength":1,"type":"string"},"Country":{"minLength":1,"type":"string"},"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":{"required":["SchemeID","Value"],"type":"object","properties":{"SchemeID":{"minLength":1,"type":"string"},"Value":{"minLength":1,"type":"string"}},"additionalProperties":false},"EInsuranceLineDto":{"required":["Name"],"type":"object","properties":{"Name":{"minLength":1,"type":"string"},"CancelledCommissionAmount":{"minimum":0,"type":"number","format":"double"},"IssuedCommissionAmount":{"minimum":0,"type":"number","format":"double"}},"additionalProperties":false},"SendResponse":{"type":"object","properties":{"UUID":{"type":"string","format":"uuid"},"InsuranceNumber":{"type":"string","nullable":true}},"additionalProperties":false}}},"paths":{"/Send/Model":{"post":{"tags":["Send"],"summary":"SKG Belgesini model olarak gönderir.","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":"SKG Belgesini 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>"},"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("//einsurance/Send/Model")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "text/plain");
request.AddHeader("Authorization", "Bearer {{bearerToken}}");
var body = @"{" + "\n" +
@"  ""Insurance"": {" + "\n" +
@"    ""CustomerInfo"": {" + "\n" +
@"      ""Address"": ""<string>""," + "\n" +
@"      ""City"": ""<string>""," + "\n" +
@"      ""Country"": ""<string>""," + "\n" +
@"      ""District"": ""<string>""," + "\n" +
@"      ""Name"": ""<string>""," + "\n" +
@"      ""TaxNumber"": ""99999999999""," + "\n" +
@"      ""TaxOffice"": ""<string>""," + "\n" +
@"      ""PartyIdentifications"": [" + "\n" +
@"        {" + "\n" +
@"          ""SchemeID"": ""<string>""," + "\n" +
@"          ""Value"": ""<string>""" + "\n" +
@"        }," + "\n" +
@"        {" + "\n" +
@"          ""SchemeID"": ""<string>""," + "\n" +
@"          ""Value"": ""<string>""" + "\n" +
@"        }" + "\n" +
@"      ]," + "\n" +
@"      ""AgentPartyIdentifications"": [" + "\n" +
@"        {" + "\n" +
@"          ""SchemeID"": ""<string>""," + "\n" +
@"          ""Value"": ""<string>""" + "\n" +
@"        }," + "\n" +
@"        {" + "\n" +
@"          ""SchemeID"": ""<string>""," + "\n" +
@"          ""Value"": ""<string>""" + "\n" +
@"        }" + "\n" +
@"      ]," + "\n" +
@"      ""PostalCode"": ""<string>""," + "\n" +
@"      ""Phone"": ""<string>""," + "\n" +
@"      ""Fax"": ""<string>""," + "\n" +
@"      ""Mail"": ""<string>""," + "\n" +
@"      ""WebSite"": ""<string>""" + "\n" +
@"    }," + "\n" +
@"    ""InsuranceInfo"": {" + "\n" +
@"      ""CurrencyCode"": ""<string>""," + "\n" +
@"      ""InsuranceSerieOrNumber"": ""E38_PCds""," + "\n" +
@"      ""IssueDate"": ""<dateTime>""," + "\n" +
@"      ""UUID"": ""<uuid>""," + "\n" +
@"      ""TemplateUUID"": ""<uuid>""," + "\n" +
@"      ""TemplateBase64String"": ""<string>""," + "\n" +
@"      ""ExchangeRate"": ""<double>""," + "\n" +
@"      ""InvoicePeriod"": {" + "\n" +
@"        ""Description"": ""<string>""," + "\n" +
@"        ""EndDate"": ""<dateTime>""," + "\n" +
@"        ""StartDate"": ""<dateTime>""," + "\n" +
@"        ""StartTime"": ""<string>""," + "\n" +
@"        ""EndTime"": ""<string>""," + "\n" +
@"        ""DurationMeasureValue"": ""<double>""" + "\n" +
@"      }" + "\n" +
@"    }," + "\n" +
@"    ""InsuranceLines"": [" + "\n" +
@"      {" + "\n" +
@"        ""Name"": ""<string>""," + "\n" +
@"        ""CancelledCommissionAmount"": ""<double>""," + "\n" +
@"        ""IssuedCommissionAmount"": ""<double>""" + "\n" +
@"      }" + "\n" +
@"    ]," + "\n" +
@"    ""CompanyInfo"": {" + "\n" +
@"      ""Address"": ""<string>""," + "\n" +
@"      ""City"": ""<string>""," + "\n" +
@"      ""Country"": ""<string>""," + "\n" +
@"      ""District"": ""<string>""," + "\n" +
@"      ""Name"": ""<string>""," + "\n" +
@"      ""TaxNumber"": ""46844684468""," + "\n" +
@"      ""TaxOffice"": ""<string>""," + "\n" +
@"      ""PartyIdentifications"": [" + "\n" +
@"        {" + "\n" +
@"          ""SchemeID"": ""<string>""," + "\n" +
@"          ""Value"": ""<string>""" + "\n" +
@"        }," + "\n" +
@"        {" + "\n" +
@"          ""SchemeID"": ""<string>""," + "\n" +
@"          ""Value"": ""<string>""" + "\n" +
@"        }" + "\n" +
@"      ]," + "\n" +
@"      ""AgentPartyIdentifications"": [" + "\n" +
@"        {" + "\n" +
@"          ""SchemeID"": ""<string>""," + "\n" +
@"          ""Value"": ""<string>""" + "\n" +
@"        }," + "\n" +
@"        {" + "\n" +
@"          ""SchemeID"": ""<string>""," + "\n" +
@"          ""Value"": ""<string>""" + "\n" +
@"        }" + "\n" +
@"      ]," + "\n" +
@"      ""PostalCode"": ""<string>""," + "\n" +
@"      ""Phone"": ""<string>""," + "\n" +
@"      ""Fax"": ""<string>""," + "\n" +
@"      ""Mail"": ""<string>""," + "\n" +
@"      ""WebSite"": ""<string>""" + "\n" +
@"    }," + "\n" +
@"    ""Notes"": [" + "\n" +
@"      ""<string>""," + "\n" +
@"      ""<string>""" + "\n" +
@"    ]" + "\n" +
@"  }" + "\n" +
@"}";
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 => '//einsurance/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 =>'{
  "Insurance": {
    "CustomerInfo": {
      "Address": "<string>",
      "City": "<string>",
      "Country": "<string>",
      "District": "<string>",
      "Name": "<string>",
      "TaxNumber": "99999999999",
      "TaxOffice": "<string>",
      "PartyIdentifications": [
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        },
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        }
      ],
      "AgentPartyIdentifications": [
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        },
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        }
      ],
      "PostalCode": "<string>",
      "Phone": "<string>",
      "Fax": "<string>",
      "Mail": "<string>",
      "WebSite": "<string>"
    },
    "InsuranceInfo": {
      "CurrencyCode": "<string>",
      "InsuranceSerieOrNumber": "E38_PCds",
      "IssueDate": "<dateTime>",
      "UUID": "<uuid>",
      "TemplateUUID": "<uuid>",
      "TemplateBase64String": "<string>",
      "ExchangeRate": "<double>",
      "InvoicePeriod": {
        "Description": "<string>",
        "EndDate": "<dateTime>",
        "StartDate": "<dateTime>",
        "StartTime": "<string>",
        "EndTime": "<string>",
        "DurationMeasureValue": "<double>"
      }
    },
    "InsuranceLines": [
      {
        "Name": "<string>",
        "CancelledCommissionAmount": "<double>",
        "IssuedCommissionAmount": "<double>"
      }
    ],
    "CompanyInfo": {
      "Address": "<string>",
      "City": "<string>",
      "Country": "<string>",
      "District": "<string>",
      "Name": "<string>",
      "TaxNumber": "46844684468",
      "TaxOffice": "<string>",
      "PartyIdentifications": [
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        },
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        }
      ],
      "AgentPartyIdentifications": [
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        },
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        }
      ],
      "PostalCode": "<string>",
      "Phone": "<string>",
      "Fax": "<string>",
      "Mail": "<string>",
      "WebSite": "<string>"
    },
    "Notes": [
      "<string>",
      "<string>"
    ]
  }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Accept: text/plain',
    'Authorization: Bearer {{bearerToken}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="Node.js - Axios" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "Insurance": {
    "CustomerInfo": {
      "Address": "<string>",
      "City": "<string>",
      "Country": "<string>",
      "District": "<string>",
      "Name": "<string>",
      "TaxNumber": "99999999999",
      "TaxOffice": "<string>",
      "PartyIdentifications": [
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        },
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        }
      ],
      "AgentPartyIdentifications": [
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        },
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        }
      ],
      "PostalCode": "<string>",
      "Phone": "<string>",
      "Fax": "<string>",
      "Mail": "<string>",
      "WebSite": "<string>"
    },
    "InsuranceInfo": {
      "CurrencyCode": "<string>",
      "InsuranceSerieOrNumber": "E38_PCds",
      "IssueDate": "<dateTime>",
      "UUID": "<uuid>",
      "TemplateUUID": "<uuid>",
      "TemplateBase64String": "<string>",
      "ExchangeRate": "<double>",
      "InvoicePeriod": {
        "Description": "<string>",
        "EndDate": "<dateTime>",
        "StartDate": "<dateTime>",
        "StartTime": "<string>",
        "EndTime": "<string>",
        "DurationMeasureValue": "<double>"
      }
    },
    "InsuranceLines": [
      {
        "Name": "<string>",
        "CancelledCommissionAmount": "<double>",
        "IssuedCommissionAmount": "<double>"
      }
    ],
    "CompanyInfo": {
      "Address": "<string>",
      "City": "<string>",
      "Country": "<string>",
      "District": "<string>",
      "Name": "<string>",
      "TaxNumber": "46844684468",
      "TaxOffice": "<string>",
      "PartyIdentifications": [
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        },
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        }
      ],
      "AgentPartyIdentifications": [
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        },
        {
          "SchemeID": "<string>",
          "Value": "<string>"
        }
      ],
      "PostalCode": "<string>",
      "Phone": "<string>",
      "Fax": "<string>",
      "Mail": "<string>",
      "WebSite": "<string>"
    },
    "Notes": [
      "<string>",
      "<string>"
    ]
  }
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: '//einsurance/Send/Model',
  headers: { 
    'Content-Type': 'application/json', 
    'Accept': 'text/plain', 
    'Authorization': 'Bearer {{bearerToken}}'
  },
  data : data
};

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

```

{% endtab %}
{% endtabs %}
