---
title: "Create Checkout Session"
method: POST
path: "/checkout"
tags: ["Online Checkout"]
---

# Create Checkout Session

`POST /checkout`

This endpoint facilitates the creation of a checkout session, where all payment information is sent within the request to enable customer payments via Tamara. The response will include `order_id`, `checkout_id` , `status` and `checkout_url`. <br /> <br /> Please store the `order_id` in your DBs to fetch the information about the order later and direct the customer to the `checkout_url` to seamlessly conclude the transaction through Tamara.

## Request body

- object
  - `total_amount` object, required — Total amount to be charged to consumer.
    - `amount` number
    - `currency` 'SAR' | 'AED' | 'BHD' | 'KWD' | 'OMR'
  - `shipping_amount` object, required — Total amount for the shipping of the order.
    - `amount` string
    - `currency` 'SAR' | 'AED' | 'BHD' | 'KWD' | 'OMR'
  - `tax_amount` object, required — Total amount of taxes, if additionally applied.
    - `amount` string
    - `currency` 'SAR' | 'AED' | 'BHD' | 'KWD' | 'OMR'
  - `order_reference_id` string, required — Unique order ID from the merchant's side, which will be used for settlement and reporting purposes. Can be modified after the checkout session is created.
  - `order_number` string — The order number from the merchant side, this will be used for communication with the customer. If this value is not passed, the order_number will take the order_reference_id value.
  - `discount` object — This object is used to mention any customer-specific discount/voucher code being used for this specific order, but not to be used for site-wide discounts.
    - `name` string, required
    - `amount` object, required
      - `amount` number, required
      - `currency` 'SAR' | 'AED', required
  - `items` object[], required
    - `name` string, required — Product name. `<=255 characters`.
    - `quantity` number, required — The quantity being purchased for this specific item.
    - `reference_id` string, required — The unique id of the item from merchant's side
    - `type` string, required
    - `sku` string, required — Product SKU. **`<= 128 characters`**
    - `item_url` string, uri — URL of the item from merchant's website. **`<= 1024 characters`**
    - `image_url` string, uri — URL to an image of the product that can be later displayed to the customer. **`<= 1024 characters`** <br /> **Size** = 2-3 MB maximum <br /> **Resolution** WxH = 1024xY (the Y height of image should be small).
    - `unit_price` object
      - `amount` number
      - `currency` 'SAR' | 'AED' | 'BHD' | 'KWD' | 'OMR'
    - `tax_amount` object
      - `amount` number
      - `currency` 'SAR' | 'AED' | 'BHD' | 'KWD' | 'OMR'
    - `discount_amount` object
      - `amount` number
      - `currency` 'SAR' | 'AED' | 'BHD' | 'KWD' | 'OMR'
    - `total_amount` object, required
      - `amount` string
      - `currency` 'SAR' | 'AED' | 'BHD' | 'KWD' | 'OMR'
  - `consumer` object, required — The customer's identifying details.
    - `email` string, email
    - `first_name` string, required
    - `last_name` string, required
    - `phone_number` string, required
  - `country_code` 'SA' | 'AE' | 'BH' | 'KW' | 'OM', required — The two-character ISO 3166-1 country code
  - `description` string, required — The order description.
  - `merchant_url` object, required — This object includes all the redirect URLs that the customer will be redirected to from the Tamara checkout page in different cases.
    - `cancel` string, uri, required
    - `failure` string, uri, required
    - `success` string, uri, required
  - `billing_address` object — The customer's billing address, if any.
    - `city` string
    - `country_code` 'SA' | 'AE' | 'BH' | 'KW' | 'OM' — The two-character ISO 3166-1 country code
    - `first_name` string
    - `last_name` string
    - `line1` string
    - `line2` string
    - `phone_number` string
    - `region` string
  - `shipping_address` object, required
    - `city` string, required
    - `country_code` 'SA' | 'AE' | 'BH' | 'KW' | 'OM', required — The two-character ISO 3166-1 country code
    - `first_name` string, required
    - `last_name` string, required
    - `line1` string, required
    - `line2` string
    - `phone_number` string
    - `region` string
  - `platform` string — Mentions the platform where the Tamara order is being initiated from (Mostly used by our e-commerce plugins) but can also be used by direct integrations.
  - `is_mobile` boolean — To identify mobile users of your store.
  - `locale` 'ar_SA' | 'en_US' — Display language for Tamara checkout page. Language to be defined by the merchant following RFC 1766, e.g en_US or ar_SA. Default is set to Arabic if not passed and customer is new. If customer already exists and locale is not passed then customer's preference will be taken into account.
  - `risk_assessment` object — Risk assessment info from the merchant side
    - `customer_age` integer — Customer age in Years
    - `customer_dob` string — Customer Date of Birth (format dd-mm-yyyy)
    - `customer_gender` 'Male' | 'Female' — Customer's gender
    - `customer_nationality` string — Customer nationality code (ISO 2 letter)
    - `is_premium_customer` boolean — Is VIP or any kind of premium customer tiers like Platinum, Gold...etc
    - `is_existing_customer` boolean — Customer's account was created in the past, not on the same day as the order is created.
    - `is_guest_user` boolean — Is the customer performing guest checkout on your store.
    - `account_creation_date` string — Date of customer registration of their account (format dd-mm-yyyy)
    - `platform_account_creation_date` string — Date of customer registration of their account with the platform like Salla (format dd-mm-yyyy)
    - `date_of_first_transaction` string — Date of consumer’s first transaction. (format dd-mm-yyyy)
    - `is_card_on_file` boolean — Does customer have any saved cards on his account?
    - `is_COD_customer` boolean — Does customer only use Cash on Delivery as their payment method previously?
    - `has_delivered_order` boolean — Does the customer have successfully delivered orders in the past?
    - `is_phone_verified` boolean — Is the customer's registered phone verified?
    - `is_fraudulent_customer` boolean — Does customer have any history of fraudulent activity in your records like false chargebacks, stolen card usage etc.?
    - `total_ltv` number — Lifetime value. The total amount (in local currency) the consumer has ordered, excluding canceled, rejected, or refunded transactions. Also excluding **Tamara** payments.
    - `total_order_count` integer — Number of orders the customer has made at your store since creating an account, excluding canceled, rejected, or refunded transactions. Also excluding **Tamara** payments.
    - `order_amount_last3months` number — Amount the consumer spent in the last 3 months, excluding canceled, rejected, or refunded transactions. Also excluding **Tamara** payments.
    - `order_count_last3months` integer — Number of orders the consumer placed in the last 3 months, excluding canceled, rejected, or refunded transactions. Also excluding **Tamara** payments.
    - `last_order_date` string — Date on which the consumer made their last purchase, excluding **Tamara** payments (format dd-mm-yyyy)
    - `last_order_amount` number — Amount (in local currency) of the last order, excluding **Tamara** payments.
    - `reward_program_enrolled` boolean — Is customer enrolled in any of your reward program?
    - `reward_program_points` number — Number of reward points earned by the customer so far.
  - `expires_in_minutes` integer — Order expiry time in minutes, min 5 minutes, max 1440 (one day). By default this key will be ignored, and default value of 30 mins is used, **Please contact our support team to enable this feature**.
  - `additional_data` object — Any additional order data information from the merchant side
    - `delivery_method` string — the delivery method selected by the customer e.g. home delivery, or click and collect
    - `pickup_store` string — the collection point selected by the user if his order is for store collection
    - `store_code` string — The unique store code/name from which request is called
    - `vendor_amount` number — The amount to be settled to vendor
    - `merchant_settlement_amount` number — The amount to be settled to merchant
    - `vendor_reference_code` string — The vendor identifier

## Response `200`

Checkout Session Created

- object
  - `checkout_id` string, uuid
  - `order_id` string, uuid
  - `status` string
  - `checkout_url` string

## Other responses

- `400` — Unsupported Country/Currency

---

[API](https://skmtc.net/tamara/apis/tamara-public-apis-v1-0.md) · [All operations](https://skmtc.net/tamara/apis/tamara-public-apis-v1-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tamara/tamara-public-apis-v1-0/versions/924ade2a1159/schema)
