Order data object
Description
Order data object is used in order import requests.
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
external_id | string | "123456" | Yes | Order additional ID |
matching | string | "email" | No | Subscriber search mode. By default – email For each type of matching, certain fields must be passed in the request body. You can learn more about these fields here. |
endpoint | string | "website" | Yes | Touchpoint ID |
tags | array | [ | No | List of tags |
status | string | "new" "delivered" "paid" "canceled" "part_refunded" | Yes | Order status ID |
delivery_cost | string | "200" | No | Cost of delivery |
total_price | string | "3000" | Yes | Total cost of the order. It consists of the cost of each item in the order and the cost of delivery. |
currency | string | "USD" | Yes | The currency that is used to indicate the cost of the order. Currencies are configured in the platform interface: Market → Settings → Other. If the request passes a currency that is not set in the platform, an error will occur. |
create_time | string | "2006-01-25" "2006-01-25 15:04:05" | No | Order creation date (RFC 3339 format) |
update_time | string | "2006-01-25" "2006-01-25 15:04:05" | No | Order update date (RFC 3339 format) |
custom_fields | object | { | No | Custom order fields"[field ID]": "[field value]" |
region | string | "region_external_id" | No | Region additional ID. You can create a region and get its identifier in the platform interface: Market → Settings. |
lines | array | [ | Yes | Order item data. At least one position. See below. |
Object structure
- JSON
- XML
[
{
"external_id": "123456",
"matching": "email",
"email": "johndoe@example.com",
"endpoint": "endpoint_external_id",
"tags": [
"one",
"two"
],
"status": "new",
"delivery_cost": "100",
"total_price": "1000",
"currency": "USD",
"custom_fields": {
"order_field_id_1": "data",
"order_field_id_2": 123
},
"region": "region_external_id",
"lines": [
{
"external_id": "1234000",
"status": "new",
"sku": "sku_external_id",
"base_price_per_item": "900",
"min_price_per_item": "900",
"final_price_per_item": "900",
"count": 5,
"custom_fields": {
"line_field_id_2": "data",
"line_field_id_1": 123
}
}
]
}
]
<xml>
<row>
<external_id>123456</external_id>
<matching>email</matching>
<email>johndoe@example.com</email>
<endpoint>endpoint_external_id</endpoint>
<tags>one</tags>
<tags>two</tags>
<status>new</status>
<delivery_cost>100</delivery_cost>
<total_price>1000</total_price>
<currency>USD</currency>
<custom_fields>
<order_field_id_1>data</order_field_id_1>
<order_field_id_2>123</order_field_id_2>
</custom_fields>
<region>region_external_id</region>
<lines>
<external_id>1234000</external_id>
<status>0001</status>
<sku>sku_external_id</sku>
<base_price_per_item>900</base_price_per_item>
<min_price_per_item>900</min_price_per_item>
<final_price_per_item>900</final_price_per_item>
<count>5</count>
<custom_fields>
<line_field_id_2>data</line_field_id_2>
<line_field_id_1>123</line_field_id_1>
</custom_fields>
</lines>
</row>
</xml>
Lines object
Description
lines
is the array of objects. It contains objects with data about order items. One object stores one order item.
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
external_id | string | "1235678" | Yes | Item additional ID |
status | string | "new" | No | Order item status ID:
|
sku | string | IPhone_Red_128Gb | Do not pass it in the request if you pass the product parameter | SKU additional ID. If the product is represented as a product - specify the product ID, if the product is represented as its variety - specify only the SKU ID. |
product | string | MP3_player_BassPro | Do not pass it in the request if you pass the sku parameter | Product additional ID |
base_price_per_item | string | "600" | Yes | Base price |
min_price_per_item | string | "300" | Yes | Minimum price |
final_price_per_item | string | "500" | Yes | Final price |
count | int | 5 | Yes | Quantity of products or SKUs in the order item |
custom_fields | object | { | No | Value of custom fields for the order item |
Object stucture
- JSON
- XML
[
{
"external_id": "12345",
"status": "new",
"product": "MP3_player_BassPro",
"base_price_per_item": "600",
"min_price_per_item": "300",
"final_price_per_item": "500",
"count": 5,
"custom_fields": {
"lot_number": 123,
"imported": true
}
}
]
Example of SKU:
[
{
"external_id": "76543",
"status": "processing",
"sku": "IPhone_Red_128Gb",
"base_price_per_item": "1000",
"min_price_per_item": "700",
"final_price_per_item": "850",
"count": 13,
"custom_fields": {
"lot_number": 93,
"localization": "RU"
}
}
]
<xml>
<external_id>1235678</external_id>
<status>0001</status>
<sku>sku_external_id</sku>
<base_price_per_item>600</base_price_per_item>
<min_price_per_item>300</min_price_per_item>
<final_price_per_item>500</final_price_per_item>
<count>5</count>
<custom_fields>
<line_field_id_2>data</line_field_id_2>
</custom_fields>
</xml>