The Newbridge API allows you to retrieve stock-related data grouped by product and summarised by quantity. This is useful for generating reports on deliveries, stocktakes, transfers, and other inventory activities.
This feature is especially useful for creating custom reports and dashboards hosted on external portals or sites outside of Newbridge POS.
Before you begin
Before you begin, ensure you have:
Requested API activation from a Newbridge support representative.
Received your company-specific API Key and Secret.
The specific date and transaction type you want to query.
Request
Headers
GET REQUEST (/api/app/json/stock/{date}/{type})
Header: Content-Type - application/json
Header: Accepts - application/json
Header: key - "XXXXXXXXX" // app key provided by newbridge
Header: token - "XXXXXX-XXXX-XXXXX" // token obtained from the auth endpoint
Date
The URI (Uniform Resource Locator) requires a date format, in either:
YYYY-MM-DD
or YYYY-MM-DD HH:MM:SS
Type
1 = Transaction or sale.
2 = Order or delivery.
3 = Stocktake.
4 = Transfer or adjustment.
5 = Wastage.
6 = Spotcheck or mini stocktake.
Response Body
The response groups the result by product and does a sum of the quantity ordered, as shown below:
Response
[
{
"summary_type": 2,
"total_qty": "5.00",
"product_id": 109693,
"updated_at": "2022-05-04 16:52:15",
"type_text": "Delivery",
"product": {
"id": 109693,
"displayname": "Jamaica Inn Luxury Mixed Nuts 250G",
"guid": "aa41d376-b0c8-470c-ac81-856111233100",
"gross_profit": "100%",
"is_wasteable": false,
"is_modifier_text": "Product"
}
},
{
"summary_type": 2,
"total_qty": "6.00",
"product_id": 109698,
"updated_at": "2022-05-04 16:52:15",
"type_text": "Delivery",
"product": {
"id": 109698,
"displayname": "Jamaica Inn Mixed Fruit and Nuts 250g",
"guid": "d1ea6b28-5377-4754-9916-06d5f9ac4b15",
"gross_profit": "100%",
"is_wasteable": false,
"is_modifier_text": "Product"
}
}
]
