Hotel Booking

Provides additional guidance for hotels, booking platforms, and other hospitality merchants by adding stay details, including check-in and check-out dates, guests, hotel name, location, room class, and refundability.

Additional guidance for hotels, booking platforms and other merchants that sell stays or hospitality services.

Send every field from the General page plus the hotels_itinerary object inside risk_assessment. For hotel bookings, risk_score is also Required.

ℹ️

What's different for hotels

  • Add risk_assessment.hotels_itinerary: stay dates, guests, hotel, location, room class and refundability.
  • Send risk_assessment.risk_score. It's optional on the General page but Required for hotels.
  • If you sell rentals booked from a host, also send the host object.
  • Hotel reservations are Digital items, so shipping_address can be left out when no shipping address is available.
📘

Endpoint

POST /checkout: see Create Checkout Session for the full API reference.

Authenticate every request with the API token provided by Tamara in the Authorization header:

Authorization: Bearer <your_api_token>
Content-Type: application/json

On this page

  1. Before you start
  2. Request structure at a glance
  3. Order details
  4. Amounts
  5. Risk assessment
  6. Hotel itinerary
  7. Consumer
  8. Items
  9. Redirect URLs
  10. Addresses
  11. Checkout options
  12. Full request example
  13. Minimal request example
  14. Common mistakes
  15. FAQs

Before you start

ConventionRule
DatesSend all dates as strings in dd-mm-yyyy format, for example 31-01-2026.
CurrencyUse the three-letter ISO 4217 code: SAR, AED, BHD, KWD or OMR.
Decimal placesAmounts support 2 decimal places by default, and 3 decimal places for BHD, KWD and OMR.
CountryUse the two-letter ISO 3166-1 code: SA, AE, BH, KW or OM.
Required fieldsFields marked Required must always be sent. Conditional fields are required only in the case described.
💡

Send as much as you can

Optional fields are not needed for the request to succeed, but the more risk signals you share, the more accurately Tamara can assess each order.


Request structure at a glance

FieldTypeRequiredSection
order_reference_idStringRequiredOrder details
order_numberStringOptionalOrder details
descriptionStringRequiredOrder details
country_codeStringRequiredOrder details
localeStringRequiredOrder details
platformStringRequiredOrder details
is_mobileBooleanRequiredOrder details
total_amountAmount objectRequiredAmounts
shipping_amountAmount objectRequiredAmounts
tax_amountAmount objectRequiredAmounts
discountObjectConditionalAmounts
risk_assessmentObjectRequiredRisk assessment
risk_assessment.hotels_itineraryObjectRequiredHotel itinerary
consumerObjectRequiredConsumer
itemsArray of objectsRequiredItems
merchant_urlObjectRequiredRedirect URLs
billing_addressObjectConditionalAddresses
shipping_addressObjectConditionalAddresses
payment_typeStringConditionalCheckout options
instalmentsIntegerConditionalCheckout options
expires_in_minutesIntegerOptionalCheckout options
additional_dataObjectOptionalCheckout options

Order details

FieldTypeRequiredDescription
order_reference_idStringRequiredYour unique order ID. Tamara uses it in settlements and reports.
order_numberStringOptionalThe order number you show to the customer, used in customer communication. Defaults to order_reference_id if not sent.
descriptionStringRequiredA short description of the order.
country_codeStringRequiredTwo-letter ISO 3166-1 country code of the order, for example SA.
localeStringRequiredLanguage of the Tamara checkout page: ar_SA or en_US. Send it to give the customer the best experience.
platformStringRequiredWhere the order was started, for example web or mobile.
is_mobileBooleanRequiredtrue if the order was started from a mobile device.

Amounts

All amount fields use the same Amount object:

FieldTypeRequiredDescription
amountNumberRequiredThe value. 2 decimal places by default, 3 for BHD, KWD and OMR.
currencyStringRequiredThree-letter ISO 4217 currency code, for example SAR.
FieldTypeRequiredDescription
total_amountAmount objectRequiredThe final amount charged to the customer: item amount + tax amount + shipping amount − discount amount.
shipping_amountAmount objectRequiredThe shipping cost for the order. Send 0 for hotel bookings with no shipping.
tax_amountAmount objectRequiredThe total tax for the order. Do not send negative values.
discountObjectConditionalRequired only if customers can use a promo or coupon code at your checkout. See the table below.

