Book
修改于: 2025-09-01 13:49
TABLE OF CONTENTS
Book API
The Book API is used by distributors to reserve rooms in real time. Once a request is sent to the hotel supplier’s system, it processes the reservation and returns immediate confirmation of the booking. This API ensures that the reservation is secured, with the distributor receiving a real-time response, which helps in completing the booking process quickly and accurately. The Book API is a critical step in finalizing reservations, offering a seamless experience for both distributors and customers by providing instant confirmation from the hotel system.
Book Request Schema
Request(METHOD: POST) | |||||
---|---|---|---|---|---|
Level | Field Name | Data Type | Required | Description | Example |
1 | header | object | Y | / | / |
2 | @supplierId | string | Y | The ID of the hotel supplier in DerbySoft's system Max Length: 32 | HILTON |
2 | @distributorId | string | Y | The ID of the distributor in DerbySoft's system MaxLength: 32 | GTA |
2 | @version | string | Y | Max Length: 20 Version of API | v4 |
2 | @token | string | Y | Max Length: 64 A unique identifier is used for requests and responses, typically a UUID. Note that this is an echo token, not an access token. | 18393849028490234 |
1 | reservationIds |
| Y | / | / |
2 | @distributorResId | string | Y | Distributor's reservation ID. Distributors should keep the ID unique on their system to avoid any potential issues caused by duplicate reservation IDs. | C2084DFL0 |
1 | iata | string | N | IATA | / |
1 | hotelId | string | Y | Hotel IDs provided by hotel suppliers, only the following characters are allowed. 1. Digits (0-9) 2. Uppercase letters (A-Z) 3. Hyphen ('-') | 100001 GATHI 00016 PEP-B3T2 B8W7 |
1 | stayRange | object | Y | / | / |
2 | @checkin | string | Y | Check in date expressed YYYY-MM-DD | 2028-01-01 |
2 | @checkout | string | Y | Check out date expressed YYYY-MM-DD | 2028-01-04 |
1 | contactPerson | object | Y | / | / |
2 | @firstName | string | Y | Contact person first name | James |
2 | @lastName | string | Y | Contact person last name | Bond |
2 | string | N | 007@james.com | ||
2 | @phone | string | N | Contact person phone number including country code | 34123456789 |
2 | @address | string | N | Contact person home address | King's Road in Chelsea, specifically in Wellington Square |
2 | roomCriteria | object | Y | / | / |
2 | @roomCount | integer | Y | Total room count per request | / |
2 | @adultCount | integer | Y | Adult count per room | / |
2 | @childCount | integer | N | Child count per room | / |
2 | @childAges | array | N | For child ages for each child, the array size MUST be the same as the child count. | / |
1 | total | object | Y | Object used to share the total amount of the reservation either ABT or AAT, or both | / |
2 | @amountBeforeTax | number | C | ABT, mandatory if AAT is not provided | 640 |
2 | @amountAfterTax | number | C | AAT, mandatory if ABT is not provided | 700 |
1 | payment | object | No | It is used to share payment information with properties. If the credit card information is not going to be passed to the property, this information will be ignored. | / |
2 | @cardType | string | N | If the payment card type is not specified, it will be treated as the default value "CC" which stands for Credit Card. The type value can be one of the options listed below. | CC |
2 | @cardCode | string | Y | VI, MC, AX, etc. Card Code | VI |
2 | @cardNumber | string | C | Credit card number | 4111111111111111 |
2 | @cardHolderName | string | C | Cardholder name | Sherlock Holmes |
2 | @expireDate | string | C | It should be 2 digits for month, 2 digits for year, expressed MMYY | 0119 |
2 | @securityCode | string | N | Card verification value | 123 |
2 | @vccEffectiveDate | string | N | The date the VCC becomes effective, expressed YYYY-MM-DD | 2025-06-30 |
2 | @vccInvalidDate | string | N | The expiry date of the VCC, expressed YYYY-MM-DD | 2025-07-30 |
2 | @vccAmountOnCard | number | N | Amount put on the virtual card | 1000.00 |
2 | @vccCurrency | string | N | The currency code [ISO-4217] of the amount | USD |
1 | loyaltyAccount | object | N | / | / |
2 | @programCode | string | C | Loyalty program code of the supplier | BW |
2 | @accountId | string | C | Loyalty program account ID | 1234567890123457 |
1 | corpAccount | object | N | Please note that the current feature will be deprecated. Instead, please implement the 'corpCodes' node. | / |
2 | @corpProgramCode | string | C | Corporate Hotel Program of hotel supplier | CR |
2 | @corpId | string | C | Corporate ID in the program account | A-1232 |
1 | promoteCode | string | N | Promotion code defined by the hotel, the promotion code is required if making a reservation under the promotion | / |
1 | guests | array[object] | Y | / |
|
2 | @firstName | string | Y | Guest First Name | James/ |
2 | @lastName | string | Y | Guest Last Name | Bond |
2 | string | N | Guest Email | 007@james.com | |
2 | @phone | string | N | Guest phone number including country code | 34123456789 |
2 | @address | string | N | Guest home address | King's Road in Chelsea, specifically in Wellington Square |
2 | @age | integer | N | Age of guest | / |
2 | @gender | enum | N | Gender of guest Enum: [Male, Female] | Male |
2 | @birthday | string | N | Birthday of guest format with yyyy-MM-dd | 1970-12-20 |
2 | @type | string | N | Type of guest, Adult, Child, or Infant Enum: [ Adult, Child, Infant ] | / |
2 | @index | integer | N | Indicate which guests will be allocated to which room.
For one room reservation, the room index is 1 for all guests. For multi-room reservations, the index starts from 1 and the max room index is equal to the number of booked rooms. | index = 1, Indicate the guest will allocate to the first room. index = 2, Indicate the guest will allocate to the second room. |
2 | @extensions | object | N | Optional: Additional agreed-upon attributes between suppliers and distributors (DerbySoft will provide the specified format). | / |
1 | comments | array[string] | N | Any preference or comment can be communicated in this field | [ "no smoking", "high floor" ] |
1 | roomRates | array[object] | Y | Min Items: 1 Max Items: 1 Meal plan, fee, and cancel policy are optional fields as some distributors do not support these in the API | / |
2 | @roomId | string | Y | Room ID in supplier's system | 10000101 |
2 | @rateId | string | Y | Rate ID in supplier's system | 123456 |
2 | @currency | string | Y | Currency code [ISO-4217] | USD |
2 | @amountBeforeTax | array[number] | N | ABT, mandatory of AAT not provided | [ 100, 100, 120 ] |
2 | @amountAfterTax | array[number] | C | AAT , mandatory of ABT not provided The daily amount of rate with tax and fee. | [ 110, 110, 130 ] |
2 | @mealPlan | string | N | Meal plan code, refer to the standard meal plan code list. | RO |
2 | @paymentType | enum | N | Indicates the product is prepaid to hotel (PayNow) or pay at hotel (PayLater). | PayNow |
1 | guarantee | object | N | Guarantee information for this room rate. | / |
2 | @guaranteeType | string | C | The type of guarantee method, refer to the standard guarantee type list. | CCG |
2 | fees | array[object] | N | Fee or tax by date range. | / |
3 | dateRange | object | C | / | / |
4 | @startDate | string | C | Start date of date range, format with yyyy-MM-dd | 2028-01-01 |
4 | @endDate | string | C | End date of date range, format with yyyy-MM-dd | 2028-01-04 |
3 | fee |
| C | / | / |
4 | @name | string | C | pattern: \w[\w\d]+ starts with a word character (letter, number, or underscore) followed by one or more word characters or digits. | Service Charge |
4 | @type | enum | C | The fee or tax is included in the amount before tax or not Enum: [ Inclusive, Exclusive ] | Exclusive |
4 | @amount | number | C | Amount value of fee or tax | 10 |
4 | @amountType | string | C | Indicates how to charge the tax, 10% per room per night in this example Enum: [ Fix, Percent ] | Percent |
4 | @chargeType | string | C | Enum: [ PerRoomPerNight, PerPersonPerNight, PerRoomPerStay, PerPersonPerStay ] | PerRoomPerNight |
4 | @paymentType | enum | N | Enum: [ PayLater, PayNow ] Indicates if the fee is prepaid to hotels(PayNow) or paid at the hotel(PayLater). Note: The 'paymentType' field will be replaced by 'collectBy' and removed from the API in the future. | PayNow |
4 | @collectBy | enum | N | Enum: [Distributor, Property] Indicates that the fee (e.g., City Tax, Tourist Tax) should be collected by the hotel(Property) at check-in or by distributors when guests make a reservation(Distributor). | Distributor |
4 | @effectivePerson | number | N | It indicates the fee will be charged starting from which occupancy, such as the "Extra Person Charge" fee. The EffectivePerson is 3, meaning an extra fee will be applied from the third person onward. | / |
2 | cancelPolicy | object | N | Cancellation policy defines what penalty will be a charge when a guest cancels the booking at a certain advance time range. The penalty is related to No-show or a time range before No-show. | / |
3 | @code | string | C | Max Length: 128 code of cancel policy | AD100P_100P |
3 | @description | string | N | Max Length: 1024 the description of the cancellation policy | Non Refundable |
3 | cancelPenalties |
| C | Details about the cancel Penalty | / |
4 | @noShow | boolean | C | If true, it means the penaltyCharge applied for No-Show, and the cancellable, cancelDeadline will NOT exist | / |
4 | @cancellable | boolean | N | Indicates cancel is allowed or not. If false, it cannot be canceled. If true, the cancelDeadline will exist. | / |
4 | cancelDeadline | object | N | Object for cancel deadline | / |
5 | @offsetTimeDropType | enum | N | Enum: [ BeforeArrival ] An enumerated type indicates when the deadline drop time goes into effect. | / |
5 | @offsetTimeUnit | enum | N | Enum: [ D, H ]
| / |
5 | @offsetTimeValue | number | N | The number of offset times with the time unit | / |
5 | @deadline | string | N | Local deadline times allowed for cancellation, like 4 PM or 6 PM | / |
4 | cancelPenalties/penaltyCharge | / | / | / | / |
5 | @chargeBase | enum | N | Enum: [ FullStay, NightBase ] If FullStay, it will be a percentage or amount, if NightBase, the nights are required. | / |
5 | @nights | number | N | It exists if the penalty charge is based on the night, like the first night. | / |
5 | @amount | number | N | It exists if the penalty charge is a flat charge, like USD 30.00. | / |
5 | @percent | number | N | It exists if the penalty charge is percent, like 15.5 means 15.5%. | / |
1 | bookingChannel | string | N | Sub-distributor ID | / |
1 | productAddons | array[object] | N | Only available for some suppliers | / |
2 | @type | string | C | product addon type | / |
2 | @code | string | C | product addon code | / |
2 | @date | string | C | format with yyyy-MM-dd | 2022-01-01 |
2 | @quantity | integer | C | / | 1 |
2 | @officeId | string | N | / | / |
2 | rate | object | N | / | / |
3 | ageQualifyingType | object | N | / | / |
4 | @type | enum | C | Enum: [Adult, Child] | Adult |
4 | @minAge | string | C | / | 18 |
4 | @maxAge | integer | C | / | 18 |
2 | currency | string | C | / | USD |
2 | amountBeforeTax | number | N | / | 123.23 |
2 | amountAfterTax | number | N | / | 134.34 |
1 | corpCode | string | N | Corporate code in Distributor's system Note: This field is primarily used by Travel Management Companies (TMCs) distributors. | D_XXX |
1 | threeDomainSecurity | object | N | / | / |
2 | @cavv | string | N | Cardholder Authentication Verification Value Information is retrieved from the 3DS provider when authentication is successful. | / |
2 | @eci | string | N | The electronic commerce indicator. | / |
2 | @xid | string | N | Transaction identifier for a 3DS Version 1 provider, assigned by the Directory Server to identify a single transaction. | / |
2 | @threeDomainSecurityVersion | string | N | Include this only for 3D Secure 2. | / |
2 | @transactionId | string | N | Transaction identifier for a 3DS Version 2 provider, assigned by the Directory Server to identify a single transaction. | / |
2 | @merchantName | string | N | Identifier of the merchant completing the 3DS transaction. | / |
2 | @channelCode | enum | N | Specify the collection channel of payment cards Enum: [TO, EC, MO, FA] Refer to: PSD2-Channel Code | EC |
2 | @exemptionType | enum | N | Determines which exemption was used by the Payment Service Provider (PSP) Enum: [SC, DA, TA, TB, LV] Refer to: PSD2-Exemption Type | SC |
1 | bookingToken | string | Y | Booking token used for booking | / |
1 | extensions | object | N | Optional: Additional agreed-upon attributes between suppliers and distributors (DerbySoft will provide the specified format). Please don't transmit sensitive information through this field. For more information refer to: | / |
Book Request Example
Book Response Schema
Response | |||||
---|---|---|---|---|---|
Level | Field Name | Data Type | Required | Description | Example |
1 | header | object | Y | / | / |
2 | @supplierId | string | Y | The ID of the hotel supplier in DerbySoft's system Max Length: 32 | HILTON |
2 | @distributorId | string | Y | The ID of the distributor in DerbySoft's system MaxLength: 32 | GTA |
2 | @version | string | Y | Max Length: 20 Version of API | v4 |
2 | @token | string | Y | Max Length: 64 A unique identifier is used for requests and responses, typically a UUID. Note that this is an echo token, not an access token. | 18393849028490234 |
1 | reservationIds |
| Y | / | / |
2 | @distributorResId | string | Y | Distributor's reservation ID. Distributors should keep the ID unique on their system to avoid any potential issues caused by duplicate reservation IDs. | C2084DFL0 |
2 | @derbyResId | string | N | Reservation ID in DerbySoft system, this is a unique ID as DerbySoft would be splitting the reservation. | D15F893D34DF |
2 | @supplierResId | string | N | Reservation ID in supplier's system | 89389494 |
1 | connectionType | enum | N | Enum: [Exchange, Standard] Indicates the connection type of product. Notes: If the field is omitted, it means the Connection Type is Standard. | Exchange |
1 | commission | object | N | Notes: If the connection type is "Exchange" and "Retail" Rate Model, the node will be visible; otherwise, it will not appear. | / |
2 | @value | number | Y | / | 10 |
2 | @type | enum | Y | Commission type Enum: [Percent, Amount] | Percent |
1 | suggestedTotalPrice | object | N | Notes: If the connection type is "Exchange" and "Net" Rate Model, the node will be visible; otherwise, it will not appear. | / |
2 | @amountBeforeTax | number | N | / | 600 |
2 | @amountAfterTax | number | N | / | 700 |
1 | extensions | object | N | Optional: Additional agreed-upon attributes between suppliers and distributors (DerbySoft will provide the specified format). Please don't transmit sensitive information through this field. For more information refer to: | / |
1 | error | string | N | error response | Key not authorized |
1 | errorCode | string | C | error response | InvalidField |
1 | supplierErrorCode | string | C | error response | InvalidField |
1 | errorMessage | string | C | error response | Invalid Message |
Book Response Example
此回答是否有所帮助? 是 否
Send feedback