HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/ordersOtherCreate a CFAR Order
Create a CFAR Order to begin the purchase.
HTS uses an external payment gateway to tokenize payment cards as well as process payments and payouts.
When HTS is the Merchant of Record (MOR) for the purchase of the order or remitting any product payout to a customer's credit card, HTS requires a tokenized credit card to be present in the payments array in the request below.
Expand this section for instructions about testing and Spreedly integration.
The returned payment method token MxyYEhDK12CUAA18bJDkAq0ab3y (from the sample response below) should be passed in the payment_card type with a token identifier as a part of the payments array in the request below.
When using the staging environment, make sure to use one of Adyen's test credit card numbers.
Tokenization URL: https://core.spreedly.com/v1/payment_methods.json
- Documentation: Spreedly API docs
Example Tokenization Request:
curl --request POST --url https://core.spreedly.com/v1/payment_methods.json --header 'content-type: application/json' -u "login:password" --data '{
"payment_method": {
"email": "aaa@bbb.com",
"credit_card": {
"number": "4000020000000000",
"month": "03",
"year": "2030",
"first_name": "John",
"last_name": "Smith",
"address1": "123 12th St",
"address2": "Building B",
"city": "Boston",
"state": "MA",
"zip": "02121",
"country": "US",
"verification_value": "737"
}
}
}'
Example Tokenization Response:
{
"transaction": {
"token": "KtToV20m9qT1Yi8pbTeLNz0Ypns",
"created_at": "2023-11-29T13:31:56Z",
"updated_at": "2023-11-29T13:31:56Z",
"succeeded": true,
"transaction_type": "AddPaymentMethod",
"retained": false,
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "MxyYEhDK12CUAA18bJDkAq0ab3y",
"created_at": "2023-11-29T13:31:56Z",
"updated_at": "2023-11-29T13:31:56Z",
"email": "aaa@bbb.com",
"data": null,
"storage_state": "cached",
"test": true,
"metadata": null,
"callback_url": null,
"last_four_digits": "0000",
"first_six_digits": "400002",
"card_type": "visa",
"first_name": "John",
"last_name": "Smith",
"month": 3,
"year": 2030,
"address1": "123 12th St",
"address2": "Building B",
"city": "Boston",
"state": "MA",
"zip": "02121",
"country": "US",
"phone_number": null,
"company": null,
"full_name": "John Smith",
"eligible_for_card_updater": true,
"shipping_address1": null,
"shipping_address2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_zip": null,
"shipping_country": null,
"shipping_phone_number": null,
"issuer_identification_number": "40000200",
"click_to_pay": false,
"managed": true,
"payment_method_type": "credit_card",
"errors": [],
"bin_metadata": {
"message": "BIN Metadata is available only to Advanced Vault enrolled customers and payment methods. Reach out to your account representative for more details."
},
"fingerprint": "7ccffcf38900f224fc946cf2a9c8e260072b",
"verification_value": "XXX",
"number": "XXXX-XXXX-XXXX-0000"
}
}
}
Parameters
Idempotency-KeyUnique key that makes resource creation idempotent. Send the same value when retrying a request to avoid creating duplicate resources. Send a new key to create a new resource.
Request body application/json · required
priced_offersList of CFAR offer IDs the user is purchasing. The offers must not be expired and must be all in the same currency.
currencyThe currency all payments are in. 3-letter ISO 4217 code.
merchant_of_record_on_cfar Party responsible for processing CFAR's cost for the purchased offers.
If it's HTS, a payment_card with a token identifier must be provided in the payments list.
partnerhtsmerchant_of_record_on_reservationParty responsible for processing the reservation cost.
partnerlodgingpayment_informationPayment information for the order. Either a detailed breakdown of payment methods (Provided) or a signal that no payment details are available (NotProvided). Payments should equate to the total amount for which a partner is the MoR, e.g. if the partner is collecting the ancillary price, the total of the payments should be inclusive of the price. Must include a tokenized payment card if HTS is merchant of record. If both payments and payment_information are provided, payment_information takes precedence.
Show fields
Payment information for the order. Either a detailed breakdown of payment methods (Provided) or a signal that no payment details are available (NotProvided). Payments should equate to the total amount for which a partner is the MoR, e.g. if the partner is collecting the ancillary price, the total of the payments should be inclusive of the price. Must include a tokenized payment card if HTS is merchant of record. If both payments and payment_information are provided, payment_information takes precedence.
type:not_provided (not_provided) not_provided
typevalue: not_provided
amountTotal amount of the transaction.
provided (provided) provided
typevalue: provided
payment_methodsList of payment methods used to pay for the booking.
Show fields
type:alternate_payment_method (alternate_payment_method) alternate_payment_method
typeA payment that cannot be tokenized. eg: ApplePay.
amountloyalty_program (loyalty_program) loyalty_program
typevalue: loyalty_program
amountnameThe name of the of the loyalty program, e.g. points, miles, cash_rewards, etc. Required, to ensure that the amounts are refunded to the same loyalty program used during purchase.
unitsThe unit to currency exchange rate is implicit from the amount in the Payment object and this number of points.
non_refundable_discounts (non_refundable_discounts) non_refundable_discounts
typeA discount to the booking that won't be refunded if the booking is canceled or CFAR is exercised. eg: $5 off first time booking.
amountnameThe name of the non-refundable discount, e.g. first time booker incentive, etc. Set if useful for refund during exercise, e.g. for display, book keeping, etc.
payment_card (payment_card) payment_card
contact_infoContact information of the user buying the product(s).
Show fields
email_addressShow fields
type:hashed (hashed) hashed
typevalue: hashed
valueA stable hash of the user's email address. Must be stable across different API calls and different bookings. Used for transaction correlation for fraud analysis.
literal (literal) literal
typevalue: literal
valueThe actual email address for the user.
^[^@\s]+@[^@\s]+\.[^@\s]+$not_provided (not_provided1) not_provided1
typevalue: not_provided
localeThe user's locale, as an IETF BCP 47 language tag in {language}-{region} form, where region is an ISO 3166-1 alpha-2 country code or a UN M.49 macro-region code (e.g. en-US, es-419). Determines the language of user-facing content.
paymentsDEPRECATED: Use payment_information instead. List of payment methods used to pay for this order, for all contracts, including both the unit and any other charges in the same booking. If the partner is MOR on CFAR payment, this should also include CFAR's cost. All amount must be in the same currency as the one specified on this request.
Show fields
type:alternate_payment_method (alternate_payment_method) alternate_payment_method
typeA payment that cannot be tokenized. eg: ApplePay.
amountmethodThe method of payment.
Show fields
The method of payment.
type:apple_pay (apple_pay) apple_pay
typevalue: apple_pay
other (other) other
typevalue: other
nameName of the alternate payment method for unsupported types, e.g. Bank Transfer.
paypal (paypal) paypal
typevalue: paypal
venmo (venmo) venmo
typevalue: venmo
loyalty_program (loyalty_program) loyalty_program
typevalue: loyalty_program
amountnameThe name of the of the loyalty program, e.g. points, miles, cash_rewards, etc. Required, to ensure that the amounts are refunded to the same loyalty program used during purchase.
unitsThe unit to currency exchange rate is implicit from the amount in the Payment object and this number of points.
non_refundable_discounts (non_refundable_discounts) non_refundable_discounts
typeA discount to the booking that won't be refunded if the booking is canceled or CFAR is exercised. eg: $5 off first time booking.
amountnameThe name of the non-refundable discount, e.g. first time booker incentive, etc. Set if useful for refund during exercise, e.g. for display, book keeping, etc.
payment_card (payment_card) payment_card
typeA credit or debit card. Must be tokenized (refer to above documentation).
amountidentifierShow fields
type:details (details) details
typevalue: details
last_four_digitsLast four digits of the payment card.
[0-9]{4}expiration_monthTwo digits expiration month of the payment card.
[0-9]{2}expiration_yearFour digits expiration year of the payment card.
[0-9]{4}token (token) token
typevalue: token
valueThe token representing a credit card or a debit card. Used to process refunds to the original form of payment.
user_idThe ID of the user making the request.
display_currencyThe currency that the user selected for display purposes.
billing_infoBilling information of the user buying the product(s). Required if HTS is merchant of record.
Show fields
first_nameFirst name of the customer.
last_nameLast name of the customer.
street_addressStreet address of the customer billing address.
cityCity of the customer billing address.
state_provinceState or province of the customer billing address.
postal_codePostal code of the customer billing address.
countryCountry of the customer billing address.
[A-Z]{2}Responses
201The created CFAR order
idThe order ID that groups all contracts together.
paymentsList of payment methods used to pay for this order, for all contracts, including both the unit and any other charges in the same booking. If the partner is MOR on CFAR payment, this should also include CFAR's cost. All amount must be in the same currency as the one specified on the order. This is from the point of view of the end user.
Show fields
type:alternate_payment_method (alternate_payment_method) alternate_payment_method
typeA payment that cannot be tokenized. eg: ApplePay.
amountmethodThe method of payment.
Show fields
The method of payment.
type:apple_pay (apple_pay) apple_pay
typevalue: apple_pay
other (other) other
typevalue: other
nameName of the alternate payment method for unsupported types, e.g. Bank Transfer.
paypal (paypal) paypal
typevalue: paypal
venmo (venmo) venmo
typevalue: venmo
loyalty_program (loyalty_program) loyalty_program
typevalue: loyalty_program
amountnameThe name of the of the loyalty program, e.g. points, miles, cash_rewards, etc. Required, to ensure that the amounts are refunded to the same loyalty program used during purchase.
unitsThe unit to currency exchange rate is implicit from the amount in the Payment object and this number of points.
non_refundable_discounts (non_refundable_discounts) non_refundable_discounts
typeA discount to the booking that won't be refunded if the booking is canceled or CFAR is exercised. eg: $5 off first time booking.
amountnameThe name of the non-refundable discount, e.g. first time booker incentive, etc. Set if useful for refund during exercise, e.g. for display, book keeping, etc.
not_provided (not_provided2) not_provided2
typevalue: not_provided
amountpayment_card (payment_card) payment_card
typeA credit or debit card. Must be tokenized (refer to above documentation).
amountidentifierShow fields
type:details (details) details
typevalue: details
last_four_digitsLast four digits of the payment card.
[0-9]{4}expiration_monthTwo digits expiration month of the payment card.
[0-9]{2}expiration_yearFour digits expiration year of the payment card.
[0-9]{4}token (token) token
typevalue: token
valueThe token representing a credit card or a debit card. Used to process refunds to the original form of payment.
reseller_controlled (reseller_controlled) reseller_controlled
typeThe partner does not charge the user directly and thus does not have payment information.
amountcontractsThe list of contracts included in this order.
Show fields
idCFAR contract ID
pricePrice for CFAR.
Show fields
total_amountThe total amount for CFAR, including base and taxes.
base_amountThe base amount for CFAR.
taxesThe taxes for this price.
Show fields
codeCode representing this tax.
amountTotal amount of the tax.
payoutBreakdown of what will be paid upon exercise.
Show fields
amountThe maximum amount to issue to the user if they exercise CFAR.
percentageThe payout defined as a percentage of the unit's booking_amount. Must be a number between 0 and 100.
price_includedIf CFAR price is included in the payout amount.
expires_atThe instant the purchased contract will expire as a UTC (RFC3339) datetime.
statusCurrent status of the contract.
draftedconfirmedexercisedvoidedcanceledcurrencyCurrency of all money values in this contract. 3-letter ISO 4217 code.
unit_reservation_id The ID of the unit reservation (in the partner's system) associated with this contract.
For single-unit bookings, this may be the same as reservation_id.
agent_commissionCommission payable to the travel agent.
Show fields
amountMonetary amount payable to the agent, in the offer's currency.
payable_dateInforms the agent of when their commission becomes payable — agents should not expect payment before this date. Commissions are not paid if the reservation is cancelled - the traveller must check-in.
currencyCurrency of all money values in this order and associated contracts. 3-letter ISO 4217 code.
reservation_idThe ID of the reservation (in the partner's system) associated with this order.
400Syntactic errors were encountered while handling the request
messagecodeExample
[
{
"message": "string",
"code": "string"
}
]401The client could not be authenticated
403The authenticated client does not have permission to call this endpoint
409The request conflicts with another request currently being processed
messagecodeExample
[
{
"message": "string",
"code": "string"
}
]422Semantic errors were encountered while handling the request
code:idempotency_key_reused (idempotency_key_reused) idempotency_key_reused
messageA human-readable message describing the error
codeinvalid_discount_amount (invalid_discount_amount) invalid_discount_amount
messageA human-readable message describing the error
codeinvalid_email (invalid_email) invalid_email
messageA human-readable message describing the error
codeinvalid_mor_reservation (invalid_mor_reservation) invalid_mor_reservation
messageA human-readable message describing the error
codeinvalid_offer_id (invalid_offer_id) invalid_offer_id
messageA human-readable message describing the error
codemissing_payment_token (missing_payment_token) missing_payment_token
messageA human-readable message describing the error
codeoffer_already_purchased (offer_already_purchased) offer_already_purchased
messageA human-readable message describing the error
codeoffer_expired (offer_expired) offer_expired
messageA human-readable message describing the error
codeoffer_not_priced (offer_not_priced) offer_not_priced
messageA human-readable message describing the error
codeorder_already_exists (order_already_exists) order_already_exists
messageA human-readable message describing the error
codepayment_authorization_failure (payment_authorization_failure) payment_authorization_failure
messageA human-readable message describing the error
codeExample
[
{
"message": "string",
"code": "string"
}
]499The client cancelled the request
500The server encountered an internal error
curl -X POST "https://fintech.staging.htsapis.com/lodging-cfar/v2/orders" \
-H "X-Api-Key: $HTS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"priced_offers": [
"string"
],
"currency": "USD",
"merchant_of_record_on_cfar": "partner",
"merchant_of_record_on_reservation": "partner",
"payment_information": {
"type": "provided",
"amount": "200.00"
},
"contact_info": {
"email_address": {
"type": "string",
"value": "a8cfcd74832004951b4408cdb0a5dbcd8c7e5243f7fe-244bf72058205241da"
}
},
"user_id": "33bb4eb2-2937-4bd3-97b1-7796206712f0",
"locale": "en-US",
"display_currency": "CAD",
"billing_info": {
"first_name": "string",
"last_name": "string",
"street_address": "string",
"city": "string",
"state_province": "string",
"postal_code": "string",
"country": "US"
}
}'{
"id": "string",
"payments": [
{
"type": "alternate_payment_method",
"amount": "173.24",
"method": {
"type": "string"
}
}
],
"contracts": [
{
"id": "string",
"price": {
"total_amount": "12.00",
"base_amount": "10.00",
"taxes": [
{
"code": "VAT",
"amount": "20.00"
}
]
},
"payout": {
"amount": "450",
"percentage": 100,
"price_included": true
},
"expires_at": "2026-12-10T15:00:00Z",
"unit_reservation_id": "string",
"status": "drafted",
"agent_commission": {
"amount": "1.20",
"payable_date": "2026-08-15"
},
"currency": "USD"
}
],
"reservation_id": "string",
"currency": "USD"
}Examples are generated from the schema where the spec publishes none; field values are illustrative.