discount object

FieldTypeRequiredDescription
nameStringRequiredThe name of the promo or coupon code.
amountAmount objectRequiredThe discount value applied to the order.
"total_amount":    { "amount": 270, "currency": "SAR" },
"shipping_amount": { "amount": 0,   "currency": "SAR" },
"tax_amount":      { "amount": 0,   "currency": "SAR" },
"discount": {
  "name": "STAY30",
  "amount": { "amount": 30, "currency": "SAR" }
}

Risk assessment

The risk_assessment object shares what you know about the customer, so Tamara can assess the order accurately.

FieldTypeRequiredDescription
is_premium_customerBooleanRequiredtrue if the customer has a subscription package or VIP status with you.
account_creation_dateStringRequiredWhen the customer registered their account with you (dd-mm-yyyy).
total_order_countIntegerRequiredNumber of successful orders the customer has placed with you.
date_first_paidStringRequiredDate of the customer's first successful order (dd-mm-yyyy). Send null if this is their first order.
date_last_paidStringRequiredDate of the customer's last successful order (dd-mm-yyyy). Send null if this is their first order.
risk_scoreIntegerRequiredYour own aggregated risk score for the customer or transaction. Required for hotel bookings.
order_count_last_24hIntegerOptionalNumber of successful orders the customer has placed with you in the last 24 hours.
account_securityObjectOptionalSecurity and identity signals for the customer's account. See the table below.
hotels_itineraryObjectRequiredDetails of the hotel booking. See Hotel itinerary.

account_security object

FieldTypeRequiredDescription
is_email_verifiedBooleanOptionaltrue if you have verified the customer's email address.
is_phone_verifiedBooleanOptionaltrue if you have verified the customer's phone number.
password_last_changedStringOptionalDate of the last password reset (dd-mm-yyyy).
last_login_dateStringOptionalDate of the customer's last login (dd-mm-yyyy).
last_verification_methodStringOptionalMethod used for the last authentication, for example OTP or Biometric.
device_idStringOptionalYour unique device fingerprint or ID. A hashed value is fine.
devices_linkedStringOptionalNumber of active devices linked to the account, sent as a string, for example "2".
"risk_assessment": {
  "is_premium_customer": true,
  "account_creation_date": "31-01-2019",
  "total_order_count": 12,
  "date_first_paid": "31-01-2019",
  "date_last_paid": "31-01-2026",
  "risk_score": 5,
  "order_count_last_24h": 0,
  "account_security": {
    "is_email_verified": true,
    "is_phone_verified": true,
    "password_last_changed": "31-01-2026",
    "last_login_date": "31-01-2026",
    "last_verification_method": "OTP",
    "device_id": "#123",
    "devices_linked": "2"
  }
}

Hotel itinerary

The hotels_itinerary object sits inside risk_assessment and describes the stay being booked.

FieldTypeRequiredDescription
checkin_dateStringRequiredCheck-in date (dd-mm-yyyy).
checkout_dateStringRequiredCheck-out date (dd-mm-yyyy).
number_of_guestsIntegerRequiredNumber of guests in this booking.
ticket_delivery_recipientStringRequiredEmail address or phone number the tickets are sent to.
hotel_nameStringRequiredName of the hotel or property.
hotel_cityStringRequiredIATA code of the city, for example RUH.
hotel_countryStringRequiredTwo-letter ISO 3166-1 country code, for example SA.
hotel_room_classStringRequiredRoom category, for example Standard, Suite or Deluxe.
is_refundable_bookingBooleanRequiredtrue if the customer can request a refund for this booking.
name_of_guestsObjectOptionalNames of the guests in this booking. See the table below.
number_of_roomsIntegerOptionalNumber of rooms in this booking.
hostObjectConditionalRequired for rentals booked from a host. See the table below.

name_of_guests object

Add one field per guest, numbered in order.

FieldTypeRequiredDescription
guest1_nameStringOptionalFull name of the first guest.
guest2_nameStringOptionalFull name of the second guest.

host object

Send host when the booking is a rental from a host. When you send it, both fields are required.

