Update Order and Order Item
The Order Update API provides endpoints that allow users to modify specific aspects of an order or its individual items.
PATCH
Update Order
PATCH
Update OrderThis endpoint allows users to update the is_send
status of an order. The is_send
parameter should be set to true
to indicate that the order has been communicated to the ERP system.
This endpoint does not support updates to other order details. Any modifications beyond is_send
must be performed through the /order_items/
endpoint.
The path variable (pk) specifies the order to be updated. If no errors occur, the response will always reflect the order's most recent status.
Path: {omnitron_url}/api/v1/orders/{pk}/
Authorization: Token <OMNITRON_ACCESS_TOKEN>
Request Parameters
is_send
boolean
It should be set to true if ERP is informed about the order.
Example Request
Example Response (200 OK)
Example Responses (400 Bad Request)
PATCH
Update Order Item
PATCH
Update Order ItemThis endpoint enables users to update the details of an order item. Request body parameters can be used individually or in combination with others. The path variable (pk) specifies the order item to be updated.
Path: {omnitron_url}/api/v1/order_items/{pk}/
Authorization: Token <OMNITRON_ACCESS_TOKEN>
Request Parameters
status
string (enum)
The status of the order item. Allowed values are order status codes.
extra_field
object
Any JSON data is allowed to be stored with the order item. Endpoint does not update or delete fields which are not included in the JSON data.
attributes
object
An object where all values must be string or boolean. The data in the body will be the final one on the item as a whole.
attributes_kwargs
object
An object where all values must be an object. The nested objects should include additional information about the attributes of the order item. The data in the body will be the final one on the item as a whole.
cancel_status
string (enum & nullable)
The status of cancellation processes of the order item. Allowed values are included in the cancel status list.
tracking_number
string (nullable)
The tracking number provided by the shipping company for the order item.
defined_tracking_url
string (nullable)
URL for shipment tracking.
invoice_number
string (nullable)
Number value of the invoice related to the order item.
invoice_date
string (nullable)
Date value of the invoice related to the order item and must be formatted as UTC ISO 8601.
e_archive_url
string (nullable)
The URL where the PDF version of the invoice can be accessed. This link allows customers or stakeholders to view and download the invoice directly from the Omnitron panel or integrated sales channels.
carrier_shipping_code
string (nullable)
Tracking code assigned by the carrier.
shipping_company
string (enum & nullable)
The name of the shipping company assigned to the order item. This field represents the official carrier used for tracking and processing the shipment, such as a general shipping service provider. Allowed values are limited to the companies and their hard-coded defined names in Omnitron.
parent
integer or string (nullable)
The input must be the primary key value of an existing order item.
shipped_date
string (nullable)
The date when the order item was shipped. It must be formatted as UTC ISO 8601.
delivered_date
string (nullable)
The date when the order item was delivered. It must be formatted as UTC ISO 8601.
estimated_delivery_date
string (nullable)
The estimated delivery date for the order item. It must be formatted as YYYY-MM-DD.
defined_shipping_company
string (nullable)
A value representing the actual shipping company that the end user should see, which may differ from the "shipping_company" field. For example, if the internal system uses one shipping service for processing but the actual delivery is handled by a different carrier, this field will contain the name of the carrier responsible for the delivery.
data_source
integer or string (nullable)
The input must be the primary key value of an existing data source. The DataSource model contains detailed information about the seller, supplier, or related data entity.
shipping_option_group
integer or string (nullable)
Key Points
Requests to change the status to "cancelled" or "refunded" will be rejected, and no updates will be made to the order item.
The request body must not include the following attribute fields:
split_from_order_item_pk
old_order_item_omnitron_id
old_order_item_id
old_product_sku
old_price
new_product_sku
new_price
If the current
cancel_status
is "approved" for the order item, the request body must include the corresponding field with a non-null value, and its value cannot be "confirmed".If the current
cancel_status
is "waiting_for_payment" for the order item, the request body must include the corresponding field with a non-null value, and its value cannot be any of the following:waiting
confirmation_waiting
confirmed
,approved
rejected
If the current status is 100 or 600, the following fields cannot be updated:
tracking_number
defined_tracking_url
defined_shipping_company
.
If the
status
code in the payload is 500 and theshipped_date
of the related order item is null, the date will be set to the request time.If the
status
code in the payload is 550 and thedelivered_date
of the related order item is null, the date will be set to the request time.Including either
invoice_number
ortracking_number
in the request body will change the order item’s status to 450 if the current status is 400, regardless of the value in the status field of the request body.If the request body includes any of the following fields, the order associated with the order item will be updated with the provided values. However, if the order's payment type is "pay on delivery" and the order already has a tracking number, it will remain unchanged:
invoice_number
invoice_date
e_archive_url
tracking_number
shipping_company
status
defined_tracking_url
Example Request
Example Response (200 OK)
Example Responses (400 Bad Request)
PATCH
Update Order Statuses in Bulk
PATCH
Update Order Statuses in BulkWhen 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 (e.g., an ERP system), 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.
Path: {omnitron_url}/api/i1/order_items/bulk_status_update/
Authorization: Token <OMNITRON_ACCESS_TOKEN>
Request Parameters
id
id
Unique identifier for the order item.
invoice_number
string
The invoice number generated for the order item.
invoice_date
string
The date when the invoice was issued. The format is expected to follow ISO 8601 standards, e.g., YYYY-MM-DDTHH:MM:SSZ
e_archive_url
string
The URL where the PDF version of the invoice can be accessed. This link allows customers or stakeholders to view and download the invoice directly from the Omnitron panel or integrated sales channels.
status
string
The current status of the order item, mapped to Omnitron's predefined status codes. Allowed values are order status codes.
tracking_number
string
The tracking number provided by the shipping company for the order item.
shipping_company
enum
The name of the shipping company assigned to the order. This field represents the official carrier used for tracking and processing the shipment, such as a general shipping service provider. Allowed values are limited to the companies and their hard-coded defined names in Omnitron.
Example Request
Example Response (200 OK)
Example Responses (400 Bad Request)
If any error occurs during the bulk operation, the response specifies which order_item is incorrect along with the error messages.
For example:
Last updated
Was this helpful?