v1

latestOpenAPI 3.0.32026-07-2418074.2 KB
Online Checkout

Create Checkout Session

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.

post/checkout

Request body

order_reference_idstring 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_numberstring

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.

country_code'SA' | 'AE' | 'BH' | 'KW' | 'OM' required

The two-character ISO 3166-1 country code

descriptionstring required

The order description.

platformstring

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_mobileboolean

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.

expires_in_minutesinteger

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.

Example request

{
  "total_amount": {
    "amount": 300,
    "currency": "SAR"
  },
  "shipping_amount": {
    "currency": "SAR"
  },
  "tax_amount": {
    "currency": "SAR"
  },
  "order_reference_id": "A1231234123",
  "order_number": "A1231234123",
  "items": [
    {
      "name": "Lego City 8601",
      "quantity": 1,
      "reference_id": "123",
      "type": "Digital, Physical...etc.",
      "sku": "SA-12436",
      "item_url": "SA-12436",
      "image_url": "SA-12436",
      "unit_price": {
        "amount": 490,
        "currency": "SAR"
      },
      "tax_amount": {
        "amount": 10,
        "currency": "SAR"
      },
      "discount_amount": {
        "amount": 100,
        "currency": "SAR"
      },
      "total_amount": {
        "currency": "SAR"
      }
    }
  ],
  "consumer": {
    "email": "customer@email.com",
    "first_name": "Mona",
    "last_name": "Lisa",
    "phone_number": "566027755"
  },
  "country_code": "SA",
  "description": "lorem ipsum dolor",
  "merchant_url": {
    "cancel": "http://example.com/#/cancel",
    "failure": "http://example.com/#/fail",
    "success": "http://example.com/#/success"
  },
  "billing_address": {
    "city": "Riyadh",
    "country_code": "SA",
    "first_name": "Mona",
    "last_name": "Lisa",
    "line1": "3764 Al Urubah Rd",
    "line2": "string",
    "phone_number": "532298658",
    "region": "As Sulimaniyah"
  },
  "shipping_address": {
    "city": "Riyadh",
    "country_code": "SA",
    "first_name": "Mona",
    "last_name": "Lisa'",
    "line1": "3764 Al Urubah Rd",
    "line2": "string",
    "phone_number": "532298658",
    "region": "As Sulimaniyah"
  },
  "platform": "Magento, WooCommerce, Salla..etc.",
  "locale": "ar_SA",
  "risk_assessment": {
    "customer_age": 21,
    "customer_dob": "01-12-2000",
    "customer_nationality": "SA or IN or KW",
    "account_creation_date": "12-06-2020",
    "platform_account_creation_date": "12-06-2020",
    "date_of_first_transaction": "12-06-2020",
    "is_card_on_file": true,
    "total_ltv": 200,
    "total_order_count": 15,
    "order_amount_last3months": 2000,
    "order_count_last3months": 10,
    "last_order_date": "12-06-2020",
    "last_order_amount": 2000,
    "reward_program_points": 2000
  },
  "expires_in_minutes": 30,
  "additional_data": {
    "delivery_method": "Home Delivery",
    "pickup_store": "Store A",
    "store_code": "Branch A",
    "vendor_amount": 10,
    "merchant_settlement_amount": 100,
    "vendor_reference_code": "AZ1234"
  }
}

Response

Checkout Session Created

checkout_idstring uuid
order_idstring uuid
statusstring
checkout_urlstring