FieldTypeRequiredDescription
host_registration_dateStringRequiredDate the host registered their account on your platform (dd-mm-yyyy).
host_number_of_reservationsIntegerRequiredNumber of reservations this host has fulfilled with you.
"hotels_itinerary": {
  "checkin_date": "24-08-2026",
  "checkout_date": "25-08-2026",
  "number_of_guests": 2,
  "name_of_guests": {
    "guest1_name": "Mona Lisa",
    "guest2_name": "Leo Lisa"
  },
  "ticket_delivery_recipient": "[email protected]",
  "number_of_rooms": 2,
  "hotel_name": "Radisson",
  "hotel_city": "RUH",
  "hotel_country": "SA",
  "hotel_room_class": "Standard",
  "is_refundable_booking": true,
  "host": {
    "host_registration_date": "24-08-2020",
    "host_number_of_reservations": 15
  }
}

Consumer

FieldTypeRequiredDescription
first_nameStringRequiredThe customer's first name.
last_nameStringRequiredThe customer's last name.
phone_numberStringRequiredThe customer's phone number. Maximum 13 characters.
emailStringOptionalThe customer's email address. Maximum 128 characters.
"consumer": {
  "first_name": "Mona",
  "last_name": "Lisa",
  "phone_number": "566027755",
  "email": "[email protected]"
}

Items

items is an array with one object for each product in the order.

FieldTypeRequiredDescription
reference_idStringRequiredYour unique ID for the product.
nameStringRequiredThe product name. Maximum 255 characters.
skuStringRequiredYour SKU for the product. Maximum 128 characters.
quantityIntegerRequiredNumber of units ordered.
typeStringRequiredThe product type. Hotel reservations are Digital.
total_amountAmount objectRequiredThe total amount for this line item.
unit_priceAmount objectOptionalThe price of one unit.
tax_amountAmount objectOptionalThe tax for this line item.
discount_amountAmount objectOptionalThe discount applied to this line item.
item_urlURLOptionalLink to the product page.
image_urlURLOptionalLink to the product image.
"items": [
  {
    "reference_id": "SA-12436",
    "type": "Digital",
    "name": "Radisson Riyadh - Standard Room",
    "sku": "SA-12436",
    "quantity": 1,
    "unit_price": { "amount": 300, "currency": "SAR" },
    "tax_amount": { "amount": 0, "currency": "SAR" },
    "total_amount": { "amount": 300, "currency": "SAR" }
  }
]

Redirect URLs

The merchant_url object tells Tamara where to send the customer after checkout.

FieldTypeRequiredWhen the customer is redirected
successURLRequiredThe checkout session completed successfully.
failureURLRequiredThe checkout failed because of a network error, or the customer was declined.
cancelURLRequiredThe customer cancelled the checkout.
"merchant_url": {
  "success": "https://example.com/checkout/success",
  "failure": "https://example.com/checkout/failure",
  "cancel": "https://example.com/checkout/cancel"
}

Addresses

Both addresses use the same Address object.

FieldTypeRequired in shipping_addressRequired in billing_addressDescription
first_nameStringRequiredRequired if availableRecipient's first name.
last_nameStringRequiredRequired if availableRecipient's last name.
line1StringRequiredRequired if availableFirst line of the street address.
line2StringRequiredRequired if availableSecond line of the street address.
regionStringRequiredRequired if availableRegion, district or neighbourhood.
cityStringRequiredRequired if availableCity.
postal_codeStringOptionalOptionalPostal code.
country_codeStringRequiredRequired if availableTwo-letter ISO 3166-1 country code.
phone_numberStringRequiredRequired if availableContact phone number for this address.
ObjectWhen to send it
shipping_addressRequired. You can leave it out for hotel bookings when no shipping address is available.
billing_addressRequired if available. If you send it, include every field marked Required if available.
"shipping_address": {
  "first_name": "Mona",
  "last_name": "Lisa",
  "line1": "3764 Al Urubah Rd",
  "line2": "Apartment 12",
  "region": "As Sulimaniyah",
  "city": "Riyadh",
  "postal_code": "12345",
  "country_code": "SA",
  "phone_number": "566027755"
}

Checkout options

FieldTypeRequiredDescription
payment_typeStringConditionalRequired only if single checkout is disabled on your account.
instalmentsIntegerConditionalRequired only if single checkout is disabled on your account.
expires_in_minutesIntegerOptionalHow long the order stays open, in minutes. Minimum 5, maximum 1440 (one day). Ignored unless Tamara support enables custom expiry for your account; otherwise the default is 30 minutes.
additional_dataObjectOptionalAny extra order information you want to share with Tamara. See the table below.

