Tamara for Payment Setup API
Last updated: April 30, 2026
To accept Tamara payments, you must:
- Create a payment setup.
- 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. |
string | The customer's full name. |
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. |
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"status": "ready",12"flags": []13}14},15"available_payment_methods": [16"tamara"17],18"settings": {19"success_url": "https://example.com/payments/success",20"failure_url": "https://example.com/payments/failure"21}22}
The response returns a payment_methods object, which contains the payment methods enabled on your account.
When all required fields are present, the payment_methods.tamara object shows a ready status.
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.