Tamara
Integration Guide: Integrating Tamara via Tap
Tamara Integration Guide with Tap Payments
Table of Contents
- Overview
- Prerequisites
- Integration Steps
- Sample Request & Response
- Payment Flow
- Webhook Handling
- Important Notes
Overview
This step-by-step documentation will guide you through the process of integrating Tamara with Tap Payments. Tamara is a buy now, pay later service that allows customers to make purchases and pay in installments or pay in full. By integrating Tamara with Tap Payments, you can offer flexible payment options to your customers.
Prerequisites
Before starting the integration:
- Active tap Payments merchant account
- Tamara merchant account
- Webhook endpoint configured
- Redirect URLs prepared
Integration Steps
Step 1: Set the Tamara Source ID
Set the following source ID for Tamara payments:
src_tamara
Step 2: Send Sample Request to Tamara
Make a POST request to the Charges API with the following payload structure:
Endpoint:
POST https://api.tap.company/v2/charges
Headers:
{
"Authorization": "Bearer YOUR_SECRET_KEY",
"Content-Type": "application/json"
}Request Body:
{
"amount": 5,
"currency": "SAR",
"customer_initiated": true,
"threeDSecure": false,
"save_card": false,
"description": "Test Description",
"metadata": {
"udf1": "Metadata 1"
},
"reference": {
"transaction": "txn_01",
"order": "ord_01"
},
"receipt": {
"email": true,
"sms": true
},
"customer": {
"first_name": "test",
"email": "[email protected]",
"phone": {
"country_code": 966,
"number": 544337866
}
},
"source": {
"id": "src_tamara"
},
"post": {
"url": "https://webhook.site/2baf692c-119e-4fe2-8e49-25e2b8ec79af"
},
"redirect": {
"url": "http://your_website.com/redirect_url"
}
}Step 3: Receive Sample Response from Tamara
Success Response:
{
"id": "chg_TS06A520221130112222T2N0461001",
"status": "INITIATED",
"amount": 100,
"currency": "SAR",
"transaction": {
"url": "https://acceptance.sandbox.tap.company/gosell/v2/payment/tap_process.aspx?chg_url=xxx"
}
}Payment Flow
Step 4: Redirect Customer and Complete Payment Process
-
Extract the redirect URL from the response:
const redirectUrl = response.transaction.url; -
Redirect the customer to the Tamara payment page:
<!-- In your frontend implementation --> <a href="https://acceptance.sandbox.tap.company/gosell/v2/payment/tap_process.aspx?chg_url=xxx"> Complete Payment with Tamara </a> -
Customer completes payment on Tamara's secure payment page
-
Automatic redirection after payment completion:
- Success: Customer is redirected to your
redirect.url - Failure/Cancel: Customer is redirected with appropriate status
- Success: Customer is redirected to your
Webhook Handling
Configuration
The Tap response will be sent to your webhook URL specified in the post.url field.
Webhook Payload Example:
{
"id": "chg_TS06xxx",
"status": "CAPTURED",
"amount": 100,
"currency": "SAR",
"customer": {
"id": "cus_TSxxx",
"first_name": "John",
"last_name": "Doe"
},
"source": {
"id": "src_tamara",
"channel": "TAMARA"
},
"timestamp": 1669804900
}Support Resources
Last Updated: December 2025 Version: 1.0
Updated about 4 hours ago