additional_data object

FieldTypeRequiredDescription
delivery_methodStringOptionalThe delivery method the customer chose, for example Home Delivery or click and collect.
pickup_storeStringOptionalThe collection point the customer chose, if the order is for store pickup.
store_codeStringOptionalThe unique store code or name the request comes from.
vendor_amountNumberOptionalThe amount to be settled to the vendor.
merchant_settlement_amountNumberOptionalThe amount to be settled to the merchant.
vendor_reference_codeStringOptionalThe vendor identifier.
"additional_data": {
  "delivery_method": "Home Delivery",
  "pickup_store": "Store A",
  "store_code": "Branch A",
  "vendor_amount": 0,
  "merchant_settlement_amount": 0,
  "vendor_reference_code": "AZ1234"
}

Full request example

The request below includes every required, conditional and optional field for hotel bookings. Each field has a comment that says whether it's Required, Conditional, Required if available or Optional.

🚧

Remove the comments before sending

JSON doesn't allow comments. Use the Without comments tab, or delete the // lines, before you send the request.

{
  // ─── Order details ───────────────────────────────────────────────

  // Required: your unique order ID, used in settlements and reports
  "order_reference_id": "abd12331-a123-1234-4567-473fkid5",
  // Optional: order number shown to the customer; defaults to order_reference_id
  "order_number": "S12356",
  // Required: short description of the order
  "description": "Radisson Riyadh, 1 night, 2 rooms",
  // Required: two-letter ISO 3166-1 country code (SA, AE, BH, KW, OM)
  "country_code": "SA",
  // Required: checkout page language (ar_SA or en_US)
  "locale": "ar_SA",
  // Required: where the order was started, e.g. web, mobile or your platform name
  "platform": "web",
  // Required: true if the order was started from a mobile device
  "is_mobile": false,

  // ─── Amounts ─────────────────────────────────────────────────────

  // Required: final amount = item amount + tax + shipping − discount (300 + 0 + 0 − 30)
  "total_amount": {
    // Required: 2 decimals by default, 3 for BHD, KWD and OMR
    "amount": 270,
    // Required: three-letter ISO 4217 code (SAR, AED, BHD, KWD, OMR)
    "currency": "SAR"
  },
  // Required: shipping cost for the order; send 0 for hotel bookings with no shipping
  "shipping_amount": {
    // Required
    "amount": 0,
    // Required
    "currency": "SAR"
  },
  // Required: total tax for the order; no negative values
  "tax_amount": {
    // Required
    "amount": 0,
    // Required
    "currency": "SAR"
  },
  // Conditional: required only if the customer applied a promo or coupon code to this order
  "discount": {
    // Required: name of the promo or coupon code
    "name": "STAY30",
    // Required: discount value applied to the order
    "amount": {
      // Required
      "amount": 30,
      // Required
      "currency": "SAR"
    }
  },

  // ─── Risk assessment ─────────────────────────────────────────────

  // Required: what you know about the customer
  "risk_assessment": {
    // Required: true if the customer has a subscription package or VIP status
    "is_premium_customer": true,
    // Required: date the customer registered with you (dd-mm-yyyy)
    "account_creation_date": "31-01-2019",
    // Required: number of successful orders with you
    "total_order_count": 12,
    // Required: date of first successful order (dd-mm-yyyy); null if first order
    "date_first_paid": "31-01-2019",
    // Required: date of last successful order (dd-mm-yyyy); null if first order
    "date_last_paid": "31-01-2026",
    // Required for hotels: your own aggregated risk score for the customer or transaction
    "risk_score": 5,
    // Optional: number of successful orders in the last 24 hours
    "order_count_last_24h": 0,
    // Optional: security and identity signals for the account
    "account_security": {
      // Optional: true if you verified the customer's email
      "is_email_verified": true,
      // Optional: true if you verified the customer's phone number
      "is_phone_verified": true,
      // Optional: date of last password reset (dd-mm-yyyy)
      "password_last_changed": "31-01-2026",
      // Optional: date of last login (dd-mm-yyyy)
      "last_login_date": "31-01-2026",
      // Optional: method used for the last authentication, e.g. OTP or Biometric
      "last_verification_method": "OTP",
      // Optional: your device fingerprint or ID; a hashed value is fine
      "device_id": "#123",
      // Optional: number of active devices linked to the account, sent as a string
      "devices_linked": "2"
    },
    // Required: details of the hotel booking
    "hotels_itinerary": {
      // Required: check-in date (dd-mm-yyyy)
      "checkin_date": "24-08-2026",
      // Required: check-out date (dd-mm-yyyy)
      "checkout_date": "25-08-2026",
      // Required: number of guests in this booking
      "number_of_guests": 2,
      // Optional: names of the guests in this booking
      "name_of_guests": {
        // Optional
        "guest1_name": "Mona Lisa",
        // Optional
        "guest2_name": "Leo Lisa"
      },
      // Required: email or phone number the tickets are sent to
      "ticket_delivery_recipient": "[email protected]",
      // Optional: number of rooms in this booking
      "number_of_rooms": 2,
      // Required: name of the hotel or property
      "hotel_name": "Radisson",
      // Required: city IATA code
      "hotel_city": "RUH",
      // Required: two-letter ISO 3166-1 country code
      "hotel_country": "SA",
      // Required: room category, e.g. Standard, Suite or Deluxe
      "hotel_room_class": "Standard",
      // Required: true if the customer can request a refund for this booking
      "is_refundable_booking": true,
      // Conditional: required for rentals booked from a host
      "host": {
        // Required: date the host registered on your platform (dd-mm-yyyy)
        "host_registration_date": "24-08-2020",
        // Required: number of reservations this host has fulfilled with you
        "host_number_of_reservations": 15
      }
    }
  },

  // ─── Consumer ────────────────────────────────────────────────────

  // Required: the customer's identifying details
  "consumer": {
    // Required
    "first_name": "Mona",
    // Required
    "last_name": "Lisa",
    // Required: maximum 32 characters
    "phone_number": "566027755",
    // Optional: maximum 128 characters
    "email": "[email protected]"
  },

  // ─── Items ───────────────────────────────────────────────────────

  // Required: one object per product in the order
  "items": [
    {
      // Required: your unique ID for the reservation
      "reference_id": "SA-12436",
      // Required: product type; hotel reservations are Digital
      "type": "Digital",
      // Required: product name; maximum 255 characters
      "name": "Radisson Riyadh - Standard Room",
      // Required: your SKU; maximum 128 characters
      "sku": "SA-12436",
      // Required: number of units ordered
      "quantity": 1,
      // Optional: price of one unit
      "unit_price": {
        "amount": 300,
        "currency": "SAR"
      },
      // Optional: tax for this line item
      "tax_amount": {
        "amount": 0,
        "currency": "SAR"
      },
      // Optional: discount applied to this line item
      "discount_amount": {
        "amount": 0,
        "currency": "SAR"
      },
      // Required: total amount for this line item
      "total_amount": {
        // Required
        "amount": 300,
        // Required
        "currency": "SAR"
      },
      // Optional: link to the hotel or room page
      "item_url": "https://example.com/hotels/radisson-riyadh",
      // Optional: link to an image of the hotel or room
      "image_url": "https://example.com/images/radisson-riyadh.png"
    }
  ],

  // ─── Redirect URLs ───────────────────────────────────────────────

  // Required: where Tamara sends the customer after checkout
  "merchant_url": {
    // Required: checkout completed successfully
    "success": "https://example.com/checkout/success",
    // Required: checkout failed or the customer was declined
    "failure": "https://example.com/checkout/failure",
    // Required: the customer cancelled the checkout
    "cancel": "https://example.com/checkout/cancel"
  },

  // ─── Addresses ───────────────────────────────────────────────────

  // Required if available: the customer's billing address
  "billing_address": {
    // Required if available
    "first_name": "Mona",
    // Required if available
    "last_name": "Lisa",
    // Required if available
    "line1": "3764 Al Urubah Rd",
    // Required if available
    "line2": "Apartment 12",
    // Required if available
    "region": "As Sulimaniyah",
    // Required if available
    "city": "Riyadh",
    // Optional
    "postal_code": "12345",
    // Required if available: two-letter ISO 3166-1 country code
    "country_code": "SA",
    // Required if available
    "phone_number": "566027755"
  },
  // Required: can be left out for hotel bookings when no shipping address is available
  "shipping_address": {
    // Required
    "first_name": "Mona",
    // Required
    "last_name": "Lisa",
    // Required
    "line1": "3764 Al Urubah Rd",
    // Required
    "line2": "Apartment 12",
    // Required
    "region": "As Sulimaniyah",
    // Required
    "city": "Riyadh",
    // Optional
    "postal_code": "12345",
    // Required: two-letter ISO 3166-1 country code
    "country_code": "SA",
    // Required
    "phone_number": "566027755"
  },

  // ─── Checkout options ────────────────────────────────────────────

  // Conditional: required only if single checkout is disabled on your account
  "payment_type": "PAY_BY_INSTALMENTS",
  // Conditional: required only if single checkout is disabled on your account
  "instalments": 3,
  // Optional: order expiry in minutes (5–1440); ignored unless Tamara support enables it, default 30
  "expires_in_minutes": 60,
  // Optional: any extra order information
  "additional_data": {
    // Optional: delivery method chosen by the customer
    "delivery_method": "Home Delivery",
    // Optional: collection point, if the order is for store pickup
    "pickup_store": "Store A",
    // Optional: the store code or name the request comes from
    "store_code": "Branch A",
    // Optional: the amount to be settled to the vendor
    "vendor_amount": 0,
    // Optional: the amount to be settled to the merchant
    "merchant_settlement_amount": 0,
    // Optional: the vendor identifier
    "vendor_reference_code": "AZ1234"
  }
}
{
  "order_reference_id": "abd12331-a123-1234-4567-473fkid5",
  "order_number": "S12356",
  "description": "Radisson Riyadh, 1 night, 2 rooms",
  "country_code": "SA",
  "locale": "ar_SA",
  "platform": "web",
  "is_mobile": false,
  "total_amount": {
    "amount": 270,
    "currency": "SAR"
  },
  "shipping_amount": {
    "amount": 0,
    "currency": "SAR"
  },
  "tax_amount": {
    "amount": 0,
    "currency": "SAR"
  },
  "discount": {
    "name": "STAY30",
    "amount": {
      "amount": 30,
      "currency": "SAR"
    }
  },
  "risk_assessment": {
    "is_premium_customer": true,
    "account_creation_date": "31-01-2019",
    "total_order_count": 12,
    "date_first_paid": "31-01-2019",
    "date_last_paid": "31-01-2026",
    "risk_score": 5,
    "order_count_last_24h": 0,
    "account_security": {
      "is_email_verified": true,
      "is_phone_verified": true,
      "password_last_changed": "31-01-2026",
      "last_login_date": "31-01-2026",
      "last_verification_method": "OTP",
      "device_id": "#123",
      "devices_linked": "2"
    },
    "hotels_itinerary": {
      "checkin_date": "24-08-2026",
      "checkout_date": "25-08-2026",
      "number_of_guests": 2,
      "name_of_guests": {
        "guest1_name": "Mona Lisa",
        "guest2_name": "Leo Lisa"
      },
      "ticket_delivery_recipient": "[email protected]",
      "number_of_rooms": 2,
      "hotel_name": "Radisson",
      "hotel_city": "RUH",
      "hotel_country": "SA",
      "hotel_room_class": "Standard",
      "is_refundable_booking": true,
      "host": {
        "host_registration_date": "24-08-2020",
        "host_number_of_reservations": 15
      }
    }
  },
  "consumer": {
    "first_name": "Mona",
    "last_name": "Lisa",
    "phone_number": "566027755",
    "email": "[email protected]"
  },
  "items": [
    {
      "reference_id": "SA-12436",
      "type": "Digital",
      "name": "Radisson Riyadh - Standard Room",
      "sku": "SA-12436",
      "quantity": 1,
      "unit_price": {
        "amount": 300,
        "currency": "SAR"
      },
      "tax_amount": {
        "amount": 0,
        "currency": "SAR"
      },
      "discount_amount": {
        "amount": 0,
        "currency": "SAR"
      },
      "total_amount": {
        "amount": 300,
        "currency": "SAR"
      },
      "item_url": "https://example.com/hotels/radisson-riyadh",
      "image_url": "https://example.com/images/radisson-riyadh.png"
    }
  ],
  "merchant_url": {
    "success": "https://example.com/checkout/success",
    "failure": "https://example.com/checkout/failure",
    "cancel": "https://example.com/checkout/cancel"
  },
  "billing_address": {
    "first_name": "Mona",
    "last_name": "Lisa",
    "line1": "3764 Al Urubah Rd",
    "line2": "Apartment 12",
    "region": "As Sulimaniyah",
    "city": "Riyadh",
    "postal_code": "12345",
    "country_code": "SA",
    "phone_number": "566027755"
  },
  "shipping_address": {
    "first_name": "Mona",
    "last_name": "Lisa",
    "line1": "3764 Al Urubah Rd",
    "line2": "Apartment 12",
    "region": "As Sulimaniyah",
    "city": "Riyadh",
    "postal_code": "12345",
    "country_code": "SA",
    "phone_number": "566027755"
  },
  "payment_type": "PAY_BY_INSTALMENTS",
  "instalments": 3,
  "expires_in_minutes": 60,
  "additional_data": {
    "delivery_method": "Home Delivery",
    "pickup_store": "Store A",
    "store_code": "Branch A",
    "vendor_amount": 0,
    "merchant_settlement_amount": 0,
    "vendor_reference_code": "AZ1234"
  }
}

