Skip to main content

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.

ParameterData TypeInDescription
api_tokenstringheaderThe API key of the customer account
ididdataOrder item ID
invoice_numberstringdataInvoice number
invoice_datestringdataInvoice issue date
e_archive_urlstringdataURL to access invoice pdf in Omnitron panel and sales channels
statusstringdataOrder status
tracking_numberstringdataShipping tracking number for order
shipping_companystringenumInformation with which courier company the order line was shipped with

PATCH Update Order Statuses in Bulk

Path: /api/i1/order_items/bulk_status_update/

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.

Example Request

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)

Example 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
}
]

Example 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"
}
}
]