Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v74
  • v74
  • v73
  • v72
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
  • Databases
  • Resources
  • Segments
  • Suppression lists
  • Templates and fragments
  • Campaigns
  • Mailings
  • Automation scenarios
  • Loyalty Programs
  • Promo codes
  • Goals
  • Application push notifications
  • Market
    • Market objects
    • Orders
      • Import order and item statuses
      • Get orders list
      • Delete order
      • Get order status
      • Update order line status
    • Products and SKU
  • Analytic reports
  • SendersDev
  • External datatables queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
  • Market
  • Orders
  • Import order and item statuses
Documentation for version v74

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": "Arrived at the pickup point",
      "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
  • Fields must be created before they can be used in an order.
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. In this block, you can specify values for previously created custom_fields
tip

If you need to set a value for an existing additional field, pass an object in custom_fields where the key is the external_id of that field, and the value is the required data

Request example​

  • JSON
  • XML

{
"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"
}
}
]
}
]
}

<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<custom_fields>
<external_id>order_field_id_123</external_id>
<name>Additional order field</name>
<entity_type>order</entity_type>
<required>false</required>
<value_type>unicode</value_type>
<default_value>value of the test field</default_value>
</custom_fields>
<custom_fields>
<external_id>line_field_id_123</external_id>
<name>Additional field of the order item</name>
<entity_type>line_order</entity_type>
<required>false</required>
<value_type>unicode</value_type>
<default_value>value of the test field</default_value>
</custom_fields>
<custom_line_statuses>
<external_id>status_id_123</external_id>
<name>Delivered to the pick-up point</name>
<type>in_process</type>
</custom_line_statuses>
<skip_triggers>true</skip_triggers>
<data>
<external_id>1234000</external_id>
<matching>email</matching>
<email>johndoe@example.com</email>
<endpoint>website</endpoint>
<tags>one</tags>
<tags>two</tags>
<status>delivered</status>
<delivery_cost>100</delivery_cost>
<total_price>1000</total_price>
<currency>USD</currency>
<create_time>2022-01-02T15:04:05.141Z</create_time>
<custom_fields>
<order_field_id_123>data</order_field_id_123>
</custom_fields>
<region>region_YnCrJj8Y1</region>
<lines>
<external_id>line_01</external_id>
<status>status_id_123</status>
<product>iphone_test_1</product>
<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>1</count>
<custom_fields>
<line_field_id_123>data</line_field_id_123>
</custom_fields>
</lines>
</data>
</xml>
info

custom_fields at the root of the request creates new fields (an array), while in data it fills them with values (an object in the format "field_id": "value")

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError text
resultarrayProduct IDs that were successfully imported

Response example​

  • JSON
  • XML
{
"error": 0,
"error_text": "",
"result": [
{
"error": 0,
"external_id": "1234000"
}
]
}
<xml>
<error>0</error>
<error_text></error_text>
<result>
<error>0</error>
<external_id>1234000</external_id>
</result>
</xml>
Last updated on Feb 28, 2024
Previous
Orders
Next
Get orders list
  • Description
  • Request URL
  • Request parameters
  • Request example
  • Response parameters
  • Response example
© 2015 - 2025 Altcraft, LLC. All rights reserved.