Skip to main content

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

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token. Make sure that market roles are available for the token.
custom_fieldsarray of objects
[ 
   {
      "external_id": "1234",
      "name": "1234",
      "entity_type": "line_order",
      "required": false,
      "value_type": "unicode",
      "default_value": "data"
   }
]
NoCreate custom fields for the following entities:
  • product
  • SKU
  • order
  • order item
Learn more
custom_line_statusesarray of objects
[
   {
      "external_id": "1234",
      "name": "Поступил в пункт выдачи",
      "type": "in_process"
   }
]
NoCustom 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:
  • delivered
  • canceled
  • refunded
  • in_process
skip_triggersbooltrueNoSkip trigger events.
By default – false
dataarray of objects
[
   {
      "external_id": "123456",
      "matching":"email",
      "email":"example@example.com"
      "endpoint": "endpoint_external_id",
      "status": "new",
      "total_price": "3000",
      "currency": "USD",
      "create_time": "2022-01-02T15:04:05.141Z",
      "lines": [
         {
            "external_id": "7777",
            "status": "new",
            "product": "product_external_id",
            "base_price_per_item": "600",
            "min_price_per_item": "300",
            "final_price_per_item": "500",
            "count": 5
         }
      ]
   }
]
YesOrder data.
Learn more

Request example


{
"token": "abcdefghijklmnqrstuvwxyz",
"custom_fields": [
{
"external_id": "order_field_id_123",
"name": "Additional order field",
"entity_type": "order",
"required": false,
"value_type": "unicode",
"default_value": "value of the test field"
},
{
"external_id": "line_field_id_123",
"name": "Additional field of the order item",
"entity_type": "line_order",
"required": false,
"value_type": "unicode",
"default_value": "value of the test field"
}
],
"custom_line_statuses": [
{
"external_id": "status_id_123",
"name": "Delivered to 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",
"create_time": "2022-01-02T15:04:05.141Z",
"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

ParameterTypeDescription
errorintError code
error_textstringError text
resultarrayProduct IDs that were successfully imported