Minimal request example

The smallest request that includes every Required field for hotel bookings, including risk_score and the required hotels_itinerary fields. Use it as a starting point, then add optional fields to share more risk signals.

📘

Before you send it

  • If single checkout is disabled on your account, also send payment_type and instalments.
  • If the customer applied a promo or coupon code, also send discount.
  • If you have the customer's billing address, also send billing_address.
  • For a customer's first order, send null for date_first_paid and date_last_paid.
  • For rentals booked from a host, also send hotels_itinerary.host.
{
  "order_reference_id": "abd12331-a123-1234-4567-473fkid5",
  "description": "Radisson Riyadh, 1 night",
  "country_code": "SA",
  "locale": "ar_SA",
  "platform": "web",
  "is_mobile": false,
  "total_amount": {
    "amount": 300,
    "currency": "SAR"
  },
  "shipping_amount": {
    "amount": 0,
    "currency": "SAR"
  },
  "tax_amount": {
    "amount": 0,
    "currency": "SAR"
  },
  "risk_assessment": {
    "is_premium_customer": false,
    "account_creation_date": "31-01-2019",
    "total_order_count": 12,
    "date_first_paid": "31-01-2019",
    "date_last_paid": "31-01-2026",
    "risk_score": 5,
    "hotels_itinerary": {
      "checkin_date": "24-08-2026",
      "checkout_date": "25-08-2026",
      "number_of_guests": 2,
      "ticket_delivery_recipient": "[email protected]",
      "hotel_name": "Radisson",
      "hotel_city": "RUH",
      "hotel_country": "SA",
      "hotel_room_class": "Standard",
      "is_refundable_booking": true
    }
  },
  "consumer": {
    "first_name": "Mona",
    "last_name": "Lisa",
    "phone_number": "566027755"
  },
  "items": [
    {
      "reference_id": "SA-12436",
      "type": "Digital",
      "name": "Radisson Riyadh - Standard Room",
      "sku": "SA-12436",
      "quantity": 1,
      "total_amount": {
        "amount": 300,
        "currency": "SAR"
      }
    }
  ],
  "merchant_url": {
    "success": "https://example.com/checkout/success",
    "failure": "https://example.com/checkout/failure",
    "cancel": "https://example.com/checkout/cancel"
  },
  "shipping_address": {
    "first_name": "Mona",
    "last_name": "Lisa",
    "line1": "3764 Al Urubah Rd",
    "line2": "Apartment 12",
    "region": "As Sulimaniyah",
    "city": "Riyadh",
    "country_code": "SA",
    "phone_number": "566027755"
  }
}

