Loymax, 2026

Wiki source code of Orders


Show last authors
1 (% class="lead" %)
2 **Order**—this is a customer request for a product or service placed via the website or mobile application.
3
4 (% class="box" %)
5 (((
6 * [[Order structure>>doc:||anchor="Structure"]]
7 * [[Order functionality integration>>doc:||anchor="Integration"]]
8 * [[Instructions for working with order functionality>>doc:||anchor="Instructions"]]
9 )))
10
11 (% class="box infomessage" %)
12 (((
13 * **Orders**—this is an optional feature that is not enabled by default. To activate this functionality, contact Loymax specialists.
14 * Visibility of orders/order lines in various System sections is controlled by a feature flag. When the flag is enabled, the corresponding tabs and functional capabilities become available.
15 )))
16
17 Unlike a [[receipt>>doc:Main.Using.Smart_Communications.Customers.All_clients.WebHome||anchor="H42743543A438"]], which records the fact of payment and the list of purchased items, an [[order>>doc:Main.Using.Smart_Communications.Customers.All_clients.WebHome||anchor="H41743043A43043744B"]] contains a broader dataset: customer information, order value, order statuses, detailed fulfillment, payment, and delivery data, as well as order contents. Like receipts, orders are used for building segments for subsequent [[communications>>doc:Main.Using.Smart_Communications.Mass_mailings.WebHome]] with customers and serve as the basis for analyzing purchasing behavior and generating [[reports>>doc:Main.Using.Smart_Communications.Mass_mailings.Mailing_report.WebHome]].
18
19 === Order structure {{id name="Structure"/}} ===
20
21 In addition to standard data typical for receipt entities, orders have the following attributes:
22
23 * **Statuses**—three status types are available for each order. Users can create statuses of the respective types in the section [[Settings ~> Order statuses>>doc:Main.Using.Smart_Communications.Settings_SC.Order_statuses.WebHome]].
24 ** **General**: includes general stages of the order lifecycle. For example: received, confirmed, in progress, completed.
25 ** **Delivery status**: includes stages related to order delivery. For example: being assembled, shipped, at pickup point, issued.
26 ** **Payment status**: includes stages related to order payment. For example: invoice issued, awaiting payment, paid.
27 * **Delivery block**
28 ** Delivery status,
29 ** Delivery type: courier, self-pickup, pickup point,
30 ** Provider: shipping carrier handling order delivery,
31 ** Address: country, city, street,
32 ** Date and time,
33 ** Customer comment.
34 * **Payment block**
35 ** Payment status,
36 ** Payment type: card, cash, cash on delivery,
37 ** Payment provider: multiple payment providers can be configured,
38 ** Order amount information:
39 *** Total order amount,
40 *** Cash payment,
41 *** Bonus payment,
42 *** Delivery cost,
43 *** Discount.
44 * **Order contents block**
45 ** Number of items,
46 ** Item cost,
47 ** Order line total,
48 ** Item weight,
49 ** Discount amount,
50 ** Bonus accrual and deduction,
51 ** Cash amount.
52
53 All the above order attributes can be used for customer communications via [[mass messaging>>doc:Main.Using.Smart_Communications.Mass_mailings.WebHome]] and marketing [[campaigns>>doc:Main.Using.Smart_Communications.Campaign_list.WebHome]].
54
55 {{showhide showmessage="Show sample order structure in REST API request" hidemessage="Hide sample order structure"}}
56 (% class="table-bordered" %)
57 (% class="info" %)|(% style="width:870px" %)**Sample order structure in REST API request**|(% style="width:781px" %)**Request parameters**
58 |(% style="width:870px" %)(((
59 {{code language="xml"}}
60 {
61 "data": {
62 "attributes": {
63 "external_id": "1050",
64 "client_external_id": "724",
65 "date": "2020-07-03 17:30:22",
66 "number": "1218/112",
67 "items_cnt": 1,
68 "items_sum": 200.3,
69 "status_code": "new",
70 "unit": "",
71 "actions": "",
72 "delivery": {
73 "status_code": "delivered",
74 "type": "",
75 "provider": "",
76 "country": "",
77 "city": "",
78 "address": "",
79 "date": "",
80 "time": "",
81 "note": ""
82 },
83 "payment": {
84 "status_code": "paid",
85 "type": "",
86 "provider": "",
87 "total": 200.3,
88 "cash": 190,
89 "bonuses": 15,
90 "delivery": 20,
91 "discount": 24.87
92 },
93 "items": [
94 {
95 "external_id": "577",
96 "product_external_id": "789",
97 "cnt": 1,
98 "sum": 120,
99 "price": 120,
100 "quantity": 0,
101 "discount": 0,
102 "bonus_to_card": 0,
103 "bonus_from_card": 0,
104 "cash_sum": 0
105 }
106 ]
107 }
108 }
109 }
110 {{/code}}
111 )))|(% style="width:781px" %)(((
112 * **external_id**—external order identifier
113 * **client_external_id**—external user identifier
114 * **date**—order date. If not specified, current date and time are used
115 * **number**—order number
116 * **items_cnt**—number of products in the order
117 * **items_sum**—order value
118 * **status_code**—general order status
119 * **unit**—point of sale
120 * **actions**—offers
121 * **delivery**—delivery block:
122 ** status_code—delivery status
123 ** type—delivery type
124 ** provider—delivery provider
125 ** country—delivery country
126 ** city—delivery city
127 ** address—delivery address
128 ** date—delivery date
129 ** time—delivery time
130 ** note—comment
131 * **payment**—payment block:
132 ** status_code—payment status
133 ** type—payment method type
134 ** provider—payment provider
135 ** total—total paid
136 ** cash—paid in cash
137 ** bonuses—paid with bonus points
138 ** delivery—delivery cost
139 ** discount—discount amount
140 * **items**—order contents:
141 ** external_id—order line identifier in the user's information system
142 ** product_external_id—product identifier
143 ** cnt—product quantity
144 ** sum—order line total
145 ** price—product cost
146 ** quantity—item weight
147 ** discount—discount
148 ** bonus_to_card—bonus points accrued
149 ** bonus_from_card—bonus points deducted
150 ** cash_sum—cash amount
151 )))
152 {{/showhide}}
153
154 === Order functionality integration {{id name="Integration"/}} ===
155
156 Order functionality integration is performed by contacting Loymax specialists and includes the following steps:
157
158 1. Enable the **EnableShopEorders** feature flag, which activates visibility of tabs and toggles for orders/order lines across various System sections.
159 1. Configure [[fields>>doc:Main.Using.Smart_Communications.Settings_SC.Data_field.WebHome]] to match the Partner's business processes.
160 1. Configure [[order statuses>>doc:Main.Using.Smart_Communications.Settings_SC.Order_statuses.WebHome]].
161 1. Testing.
162
163 ==== Instructions for working with order functionality can be found in the relevant sections: {{id name="Instructions"/}} ====
164
165 (% class="table-bordered" %)
166 |(% style="width:423px" %)(((
167 (% class="lead" %)
168 Analytics and reports
169 )))|(% style="width:1019px" %)(((
170 In all reports for [[mass messaging>>doc:Main.Using.Smart_Communications.Mass_mailings.Mailing_report.WebHome]], [[campaigns>>doc:Main.Using.Smart_Communications.Campaign_list.Campaign_report.WebHome]], including the [[dashboard>>doc:Main.Using.Smart_Communications.Review.WebHome]], as well as consolidated reports in the **Analytics** section, you can switch between receipts and orders (provided both functionalities are enabled).
171
172 (% class="box infomessage" %)
173 (((
174 Reports include only orders with statuses marked with the **Include in analytics** flag during creation/editing. Order statuses can be created in the section [[Settings ~> Order statuses>>doc:Main.Using.Smart_Communications.Settings_SC.Order_statuses.WebHome]].
175 )))
176 )))
177 |(% style="width:423px" %)(((
178 (% class="lead" %)
179 Attribution
180 )))|(% style="width:1019px" %)Similar to [[receipt attribution>>doc:Main.Using.Smart_Communications.Receipt_attribution.WebHome]], order attribution is available for [[mass messaging>>doc:Main.Using.Smart_Communications.Mass_mailings.WebHome]] and [[campaigns>>doc:Main.Using.Smart_Communications.Campaign_list.WebHome]]. **Order attribution**—these are rules that link orders to communications sent to the customer.
181 |(% style="width:423px" %)(((
182 (% class="lead" %)
183 [[Template engine macros>>doc:Main.Using.Smart_Communications.Mass_mailings.Template_builder.WebHome||anchor="H42143844144243543C43D44B43543F43544043543C43543D43D44B435"]]
184 )))|(% style="width:1019px" %)(((
185 For customizing message text in [[mass messaging>>doc:Main.Using.Smart_Communications.Mass_mailings.Template_builder.WebHome]] and [[campaigns>>doc:Main.Using.Smart_Communications.Campaign_list.WebHome]], the following template engine macros are supported for order functionality:
186
187 * Number of customer orders
188 * Total amount of all customer orders
189 * Date of customer's first/last order
190 * Number of customer's first/last order
191 * Value of attribute in customer's first/last order
192 * Contents of customer's first/last order
193 )))
194 |(% style="width:423px" %)(((
195 (% class="lead" %)
196 [[API methods for working with orders>>doc:Main.Integration.Integration_of_SC.Data_communiction.SmC_API.SmC_API_methods.Eorder.WebHome]]
197 )))|(% style="width:1019px" %)(((
198 The following API methods are available for working with orders:
199
200 * Register an order
201 * Update order status
202 * Get a list of orders
203 * Get an order by external identifier
204 * Get a list of customer orders by customer external identifier
205 * Link an order to a receipt
206 * Delete an order
207 )))
208 |(% style="width:423px" %)(((
209 (% class="lead" %)
210 [[Fields>>doc:Main.Using.Smart_Communications.Settings_SC.Data_field.WebHome]]
211 )))|(% style="width:1019px" %)(((
212 The fields configuration section allows managing the set of fields for orders and order lines. System fields are present by default. Users can also create custom fields for orders and order lines, which can be deleted or edited.
213
214 (% class="table-bordered" %)
215 (% class="info" %)|(% style="width:647px" %)**Example list of order fields**|(% style="width:686px" %)**Example list of order line fields**
216 |(% style="width:647px" %){{lightbox image="Orders_fields.png" width="700"/}}|(% style="width:686px" %){{lightbox image="Lines_example.png" width="700"/}}
217
218 It is also possible to [[manage field display>>doc:Main.Using.Smart_Communications.Settings_SC.Data_field.Views_management.WebHome]]: for orders and order lines, you can change the field set or their sequence in the [[customer profile>>doc:Main.Using.Smart_Communications.Customers.All_clients.WebHome||anchor="H41F44043E44443843B44C43A43B43843543D442430"]].
219 )))
220 |(% style="width:423px" %)(((
221 (% class="lead" %)
222 [[Segment builder>>doc:Main.Using.Smart_Communications.Customers.User_segments.Segment_builder.WebHome]]
223 )))|(% style="width:1019px" %)(((
224 For customer segmentation using order data, the **Segment builder** provides the following filters:
225
226 * **Customer**
227 ** Number of orders
228 ** Number of attributed orders
229 ** Date of first/last order
230 ** Days since first/last order
231 ** Average order amount
232 ** Average number of items per order
233 ** Total order value
234 ** Last order value
235 ** Median order amount
236 ** Average item price in order
237 * **Order**
238 ** Last order/delivery/payment status
239 ** Identifier
240 ** Date
241 ** Status
242 ** Number
243 ** Item quantity/value
244 ** Point of sale
245 ** Offers
246 ** Card
247 ** Delivery status/type
248 ** Delivery provider
249 ** Delivery country/city/address
250 ** Delivery date/time
251 ** Delivery comment
252 ** Payment status/type
253 ** Total paid
254 ** Paid in cash/bonus points
255 ** Delivery cost
256 ** Discount amount
257 * **Order contents**
258 ** Average item price
259 ** Identifier
260 ** Quantity
261 ** Value
262 ** Price
263 ** Item weight
264 ** Discount
265 ** Bonus points accrued
266 ** Bonus points deducted
267 ** Cash amount
268 * **Interaction**
269 ** Ordered via email campaign
270 ** Ordered via SMS campaign
271 ** Ordered via push campaign
272 ** Ordered via campaign
273 )))
274 |(% style="width:423px" %)(((
275 (% class="lead" %)
276 [[Customer profile>>doc:Main.Using.Smart_Communications.Customers.All_clients.WebHome||anchor="H41F44043E44443843B44C43A43B43843543D442430"]]
277 )))|(% style="width:1019px" %)(((
278 * When order functionality is enabled, a separate [[orders>>doc:Main.Using.Smart_Communications.Customers.All_clients.WebHome||anchor="H41743043A43043744B"]] tab appears in the customer profile, displaying detailed information about all customer orders, including payment, delivery, item quantity, and order value.
279 * The [[Activity>>doc:Main.Using.Smart_Communications.Customers.All_clients.WebHome||anchor="H41043A44243843243D43E44144244C"]] tab in the customer profile also displays customer order information.
280 * For orders whose statuses are included in statistics and [[reports>>doc:Main.Using.Smart_Communications.Mass_mailings.Mailing_report.WebHome]], the following [[metrics>>doc:Main.Using.Smart_Communications.Customers.User_segments.Segment_builder.Metrics.WebHome]] are available in the customer profile:
281 ** Number of orders
282 ** Total order value
283 ** Average order value
284 ** Average number of items per order
285 )))
286 |(% style="width:423px" %)(((
287 (% class="lead" %)
288 [[Order statuses>>doc:Main.Using.Smart_Communications.Settings_SC.Order_statuses.WebHome]]
289 )))|(% style="width:1019px" %)(((
290 Viewing and creating order statuses is available in the **[[Settings>>doc:Main.Using.Smart_Communications.Settings_SC.WebHome]] > Order statuses** section. Three status types are available for orders:
291
292 * General
293 * Delivery status
294 * Payment status
295 )))
296 |(% style="width:423px" %)(((
297 (% class="lead" %)
298 [[Triggers>>doc:Main.Using.Smart_Communications.Campaign_list.Triggers.WebHome]] for orders
299 )))|(% style="width:1019px" %)(((
300 A **Trigger**—is an event that activates a [[campaign>>doc:Main.Using.Smart_Communications.Campaign_list.WebHome]]. The following triggers are available for order functionality:
301
302 * [[Days since order>>doc:Main.Using.Smart_Communications.Campaign_list.Triggers.WebHome||anchor="H41443D43543944143743043A430437430"]]
303 * [[Product ordered>>doc:Main.Using.Smart_Communications.Campaign_list.Triggers.WebHome||anchor="H41743043A43043743043D43F44043E43444343A442"]]
304 * [[Product from category ordered>>doc:Main.Using.Smart_Communications.Campaign_list.Triggers.WebHome||anchor="H41743043A43043743043D43F44043E43444343A44243843743A43044243543343E440438438"]]
305 * [[Order status changed>>doc:Main.Using.Smart_Communications.Campaign_list.Triggers.WebHome||anchor="H41843743C43543D43843B44144F44144243044244344143743043A430437430"]]
306 * [[Order date reached>>doc:Main.Using.Smart_Communications.Campaign_list.Triggers.WebHome||anchor="H41D43044144244343F43B43543D43843543443044244B43443B44F43743043A430437430"]]
307 * [[Order placed>>doc:Main.Using.Smart_Communications.Campaign_list.Triggers.WebHome||anchor="H42143443543B43043D43743043A430437"]]
308 )))
309 |(% style="width:423px" %)(((
310 (% class="lead" %)
311 [[Export>>doc:Main.Using.Smart_Communications.Customers.User_segments.Segment_builder.WebHome||anchor="02"]]
312 )))|(% style="width:1019px" %)(((
313 In customer lists within the [[Segment builder>>doc:Main.Using.Smart_Communications.Customers.User_segments.Segment_builder.WebHome]] and consolidated reports in the **Analytics** section, you can export order and order line data to a file.
314 )))