> 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-despatch-api/purchase-despatch/creates-a-answer-to-the-despatch.md).

# Creates a Answer to the Despatch

## POST /Purchase/SendAnswer

> İrsaliyeye yanıt verir.

```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":{"PurchaseDespatchSendAnswerCommand":{"type":"object","properties":{"DespatchUUID":{"type":"string","format":"uuid"},"DespatchAnswerLines":{"type":"array","items":{"$ref":"#/components/schemas/DespatchAnswerLineDto"},"nullable":true},"Notes":{"type":"array","items":{"type":"string"},"nullable":true},"Serie":{"type":"string","nullable":true},"DeliveryDateTime":{"type":"string","format":"date-time"},"TemplateUUID":{"type":"string","format":"uuid"},"AcceptAll":{"type":"boolean"},"RejectAll":{"type":"boolean"}},"additionalProperties":false},"DespatchAnswerLineDto":{"type":"object","properties":{"Index":{"type":"integer","format":"int32"},"Received":{"$ref":"#/components/schemas/UnitCodeValueDto"},"Short":{"$ref":"#/components/schemas/UnitCodeValueDto"},"Rejected":{"$ref":"#/components/schemas/UnitCodeValueDto"},"Oversupply":{"$ref":"#/components/schemas/UnitCodeValueDto"},"RejectReason":{"type":"string","nullable":true},"SellerCode":{"type":"string","nullable":true},"Name":{"type":"string","nullable":true},"Description":{"type":"string","nullable":true},"QuantityPrice":{"type":"number","format":"double"},"LineTotal":{"type":"number","format":"double"}},"additionalProperties":false},"UnitCodeValueDto":{"type":"object","properties":{"UnitCode":{"type":"string","nullable":true},"Value":{"type":"number","format":"double"}},"additionalProperties":false}}},"paths":{"/Purchase/SendAnswer":{"post":{"tags":["Purchase"],"summary":"İrsaliyeye yanıt verir.","requestBody":{"description":"","content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/PurchaseDespatchSendAnswerCommand"}},"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseDespatchSendAnswerCommand"}},"text/json":{"schema":{"$ref":"#/components/schemas/PurchaseDespatchSendAnswerCommand"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/PurchaseDespatchSendAnswerCommand"}}}},"responses":{"200":{"description":"İrsaliyeye yanıt verir.","content":{"application/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("/edespatch/Purchase/SendAnswer", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "APIKEY");

var body = new
{
    DespatchUUID = "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    DespatchAnswerLines = new[]
    {
        new
        {
            Index = 0,
            Received = new
            {
                UnitCode = "string",
                Value = 0
            },
            Short = new
            {
                UnitCode = "string",
                Value = 0
            },
            Rejected = new
            {
                UnitCode = "string",
                Value = 0
            },
            Oversupply = new
            {
                UnitCode = "string",
                Value = 0
            },
            RejectReason = "string",
            SellerCode = "string",
            Name = "string",
            Description = "string",
            QuantityPrice = 0,
            LineTotal = 0
        }
    },
    Notes = new[] { "string" },
    Serie = "string",
    DeliveryDateTime = "2024-01-01T00:00:00",
    TemplateUUID = "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    AcceptAll = true,
    RejectAll = true
};

request.AddJsonBody(body);
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/edespatch/Purchase/SendAnswer',
  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 =>'{
  "DespatchUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "DespatchAnswerLines": [
    {
      "Index": 0,
      "Received": {
        "UnitCode": "string",
        "Value": 0
      },
      "Short": {
        "UnitCode": "string",
        "Value": 0
      },
      "Rejected": {
        "UnitCode": "string",
        "Value": 0
      },
      "Oversupply": {
        "UnitCode": "string",
        "Value": 0
      },
      "RejectReason": "string",
      "SellerCode": "string",
      "Name": "string",
      "Description": "string",
      "QuantityPrice": 0,
      "LineTotal": 0
    }
  ],
  "Notes": [
    "string"
  ],
  "Serie": "string",
  "DeliveryDateTime": "2024-01-01T00:00:00",
  "TemplateUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "AcceptAll": true,
  "RejectAll": true
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: APIKEY'
  ),
));

$response = curl_exec($curl);

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

{% endtab %}

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

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "DespatchUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "DespatchAnswerLines": [
    {
      "Index": 0,
      "Received": {
        "UnitCode": "string",
        "Value": 0
      },
      "Short": {
        "UnitCode": "string",
        "Value": 0
      },
      "Rejected": {
        "UnitCode": "string",
        "Value": 0
      },
      "Oversupply": {
        "UnitCode": "string",
        "Value": 0
      },
      "RejectReason": "string",
      "SellerCode": "string",
      "Name": "string",
      "Description": "string",
      "QuantityPrice": 0,
      "LineTotal": 0
    }
  ],
  "Notes": [
    "string"
  ],
  "Serie": "string",
  "DeliveryDateTime": "2024-01-01T00:00:00",
  "TemplateUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "AcceptAll": true,
  "RejectAll": true
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://apitest.nilvera.com/edespatch/Purchase/SendAnswer',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'APIKEY'
  },
  data : data
};

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

{% endtab %}
{% endtabs %}