Common mistakes

🚧

Check these before going live

  • Wrong date format. Send all dates as dd-mm-yyyy strings, for example 31-01-2026, not 2026-01-31.
  • Wrong types for counts. Send total_order_count and order_count_last_24h as integers (12), but devices_linked as a string ("2").
  • First-time customers. Send null for date_first_paid and date_last_paid when it is the customer's first order.
  • Totals that don't add up. total_amount must equal item amount + tax amount + shipping amount − discount amount.
  • Too many decimals. Use 2 decimal places, or 3 for BHD, KWD and OMR.
  • City names instead of codes. Send an IATA code in hotel_city (for example RUH, not Riyadh) and a two-letter code in hotel_country.
  • Swapped dates. checkout_date should be after checkin_date.
  • Booleans sent as strings. Send is_refundable_booking as true or false, not "true".
  • Missing risk_score. It's optional on the General page but Required for hotel bookings.
  • Missing host details for rentals. If the booking is a rental from a host, send host with both of its fields.

FAQs

Answers to common questions, grouped by topic. Select a question to expand it.

Hotel bookings

Which dates do I send for a stay?

Send checkin_date and checkout_date as strings in dd-mm-yyyy format, for example 24-08-2026 and 25-08-2026. The check-out date should be after the check-in date.

What goes in hotel_city and hotel_country?

