AgencyUSB-ARI API
Modified on: 2024-07-08 17:55
Introduction
ARI API is used by DerbySoft to sync ARI from the supplier and publish it to distributors automatically. DerbySoft does support two ways to sync ARI: With CDS API - DerbySoft does get ARI changes by calling CDS API with a regular schedule and then getting ARI to change details accordingly; Without CDS API - DerbySoft will get ARI details on a regular schedule.
In this article, 3 types of ARI API will be interpreted in detail:
APIs marked with "☆" are mandatory to implement, while those marked with "◎" are optional but recommended.
- ☆ Daily ARI (/ari/daily/details) - Get daily ARI of one hotel to one distributor(It's an optional API if hotel supplier supports LOS ARI Only).
- ☆ LOS ARI (/ari/los/details) - Get LOS ARI of one hotel to one distributor(It's an optional API if hotel supplier supports Daily ARI Only).
- ◎ CDS (/ari/changes) - Change Discovery Service to detect changes by one hotel to one distributor.
TABLE OF CONTENTS
Daily ARI
This is an API for DerbySoft to call the Supplier's system to get the daily ARI of one hotel by date range.
POST /ari/daily/details HTTP/1.1 URL: {{endpoint}}/ari/daily/details Authorization: 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc Accept-Encoding: gzip Content-Encoding: gzip Content-Type: application/json;charset=utf-8
Request Example
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "hotelId": "100001", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" } }
Request Specification
Attribute | Type | Required | Description | Example |
---|---|---|---|---|
header | object | Yes | / | / |
@sourceId | string | Yes | maxLength: 32 id of hotel's source in DerbySoft's system | HHBIJSOPLS |
@distributorId | string | Yes | maxLength: 32 id of distributor in DerbySoft's system | GTA |
@version | string | Yes | maxLength: 20 version of API | v4 |
@token | string | Yes | maxLength: 64 A unique id to identify request and response, normally it should be UUID. | 18393849028490234 |
hotelId | string | Yes | / | 100001 |
dateRange | object | / | / | / |
@startDate | string | Yes | start date of date range, format with yyyy-MM-dd | 2018-01-01 |
@endDate | string | Yes | end date of date range, format with yyyy-MM-dd | 2018-01-04 |
Response Example
- Common Rate Success Response (HTTP Status 200)
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "hotelId": "100001", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "currency": "USD", "dailyAris": [ { "roomId": "10000101", "rateId": "123456", "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "type": "CommonRate", "amountAfterTax": [ 623.23, 623.23, 623.23, 623.23 ] }, "availStatuses": { "close": [ false, false, false, false ], "minStayArrival": [ 0, 2, 0, 0 ], "maxStayArrival": [ 0, 2, 0, 0 ], "minStayThrough": [ 0, 2, 0, 0 ], "maxStayThrough": [ 0, 2, 0, 0 ], "minAdvanceDay": [ 0, 2, 0, 0 ], "maxAdvanceDay": [ 365, 365, 365, 365 ], "cta": [ false, false, false, true ], "ctd": [ false, false, false, true ], "fplos": [ "1111111", "1001111", "1000001", "0000000" ] }, "rateChangeIndicators": [ true, false, true, false ], "extensions": { "key": "value" } } ] }
- Occupancy Rate Success Response (HTTP Status 200)
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "hotelId": "100001", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "currency": "USD", "dailyAris": [ { "roomId": "10000101", "rateId": "123456", "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "type": "OccupancyRate", "rates": [ { "adultCount": 2, "childCount": 1, "amountBeforeTax": [ 502.19, 502.19, 502.19, 502.19 ], "amountAfterTax": [ 623.23, 623.23, 623.23, 623.23 ] } ] }, "availStatuses": { "close": [ false, false, false, false ], "minStayArrival": [ 0, 2, 0, 0 ], "maxStayArrival": [ 0, 2, 0, 0 ], "minStayThrough": [ 0, 2, 0, 0 ], "maxStayThrough": [ 0, 2, 0, 0 ], "minAdvanceDay": [ 0, 2, 0, 0 ], "maxAdvanceDay": [ 365, 365, 365, 365 ], "cta": [ false, false, false, true ], "ctd": [ false, false, false, true ], "fplos": [ "1111111", "1001111", "1000001", "0000000" ] }, "rateChangeIndicators": [ true, false, true, false ], "extensions": { "key": "value" } } ] }
- Occupancy Rate with Child Pricing based on age bands Success Response (HTTP Status 200)
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "hotelId": "100001", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "currency": "USD", "dailyAris": [ { "roomId": "10000101", "rateId": "123456", "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "extraChildRates": [ { "amountAfterTax": [ 50.00, 50.00, 50.00, 50.00 ], "amountBeforeTax": [ 40.00, 40.00, 40.00, 40.00 ], "maxAge": "2", "minAge": "0" }, { "amountAfterTax": [ 60.00, 60.00, 60.00, 60.00 ], "amountBeforeTax": [ 50.00, 50.00, 50.00, 50.00 ], "maxAge": "8", "minAge": "3" }, { "amountAfterTax": [ 70.00, 70.00, 70.00, 70.00 ], "amountBeforeTax": [ 60.00, 60.00, 60.00, 60.00 ], "maxAge": "17", "minAge": "9" } ], "type": "OccupancyRate", "rates": [ { "adultCount": 1, "amountBeforeTax": [ 180.00, 180.00, 180.00, 180.00 ], "amountAfterTax": [ 198.00, 198.00, 198.00, 198.00 ] }, { "adultCount": 2, "amountBeforeTax": [ 200.00, 200.00, 200.00, 200.00 ], "amountAfterTax": [ 220.00, 220.00, 220.00, 220.00 ] } ] }, "availStatuses": { "close": [ false, false, false, false ], "minStayArrival": [ 0, 2, 0, 0 ], "maxStayArrival": [ 0, 2, 0, 0 ], "minStayThrough": [ 0, 2, 0, 0 ], "maxStayThrough": [ 0, 2, 0, 0 ], "minAdvanceDay": [ 0, 2, 0, 0 ], "maxAdvanceDay": [ 365, 365, 365, 365 ], "cta": [ false, false, false, true ], "ctd": [ false, false, false, true ], "fplos": [ "1111111", "1001111", "1000001", "0000000" ] }, "rateChangeIndicators": [ true, false, true, false ], "extensions": { "key": "value" } } ] }
- Error Response (HTTP Status 500)
{ "errorCode": "InvalidField", "errorMessage": "Invalid Message" }
Response Specification
Attribute | Type | Required | Description | Example |
---|---|---|---|---|
header | object | Yes | / | / |
@sourceId | string | Yes | maxLength: 32 id of hotel's source in DerbySoft's system | HHBIJSOPLS |
@distributorId | string | Yes | maxLength: 32 id of distributor in DerbySoft's system | GTA |
@version | string | Yes | maxLength: 20 version of API | v4 |
@token | string | Yes | maxLength: 64 A unique id to identify request and response, normally it should be UUID. | 18393849028490234 |
hotelId | string | Yes | / | 100001 |
dateRange | object |
| / | / |
@startDate | string | Yes | start date of date range, format with yyyy-MM-dd | 2018-01-01 |
@endDate | string | Yes | end date of date range, format with yyyy-MM-dd | 2018-01-04 |
currency | string | Yes | currency code[ISO-4217] | USD |
dailyAris | array | Yes | daily rate & inventory within the date range | / |
@roomId | string | Yes | room id in supplier's system | 10000101 |
@rateId | string | Yes | rate id in supplier's system | 123456 |
@mealPlans | array[string] | No | meal plan of each date | [ "BB", "BB", "BB", "BB" ] |
@inventories | array[integer] | Yes | room inventory of each date | [ 9, 0, 9, 9 ] |
dailyAris / rates | / | Yes | / | / |
@type | enum | Yes | Enum: [ OccupancyRate, CommonRate ] Indicates which rate model to use: OccupancyRate or CommonRate., | / |
rates / rates | array[object] | Yes | The node disappears if it’s the Common Rate Model. | / |
@adultCount | integer | No | / | / |
@childCount | integer | No | / | / |
@amountBeforeTax | array[number] | No | / | [ 502.19, 502.19, 502.19, 502.19 ] |
@amountAfterTax | array[number] | No | / | [ 623.23, 623.23, 623.23, 623.23 ] |
availStatuses | / | / | / | / |
@close | array[boolean] | Yes | close or not for each date. | [ false, false, false, false ] |
@minStayArrival | array[integer] | No | Minimal length of stay based on checkin for each date, zero means no restriction. | [ 0, 2, 0, 0 ] |
@maxStayArrival | array[integer] | No | Maximal length of stay based on checkin for each date, zero means no restriction. | [ 0, 2, 0, 0 ] |
@minStayThrough | array[integer] | No | Minimal length of stay based on a date through for each date, zero means no restriction. | [ 0, 2, 0, 0 ] |
@maxStayThrough | array[integer] | No | The maximum length of stay based on a date through for each date, zero means no restriction. | [ 0, 2, 0, 0 ] |
@minAdvanceDay | array[integer] | No | Minimal days to book in advance for each date, zero means no restriction. | [ 0, 2, 0, 0 ] |
@maxAdvanceDay | array[integer] | No | Maximum days to book in advance for each date, zero means no restriction. | [ 365, 365, 365, 365 ] |
@cta | array[boolean] | No | close to arrival for each date | [ false, false, false, true ] |
@ctd | array[boolean] | No | close to departure for each date | [ false, false, false, true ] |
@fplos | array[string] | No | Full pattern length of stay to indicate if the stay is available. | [ "1111111", "1001111", "1000001", "0000000" ] |
rateChangeIndicators | array[boolean] | No | rate change indicator of each date. for more information refer to: Rate Change Indicators | [ true, false, true, false ] |
extensions | object | No | a common extension object for extra attributes like account, extra setting required by a distributor, etc | / |
LOS ARI
This is an API for DerbySoft to call the Supplier's system to get LOS ARI of one hotel by date range.
Notes: ① Full length of stay ARI for each date should be included in the response. Any missing ARI of the length of stay CANNOT be pushed out to the distributor. ② If no rate in the supplier's system, it's recommended to set both of rate and inventory to zero. ③ The meal plan is an optional field, as some distributors get this offline instead of through the API.
POST /ari/los/details HTTP/1.1 URL: {{endpoint}}/ari/los/details Authorization: 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc Accept-Encoding: gzip Content-Encoding: gzip Content-Type: application/json;charset=utf-8
Request Example
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "hotelId": "100001", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" } }
Request Specification
Attribute | Type | Required | Description | Example |
---|---|---|---|---|
header | object | Yes | / | / |
@sourceId | string | Yes | maxLength: 32 id of hotel's source in DerbySoft's system | HHBIJSOPLS |
@distributorId | string | Yes | maxLength: 32 id of distributor in DerbySoft's system | GTA |
@version | string | Yes | maxLength: 20 version of API | v4 |
@token | string | Yes | maxLength: 64 A unique id to identify request and response, normally it should be UUID. | 18393849028490234 |
hotelId | string | Yes | / | 100001 |
dateRange | object | / | / | / |
@startDate | string | Yes | start date of date range, format with yyyy-MM-dd | 2018-01-01 |
@endDate | string | Yes | end date of date range, format with yyyy-MM-dd | 2018-01-04 |
Response Example
- Common Rate Success Response (HTTP Status 200)
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "hotelId": "100001", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "currency": "USD", "losAris": [ { "roomId": "10000101", "rateId": "123456", "los": 1, "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "type": "CommonRate", "amountAfterTax": [ 623.23, 623.23, 623.23, 623.23 ] }, "extensions": { "key": "value" } }, { "roomId": "10000101", "rateId": "123456", "los": 2, "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "type": "CommonRate", "amountBeforeTax": [ 1004.38, 1004.38, 1004.38, 1004.38 ] }, "extensions": { "key": "value" } } ] }
- Occupancy Rate Success Response (HTTP Status 200)
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "hotelId": "100001", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "currency": "USD", "losAris": [ { "roomId": "10000101", "rateId": "123456", "los": 1, "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "type": "OccupancyRate", "rates": [ { "adultCount": 2, "childCount": 1, "amountBeforeTax": [ 502.19, 502.19, 502.19, 502.19 ], "amountAfterTax": [ 623.23, 623.23, 623.23, 623.23 ] } ] }, "extensions": { "key": "value" } }, { "roomId": "10000101", "rateId": "123456", "los": 2, "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "type": "OccupancyRate", "rates": [ { "adultCount": 2, "childCount": 1, "amountBeforeTax": [ 1004.38, 1004.38, 1004.38, 1004.38 ], "amountAfterTax": [ 1246.46, 1246.46, 1246.46, 1246.46 ] } ] }, "extensions": { "key": "value" } } ] }
- Occupancy Rate with Child Pricing based on age bands Success Response (HTTP Status 200)
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "hotelId": "100001", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "currency": "USD", "losAris": [ { "roomId": "10000101", "rateId": "123456", "los": 1, "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "extraChildRates": [ { "amountAfterTax": [ 50.00, 50.00, 50.00, 50.00 ], "amountBeforeTax": [ 40.00, 40.00, 40.00, 40.00 ], "maxAge": "2", "minAge": "0" }, { "amountAfterTax": [ 60.00, 60.00, 60.00, 60.00 ], "amountBeforeTax": [ 50.00, 50.00, 50.00, 50.00 ], "maxAge": "8", "minAge": "3" }, { "amountAfterTax": [ 70.00, 70.00, 70.00, 70.00 ], "amountBeforeTax": [ 60.00, 60.00, 60.00, 60.00 ], "maxAge": "17", "minAge": "9" } ], "type": "OccupancyRate", "rates": [ { "adultCount": 1, "amountBeforeTax": [ 180.00, 180.00, 180.00, 180.00 ], "amountAfterTax": [ 198.00, 198.00, 198.00, 198.00 ] }, { "adultCount": 2, "amountBeforeTax": [ 200.00, 200.00, 200.00, 200.00 ], "amountAfterTax": [ 220.00, 220.00, 220.00, 220.00 ] } ] }, "extensions": { "key": "value" } }, { "roomId": "10000101", "rateId": "123456", "los": 2, "mealPlans": [ "BB", "BB", "BB", "BB" ], "inventories": [ 9, 0, 9, 9 ], "rates": { "extraChildRates": [ { "amountAfterTax": [ 50.00, 50.00, 50.00, 50.00 ], "amountBeforeTax": [ 40.00, 40.00, 40.00, 40.00 ], "maxAge": "2", "minAge": "0" }, { "amountAfterTax": [ 60.00, 60.00, 60.00, 60.00 ], "amountBeforeTax": [ 50.00, 50.00, 50.00, 50.00 ], "maxAge": "8", "minAge": "3" }, { "amountAfterTax": [ 70.00, 70.00, 70.00, 70.00 ], "amountBeforeTax": [ 60.00, 60.00, 60.00, 60.00 ], "maxAge": "17", "minAge": "9" } ], "type": "OccupancyRate", "rates": [ { "adultCount": 1, "amountBeforeTax": [ 360.00, 360.00, 360.00, 360.00 ], "amountAfterTax": [ 396.00, 396.00, 396.00, 396.00 ] }, { "adultCount": 2, "amountBeforeTax": [ 400.00, 400.00, 400.00, 400.00 ], "amountAfterTax": [ 440.00, 440.00, 440.00, 440.00 ] } ] }, "extensions": { "key": "value" } } ] }
- Error Response (HTTP Status 500)
{ "errorCode": "InvalidField", "errorMessage": "Invalid Message" }
Response Specification
Attribute | Type | Required | Description | Example |
---|---|---|---|---|
header | object | Yes | / | / |
@sourceId | string | Yes | maxLength: 32 id of hotel's source in DerbySoft's system | HHBIJSOPLS |
@distributorId | string | Yes | maxLength: 32 id of distributor in DerbySoft's system | GTA |
@version | string | Yes | maxLength: 20 version of API | v4 |
@token | string | Yes | maxLength: 64 A unique id to identify request and response, normally it should be UUID. | 18393849028490234 |
hotelId | string | Yes | / | 100001 |
dateRange | object |
| / | / |
@startDate | string | Yes | start date of date range, format with yyyy-MM-dd | 2018-01-01 |
@endDate | string | Yes | end date of date range, format with yyyy-MM-dd | 2018-01-04 |
currency | string | Yes | currency code[ISO-4217] | USD |
losAris | array | Yes | Full length of stay ARI for each date should ALL be included in the response. Any missing ARI of the length of stay CANNOT be pushed out to the distributor. If no rate in the supplier's system, it's recommended to set both rate and inventory to zero. The meal plan is an optional field, as some distributors get this offline instead of through the API. | / |
@roomId | string | Yes | room id in supplier's system | 10000101 |
@rateId | string | Yes | rate id in supplier's system | 123456 |
@los | integer | Yes | length of stay | 1 |
@mealPlans | array[string] | No | meal plan of each date | [ "BB", "BB", "BB", "BB" ] |
@inventories | array[integer] | Yes | room inventory of each date | [ 9, 0, 9, 9 ] |
losAris / rates | / | Yes | / | / |
@type | enum | Yes | Enum: [ OccupancyRate, CommonRate ] indicates which rate model be used: OccupancyRate or CommonRate | / |
rates / rates | array[object] | Yes | The node disappears if it’s the Common Rate Model. | / |
@adultCount | integer | No | / | / |
@childCount | integer | No | / | / |
@amountBeforeTax | array[number] | No | / | [ 502.19, 502.19, 502.19, 502.19 ] |
@amountAfterTax | array[number] | No | / | [ 623.23, 623.23, 623.23, 623.23 ] |
rates / extraChildRates | object | No | Extra child rate is only used with occupancy rate, max child age must be provided for available hotel product. | / |
@minAge | integer | Yes | Minimal child age is greater than or equal to zero. | 0 |
@maxAge | integer | Yes | Maximum child age is less than or equal to maxChildAge. | 2 |
@amountBeforeTax | array[number] | No | / | [ 40, 40 ] |
@amountAfterTax | array[number] | No | / | [ 40, 40 ] |
extensions | object | No | a common extension object for extra attributes like account, extra setting required by a distributor, etc | / |
CDS
This is an API for DerbySoft to call the Supplier's system to get daily ARI changes for one hotel. It's an optional function, but it is recommended for the Supplier's system to implement.
POST /ari/changes HTTP/1.1 URL: {{endpoint}}/ari/changes Authorization: 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc Accept-Encoding: gzip Content-Encoding: gzip Content-Type: application/json;charset=utf-8
Request Example
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "timestamp": "2017-07-21T17:32:28.000Z", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "hotelIds": [ "100001", "100002", "100003" ] }
Request Specification
Attribute | Type | Required | Description | Example |
---|---|---|---|---|
header | object | Yes | / | / |
@sourceId | string | Yes | MaxLength: 32 ID of hotel's source in DerbySoft's system. | HHBIJSOPLS |
@distributorId | string | Yes | MaxLength: 32 The ID of the distributor in DerbySoft's system. | GTA |
@version | string | Yes | MaxLength: 20 The version of API. | v4 |
@token | string | Yes | MaxLength: 64 A unique id to identify request and response, normally it should be UUID. | 18393849028490234 |
timestamp | string | Yes | Timestamp to request changes in UTC timezone. | 2017-07-21T17:32:28.000Z |
dateRange | object | / | / | / |
@startDate | string | Yes | Start date of date range, format with yyyy-MM-dd. | 2018-01-01 |
@endDate | string | Yes | End date of date range, format with yyyy-MM-dd. | 2018-01-04 |
hotelIds | array[string] | Yes | Hotel IDs in supplier's system | [ "100001", "100002", "100003" ] |
Response Example
- Success Response (HTTP Status 200)
{ "header": { "sourceId": "HHBIJSOPLS", "distributorId": "GTA", "version": "v4", "token": "18393849028490234" }, "timestamp": "2017-07-21T17:32:28.000Z", "dateRange": { "startDate": "2018-01-01", "endDate": "2018-01-04" }, "changes": { "100001": [ "2018-01-01", "2018-01-02" ], "100002": [ "2018-01-02" ] } }
- Error Response (HTTP Status 500)
{ "errorCode": "InvalidField", "errorMessage": "Invalid Message" }
Response Specification
Attribute | Type | Required | Description | Example |
---|---|---|---|---|
header | object | Yes | / | / |
@sourceId | string | Yes | MaxLength: 32 ID of hotel's source in DerbySoft's system | HHBIJSOPLS |
@distributorId | string | Yes | MaxLength: 32 ID of distributor in DerbySoft's system | GTA |
@version | string | Yes | MaxLength: 20 Version of API | v4 |
@token | string | Yes | maxLength: 64 A unique id to identify request and response, normally it should be UUID. | 18393849028490234 |
timestamp | string | Yes | Timestamp to request changes in UTC timezone | 2017-07-21T17:32:28.000Z |
dateRange | object |
|
|
|
@startDate | string | Yes | Start date of date range, format with yyyy-MM-dd | 2018-01-01 |
@endDate | string | Yes | End date of date range, format with yyyy-MM-dd | 2018-01-04 |
changes | object | Yes | Aate format: yyyy-MM-dd A changed date array by each hotel | 2018-01-01 |
Did you find it helpful? Yes No
Send feedback