API UpdateOrder
Request
- tenant - (mandatory) - to which tenant/system to connect, e.g. "zegoal"
- order_id - (mandatory)
- update_order_attributes
- start_date - (optional) - can not be empty
- end_date - (optional)
- order_type - (optional)
- tel_num - (optional)
- email - (optional)
- address_text - (optional)
- order_description - (optional)
- order_status - (optional)
- account_address_id - (optional)
Примеры использования с малым и полным набором атрибутов:
Запрос
{
"tenant": "orderingtenant885",
"order_id": 4,
"update_order_attributes":{
"order_type": "Online"
}
}
CODE
Ответ
{
"processing_result": {
"text": "Order is updated.",
"status": "ok",
"ctx_id": "N7mBRNtb:0-fM",
"code": 0
},
"processing_date": "2020-07-03 09:54:48",
"UpdateOrder": {
"response": {
"update_order_attributes": {"order_type": "Online"},
"old_order": {
"start_date": "2020-07-03 09:19:58",
"order_type": "OnSite",
"order_total": 260.5,
"order_status": "Draft",
"order_positions": [
{
"unit": "шт",
"quantity": 2,
"product_name": "position #612",
"price": 30,
"position_type": "Goods",
"position_total": 60,
"position_id": 7,
"order_id": 4,
"catalog_position_id": 4
},
{
"unit": "кг",
"quantity": 1,
"product_name": "position #2",
"product_code": "6205",
"price": 200.5,
"position_type": "Goods",
"position_total": 200.5,
"position_id": 8,
"order_id": 4
}
],
"order_num": 4,
"order_id": 4,
"order_description": "order Description",
"end_date": "2020-07-06 09:19:58",
"customer_name": "NewClient_1593756522762",
"address_text": "a big white building",
"account_id": 1,
"account_address_id": 1
},
"new_order": {
"start_date": "2020-07-03 09:19:58",
"order_type": "Online",
"order_total": 260.5,
"order_status": "Draft",
"order_positions": [
{
"unit": "шт",
"quantity": 2,
"product_name": "position #612",
"price": 30,
"position_type": "Goods",
"position_total": 60,
"position_id": 7,
"order_id": 4,
"catalog_position_id": 4
},
{
"unit": "кг",
"quantity": 1,
"product_name": "position #2",
"product_code": "6205",
"price": 200.5,
"position_type": "Goods",
"position_total": 200.5,
"position_id": 8,
"order_id": 4
}
],
"order_num": 4,
"order_id": 4,
"order_description": "order Description",
"end_date": "2020-07-06 09:19:58",
"customer_name": "NewClient_1593756522762",
"address_text": "a big white building",
"account_id": 1,
"account_address_id": 1
},
"TZ": "Europe/Minsk"
},
"request": {
"update_order_attributes": {"order_type": "Online"},
"tenant": "orderingTenant885",
"order_id": 4
},
"extra_logic": "",
"enriched_request": {
"update_order_attributes": {"order_type": "Online"},
"tenant": "orderingtenant885",
"order_id": 4
}
}
}
CODE
Запрос
{
"tenant": "orderingtenant885",
"order_id": 4,
"update_order_attributes":{
"start_date":"2020-07-03 10:12:38",
"end_date":"2020-07-04 10:12:38",
"tel_num": "998877665544332211",
"email": "updatedEmail@email.com",
"address_text":"address text updated",
"order_description": " updated order Description",
"order_status":"In Progress",
"order_type": "Online"
}
}
CODE
Ответ
{
"processing_result": {
"text": "Order is updated.",
"status": "ok",
"ctx_id": "MmqMNp3m:0-Gq",
"code": 0
},
"processing_date": "2020-07-03 10:12:40",
"UpdateOrder": {
"response": {
"update_order_attributes": {
"tel_num": "998877665544332211",
"start_date": "2020-07-03 10:12:38",
"order_type": "Online",
"order_status": "In Progress",
"order_description": " updated order Description",
"end_date": "2020-07-04 10:12:38",
"email": "updatedEmail@email.com",
"address_text": "address text updated"
},
"old_order": {
"start_date": "2020-07-03 09:19:58",
"order_type": "Online",
"order_total": 260.5,
"order_status": "Draft",
"order_positions": [
{
"unit": "шт",
"quantity": 2,
"product_name": "position #612",
"price": 30,
"position_type": "Goods",
"position_total": 60,
"position_id": 7,
"order_id": 4,
"catalog_position_id": 4
},
{
"unit": "кг",
"quantity": 1,
"product_name": "position #2",
"product_code": "6205",
"price": 200.5,
"position_type": "Goods",
"position_total": 200.5,
"position_id": 8,
"order_id": 4
}
],
"order_num": 4,
"order_id": 4,
"order_description": "order Description",
"end_date": "2020-07-06 09:19:58",
"customer_name": "NewClient_1593756522762",
"address_text": "a big white building",
"account_id": 1,
"account_address_id": 1
},
"new_order": {
"tel_num": "998877665544332211",
"start_date": "2020-07-03 10:12:38",
"order_type": "Online",
"order_total": 260.5,
"order_status": "In Progress",
"order_positions": [
{
"unit": "шт",
"quantity": 2,
"product_name": "position #612",
"price": 30,
"position_type": "Goods",
"position_total": 60,
"position_id": 7,
"order_id": 4,
"catalog_position_id": 4
},
{
"unit": "кг",
"quantity": 1,
"product_name": "position #2",
"product_code": "6205",
"price": 200.5,
"position_type": "Goods",
"position_total": 200.5,
"position_id": 8,
"order_id": 4
}
],
"order_num": 4,
"order_id": 4,
"order_description": " updated order Description",
"end_date": "2020-07-04 10:12:38",
"email": "updatedEmail@email.com",
"customer_name": "NewClient_1593756522762",
"address_text": "address text updated",
"account_id": 1,
"account_address_id": 1
},
"TZ": "Europe/Minsk"
},
"request": {
"update_order_attributes": {
"tel_num": "998877665544332211",
"start_date": "2020-07-03 10:12:38",
"order_type": "Online",
"order_status": "In Progress",
"order_description": " updated order Description",
"end_date": "2020-07-04 10:12:38",
"email": "updatedEmail@email.com",
"address_text": "address text updated"
},
"tenant": "orderingtenant885",
"order_id": 4
},
"extra_logic": "",
"enriched_request": {
"update_order_attributes": {
"tel_num": "998877665544332211",
"start_date": "2020-07-03 10:12:38",
"order_type": "Online",
"order_status": "In Progress",
"order_description": " updated order Description",
"end_date": "2020-07-04 10:12:38",
"email": "updatedEmail@email.com",
"address_text": "address text updated"
},
"tenant": "orderingtenant885",
"order_id": 4
}
}
}
CODE