Tamara
Tamara is a Buy Now, Pay Later (BNPL) payment method that allows customers to split their purchases into installments instead of paying the full amount upfront.
DigetPay supports Tamara through two integration methods:
- Hosted Checkout: Tamara is available directly on the DigetPay payment page, without requiring a separate Tamara API request or additional merchant-side activation.
- Server-to-Server (S2S): Merchants can initiate Tamara payments through the DigetPay S2S Sale API using a dedicated request structure and hash calculation.
1. Choose Your Integration Method
| Feature | Hosted Checkout | S2S Integration |
|---|---|---|
| Payment interface | DigetPay Checkout | Merchant-controlled integration |
| API endpoint | /payment/checkout/intiate | /payment/s2s/sale |
| Payment method selection | Customer selects Tamara | Merchant specifies paymentMethod: "tamara" |
| Special Tamara request | Not required | Required |
| Tamara request hash | Not required | Required |
| Customer redirection | DigetPay Checkout | Tamara payment URL returned by API |
| Integration complexity | Simple | Advanced |
Recommended: Use Hosted Checkout for the simplest Tamara integration. Choose S2S when you need to initiate Tamara payments directly from your backend.
2. Tamara via Hosted Checkout
Tamara is supported directly through DigetPay Hosted Checkout.
No additional Tamara-specific integration, API request, or separate merchant-side activation is required.
Merchants can continue using the standard Create Payment Link API, and eligible customers can select Tamara from the available payment methods on the DigetPay Checkout page.
How It Works
sequenceDiagram
autonumber
participant M as Merchant Server
participant D as DigetPay API
participant C as Customer
participant P as DigetPay Checkout
participant T as Tamara
M->>D: POST /payment/checkout/intiate
D-->>M: Payment Link (redirectUrl)
M->>C: Redirect to DigetPay Checkout
C->>P: Select Tamara
P->>T: Initiate Tamara Payment
T->>C: Review Installment Plan
C->>T: Confirm Payment
T-->>P: Payment Result
P-->>C: Display DigetPay Payment Result Page
D-->>M: Webhook Notification
M->>D: Verify Payment Status
Integration Steps
- Create a payment link using the standard Hosted Checkout API.
- Include the customer's full name (first and last name).
- Redirect the customer to the returned
redirectUrl. - The customer selects Tamara on the DigetPay Checkout page.
- The customer reviews and confirms the installment plan.
- DigetPay displays the payment result on its Hosted Checkout page.
- Verify the final payment status using the Payment Status API or use webhook notifications followed by server-side verification.
API Endpoint
| Property | Value |
|---|---|
| Method | POST |
| URL | https://api.digetpay.com/v1/payment/checkout/intiate |
| Authentication | x-api-key |
| Content-Type | application/json |
Request Example
{
"merchantOrderId": "ORD-1001",
"amount": 450.00,
"currency": "SAR",
"customerName": "Ahmed Ali",
"customerEmail": "[email protected]",
"customerPhone": "+966501234567",
"successUrl": "https://yourstore.com/checkout/success",
"failureUrl": "https://yourstore.com/checkout/failure"
}Important: No paymentMethod: "tamara" parameter or Tamara-specific hash is needed for Hosted Checkout.
Tamara is presented as a payment option on the DigetPay Checkout page when available and eligible.
Customer Name Requirement
The customer's full name is required for Tamara.
customerName | Tamara |
|---|---|
Ahmed Ali | Supported |
Mohamed Ashour | Supported |
Ahmed Mohamed Ali | Supported |
Ahmed | Not supported |
Important: Always provide both first and last name in
customerName. A single-word name may cause Tamara validation to fail, even if other payment methods are working.
Payment Result & Verification
After the customer completes the payment, DigetPay displays its own payment result page.
The customer is not automatically redirected to the merchant's successUrl or failureUrl in the current Hosted Checkout flow.
Merchants should use the Payment Status API to confirm the final payment result before fulfilling an order. Webhook notifications can also be used to receive payment updates.
3. Tamara via S2S Integration
Tamara is also supported through DigetPay's Server-to-Server (S2S) Sale API.
Unlike Hosted Checkout, the S2S integration requires merchants to initiate Tamara payments using a specific request payload and generate a Tamara-specific request hash.
How It Works
sequenceDiagram
autonumber
participant C as Customer
participant M as Merchant Server
participant D as DigetPay API
participant T as Tamara
C->>M: Select Tamara
M->>M: Generate Tamara Request Hash
M->>D: POST /payment/s2s/sale
D-->>M: REDIRECT + PENDING + redirect_url
M->>C: Redirect to Payment URL
C->>T: Review and Confirm Installments
T-->>D: Payment Result
D-->>M: Payment Notification
M->>D: Verify Final Payment Status
M-->>C: Confirm Order Status
Integration Requirements
- A valid DigetPay Test or Live API Key.
- Tamara enabled for the merchant's S2S payment configuration.
- A valid customer full name, email, and phone number.
- A unique
orderId. - The Tamara-specific MD5 request hash.
- Success and failure return URLs.
- Server-side payment status verification.
API Endpoint
| Property | Value |
|---|---|
| Method | POST |
| URL | https://api.digetpay.com/v1/payment/s2s/sale |
| Authentication | x-api-key |
| Payment Method | tamara |
| Request Hash | Required |
Request Example
{
"orderId": "TAMARA-ORDER-1001",
"amount": 125.52,
"currency": "SAR",
"paymentMethod": "tamara",
"auth": "N",
"customer": {
"name": "Ahmed Mohamed",
"email": "[email protected]",
"phone": "+966501234567"
},
"successUrl": "https://merchant.example/success",
"failureUrl": "https://merchant.example/failure",
"hash": "GENERATED_TAMARA_MD5_HASH"
}Tamara Request Hash
Tamara S2S uses a different hash formula from standard S2S card payments.
MD5(
UPPERCASE(
REVERSE(customerEmail)
+ API_KEY
+ REVERSE(orderId)
)
)The hash must be generated securely on the merchant's backend using the same email and order ID included in the payment request.
Redirect Handling
After a successful S2S payment initiation, the API returns:
result: REDIRECTstatus: PENDINGredirect_url
The merchant must redirect the customer to data.redirect_url to complete the Tamara payment process.
Important: A successful API response or REDIRECT result does not mean the payment has been completed.
Always verify the final payment status before confirming the order.
Complete S2S API Documentation
For full request parameters, hash generation examples, API responses, redirect handling, and transaction verification, refer to:
4. General Requirements
| Requirement | Hosted Checkout | S2S |
|---|---|---|
| DigetPay API Key | Required | Required |
| Full Customer Name | Required for Tamara | Required |
| Customer Phone | Required | Required |
| Currency | SAR | SAR |
| Tamara-Specific Hash | Not required | Required |
| Separate Tamara API Request | Not required | Required |
| Merchant-Side Activation | No additional activation required | Tamara must be enabled for S2S |
| Payment Verification | Required | Required |
Test & Live Environments
Both integration methods use the same DigetPay API base URL:
https://api.digetpay.com/v1
- Test Mode: Use your Test API Key.
- Live Mode: Use your Live API Key.
The API key determines the environment.
5. Troubleshooting
| Issue | Possible Cause | Recommended Action |
|---|---|---|
| Tamara is unavailable on Hosted Checkout | Missing or invalid customer details | Send the customer's full name and valid contact information |
| Tamara is unavailable for a specific order | Customer or order is not eligible | Offer another available payment method |
| S2S request returns an invalid hash error | Incorrect hash calculation | Follow the Tamara-specific hash formula |
| S2S request is rejected | Invalid credentials, payload, or merchant configuration | Verify API Key, request parameters, and Tamara availability |
S2S payment remains PENDING | Customer has not completed payment | Query the final transaction status |
| Payment fails during Tamara approval | Customer is declined or cancels the process | Allow the customer to retry or choose another method |
6. Related Documentation
Updated about 1 month ago

