Updating Orders
Function orders/update (<http://<DOMAIN>>/api/orders/update/)
Parameters:
token - authorization key obtained through the auth function.
orders[] - array of orders
orders[i].order_id - order number
orders[i].status - order status
1 - New
2 - In processing
3 - Delivered
4 - Not delivered
6 - Delivering
orders[i].tracking_code - tracking code for UkrPochta (displayed in orders in user profile). Optional parameter.
orders[i].paid - fact of order payment
0 - not paid
1 - paid
Response:
status - status of the function execution
OK - all records were updated successfully
WARNING - errors occurred while updating some records
response.log - log of function execution for each record
response.log[i].order_id - order number
response.log[i].status - record update status
OK - everything was updated successfully
ERROR - update error
response.log[i].message - status explanation
Query example http://<DOMAIN>/api/orders/update/
{
"token": "7abd7fbadb3920e48b3961181b4cd3e5",
"orders": [
{
"order_id": 24,
"status": 2
},
{
"order_id": 23,
"status": 4,
"tracking_code": "123123123123"
},
{
"order_id": 22,
"status": 3
},
{
"order_id": 26,
"status": 3123
}
]
}
Response example
{
"status": "WARNING",
"response": {
"log": [
{
"status": "OK",
"messages": "UPDATED"
},
{
"status": "OK",
"messages": "UPDATED"
},
{
"status": "OK",
"messages": "UPDATED"
},
{
"status": "ERROR",
"messages": "status is not defined or defined incorrectly"
}
]
}
}