# Toplu Taslak Makbuz Oluşturur

## POST /Draft/CreateBulk

> Toplu Taslak makbuz oluşturur.

```json
{"openapi":"3.0.1","info":{"title":"E-Mustahsil Makbuz API","version":"v1"},"servers":[{"url":"/eproducer"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"API anahtar� giriniz","scheme":"Bearer","bearerFormat":"JWT"}},"schemas":{"CreateBulkDraftCommand":{"type":"object","properties":{"Producers":{"type":"array","items":{"$ref":"#/components/schemas/BulkProducerDto"},"nullable":true}},"additionalProperties":false},"BulkProducerDto":{"type":"object","properties":{"Producer":{"$ref":"#/components/schemas/ProducerDto"},"Tags":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true},"SpecialCode":{"type":"string","nullable":true}},"additionalProperties":false},"ProducerDto":{"type":"object","properties":{"ProducerInfo":{"$ref":"#/components/schemas/ProducerInfoDto"},"CompanyInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"CustomerInfo":{"$ref":"#/components/schemas/PartyInfoDto"},"ProducerLines":{"type":"array","items":{"$ref":"#/components/schemas/EProducerLineDto"},"nullable":true},"Notes":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false},"ProducerInfoDto":{"type":"object","properties":{"UUID":{"type":"string","format":"uuid"},"TemplateUUID":{"type":"string","format":"uuid"},"TemplateBase64String":{"type":"string","nullable":true},"DeliveryDate":{"type":"string","format":"date-time"},"ProducerSerieOrNumber":{"type":"string","nullable":true},"IssueDate":{"type":"string","format":"date-time"},"CurrencyCode":{"type":"string","nullable":true},"ExchangeRate":{"type":"number","format":"double","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},"EProducerLineDto":{"type":"object","properties":{"Name":{"type":"string","nullable":true},"Quantity":{"type":"number","format":"double"},"UnitType":{"type":"string","nullable":true},"Price":{"type":"number","format":"double"},"Taxes":{"type":"array","items":{"$ref":"#/components/schemas/TaxDto"},"nullable":true},"GVWithholdingPercent":{"type":"number","format":"double"},"GVWithholdingAmount":{"type":"number","format":"double"}},"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}}},"paths":{"/Draft/CreateBulk":{"post":{"tags":["Draft"],"summary":"Toplu Taslak makbuz oluşturur.","requestBody":{"description":"","content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/CreateBulkDraftCommand"}},"application/json":{"schema":{"$ref":"#/components/schemas/CreateBulkDraftCommand"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateBulkDraftCommand"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateBulkDraftCommand"}}}},"responses":{"200":{"description":"Toplu Taslak makbuz oluşturur.","content":{"application/json":{"schema":{"type":"array","items":{"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("/eproducer/Draft/CreateBulk", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "APIKEY");

var body = new
{
    Producers = new List<object>
    {
        new
        {
            Producer = new
            {
                ProducerInfo = new
                {
                    UUID = "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    TemplateUUID = "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    TemplateBase64String = "string",
                    DeliveryDate = DateTime.Parse("2024-07-04T10:33:11.582Z"),
                    ProducerSerieOrNumber = "string",
                    IssueDate = DateTime.Parse("2024-07-04T10:33:11.582Z"),
                    CurrencyCode = "string",
                    ExchangeRate = 0
                },
                CompanyInfo = new
                {
                    TaxNumber = "string",
                    Name = "string",
                    TaxOffice = "string",
                    PartyIdentifications = new List<object>
                    {
                        new
                        {
                            SchemeID = "string",
                            Value = "string"
                        }
                    },
                    AgentPartyIdentifications = new List<object>
                    {
                        new
                        {
                            SchemeID = "string",
                            Value = "string"
                        }
                    },
                    Address = "string",
                    District = "string",
                    City = "string",
                    Country = "string",
                    PostalCode = "string",
                    Phone = "string",
                    Fax = "string",
                    Mail = "string",
                    WebSite = "string"
                },
                CustomerInfo = new
                {
                    TaxNumber = "string",
                    Name = "string",
                    TaxOffice = "string",
                    PartyIdentifications = new List<object>
                    {
                        new
                        {
                            SchemeID = "string",
                            Value = "string"
                        }
                    },
                    AgentPartyIdentifications = new List<object>
                    {
                        new
                        {
                            SchemeID = "string",
                            Value = "string"
                        }
                    },
                    Address = "string",
                    District = "string",
                    City = "string",
                    Country = "string",
                    PostalCode = "string",
                    Phone = "string",
                    Fax = "string",
                    Mail = "string",
                    WebSite = "string"
                },
                ProducerLines = new List<object>
                {
                    new
                    {
                        Name = "string",
                        Quantity = 0,
                        UnitType = "string",
                        Price = 0,
                        Taxes = new List<object>
                        {
                            new
                            {
                                TaxCode = "string",
                                Total = 0,
                                Percent = 0,
                                ReasonCode = "string",
                                ReasonDesc = "string"
                            }
                        },
                        GVWithholdingPercent = 0,
                        GVWithholdingAmount = 0
                    }
                },
                Notes = new List<string>
                {
                    "string"
                }
            },
            Tags = new List<string>
            {
                "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            SpecialCode = "string"
        }
    }
};

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/eproducer/Draft/CreateBulk',
  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 =>'{
  "Producers": [
    {
      "Producer": {
        "ProducerInfo": {
          "UUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "TemplateUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "TemplateBase64String": "string",
          "DeliveryDate": "2024-07-04T10:33:11.582Z",
          "ProducerSerieOrNumber": "string",
          "IssueDate": "2024-07-04T10:33:11.582Z",
          "CurrencyCode": "string",
          "ExchangeRate": 0
        },
        "CompanyInfo": {
          "TaxNumber": "string",
          "Name": "string",
          "TaxOffice": "string",
          "PartyIdentifications": [
            {
              "SchemeID": "string",
              "Value": "string"
            }
          ],
          "AgentPartyIdentifications": [
            {
              "SchemeID": "string",
              "Value": "string"
            }
          ],
          "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": [
            {
              "SchemeID": "string",
              "Value": "string"
            }
          ],
          "AgentPartyIdentifications": [
            {
              "SchemeID": "string",
              "Value": "string"
            }
          ],
          "Address": "string",
          "District": "string",
          "City": "string",
          "Country": "string",
          "PostalCode": "string",
          "Phone": "string",
          "Fax": "string",
          "Mail": "string",
          "WebSite": "string"
        },
        "ProducerLines": [
          {
            "Name": "string",
            "Quantity": 0,
            "UnitType": "string",
            "Price": 0,
            "Taxes": [
              {
                "TaxCode": "string",
                "Total": 0,
                "Percent": 0,
                "ReasonCode": "string",
                "ReasonDesc": "string"
              }
            ],
            "GVWithholdingPercent": 0,
            "GVWithholdingAmount": 0
          }
        ],
        "Notes": [
          "string"
        ]
      },
      "Tags": [
        "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      ],
      "SpecialCode": "string"
    }
  ]
}',
  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({
  "Producers": [
    {
      "Producer": {
        "ProducerInfo": {
          "UUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "TemplateUUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "TemplateBase64String": "string",
          "DeliveryDate": "2024-07-04T10:33:11.582Z",
          "ProducerSerieOrNumber": "string",
          "IssueDate": "2024-07-04T10:33:11.582Z",
          "CurrencyCode": "string",
          "ExchangeRate": 0
        },
        "CompanyInfo": {
          "TaxNumber": "string",
          "Name": "string",
          "TaxOffice": "string",
          "PartyIdentifications": [
            {
              "SchemeID": "string",
              "Value": "string"
            }
          ],
          "AgentPartyIdentifications": [
            {
              "SchemeID": "string",
              "Value": "string"
            }
          ],
          "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": [
            {
              "SchemeID": "string",
              "Value": "string"
            }
          ],
          "AgentPartyIdentifications": [
            {
              "SchemeID": "string",
              "Value": "string"
            }
          ],
          "Address": "string",
          "District": "string",
          "City": "string",
          "Country": "string",
          "PostalCode": "string",
          "Phone": "string",
          "Fax": "string",
          "Mail": "string",
          "WebSite": "string"
        },
        "ProducerLines": [
          {
            "Name": "string",
            "Quantity": 0,
            "UnitType": "string",
            "Price": 0,
            "Taxes": [
              {
                "TaxCode": "string",
                "Total": 0,
                "Percent": 0,
                "ReasonCode": "string",
                "ReasonDesc": "string"
              }
            ],
            "GVWithholdingPercent": 0,
            "GVWithholdingAmount": 0
          }
        ],
        "Notes": [
          "string"
        ]
      },
      "Tags": [
        "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      ],
      "SpecialCode": "string"
    }
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://apitest.nilvera.com/eproducer/Draft/CreateBulk',
  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 %}
