Order Bulk Status Update
When the order is invoiced or the shipping process is managed outside of Omnitron, the following endpoint is used to save this order information to Omnitron. Based on this information, Omnitron decides on the cancellation / return processes of the order.
For example, if the delivery processes are controlled from outside of Omnitron (ERP), the status of the order line should be updated when the cargo information is received. The order should be updated with the status information corresponding to the Omnitron order status table along with the tracking number received from the courier company.
Parameter | Data Type | In | Description |
api_token | string | header | The API key of the customer account |
id | id | data | Order item ID |
invoice_number | string | data | Invoice number |
invoice_date | string | data | Invoice issue date |
e_archive_url | string | data | URL to access invoice pdf in Omnitron panel and sales channels |
status | string | data | Order status |
tracking_number | string | data | Shipping tracking number for order |
shipping_company | string | enum | Information with which courier company the order line was shipped with |
Request PATCH
Sample HTTP request to bulk update order_items.
‘content_type’ header represents the response type.
‘Authorization’ header is a required header for authentication. You can retrieve api_token with login.
Path: /api/i1/order_items/bulk_status_update/
import requests
import json
url = "https://{customer_api_url}/api/i1/order_items/bulk_status_update/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"
headers = {
'content-type': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}
data = {
"orderitem_set": [
{
#Faturası kesildi, kargoya verilmedi
"id": 1,
"status": "450",
"invoice_number": "SEP123123",
"invoice_date": "2021-07-14T00:00:00.000000Z",
"e_archive_url": "http://e.archive.url/SEP123123",
},
{
#Fatura kesildi ve kargoya verildi
"id": 2,
"status": "500",
"invoice_number": "SEP123123",
"invoice_date": "2021-07-14T00:00:00.000000Z",
"tracking_number": "TR123123",
"e_archive_url": "http://e.archive.url/SEP123123",
"shipping_company": "ups"
},
{
#Kargoya verildi
"id": 3,
"status": "500",
"tracking_number": "TR444444",
"shipping_company": "ups"
}
]
}
response = requests.patch(url, headers=headers , data=json.dumps(data))
print(response.text)
Response
Returns the updated order items properties.
Response contains parameters details.
[
{
"id": 1,
"order": 1,
"product_sku": "1185185001",
"status": "500",
"price_currency": "try",
"price": "100.00",
"tax_rate": "18.00",
"extra_field": {},
"price_list": 1,
"stock_list": 1,
"cancel_status": null,
"invoice_number": "SEP123123",
"invoice_date": "2021-07-14T00:00:00Z",
"e_archive_url": "http://e.archive.url/SEP123123",
"installment_interest_amount": "0.00",
"tracking_number": "11111111",
"carrier_shipping_code": null,
"shipping_company": "other",
"shipment_code": null,
"external_status": null,
"discount_amount": "0.00",
"retail_price": null,
"attributes": {},
"attributes_kwargs": {},
"image": null
},
{
"id": 2,
"order": 1,
"product_sku": "1185185002",
"status": "500",
"price_currency": "try",
"price": "86.00",
"tax_rate": "18.00",
"extra_field": {},
"price_list": 1,
"stock_list": 1,
"cancel_status": null,
"invoice_number": "SEP123123",
"invoice_date": "2021-07-14T00:00:00Z",
"e_archive_url": "http://e.archive.url/SEP123123",
"installment_interest_amount": "0.00",
"tracking_number": "TR123123",
"carrier_shipping_code": null,
"shipping_company": "ups",
"shipment_code": null,
"external_status": null,
"discount_amount": "0.00",
"retail_price": null,
"attributes": {},
"attributes_kwargs": {},
"image": null
},
{
"id": 3,
"order": 1,
"product_sku": "1185185003",
"status": "500",
"price_currency": "try",
"price": "17.00",
"tax_rate": "18.00",
"extra_field": {},
"price_list": 1,
"stock_list": 1,
"cancel_status": null,
"invoice_number": "SEP123123",
"invoice_date": "2021-07-14T00:00:00Z",
"e_archive_url": "http://e.archive.url/SEP123123",
"installment_interest_amount": "0.00",
"tracking_number": "TR444444",
"carrier_shipping_code": null,
"shipping_company": "ups",
"shipment_code": null,
"external_status": null,
"discount_amount": "0.00",
"retail_price": null,
"attributes": {},
"attributes_kwargs": {},
"image": null
}
]
Bad Responses
Returns which order_item
is incorrect with error messages if any error occurs during the bulk. For example:
[
{
"message": {
"status": [
"No matching type."
]
},
"args": {
"orderitem_id": "123"
}
},
{
"message": [
"You can only update one order at a time."
],
"args": {
"orderitem_id": "122"
}
}
]