---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.5
alternate:
  - https://yandex.com/dev/metrika/en/management/openapi/schema/uploadOrders.md
  - https://yandex.com/dev/metrika/ru/management/openapi/schema/uploadOrders.md
  - href: en/management/openapi/schema/uploadOrders.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/metrika/en/llms.txt

<!-- source: en/management-src/Managing-customer-and-order-data-from-the-CRM/uploadOrders.md -->
<div class="openapi">

# Uploading orders (CSV)

<!-- markdownlint-disable-file -->

Uploads orders. The data is transmitted as multipart/form-data in CSV format. You must pass the column names in the first line of the request. [Learn more about the format of transmitted data](https://yandex.com/dev/metrika/en/data-import/orders-data.md).

[Example of an uploaded file](https://download.cdn.yandex.net/from/yandex.ru/support/ru/metrica/files/crm-orders.csv).

For Yandex Metrica to process information about orders, you need to transmit customer data. Yandex Metrica links customer information to sessions, and order data to sessions and customers. This is necessary for calculating and displaying statistics.

{% note info %}

1. You can transmit data for up to 100,000 orders per customer.
2. File size limit: 1 GB.

{% endnote %}

{% cut "Sample request" %}

- Transmitting goals: The `goals` column must contain goals in the format `goal_action1[:price1],goal_action2[:price2]`.
- Transmitting products: The `products` column must contain products in the format `Laptop TGDD12:1,Laptop TGD123:2`. First specify the product, then its quantity.

If you're transmitting multiple goals or products, use semicolons as delimiters (`delimiter_type=SEMICOLON`).

```json translate=no
POST https://api-metrika.yandex.net/cdp/api/v1/counter/2215573/data/orders/csv?
    merge_mode=SAVE&
    columns_mapping=
        "id":"ИД",
        "client_uniq_id":"ИД клиента",
        "client_type":"Тип клиента",
        "order_status":"Статус",
        "create_date_time":"Дата создания",
        "revenue":"Сумма",
        "goals":"Цели"&
    delimiter_type=COMMA
    Content-Type: multipart/form-data; boundary=------------------------7zDUQOAIAE9hEWoV
    Context-Length: TBD

    --------------------------7zDUQOAIAE9hEWoV
    Content-Disposition: form-data; name="file"; filename="data.csv"
    Content-Type: text/csv

    ИД,ИД клиента,Тип клиента,Статус,Дата создания,Сумма,Цели
    100,11,CONTACT,paid,2020-06-11 12:30:00,43089.54,goal_action_id_1:1000
    101,42,CONTACT,paid,2019-10-11 09:10:00,109999,goal_action_id_2
    102,42,CONTACT,created,2020-12-24 12:30:00,1004.17,goal_action_id_3:500
    --------------------------7zDUQOAIAE9hEWoV--
```

{% endcut %}


## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/data/orders/csv
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_counterId_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

ID of the tag for which you want to upload orders.
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

#|
|| **Name** | **Description** ||
||

_columns_mapping_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Correspondence between column names and attribute names.

_Pattern:_{.json-schema-reset .json-schema-assertion} `"([^"]+)":"([^"]+)"`

_Example:_{.json-schema-reset .json-schema-example} `"uniq_id":"ИД","name":"Name","birth_date":"Date of birth"`
{.table-cell}
||
||

_merge_mode_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Data saving mode. For any value, pass all [required fields](https://yandex.com/dev/metrika/en/data-import/orders-data.md), even ones that aren't modified.

- `SAVE`: All previously transmitted data is completely replaced with new data. [Details](https://yandex.com/dev/metrika/en/data-import/modes.md).
- `UPDATE`: Only the data that you're currently uploading is updated. [Details](https://yandex.com/dev/metrika/en/data-import/modes.md).
- `APPEND`: New data is added to previously uploaded data. [Details](https://yandex.com/dev/metrika/en/data-import/modes.md).


_Example:_{.json-schema-reset .json-schema-example} `SAVE`
{.table-cell}
||
||

_delimiter_type_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Type of column separator used in the file:
- `COMMA`: Comma separator.
- `SEMICOLON`: Semicolon separator.


_Default:_{.json-schema-reset .json-schema-value} `COMMA`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "multipart/form-data" %}

```json translate=no
{
  "file": "example"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_file_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;binary&gt;

The file size limit is 1 GB.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "uploading": {
    "uploading_id": "example",
    "datetime": "2020-04-21T11:59:21.000Z",
    "api_validation_status": "example",
    "elements_count": 0,
    "entity_type": "example",
    "uploading_format": "example",
    "uploading_source": "example"
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_uploading_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [UploadingMetaExternal](#entity-UploadingMetaExternal)

Upload information

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "uploading_id": "example",
  "datetime": "2020-04-21T11:59:21.000Z",
  "api_validation_status": "example",
  "elements_count": 0,
  "entity_type": "example",
  "uploading_format": "example",
  "uploading_source": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### UploadingMetaExternal {#entity-UploadingMetaExternal}

Upload information

#|
|| **Name** | **Description** ||
||

_api_validation_status_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Upload validation status:
- `PASSED`: Validation passed.
- `FAILED`: Validation failed.


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_datetime_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Upload time.

_Example:_{.json-schema-reset .json-schema-example} `2020-04-21T11:59:21.000Z`
{.table-cell}
||
||

_elements_count_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Number of elements within the upload.
{.table-cell}
||
||

_entity_type_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Entity type:
- `SYSTEM`: System entity, such as contacts or orders.
- `CUSTOM_LIST`: Custom list.
- `SYSTEM_LIST`: System list, such as products.


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_uploading_format_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Upload format. Possible values:
- `JSON`
- `CSV`


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_uploading_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Upload ID.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_uploading_source_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Upload source. Possible values: `API`

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "uploading_id": "example",
  "datetime": "2020-04-21T11:59:21.000Z",
  "api_validation_status": "example",
  "elements_count": 0,
  "entity_type": "example",
  "uploading_format": "example",
  "uploading_source": "example"
}
```

{% endcut %}

</div>

</div>

</div>
<!-- endsource: en/management-src/Managing-customer-and-order-data-from-the-CRM/uploadOrders.md -->

[*Deprecated]: No longer supported, please use an alternative and newer version.