hotel_city takes the city's IATA code, for example RUH for Riyadh. hotel_country takes the two-letter ISO 3166-1 country code, for example SA.

Do I need to send guest names?

No. number_of_guests is required, but name_of_guests is optional. If you send it, add one field per guest: guest1_name, guest2_name and so on.

Which room details should I send?

hotel_room_class is required, for example Standard, Suite or Deluxe. number_of_rooms is optional but helps when one booking covers several rooms.

When do I send the host object?

Only for rentals booked from a host. When you send host, include both host_registration_date (dd-mm-yyyy) and host_number_of_reservations.

What is ticket_delivery_recipient?

The email address or phone number the tickets are sent to. It can be different from the customer's own contact details.

Is risk_score required for hotels?

Yes. risk_score is optional on the General page, but Required for hotel bookings.

How do I send is_refundable_booking?

As a boolean: true if the customer can request a refund for this booking, otherwise false. Don't send it as a string like "true".

Getting started

Do I also need to send the General fields?

Yes. Send every field from the General page, plus the hotels_itinerary object and risk_score.

Do I have to send the optional fields?

No, the request works without them. But optional fields such as risk_score, order_count_last_24h and account_security are extra risk signals. The more you share, the more accurately Tamara can assess each order.

Can I test before going live?

Yes. Send requests to the sandbox URL https://api-sandbox.tamara.co/checkout with your sandbox API token, then switch to https://api.tamara.co/checkout with your live token.

