Tamara for Payment Setup API
Last updated: September 3, 2026
To accept Tamara payments, you must:
- Create a payment setup.
- Enable initialization to check the customer's eligibility.
- Confirm the payment.
- Redirect the customer to Tamara.
Call the Create a payment setup endpoint.
Information
Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see API endpoints.
post
https://{prefix}.api.checkout.com/payments/setups
1{2"amount": 10000,3"currency": "SAR",4"reference": "ORD-5023-4E89",5"customer": {6"name": "Ali Farid",7"phone": {8"country_code": "966",9"number": "556002013"10}11},12"order": {13"shipping": {14"address": {15"address_line1": "123 King Fahd Rd",16"city": "Riyadh",17"zip": "11564",18"country": "SA"19}20}21},22"settings": {23"success_url": "https://example.com/payments/success",24"failure_url": "https://example.com/payments/failure"25}26}
In the request body, provide the following:
| Field | Description |
|---|---|
number | The payment amount, in the minor currency unit. |
string | Three-letter ISO 4217 currency code.
Required |
string | The customer's full name. |
string | The customer's email address. |
object | The customer's phone number. |
string | The international dialing code for the customer's phone number. |
string | The customer's phone number. |
object | The order details. |
object | The shipping details for the order. |
object | The shipping address. |
string | The first line of the shipping address. |
string | The city of the shipping address. |
string | The two-letter ISO 3166 country code for the shipping address. |
string | The postal code of the shipping address. |
string | A reference you can use to identify the payment. |
string | The URL to redirect the customer to if the payment fails. |
string | The URL to redirect the customer to if the payment is successful. |
object | The customer's billing details. |
object | The customer's billing address. |
string | The first line of the billing address. |
string | The second line of the billing address. |
string | The city of the billing address. |
string | The two-letter ISO 3166 country code for the billing address. |
string | The state or region of the billing address. |
string | The postal code of the billing address. |
string | A description of the payment. |
string | The customer's chosen Tamara payment plan.
|
array[object] | The accommodation-specific data, if applicable. |
string | Required when Conditional |
string | Required when Conditional |
string | Required when Conditional |
string | Required when Conditional |
array[object] | Required when Conditional |
string | Required when Conditional |
array[object] | The airline-specific data, if applicable. |
string | Required when Conditional |
string | Required when Conditional |
string | Required when Conditional |
array[object] | Required when Conditional |
string | Required when Conditional |
string | Required when Conditional |
string | Required when Conditional |
string | Required when Conditional |
string | The departure date of that flight leg. |
array | An array of items in the order. |
string | The name of the item. |
number | The quantity of the item. |
number | The unit price of the item, in the minor currency unit. |
1{2"id": "set_rcmepwrchqab2wsergcafvijfy",3"processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4",4"amount": 10000,5"currency": "SAR",6"payment_type": "Regular",7"reference": "ORD-5023-4E89",8"description": "Tamara payment",9"payment_methods": {10"tamara": {11"initialization": "disabled",12"status": "initialization_required",13"flags": []14}15},16"available_payment_methods": [17"tamara"18],19"settings": {20"success_url": "https://example.com/payments/success",21"failure_url": "https://example.com/payments/failure"22}23}
The response returns a payment_methods object, which contains the payment methods enabled on your account.
While payment_methods.tamara.initialization is disabled, the request is not validated against Tamara's rules and the payment_methods.tamara object shows an initialization_required status. To check the customer's eligibility, enable initialization.
When the customer selects Tamara, update the payment setup by calling the Update a payment setup endpoint and provide:
- The payment setup
idas the{id}path parameter. payment_methods.tamara.initializationset toenabled.
Enabling initialization triggers Tamara's eligibility assessment for the customer. The request must also carry the reference, settings.success_url, settings.failure_url, a customer (with name, email.address, and phone), and an order.shipping.address.
put
https://{prefix}.api.checkout.com/payments/setups/{id}
1{2"amount": 10000,3"currency": "SAR",4"reference": "ORD-5023-4E89",5"customer": {6"name": "Ali Farid",7"email": {8"address": "ali.farid@example.com"9},10"phone": {11"country_code": "966",12"number": "556002013"13}14},15"order": {16"shipping": {17"address": {18"address_line1": "123 King Fahd Rd",19"city": "Riyadh",20"zip": "11564",21"country": "SA"22}23}24},25"settings": {26"success_url": "https://example.com/payments/success",27"failure_url": "https://example.com/payments/failure"28},29"payment_methods": {30"tamara": {31"initialization": "enabled"32}33}34}
Optionally, provide a payment_methods.tamara.risk_assessment object with your own assessment of the customer:
| Field | Description |
|---|---|
boolean | Whether the customer is a premium customer. |
integer | Your own risk score for the customer. |
integer | The number of orders the customer placed in the last 24 hours. |
integer | The number of devices linked to the customer. |
If the customer is eligible, the payment_methods.tamara object shows a ready status, and you can proceed to confirm the payment:
1{2"payment_methods": {3"tamara": {4"initialization": "enabled",5"status": "ready",6"flags": []7}8},9"available_payment_methods": [10"tamara"11]12}
If the customer is not eligible, the payment_methods.tamara object shows an unavailable status with the ineligible_customer flag, and Tamara is removed from available_payment_methods. Offer the customer another payment method.
1{2"payment_methods": {3"tamara": {4"initialization": "enabled",5"status": "unavailable",6"flags": [7"ineligible_customer"8]9}10},11"available_payment_methods": []12}
If Tamara returns its own risk assessment for the customer, it's echoed back on payment_methods.tamara.risk_assessment.
Two other outcomes are possible:
| Status | Description |
|---|---|
| The request failed Tamara's validation rules. The |
| The eligibility check could not be completed. |
Once the payment_methods.tamara status is ready, confirm the payment by calling the Confirm a payment setup endpoint and provide:
- The payment setup
idas the{id}path parameter. tamaraas the{payment_method_name}path parameter.
post
https://{prefix}.api.checkout.com/payments/setups/{id}/confirm/tamara
1{2"id": "pay_er3uvjvfgpauje7o64agv3damy",3"status": "Pending",4"customer": {5"id": "cus_ujs5uvwcshhujllodxegkknwou"6},7"_links": {8"self": {9"href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_er3uvjvfgpauje7o64agv3damy"10},11"redirect": {12"href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_er3uvjvfgpauje7o64agv3damy/redirect"13}14}15}
Redirect the customer to the redirect.href URL from the response. The customer completes the payment on the Tamara page and is then redirected back to your settings.success_url or settings.failure_url.