HirePOS API - WebsiteBookings

The WebsiteBookings endpoint allows developers to submit bookings from third-party Online Stores to HirePOS, which are then accepted or declined via the HirePOS app.

POST

POST https://api.hirepos.com/WebsiteBookings

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

Request Body (raw JSON)

Attribute Name

Allowed Values

Example Value

BookingDate

Required

Date/time value (in local time)

OR

Serialised date/time format

Date booking was made

8/07/2021 9:00 am

OR

2021-07-08T09:00

EstDateFrom

Required

Date/time value (in local time)

OR

Serialised date/time format

Book from date

10/07/2021 10:00 pm

OR

2021-07-10T10:00

EstDateTo

Required

Date/time value (in local time)

OR

Serialised date/time format

Book to date

12/07/2021 4:00 pm

OR

2021-07-12T16:00

EventDate

Date/time value (in local time)

OR

Serialised date/time format

12/07/2021 4:00 pm

OR

2021-07-12T16:00

BranchCode

Alphanumeric value up to 15 characters length

Match a Branch Code in Setup > Branches

Company

Company OR First/Last Name Required

Alphanumeric value up to 50 characters length

AnyDay Hire

FirstName

Company OR First/Last Name Required

Alphanumeric value up to 50 characters length

John

LastName

Company OR First/Last Name Required

Alphanumeric value up to 50 characters length

Smith

AddressLine1

ALL other attributes below are Optional

Alphanumeric value up to 50 characters length

1 Any Street

AddressLine2

Alphanumeric value up to 50 characters length

City

Alphanumeric value up to 40 characters length

Cairns

State

Alphanumeric value up to 30 characters length

QLD

Postcode

Alphanumeric value up to 10 characters length

4870

Country

Alphanumeric value up to 50 characters length

Australia

Phone1

Alphanumeric value up to 20 characters length

(07) 1000 0000

Phone2

Alphanumeric value up to 20 characters length

Phone3

Alphanumeric value up to 20 characters length

Email

Alphanumeric value up to 255 characters length

hirepos@hirepos.com.au

DeliveryAddressLine1

Alphanumeric value up to 50 characters length

10 Somewhere

DeliveryAddressLine2

Alphanumeric value up to 50 characters length

DeliveryCity

Alphanumeric value up to 40 characters length

Cairns

DeliveryState

Alphanumeric value up to 30 characters length

QLD

Reference

Alphanumeric value up to 50 characters length

InvoiceCategoryName

Alphanumeric value up to 50 characters length

Match a Category in Setup > Invoice Categories

Message

Memo field

Comments

Memo field

Pick up from airport.

Items

Array of items

CustomField1

Alphanumeric value up to 100 characters length

CustomField2

Alphanumeric value up to 100 characters length

CustomField3

Alphanumeric value up to 100 characters length

CustomField4

Alphanumeric value up to 100 characters length

CustomField5

Alphanumeric value up to 100 characters length

CustomField6

Alphanumeric value up to 100 characters length

CustomField7

Alphanumeric value up to 100 characters length

CustomField8

Alphanumeric value up to 100 characters length

Example Request

The POST consists of the date booking was made, the booking date range, the customer details, and the array of item identifiers (i.e. the Website Code) and Quantity required for each item.

{
"BookingDate": "1/01/2021",
"EstDateFrom": "1/02/2021 8:00 am",
"EstDateTo": "1/03/2021 4:00 pm",
"EventDate": "10/02/2021 6:00 pm",
"Company": "AnyDay Hire",
"FirstName": "John",
"LastName": "Smith",
"AddressLine1": "1 Any Street",
"AddressLine2": "",
"City": "Cairns",
"State": "QLD",
"Postcode": "4870",
"Country": "Australia",
"Phone1": "(07) 1000 0000",
"Phone2": "",
"Phone3": "",
"Fax": "",
"Email": "",
"DeliveryAddressLine1": "10 Somewhere",
"DeliveryAddressLine2": "",
"DeliveryCity": "Cairns",
"DeliveryState": "QLD",
"Reference": "Holiday Special",
"InvoiceCategoryName": "Baby Equipment Hire",
"Message": "Thank you for your business.",
"Comments": "Call on arrival.",
"Items": [{"Code": "1000", "Quantity": 7}, {"Code": "2000", "Quantity": 3}],
"CustomField1": "Pick up from airport.",
"CustomField2": "",
"CustomField3": "",
"CustomField4": "",
"CustomField5": "",
"CustomField6": "",
"CustomField7": "",
"CustomField8": ""
}

Response

Note the Id attribute returned in the response JSON, which can be used with a GET to retrieve the booking details at a later stage if required.

{
"ErrorRaised": "False",
"ErrorType": null,
"ErrorMessage": null,
"Bookings": [
{
"Id": "545",
"BookingDate": "1/01/2021",
"EstDateFrom": "1/02/2021 8:00 am",
"EstDateTo": "1/03/2021 4:00 pm",
"EventDate": "10/02/2021 6:00 pm",
"Company": "AnyDay Hire",
"FirstName": "John",
"LastName": "Smith",
"AddressLine1": "1 Any Street",
"AddressLine2": "",
"City": "Cairns",
"State": "QLD",
"Postcode": "4870",
"Country": "Australia",
"Phone1": "(07) 1000 0000",
"Phone2": "",
"Phone3": "",
"Email": "",
"DeliveryAddressLine1": "10 Somewhere",
"DeliveryAddressLine2": "",
"DeliveryCity": "Cairns",
"DeliveryState": "QLD",
"Reference": "Holiday Special",
"InvoiceCategoryName": "Baby Equipment Hire",
"Message": "Thank you for your business.",
"Comments": "Call on arrival.",
"CustomField1": "Pick up from airport.",
"CustomField2": "",
"CustomField3": "",
"CustomField4": "",
"CustomField5": "",
"CustomField6": "",
"CustomField7": "",
"CustomField8": "",
"Items": [
{
"Code": "1000",
"Quantity": 7
},
{
"Code": "2000",
"Quantity": 3
}]
}

GET

Use the GET verb with the Id parameter to retrieve the details of a previously submitted booking.

GET https://api.hirepos.com/WebsiteBookings?Id=545

Errors

Errors may be returned in the response JSON. 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.


Did this help?


Powered by HelpDocs (opens in a new tab)