Calling API for Getting Item Details
Calls to the /app.php/api/inventory/item
endpoint must be authorized. Before making a request, make sure you have received the authorization token. For more information, see Getting API Authorization Data.
- Authorizing in the Inventory Level API
- Getting the Item Price and Stock Quantity Data
- Endpoint description
- Parameters
- Response
- Errors
Authorizing in the Inventory Level API
To get authorized in the Inventory Level API:
- Go to the Inventory Level API:
https://api-docs.petrosoft.cloud/?service=cso_inventory - Click the Authorize button.
- In the Available authorizations window, enter the authorization token. Take the value from the
access_token
parameter. For more information, see Getting the Authorization Token. - Click Authorize.
- Make sure all authorize icons are locked. It means that you have been successfully authorized in the API.
Getting the Item Price and Stock Quantity Data
To get the item price and stock quantity data:
- Go to the Inventory Level API:
https://api-docs.petrosoft.cloud/?service=cso_inventory - Use the
/app.php/api/intentory/item
endpoint. - Authorize your API request using the authorization token.
- Send the API request. Request parameters:
Parameter Description station_id
The station identifier. Can be taken from the Locations list. upc
The item UPC code. Can be taken from the Items list > GTIN field without leading zeros and last digit.
- Receive the API response. Response parameters:
Parameter Description upc
The item UPC code. retail
The item retail value. onhandQty
The item on hand quantity value.
Endpoint Description
The /app.php/api/intentory/item
endpoint is used for receiving the information about the item price and stock quantity and other item detailed data by the station ID and item UPC. In the Inventory Level API, it is located under the Items section:
Parameters
Parameter | Description |
station_id
|
The station identifier. Can be taken from the Locations list. |
upc
|
The item UPC code. Can be taken from the Items list > GTIN field without leading zeros and last digit. |
vendor_id
|
Optional. The vendor identifier. |
Response
Response Code
200
Response Parameters
Parameter | Description |
upc
|
Item UPC. |
name
|
Full item name. |
crName
|
Short item name used for CR reciepts. |
departmentId
|
Internal CSO department Id that item belongs to. |
departmentName
|
Full department name that item belongs to. |
image
|
Link to the item image if any was configured for item. |
lastUpdate
|
Date of last item information update (description, retail, etc.). |
manufacturerId
|
Internal CSO manufacturer Id for item. |
manufacturerName
|
Item manufacturer name. |
vendorId
|
Vendor Id for vendor that item was purchased from for the last time. |
vendorName
|
Vendor name that item was purchased from for the last time. |
categoryId
|
Internal CSO category Id that item belongs to. |
categoryName
|
Full category name that item belongs to. |
size
|
Item size as configured in PB. |
isBestSeller
|
Flag indicating if item is a best seller, possible values: 0 – not a bestseller 1 – best seller |
retail
|
Current item retail. |
categoryGPMRangeFrom
|
Low GPM border for item category. |
categoryGPMRangeTo
|
High GPM border for item category. |
minStockQty
|
Minimum stock level that should be maintained for item. |
onhandQty
|
Current calculated stock level for item calculated based on sales and purchases. |
onhandDate
|
Date and time for onhand qty last calculation. |
negotiatedCost
|
Item negotiated cost. |
childs
|
Array of child items linked with current one. |
parents
|
Array of parent items linked with current one. |
vins
|
Array of vendor identification numbers configured for item. |
primaryVendorId
|
Id of Primary vendor for this item. |
Response Example
{
"data": [
{
"upc": "10000000008",
"name": "Red Bull Energy",
"crName": "Red Bull Energy",
"departmentId": "21",
"departmentName": "Carbonated S.D.",
"categoryId": "21",
"categoryName": "Carbonated Soft Drinks",
"manufacturerId": "12601",
"manufacturerName": "Coca-Cola Bottling Company of Northern New England, Inc.",
"vendorId": null,
"vendorName": null,
"lastUpdate": "2022-05-15 10:21:14",
"size": ".50",
"isBestSeller": 0,
"retail": "0.00",
"categoryGPMRangeFrom": null,
"categoryGPMRangeTo": null,
"minStockQty": "0",
"onhandQty": -9,
"onhandDate": "2022-03-04 12:00:00",
"minStockChildQty": 0,
"childInParentQty": 0,
"onhandChildQty": 0,
"negotiatedCost": null,
"image": "",
"childs": [],
"parents": [],
"vins": [
{
"vin": "29990000001",
"uic": "1",
"unitCost": null,
"caseCost": null,
"negotiatedCost": null,
"suggestedRetail": null,
"vendorName": "Coca-Cola",
"vendorId": "6",
"lastPurchaseDate": null
},
{
"vin": "A3F4",
"uic": "5",
"unitCost": "0.000000",
"caseCost": "0.000000",
"negotiatedCost": "0.9900",
"suggestedRetail": "0.00",
"vendorName": "Coca-Cola",
"vendorId": "6",
"lastPurchaseDate": null
},
{
"vin": "29990000001",
"uic": "1",
"unitCost": null,
"caseCost": null,
"negotiatedCost": null,
"suggestedRetail": null,
"vendorName": "Charlie Test",
"vendorId": "79109",
"lastPurchaseDate": null
},
{
"vin": "29990000001",
"uic": "1",
"unitCost": "0.000000",
"caseCost": "0.000000",
"negotiatedCost": "0.0000",
"suggestedRetail": "0.00",
"vendorName": "24",
"vendorId": "79716",
"lastPurchaseDate": null
}
],
"primaryVendorId": null
}
],
"status": true,
"success": true,
"message": ""
}
Errors
401: Unauthorized
401 Error Parameters
Parameter | Description |
status
|
API request success status indicator. |
success
|
API request status details. |
message
|
Details for failure reason. |
401 Error Example
{
"data": [],
"status": false,
"success": false,
"message": "Access token is missing or invalid"
}
403: Forbidden
403 Error Parameters
Parameter | Description |
message
|
Details for failure reason. |
403 Error Example
{
"message": "Access Denied."
}
500: Internal Server Error
500 Error Parameters
Parameter | Description |
success
|
API request success status indicator. |
data
|
N/A. |
message
|
Details for failure reason. |
http_code
|
Error code. |