Customer and risk data

What should I send for a customer placing their first order?

Send null for both date_first_paid and date_last_paid, and 0 for total_order_count.

Which date format should I use?

Send every date as a string in dd-mm-yyyy format, for example 31-01-2026.

Amounts

How is total_amount calculated?

total_amount is the final amount charged to the customer: item amount + tax amount + shipping amount − discount amount.

How many decimal places can amounts have?

2 decimal places by default, and 3 for BHD, KWD and OMR.

Do I still send shipping_amount for hotel bookings?

Yes. shipping_amount is required, so send it with an amount of 0 when there's nothing to ship.

When should I send the discount object?

Only when the customer applies a promo or coupon code to this specific order. Don't use it for site-wide discounts.

Addresses

Hotel bookings have no shipping address. What do I send?

shipping_address is required, but you can leave it out for hotel bookings when no shipping address is available. Send billing_address if you have one.

Is billing_address required?

It's required if available. If you send it, include every field marked Required if available in the Addresses table.

Checkout session

Do I need to send payment_type and instalments?

Only if single checkout is disabled on your account. If you're not sure which applies to you, ask your Tamara account manager.

What happens if I don't send locale?

New customers see the checkout page in Arabic. Returning customers see their saved language preference. Send ar_SA or en_US to control it yourself.

How long does a checkout session stay open?

30 minutes by default. You can set between 5 and 1440 minutes with expires_in_minutes, but only after Tamara support enables custom expiry for your account.

Where is the customer sent after checkout?

To one of the URLs in merchant_url: success when checkout completes, failure if it fails or the customer is declined, and cancel if the customer cancels.

What should I do with the response?

The response includes order_id, checkout_id, status and checkout_url. Store the order_id in your database so you can fetch the order details later, then redirect the customer to the checkout_url to complete the payment through Tamara. See Create Checkout Session.


Did this page help you?