Uploading orders (CSV)
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
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.
Request syntax
counterId
: ID of the tag that you want to upload orders for.
https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/data/orders
? merge_mode=<update_type>
& [columns_mapping=<string>]
& [delimiter_type=<delimiter_type>]
merge_mode * | Data saving mode. For any value, pass all required fields, even ones that aren't modified. Acceptable values:
|
columns_mapping | Correspondence between column names and attribute names. |
delimiter_type | Type of column separator used in the file. Default value: COMMA. Acceptable values:
|
merge_mode * | Data saving mode. For any value, pass all required fields, even ones that aren't modified. Acceptable values:
|
columns_mapping | Correspondence between column names and attribute names. |
delimiter_type | Type of column separator used in the file. Default value: COMMA. Acceptable values:
|
* Required
In the request body
POST https://api-metrika.yandex.net/cdp/api/v1/counter/2215573/data/orders?
merge_mode=SAVE&
columns_mapping=
"id":"ID",
"client_uniq_id":"Client ID",
"client_type":"Client type",
"order_status":"Status",
"create_date_time":"Creation date",
"revenue":"Amount"&
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
ID,Client ID,Client type,Status,Creation date,Amount
100,11,CONTACT,paid,2020-06-11 12:30:00,43089.54
101,42,CONTACT,paid,2019-10-11 09:10:00,109999
102,42,CONTACT,created,2020-12-24 12:30:00,1004.17
--------------------------7zDUQOAIAE9hEWoV--
Sample request
POST https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/data/orders?merge_mode=SAVE
Response format
{
"uploading" : {
"uploading_id" : < string > ,
"datetime" : < local_date_time > ,
"api_validation_status" : < api_validation_status > ,
"elements_count" : < integer > ,
"entity_type" : < entity_type > ,
"entity_subtype" : < string > ,
"uploading_format" : < uploading_format > ,
"uploading_source" : < uploading_source >
}
}
Parameters | Description |
---|---|
uploading | Upload information |
uploading | |
uploading_id | Upload ID |
datetime | Upload time |
api_validation_status | Upload validation status Possible values:
|
elements_count | Number of elements in the upload |
entity_type | Entity type Possible values:
|
entity_subtype | Entity subtype |
uploading_format | Upload format Possible values:
|
uploading_source | Upload source Possible values:
|
Parameters | Description |
---|---|
uploading | Upload information |
uploading | |
uploading_id | Upload ID |
datetime | Upload time |
api_validation_status | Upload validation status Possible values:
|
elements_count | Number of elements in the upload |
entity_type | Entity type Possible values:
|
entity_subtype | Entity subtype |
uploading_format | Upload format Possible values:
|
uploading_source | Upload source Possible values:
|