API reference

HTS APIs

Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.

POST/ordersOther

Create a CFAR Order

https://fintech.staging.htsapis.com/lodging-cfar/v2/orders

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

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-Key
header · string · uuid
required

Unique 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_offers
array of string
required

List of CFAR offer IDs the user is purchasing. The offers must not be expired and must be all in the same currency.

Items ≥ 1
currency
string
required

The currency all payments are in. 3-letter ISO 4217 code.

merchant_of_record_on_cfar
string enum
required

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.

Values partnerhts
merchant_of_record_on_reservation
string enum
required

Party responsible for processing the reservation cost.

Values partnerlodging
payment_information
payment_information · one of 2
required

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.

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.

Exactly one of the following, selected by type:
not_provided (not_provided) not_provided
type
string
required

value: not_provided

amount
string
required

Total amount of the transaction.

provided (provided) provided
type
string
required

value: provided

payment_methods
array of provided_payment
required

List of payment methods used to pay for the booking.

Items ≥ 1
Show fields
Array of provided_payment · one of 4 · List of payment methods used to pay for the booking.
Items ≥ 1
Exactly one of the following, selected by type:
alternate_payment_method (alternate_payment_method) alternate_payment_method
type
string
required

A payment that cannot be tokenized. eg: ApplePay.

amount
string
required
method
method · one of 4
required

The method of payment.

Show fields

The method of payment.

Exactly one of the following, selected by type:
apple_pay (apple_pay) apple_pay
other (other) other
paypal (paypal) paypal
venmo (venmo) venmo
loyalty_program (loyalty_program) loyalty_program
type
string
required

value: loyalty_program

amount
string
required
name
string
required

The 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.

Length ≥ 1
units
string
required

The 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
type
string
required

A discount to the booking that won't be refunded if the booking is canceled or CFAR is exercised. eg: $5 off first time booking.

amount
string
required
name
string
required

The 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.

Length ≥ 1
payment_card (payment_card) payment_card
type
string
required

A credit or debit card. Must be tokenized (refer to above documentation).

amount
string
required
identifier
identifier · one of 2
required
Show fields
Exactly one of the following, selected by type:
details (details) details
token (token) token
contact_info
contact_info
required

Contact information of the user buying the product(s).

Show fields
email_address
email_address · one of 3
required
Show fields
Exactly one of the following, selected by type:
hashed (hashed) hashed
type
string
required

value: hashed

value
string
required

A 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.

Length ≥ 1
literal (literal) literal
type
string
required

value: literal

value
string
required

The actual email address for the user.

Pattern ^[^@\s]+@[^@\s]+\.[^@\s]+$
not_provided (not_provided1) not_provided1
type
string
required

value: not_provided

locale
string
required

The 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.

payments
array of provided_payment
deprecated

DEPRECATED: 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.

Items ≥ 1
Show fields
Array of provided_payment · one of 4 · DEPRECATED: 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.
Items ≥ 1
Exactly one of the following, selected by type:
alternate_payment_method (alternate_payment_method) alternate_payment_method
type
string
required

A payment that cannot be tokenized. eg: ApplePay.

amount
string
required
method
method · one of 4
required

The method of payment.

Show fields

The method of payment.

Exactly one of the following, selected by type:
apple_pay (apple_pay) apple_pay
type
string
required

value: apple_pay

other (other) other
type
string
required

value: other

name
string
required

Name of the alternate payment method for unsupported types, e.g. Bank Transfer.

Length ≥ 1
paypal (paypal) paypal
type
string
required

value: paypal

venmo (venmo) venmo
type
string
required

value: venmo

loyalty_program (loyalty_program) loyalty_program
type
string
required

value: loyalty_program

amount
string
required
name
string
required

The 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.

Length ≥ 1
units
string
required

The 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
type
string
required

A discount to the booking that won't be refunded if the booking is canceled or CFAR is exercised. eg: $5 off first time booking.

amount
string
required
name
string
required

The 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.

Length ≥ 1
payment_card (payment_card) payment_card
type
string
required

A credit or debit card. Must be tokenized (refer to above documentation).

amount
string
required
identifier
identifier · one of 2
required
Show fields
Exactly one of the following, selected by type:
details (details) details
type
string
required

value: details

last_four_digits
string
required

Last four digits of the payment card.

Pattern [0-9]{4}
expiration_month
string
required

Two digits expiration month of the payment card.

Pattern [0-9]{2}
expiration_year
string
required

Four digits expiration year of the payment card.

Pattern [0-9]{4}
token (token) token
type
string
required

value: token

value
string
required

The token representing a credit card or a debit card. Used to process refunds to the original form of payment.

Length ≥ 1
user_id
string

The ID of the user making the request.

display_currency
string

The currency that the user selected for display purposes.

billing_info
billing_info

Billing information of the user buying the product(s). Required if HTS is merchant of record.

Show fields
first_name
string
required

First name of the customer.

Length ≥ 1
last_name
string
required

Last name of the customer.

Length ≥ 1
street_address
string
required

Street address of the customer billing address.

Length ≥ 1
city
string
required

City of the customer billing address.

Length ≥ 1
state_province
string
required

State or province of the customer billing address.

Length ≥ 1
postal_code
string
required

Postal code of the customer billing address.

Length ≥ 1
country
string
required

Country of the customer billing address.

Pattern [A-Z]{2}

Responses

201The created CFAR order
id
string
required

The order ID that groups all contracts together.

payments
array of payment
required

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 the order. This is from the point of view of the end user.

Items ≥ 1
Show fields
Array of payment · one of 6 · 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 the order. This is from the point of view of the end user.
Items ≥ 1
Exactly one of the following, selected by type:
alternate_payment_method (alternate_payment_method) alternate_payment_method
type
string
required

