For the complete documentation index, see llms.txt. This page is also available as Markdown.

Stock Reservation Release

When the order is created, the Omnitron starts to hold reservations on stock. This reservation is used to synchronize the stock between the ERP system and the Omnitron. If the order has been successfully registered in the ERP, a request must be sent to Omnitron with the order line created in the ERP to release the reservation.

Due to the information sent to the endpoint below, Omnitron both keeps the information of the order line created in the ERP and removes the reservation for the order.

Parameter

Data Type

In

Reqiured

Description

api_token

string

header

mandatory

update_stock

boolean

data

optional

If it is True, the stock reservation is released. Default is True.

code

string

data

mandatory

Unique ID of the order line on the ERP side.

{order_item_id}

string

query

mandatory

Order item ID.

POST Release Stock Reservation

Path: /api/i1/order_items/{order_item_id}/create_mapping/

Sample HTTP request to create mapping and release a stock.

  • 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/v1/order_items/{order_item_id}/create_mapping/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
   'content-type': 'application/json',
   'Authorization': 'Token {}'.format(api_token)

data = {
 "update_stock": True,
 "code": "{erp_orderitem_code}"
}

response = requests.post(url, headers=headers , data=json.dumps(data))
print(response.text)

Example Response

Returns Integration Mapping object data.

object_id is the ID of the order_item, code is the given code, content_type shows the data table (ex: Product, Order etc.) in the Omnitron system. Users can get all table ContentType information via HTTP GET request to /api/v1/content_types/ endpoint.

Why This Mapping Matters

The purpose of this mapping is to make the ERP's own order-item code a queryable, retrievable key in Omnitron going forward. Once a mapping is created, the related stock reservation is automatically released.

This unlocks two things in practice:

Reverse lookup by the ERP's own code Once the mapping row exists, the ERP can query Omnitron later using its own identifier instead of Omnitron's internal ID:

This is useful when the ERP's system of record keys everything off its own codes and doesn't want to persist Omnitron's primary keys everywhere.

It is echoed back on re-fetch The integration-facing detail payload includes a mapping field. So when the ERP later re-fetches an order or order item via the integration API, Omnitron returns the ERP's own code alongside its data — useful for reconciliation or logging without a second lookup.

Last updated

Was this helpful?