Skip to main content

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.

ParameterData TypeInReqiuredDescription
api_tokenstringheadermandatoryThe API key of the customer account.
update_stockbooleandataoptionalIf it is True, the stock reservation is released. Default is True.
codestringdatamandatoryUnique ID of the order line on the ERP side.
{order_item_id}stringquerymandatoryOrder 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.

{
"pk": 4183,
"content_type": 66,
"object_id": 46761,
"integration_type": "external_company",
"code": "<erp_orderitem_code>"
}