Import order and item statuses
Description
Imports an order, payment method and statuses of order items into the market.
Request URL
Method: POST
https://example.com/api/v1.1/market/orders/import
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token. Make sure that market roles are available for the token. |
custom_fields | array of objects | [ | No | Create custom fields for the following entities:
|
custom_line_statuses | array of objects | [ | No | Custom status of the order item. It is necessary to pass the status id ( external_id ), its name (name ) and type (type ). Possible values of the type field:
|
skip_triggers | bool | true | No | Skip trigger events. By default – false |
data | array of objects | [ | Yes | Order data. Learn more |
Request example
{
"token": "abcdefghijklmnqrstuvwxyz",
"custom_fields": [
{
"external_id": "order_field_id_123",
"name": "Custom order field",
"entity_type": "order",
"required": false,
"value_type": "unicode",
"default_value": "Custom field value"
},
{
"external_id": "line_field_id_123",
"name": "Custom order item field",
"entity_type": "line_order",
"required": false,
"value_type": "unicode",
"default_value": "Custom field value"
}
],
"custom_line_statuses": [
{
"external_id": "status_id_123",
"name": "Delivered to the pick up point",
"type": "in_process"
}
],
"skip_triggers": true,
"data": [
{
"external_id": "1234000",
"matching":"email",
"email":"johndoe@example.com",
"endpoint": "website",
"tags": [
"one",
"two"
],
"status": "delivered",
"delivery_cost": "100",
"total_price": "1000",
"currency": "USD",
"custom_fields": {
"order_field_id_123": "data"
},
"region": "region_YnCrJj8Y1",
"lines": [
{
"external_id": "line_01",
"status": "status_id_123",
"product": "iphone_test_1",
"base_price_per_item": "900",
"min_price_per_item": "900",
"final_price_per_item": "900",
"count": 1,
"custom_fields": {
"line_field_id_123": "data"
}
}
]
}
]
}
Response example
{
"error": 0,
"error_text": "",
"result": [
{
"error": 0,
"external_id": "1234000"
}
]
}
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
result | array | Product IDs that were successfully imported |