Add stock order /orders/addStock

This endpoint allows a stock order to be submitted to Rx-Universe from another system.

The endpoint is described in swagger; the initial release allows specifying all of the core information required for a stock order. Currently the endpoint is limited to 10 line items, this can be increased as the need arrises.

 

The input is shown below, and the options are more fully described in the Model section of this endpoint in Swagger. Following this full description are some sample inputs of different types of jobs:
{

"customer": "string",

"patient": "string",

"job": "string",

"jobType": "string",

"tray": "string",

"shipToName": "string",

"shipToAddress1": "string",

"shipToAddress2": "string",

"shipToAddress3": "string",

"shipToAddress4": "string",

"shipToPostalCode": "string",

"item1": "string",

"quantity1": 0,

""item2": "string",

"quantity2": 0,

""item3": "string",

"quantity3": 0,

""item4": "string",

"quantity4": 0,

""item5": "string",

"quantity5": 0,

""item6": "string",

"quantity6": 0,

""item7": "string",

"quantity7": 0,

""item8": "string",

"quantity8": 0,

""item9": "string",

"quantity9": 0,

""item10": "string",

"quantity10": 0,

"REM": ”string”

}

 

Notes

Note that items lines not required for a stock order need not be sent.

The items values must be one of the following

  • for lenses - the OPC code

  • for frames - either the UPC code of the frame Id from frame inventory

If a stock order is successfully received (there are no validation issues), an order number is assigned and returned to the calling program along with the result :
{ "orderNumber": "102345", “result”: “successful” }

If a stock order fails validation for any reason, an appropriate error message is returned; for example, if an item has no pricing associated with it, an error will be returned:
{ "error": "item 560040000111 pricing not found”}

 

 

Sample Order

{
"customer": "1",
"patient": "API 20210607-1",
"job": "API 20210607-1",
"shipToName": "SHIP PLACE",
"shipToAddress1": "123 SHIP AVE",
"shipToAddress2": "SUITE 100",
"shipToAddress3": "SHIPSVILLE",
"shipToAddress4": "ON",
"shipToPostalCode": "123 456",
"item1": "560040000111",
"quantity1": 3,
"item2”: "5658886964",
"quantity2": 6,
"item3": “0023482516”,
"quantity3": 10,
"REM”: “stock API order for testing”,
}