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

FeatureHosted CheckoutS2S Integration
Payment interfaceDigetPay CheckoutMerchant-controlled integration
API endpoint/payment/checkout/intiate/payment/s2s/sale
Payment method selectionCustomer selects TamaraMerchant specifies paymentMethod: "tamara"
Special Tamara requestNot requiredRequired
Tamara request hashNot requiredRequired
Customer redirectionDigetPay CheckoutTamara payment URL returned by API
Integration complexitySimpleAdvanced

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

  1. Create a payment link using the standard Hosted Checkout API.
  2. Include the customer's full name (first and last name).
  3. Redirect the customer to the returned redirectUrl.
  4. The customer selects Tamara on the DigetPay Checkout page.
  5. The customer reviews and confirms the installment plan.
  6. DigetPay displays the payment result on its Hosted Checkout page.
  7. Verify the final payment status using the Payment Status API or use webhook notifications followed by server-side verification.

API Endpoint

PropertyValue
MethodPOST
URLhttps://api.digetpay.com/v1/payment/checkout/intiate
Authenticationx-api-key
Content-Typeapplication/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.

customerNameTamara
Ahmed AliSupported
Mohamed AshourSupported
Ahmed Mohamed AliSupported
AhmedNot 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

PropertyValue
MethodPOST
URLhttps://api.digetpay.com/v1/payment/s2s/sale
Authenticationx-api-key
Payment Methodtamara
Request HashRequired

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: REDIRECT
  • status: PENDING
  • redirect_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:

Tamara S2S API Reference


4. General Requirements

RequirementHosted CheckoutS2S
DigetPay API KeyRequiredRequired
Full Customer NameRequired for TamaraRequired
Customer PhoneRequiredRequired
CurrencySARSAR
Tamara-Specific HashNot requiredRequired
Separate Tamara API RequestNot requiredRequired
Merchant-Side ActivationNo additional activation requiredTamara must be enabled for S2S
Payment VerificationRequiredRequired

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

IssuePossible CauseRecommended Action
Tamara is unavailable on Hosted CheckoutMissing or invalid customer detailsSend the customer's full name and valid contact information
Tamara is unavailable for a specific orderCustomer or order is not eligibleOffer another available payment method
S2S request returns an invalid hash errorIncorrect hash calculationFollow the Tamara-specific hash formula
S2S request is rejectedInvalid credentials, payload, or merchant configurationVerify API Key, request parameters, and Tamara availability
S2S payment remains PENDINGCustomer has not completed paymentQuery the final transaction status
Payment fails during Tamara approvalCustomer is declined or cancels the processAllow the customer to retry or choose another method

6. Related Documentation


Did this page help you?