Calling Inventory Visibility APIs through SDF utility service
When you develop customizations in Sterling™ Order Management System, you might need to make
more API calls to Sterling Intelligent Promising to manage reservations, verify node
availability, and review audit data. To do so, the Systems
Integrator can use the
CustomIVInvokeRestAPI SDF service utility. The
CustomIVInvokeRestAPI service supports the HTTP requests and authentication token
handling to create a seamless integration experience.
The CustomIVInvokeRestAPI SDF service utility is provided by the application.
This service uses the same properties for tenant credentials as that of OMS-SIV integration and
takes care of authentication.
Token management for CustomIVInvokeRestAPI
The CustomIVInvokeRestAPI SDF utility service automatically manages the access
token, including generating a new token, renewing the token, and invalidating and resetting the
token cache. It regenerates a new token within a few minutes before a token expires. Upon refresh,
the token is internally stored in the cache and the application reuses the token while it is still
valid. If you restart the application, a new token is issued and the previous token is invalidated.
The total token that is managed by the service might equate to the number of server instances that
are running on Sterling Order Management System.
CustomIVInvokeRestAPI SDF utility
service automatically flushes the token and requests a new token. Under rare occasion due to excess
token request, the utility might receive an HTTP 429 TOO MANY REQUEST error. You can
find such error messages in the log file.Following is a sample response message in
case of response code - 400 bad request. {
"error_message": "Number of actions in input (310) is greater than the tenant limit of 100."
}- Sample input format
-
<InventoryVisibilityAPI Content-Type="application/json" HTTPMethod="<http_method>" URL="<URL To SIV REST Api>"> <Input> <json_input_to_the_iv_api> </Input> </InventoryVisibilityAPI> - Example
-
<InventoryVisibilityAPI Content-Type="application/json" HTTPMethod="POST" URL="https://<Host Name>/inventory/<tenant_id>/v1/availability/node/"> <Input> {"considerSafetyStock":true,"lines":[{"itemId":"ITEM_001","shipNodes":["NODE_001","NODE_002"],"productClass":"GOOD","unitOfMeasure":"EACH","deliveryMethod":"SHP","lineId":"id1"}],"demandType":"OPEN_ORDER"} </Input> </InventoryVisibilityAPI>