# Order BATCH insertion

Beta/Experimental feature: This endpoint is currently in beta and may exhibit unexpected behavior.    
This endpoint allows you to create multiple orders at once. Batch insertion is processed asynchronously in the same way as, for example, List of all orders, but it does not have resultUrl in the response. Instead, you can check the attribute log which contains successfully created orders and errors.

See how Asynchronous requests work on our developer's portal.

File with data for insert must be in JSONL (jsonlines) format. Each line must contain one order in JSON format. Maximum size of file is 100MB. The base structure of a JSON row contains 2 main parameters settings and data.

The settings parameter:

Default suppress params for each row can be defined in URL params same as in Order insertion endpoint. In the settings parameter, you can modify suppress parameters for specific row/record.

All params in settings can be in 3 states:

- true - _true_ value is applied.

- false - _false_ value is applied.

- _parameter is missing_ - The value from corresponding request parameter is used, if corresponding request parameter is not defined the value is set to false.

The data parameter:

Structure of the data parameter is the same as the structure of JSON for single Order insertion endpoint. See Order batch create schema for more details.


The asynchronous job processes the JSONL file row by row and tries to validate and save the data. If there is any error, the row is skipped and the error is logged, but it does not stop the processing of other rows. In the log, every order is identified by its position in the file (starting from 1).

Endpoint: POST /api/orders/batch
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Request fields (application/json):

  - `batchFileUrlPath` (string, required)
    Url to batch file with products data. File must be in JSONL format.

## Response 202 fields (application/json):

  - `data` (object, required)

  - `data.jobId` (string, required)
    token of job

  - `errors` (array,null, required)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object, required)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.

## Response 409 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.


## Response 404 fields