A payment that cannot be tokenized. eg: ApplePay.

amount
string
required
method
method · one of 4
required

The method of payment.

Show fields

The method of payment.

Exactly one of the following, selected by type:
apple_pay (apple_pay) apple_pay
type
string
required

value: apple_pay

other (other) other
type
string
required

value: other

name
string
required

Name of the alternate payment method for unsupported types, e.g. Bank Transfer.

Length ≥ 1
paypal (paypal) paypal
type
string
required

value: paypal

venmo (venmo) venmo
type
string
required

value: venmo

loyalty_program (loyalty_program) loyalty_program
type
string
required

value: loyalty_program

amount
string
required
name
string
required

The 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.

Length ≥ 1
units
string
required

The 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
type
string
required

A discount to the booking that won't be refunded if the booking is canceled or CFAR is exercised. eg: $5 off first time booking.

amount
string
required
name
string
required

The 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.

Length ≥ 1
not_provided (not_provided2) not_provided2
type
string
required

value: not_provided

amount
string
required
payment_card (payment_card) payment_card
type
string
required

A credit or debit card. Must be tokenized (refer to above documentation).

amount
string
required
identifier
identifier · one of 2
required
Show fields
Exactly one of the following, selected by type:
details (details) details
type
string
required

value: details

last_four_digits
string
required

Last four digits of the payment card.

Pattern [0-9]{4}
expiration_month
string
required

Two digits expiration month of the payment card.

Pattern [0-9]{2}
expiration_year
string
required

Four digits expiration year of the payment card.

Pattern [0-9]{4}
token (token) token
type
string
required

value: token

value
string
required

The token representing a credit card or a debit card. Used to process refunds to the original form of payment.

Length ≥ 1
reseller_controlled (reseller_controlled) reseller_controlled
type
string
required

The partner does not charge the user directly and thus does not have payment information.

amount
string
required
contracts
array of cfar_contract
required

The list of contracts included in this order.

Items ≥ 1
Show fields
Array of cfar_contract · The list of contracts included in this order.
Items ≥ 1
id
string
required

CFAR contract ID

price
cfar_price
required

Price for CFAR.

Show fields
total_amount
string
required

The total amount for CFAR, including base and taxes.

base_amount
string
required

The base amount for CFAR.

taxes
array of tax

The taxes for this price.

Show fields
Array of tax · The taxes for this price.
code
string
required

Code representing this tax.

Length ≥ 1
amount
string
required

Total amount of the tax.

payout
payout
required

Breakdown of what will be paid upon exercise.

Show fields
amount
string
required

The maximum amount to issue to the user if they exercise CFAR.

percentage
integer · int32
required

The payout defined as a percentage of the unit's booking_amount. Must be a number between 0 and 100.

price_included
boolean
required

If CFAR price is included in the payout amount.

expires_at
string · date-time
required

The instant the purchased contract will expire as a UTC (RFC3339) datetime.

status
string enum
required

Current status of the contract.

Values draftedconfirmedexercisedvoidedcanceled
currency
string
required

Currency of all money values in this contract. 3-letter ISO 4217 code.

unit_reservation_id
string

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.

Length ≥ 1
agent_commission
agent_commission

Commission payable to the travel agent.

Show fields
amount
string
required

Monetary amount payable to the agent, in the offer's currency.

payable_date
string · date
required

Informs 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.

currency
string
required

Currency of all money values in this order and associated contracts. 3-letter ISO 4217 code.

reservation_id
string

The ID of the reservation (in the partner's system) associated with this order.

Length ≥ 1
400Syntactic errors were encountered while handling the request
Array of error
message
string
required
code
string
required
Example
[
  {
    "message": "string",
    "code": "string"
  }
]
401The client could not be authenticated
No body.
403The authenticated client does not have permission to call this endpoint
No body.
409The request conflicts with another request currently being processed
Array of error
message
string
required
code
string
required
Example
[
  {
    "message": "string",
    "code": "string"
  }
]
422Semantic errors were encountered while handling the request
Array of create_cfar_order_error · one of 11
Items ≥ 1
Exactly one of the following, selected by code:
idempotency_key_reused (idempotency_key_reused) idempotency_key_reused
message
string
required

A human-readable message describing the error

code
string
required
invalid_discount_amount (invalid_discount_amount) invalid_discount_amount
message
string
required

A human-readable message describing the error

code
string
required
invalid_email (invalid_email) invalid_email
message
string
required

A human-readable message describing the error

code
string
required
invalid_mor_reservation (invalid_mor_reservation) invalid_mor_reservation
message
string
required

A human-readable message describing the error

code
string
required
invalid_offer_id (invalid_offer_id) invalid_offer_id
message
string
required

A human-readable message describing the error

code
string
required
missing_payment_token (missing_payment_token) missing_payment_token
message
string
required

A human-readable message describing the error

code
string
required
offer_already_purchased (offer_already_purchased) offer_already_purchased
message
string
required

A human-readable message describing the error

code
string
required
offer_expired (offer_expired) offer_expired
message
string
required

A human-readable message describing the error

code
string
required
offer_not_priced (offer_not_priced) offer_not_priced
message
string
required

A human-readable message describing the error

code
string
required
order_already_exists (order_already_exists) order_already_exists
message
string
required

A human-readable message describing the error

code
string
required
payment_authorization_failure (payment_authorization_failure) payment_authorization_failure
message
string
required

A human-readable message describing the error

code
string
required
Example
[
  {
    "message": "string",
    "code": "string"
  }
]
499The client cancelled the request
No body.
500The server encountered an internal error
No body.
Request
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"
  }
}'
Response 201
{
  "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.