HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/contractsOtherCreate Draft Contract
Create a draft contract for a customer's chosen offer.
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
offer_idPriced offer to be purchased by the user.
currencyCurrency of all pricing fields within the request.
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.
payment_informationPayment information for the contract. 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 contract. 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
merchant_of_recordParty responsible for processing the payment for the purchased offers.
partnerhtscontact_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
phone_number^\+[1-9][0-9]{1,14}$additional_recipientsShow fields
email_addressEmail address of the additional recipient to notify.
Show fields
valueThe actual email address for the user.
^[^@\s]+@[^@\s]+\.[^@\s]+$phone_numberSMS notifications are not currently supported; a request that includes a phone number is rejected.
^\+[1-9][0-9]{1,14}$notification_preferencesConsent for the PRIMARY BOOKER (the email_address / phone_number on this contact_info) to receive disruption notifications via SMS/push. Applies to the primary booker only: additional_recipients never receive SMS or push (they are email-only, notification-only). Captured per offer at purchase; does not persist across offers. Recording consent does not trigger delivery.
Show fields
smsSMS consent for the primary booker's phone_number. Omit = not specified, true = opt-in, false = declined. Requires phone_number to be present; the request is rejected if sms=true and phone_number is absent.
pushPush consent for the primary booker. Omit = not specified, true = opt-in, false = declined.
paymentsDEPRECATED: Use payment_information instead. List of payment methods used to pay for the booking (includes flights and ancillaries). 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.
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.
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}user_idPartner's unique ID of the user making the purchase. This is used for fraud prevention.
Responses
201The created contract
idUnique ID for a contract.
statusCurrent status of the contract.
canceledconfirmeddraftedexercisedexpiredvoidedpriceThe price breakdown of the product.
Show fields
total_amountTotal amount to be paid for the product, including taxes.
base_amountAmount to be paid for the product, excluding taxes.
taxesShow fields
codeCode representing this tax.
amountTotal amount of the tax.
payoutThe payout to be issued to the user upon exercise.
Show fields
amountThe total amount to be paid out upon exercise.
percentageThe percentage of the booking to be paid out upon exercise.
price_includedIf the product price is included in the product payout amount.
currencyCurrency of all pricing fields within the contract.
expires_atDate and time at which the contract will expire, once purchased, as a UTC RFC3339 formatted datetime.
booking_referencesRecord locators if PSS, Order ID if OMS, etc. Used to retrieve the flight booking later. It's a dictionary of key/value pairs. The keys can be anything, but they are referenced in the configuration when retrieving the booking, so those must align.
exercisesExercises completed for this contract.
Show fields
idUnique identifier for this exercise.
exercised_atDate and time at which the exercise was completed, as a UTC RFC3339 formatted datetime.
payoutsThe payouts issued for this exercise.
Show fields
The method by which the payout will be be delivered to the customer.
type:future_travel_credit (future_travel_credit) future_travel_credit
typevalue: future_travel_credit
amountThe amount of the payout.
original_form_of_payment (original_form_of_payment) original_form_of_payment
typevalue: original_form_of_payment
paymentDEPRECATED: The payment details for this payout.
Show fields
DEPRECATED: The payment details for this payout.
type:alternate_payment_method (alternate_payment_method) alternate_payment_method
loyalty_program (loyalty_program) loyalty_program
not_provided (not_provided2) not_provided2
payment_card (payment_card) payment_card
reseller_controlled (reseller_controlled) reseller_controlled
payoutThe payment details for this payout.
Show fields
The payment details for this payout.
type:alternate_payment_method (alternate_payment_method) alternate_payment_method
loyalty_program (loyalty_program) loyalty_program
not_provided (not_provided2) not_provided2
payment_card (payment_card) payment_card
reseller_controlled (reseller_controlled) reseller_controlled
passenger_idsIdentifier for each passenger exercised. Omitted only when identifiers are unavailable.
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
422Semantic errors were encountered while handling the request
code:billing_info_required_for_merchant_of_record_hts (billing_info_required_for_merchant_of_record_hts) billing_info_required_for_merchant_of_record_hts
messageA human-readable message describing the error
codeidempotency_key_reused (idempotency_key_reused) idempotency_key_reused
messageA human-readable message describing the error
codeinvalid_email (invalid_email) invalid_email
messageA human-readable message describing the error
codeinvalid_itinerary_price (invalid_itinerary_price) invalid_itinerary_price
messageA human-readable message describing the error
codeoffer_expired (offer_expired1) offer_expired1
messageA human-readable message describing the error
codeoffer_not_found (offer_not_found2) offer_not_found2
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
codepayment_card_required_for_merchant_of_record_hts (payment_card_required_for_merchant_of_record_hts) payment_card_required_for_merchant_of_record_hts
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/flights-cfar/v2/contracts" \
-H "X-Api-Key: $HTS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"offer_id": "string",
"currency": "CAD",
"locale": "en-US",
"payment_information": {
"type": "provided",
"amount": "200.00"
},
"merchant_of_record": "partner",
"contact_info": {
"email_address": {
"type": "string",
"value": "a8cfcd74832004951b4408cdb0a5dbcd8c7e5243f7fe-244bf72058205241da"
},
"phone_number": "string",
"additional_recipients": [
{
"email_address": {
"value": "john@email.com"
},
"phone_number": "string"
}
],
"notification_preferences": {
"sms": true,
"push": true
}
},
"billing_info": {
"first_name": "string",
"last_name": "string",
"street_address": "string",
"city": "string",
"state_province": "string",
"postal_code": "string",
"country": "US"
},
"user_id": "33bb4eb2-2937-4bd3-97b1-7796206712f0"
}'{
"id": "1ec9eed3-4486-6460-9d6c-2fb8469d35db",
"status": "Confirmed",
"price": {
"total_amount": "40.80",
"base_amount": "30.20",
"taxes": [
{
"code": "VAT",
"amount": "20.00"
}
]
},
"payout": {
"amount": "400.00",
"percentage": 80,
"price_included": false
},
"currency": "CAD",
"expires_at": "2020-12-20T12:15:48Z",
"booking_references": {},
"exercises": [
{
"id": "string",
"exercised_at": "2026-12-10T15:00:00Z",
"payouts": [
{
"type": "string",
"amount": "string"
}
],
"passenger_ids": [
"string"
]
}
]
}Examples are generated from the schema where the spec publishes none; field values are illustrative.
