api.hirepos.com/Availability
This document provides detailed information on how developers can utilize the Availability endpoint to retrieve the Quantity Available for items within a specified date range.
Overview
The Availability endpoint is a crucial feature that enables developers to access real-time information on the Quantity Available for specific items. By submitting a date range along with an array of items, developers can retrieve accurate data on the availability of each item within the specified timeframe.
Usage
To utilize the Availability endpoint effectively, developers need to submit a request containing the following parameters:
Date Range: Specify the start and end dates for the desired timeframe.
Items Array: Provide an array of items for which the Quantity Available needs to be retrieved.
HirePOS Setup
This endpoint will only work for Items that are active in the HirePOS online store.
Even if you are using an external online store, only items that are active in the online store will function with the /Availability and /WebsiteBookings endpoints.
To activate items in the HirePOS online store and give them a WebsiteCode, see the following guide: https://docs.hirepos.com/en/articles/3143105
Response
Upon submitting a request to the Availability endpoint, developers will receive a response containing the Quantity Available for each item within the specified date range. The response will be structured in a format that is easy to parse and integrate into the developer's application.
Example
Below is an example of how a request to the Availability endpoint may look:
GET https://api.hirepos.com/Availability
Headers:
AuthKey={YourAPIKey}
AuthSecret={YourAPISecret}
// Example Request...
{
"DateFrom":"8/07/2021 9:00 am",
"DateTo":"10/07/2021 4:00 pm",
"Items":[
{
"WebsiteCode":"H1"
},
{
"WebsiteCode":"H2"
}
]
}
// Example Response...
{
"ErrorRaised": "False",
"ErrorType": null,
"ErrorMessage": null,
"Items": [
{
"ItemID": "6877",
"IsHireItem": null,
"PackageID": "",
"Code": "H1",
"GroupCode": null,
"WebsiteCode": "H",
"QtyRequired": null,
"QtyAvailable": "1",
"ErrorRaised": "False",
"ErrorType": null,
"ErrorMessage": null
},
{
"ItemID": "6878",
"IsHireItem": null,
"PackageID": "",
"Code": "H2",
"GroupCode": null,
"WebsiteCode": "H",
"QtyRequired": null,
"QtyAvailable": "0",
"ErrorRaised": "False",
"ErrorType": null,
"ErrorMessage": null
}
]
}
Branches Module
If the Branches module is activated, you can include a BranchID in the JSON payload to check availability for a specific branch. To find the BranchID, go to Setup > Branches in HirePOS, click a branch to edit, and note the Branch_ID in the browser's address bar (e.g., Branch_ID=345) for use in your JSON request.
{
"DateFrom":"8/07/2021 9:00 am",
"DateTo":"10/07/2021 4:00 pm",
"BranchID":345,
"Items":[
{
"WebsiteCode":"H1"
},
{
"WebsiteCode":"H2"
}
]
}Conclusion
The Availability endpoint is a powerful tool that empowers developers to access real-time information on the Quantity Available for items within a specified date range. By leveraging this endpoint effectively, developers can enhance the functionality of their applications and provide users with up-to-date availability information.
