Order Confirmation
Description
The preorder_commit method performs the final order confirmation after a successful preliminary calculation via the preorder method. The method creates the order in the system, applies all calculated discounts, accrues and redeems points, and activates promo codes.
URL
Method: POST
https://example.com/api/v1.1/market/orders/preorder_commit
Request Parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| external_id | string | "order_12345" | Yes | External order ID in the client's system |
| profile_id | string | "696e304f547840a7286619e0" | Yes* | Profile identifier. Field used for matching |
| string | "user@example.com" | Yes* | Member's email. Field used for matching | |
| phone | string | "+79991234567" | Yes* | Member's phone number. Field used for matching |
| skip_triggers | boolean | false | No | Disable trigger execution when creating the order. Default is false |
| data | object | | Yes | Object with order data |
* — to identify the profile, one of the parameters must be provided: profile_id, email, or phone
data object
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| endpoint | string | "bot", "website" | Yes | Order source (touchpoint). Must be configured in the Market module |
| status | string | "new", "confirmed", "paid" | Yes | Order status. Uses statuses configured in the platform |
| currency | string | "RUB", "USD", "EUR" | Yes | Order currency (three-letter ISO code) |
| total_price | string | "2500.00" | Yes | Total order cost before discounts |
| final_total_price | string | "2150.00" | Yes | Final order cost after applying all discounts |
| delivery_cost | string | "300.00" | No | Delivery cost |
| create_time | string (ISO 8601) | "2026-02-18T13:01:05.141Z" | No | Order creation date and time. If not provided, the current server time is used |
| region | string | "region_moscow" | No | Region identifier for applying regional prices and promotions |
| lines | array | See "lines array" section below | Yes | Array of order items. Must contain at least 1 element |
| promocodes | array | See "promocodes array" section below | No | Array of promo codes applied to the order |
| requested_promotions | array | See "requested_promotions array" section below | No | Promotions applied to this order. This field should contain the structure from the applied_promotions field of the /preorder method response |
| redeem_points | array | See "redeem_points array" section below | Yes, if type="redeem_points" is specified in requested_promotions | Array of point redemptions by point currency types |
| custom_fields | object | | No | Order custom fields |
| tags | array | | No | Tags for labeling the order |
lines array
The array contains information about the order items. Must contain at least 1 item.
Each item is a separate object within the array with the following parameters:
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| external_id | string | "line_1" | Yes | External line ID in the client's system |
| product | string | "iphone17pmb256" | Yes* | Product identifier |
| sku | string | "IPHONE17-256-BLACK" | Yes* | SKU identifier |
| line_number | integer | 1 | No | Sequential line number in the order |
| count | integer | 1 | Yes | Quantity of the product |
| base_price_per_item | string | "139999.00" | Yes | Base price per unit |
| min_price_per_item | string | "130000.00" | No | Minimum allowable price per unit |
| final_price_per_item | string | "139500.00" | Yes | Final price per unit after applying all discounts |
| status | string | "new" | No | Order line status |
| custom_fields | object | {"color": "black", "size": "XL"} | No | Line custom fields |
| requested_promotions | array | See "requested_promotions array" section below | No | Promotions applied to this line. This field should contain the structure from the applied_promotions field of the /preorder method response for the corresponding order line. |
* — one of the parameters is required: product or sku
promocodes array
The array contains objects with information about promo codes.
A full description of the promo code structure can be found in this article.
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| code | string | "SUMMER20" | Yes | Promo code |
| pool_id | integer | 42 | Yes | Promo code pool identifier |
redeem_points array
An array with information about loyalty point redemption. Each object describes a separate redemption.
A full description of the point redemption structure can be found in this article.
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| points_currency_iid | integer | 1 | Yes* | Internal identifier of the point type |
| points_currency_eid | string | "bonus1" | Yes* | External identifier of the point type |
| name | string | "Bonus points" | No | Name of the point type |
| amount | integer | 499 | Yes | Number of points to redeem |
* — one of the parameters is required: points_currency_iid or points_currency_eid
requested_promotions array
The requested_promotions array can be contained both in the data object and in the lines array within that object. In the first case, the array will contain promotions applied to the order, in the second — promotions applied to the products/lines.
An array of promotions applied to the order. Each object in the array describes a separate promotion.
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| type | string | "discount", "accrue_points", "redeem_points", "code_issue", "message" | Yes | Promotion type |
| promotion | object | | Yes | Object with the promotion's identifier and name |
| amount | string | "150.00" | Yes, if type is discount, accrue_points, or redeem_points | Discount amount or number of points |
| points_info | object | | Yes, if type is accrue_points or redeem_points | Object with point information |
The structure of the points_info object is as follows:
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| points_currency_iid | integer | 1 | Yes* | Internal identifier of the point type |
| points_currency_eid | string | "bonus1" | Yes* | External identifier of the point type |
| name | string | "Bonus points" | No | Name of the point type |
| amount | string | "6999" | Yes | Number of points |
| expiration_date | string (ISO 8601) | "2027-02-18T00:00:00.000Z" | No | Expiration date for accrued points |
* — one of the parameters is required: points_currency_iid or points_currency_eid
Request Example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"external_id": "order_12345",
"profile_id": "696e304f547840a7286619e0",
"skip_triggers": false,
"data": {
"endpoint": "bot",
"status": "confirmed",
"currency": "RUB",
"total_price": "2500.00",
"final_total_price": "2150.00",
"delivery_cost": "300.00",
"create_time": "2026-02-18T13:01:05.141Z",
"region": "region_moscow",
"lines": [
{
"external_id": "line_1",
"product": "popit",
"base_price_per_item": "1500.00",
"final_price_per_item": "1350.00",
"count": 1,
"requested_promotions": [
{
"type": "discount",
"promotion": {
"external_id": "promo_1",
"name": "Summer Sale"
},
"amount": "150.00"
},
{
"type": "accrue_points",
"promotion": {
"external_id": "bonus_promo",
"name": "Point Accrual"
},
"points_info": {
"points_currency_iid": 1,
"points_currency_eid": "bonus1",
"name": "Bonus points",
"amount": "75"
}
}
]
},
{
"external_id": "line_2",
"sku": "skuf",
"base_price_per_item": "700.00",
"min_price_per_item": "650.00",
"final_price_per_item": "650.00",
"count": 2,
"requested_promotions": [
{
"type": "redeem_points",
"promotion": {
"external_id": "redeem_promo",
"name": "Point Redemption"
},
"points_info": {
"points_currency_iid": 1,
"points_currency_eid": "bonus1",
"name": "Bonus points",
"amount": "50"
}
}
]
}
],
"promocodes": [
{
"code": "HYDO-4728-DZGU",
"pool_id": 42
}
],
"redeem_points": [
{
"points_currency_eid": "bonus1",
"amount": 100
}
],
"requested_promotions": [
{
"type": "code_issue",
"promotion": {
"external_id": "welcome_promo",
"name": "Welcome Gift"
}
}
],
"custom_fields": {
"source": "telegram_bot",
"campaign": "spring_sale"
},
"tags": ["premium", "first_order"]
}
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<external_id>order_12345</external_id>
<profile_id>696e304f547840a7286619e0</profile_id>
<skip_triggers>false</skip_triggers>
<data>
<endpoint>bot</endpoint>
<status>confirmed</status>
<currency>RUB</currency>
<total_price>2500.00</total_price>
<final_total_price>2150.00</final_total_price>
<delivery_cost>300.00</delivery_cost>
<create_time>2026-02-18T13:01:05.141Z</create_time>
<region>region_moscow</region>
<lines>
<external_id>line_1</external_id>
<product>popit</product>
<base_price_per_item>1500.00</base_price_per_item>
<final_price_per_item>1350.00</final_price_per_item>
<count>1</count>
<requested_promotions>
<type>discount</type>
<promotion>
<external_id>promo_1</external_id>
<name>Summer Sale</name>
</promotion>
<amount>150.00</amount>
</requested_promotions>
<requested_promotions>
<type>accrue_points</type>
<promotion>
<external_id>bonus_promo</external_id>
<name>Point Accrual</name>
</promotion>
<points_info>
<points_currency_iid>1</points_currency_iid>
<points_currency_eid>bonus1</points_currency_eid>
<name>Bonus points</name>
<amount>75</amount>
</points_info>
</requested_promotions>
</lines>
<lines>
<external_id>line_2</external_id>
<sku>skuf</sku>
<base_price_per_item>700.00</base_price_per_item>
<min_price_per_item>650.00</min_price_per_item>
<final_price_per_item>650.00</final_price_per_item>
<count>2</count>
<requested_promotions>
<type>redeem_points</type>
<promotion>
<external_id>redeem_promo</external_id>
<name>Point Redemption</name>
</promotion>
<points_info>
<points_currency_iid>1</points_currency_iid>
<points_currency_eid>bonus1</points_currency_eid>
<name>Bonus points</name>
<amount>50</amount>
</points_info>
</requested_promotions>
</lines>
<promocodes>
<code>HYDO-4728-DZGU</code>
<pool_id>42</pool_id>
</promocodes>
<redeem_points>
<points_currency_eid>bonus1</points_currency_eid>
<amount>100</amount>
</redeem_points>
<requested_promotions>
<type>code_issue</type>
<promotion>
<external_id>welcome_promo</external_id>
<name>Welcome Gift</name>
</promotion>
</requested_promotions>
</data>
</xml>
Response Example
- JSON
- XML
{
"data": {
"status": "success",
"processing_target": "immediate",
"external_id": "order_12345",
"issued_promocodes": [
{
"codes": ["HYDO-4728-DZGU"],
"pool": {
"pool_id": 100,
"name": "Welcome Promocodes"
},
"promotion": {
"external_id": "welcome_promo",
"name": "Welcome Gift"
}
}
],
"points_changes": [
{
"points_info": {
"points_currency_iid": 1,
"points_currency_eid": "bonus1",
"name": "Bonus points",
"amount": "21500"
},
"accrue_points": 75,
"redeem_points": 150
}
],
"contents": [
{
"promotion": {
"external_id": "message_promo",
"name": "Information Message"
},
"contents": [
{
"type": "text",
"message": "Thank you for your purchase! You have received 75 bonus points."
}
]
}
]
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<status>success</status>
<processing_target>immediate</processing_target>
<external_id>order_12345</external_id>
<issued_promocodes>
<codes>HYDO-4728-DZGU</codes>
<pool>
<pool_id>100</pool_id>
<name>Welcome Promocodes</name>
</pool>
<promotion>
<external_id>welcome_promo</external_id>
<name>Welcome Gift</name>
</promotion>
</issued_promocodes>
<points_changes>
<points_info>
<points_currency_iid>1</points_currency_iid>
<points_currency_eid>bonus1</points_currency_eid>
<name>Bonus points</name>
<amount>21500</amount>
</points_info>
<accrue_points>75</accrue_points>
<redeem_points>150</redeem_points>
</points_changes>
<contents>
<promotion>
<external_id>message_promo</external_id>
<name>Information Message</name>
</promotion>
<contents>
<type>text</type>
<message>Thank you for your purchase! You have received 75 bonus points.</message>
</contents>
</contents>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| data | object | Confirmation result data |
| error | int | Error code (0 on success) |
| error_text | string | Error description |
Parameters returned in the data object:
| Parameter | Type | Description |
|---|---|---|
| status | string | Processing status: • success — order successfully created• outdated — price has changed since the preliminary calculation (/preorder must be repeated) |
| processing_target | string | Only for success status. Value: immediate or processed |
| external_id | string | External order ID (from the request) |
| issued_promocodes | array | Array of issued promo codes (for code_issue type promotions) |
| points_changes | array | Array of point balance changes by point currency types |
| contents | array | Array of content for display (text messages from promotions) |
The issued_promocodes array consists of objects with information about applied promo codes:
| Parameter | Type | Description |
|---|---|---|
| codes | array | Array of issued promo codes |
| pool | object | Information about the promo code pool |
| pool.pool_id | integer | Pool identifier |
| pool.name | string | Pool name |
| promotion | object | Object with promotion information |
| promotion.external_id | string | External promotion identifier |
| promotion.name | string | Promotion name |
The points_changes array consists of objects with information about point balance changes:
| Parameter | Type | Description |
|---|---|---|
| points_info | object | Object with point type information |
| points_info.points_currency_iid | integer | Internal identifier of the point type |
| points_info.points_currency_eid | string | External identifier of the point type |
| points_info.name | string | Name of the point type |
| points_info.amount | string | Current balance after the operation |
| accrue_points | integer | Number of points accrued |
| redeem_points | integer | Number of points redeemed |