HirePOS API - Availability

The Availability endpoint allows developers to submit a date range and an array of items to retrieve the Quantity Available for each item within the given date range.

GET

GET https://api.hirepos.com/Availability

Headers

Attribute Name

Allowed Values

Example Value

AuthKey

Unique API Key

42cebc4f-0c85-47c3-bdae-66c81ca8fe0c

AuthSecret

Unique API Secret

951e7bdb-ff69-4a98-afe9-1b52203354c1

OR

StoreKey

Unique Store Key

a75d6480-8b57-4d02-a627-342721bd7b3

Request Body (raw JSON)

Attribute Name

Allowed Values

Example Value

DateFrom

Date/time value (in local time)

OR

Serialised date/time format

8/07/2021 9:00 am

OR

2021-07-08T09:00

DateTo

Date/time value (in local time)

OR

Serialised date/time format

10/07/2021 4:00 pm

OR

2021-07-10T16:00

Items

An array of any of the following item identifiers

WebsiteCode

H

OR

Code

H1

OR

GroupCode

H

Example Request

The request consists of the date range, and the array of item identifiers, which are checked in order of WebsiteCode, Code, GroupCode. You can choose to submit any of these item identifiers.

{
"DateFrom":"8/07/2021 9:00 am",
"DateTo":"10/07/2021 4:00 pm",
"Items":[
{
"WebsiteCode":"H1"
},
{
"WebsiteCode":"H2"
}
]
}

Response

Additional values are returned, however the only values you should be concerned with are the ErrorRaised, (Code, GroupCode or WebsiteCode), QtyAvailable values. Check the QtyAvailable for the items is sufficient for the quantity required in the desired date range.

{
"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
}
]
}

Errors

Errors may be returned at either the top level in the response JSON or at the item level. You need to test whether the ErrorRaised attribute is returned as "True", and action accordingly.

Top Level Errors

Error Message

What it Means

What To Do

400 Bad Request

There could be any number of reasons for this error. A poorly formatted request, or invalid authorisation keys are the most common causes.

Check your authorisation keys are correct.

Item Level Errors

Error Message

What it Means

What To Do

No items are available within the date range provided.

Quantity available returned zero for the date range provided.

Relay the availability results appropriately in your app or website.

No active items with this Item Code and a Qty For Hire exist.

The item code submitted does not match one of the item identifiers in the HirePOS item setup.

Crosscheck the codes in your app or website with the codes in the HirePOS item setup.


Did this help?


Powered by HelpDocs (opens in a new tab)