Step 1 - Setting up your Merchant Account¶
Once you have signed with Tamara, you will be provided with an API token and Notification token.
You authenticate with our API by providing the appropriate API token in the request Authorization header.
Authorization: Bearer your_token
We use a Notification token to authenticate back when sending our notification data to your webhook URL. This JWT token will be attached to the Authorization header.
Authorization: Bearer jwt_token
In order to validate this token, please use JWT decode with the HS256 algorithm and your given notification token.
Never share your secret tokens. Keep them guarded and secure.
Step 2: Setting Up the Checkout Process¶
Overview of the checkout Process:
You should fetch the available payment options from us before displaying Tamara on your checkout page. We will return the minimum and maximum order limits to you and based on that information, you can allow the customer to pay with Tamara or not.
When a customer chooses Tamara and proceeds to checkout, your server should generate a request to us transmitting the details of purchase. The response to this request contains an order reference and the URL for completing the transaction.
Your systems then redirect the customer to the transaction URL provided by us.
Tamara will send the OTP to the customer’s mobile number via SMS.
The customer verifies himself with the received OTP and completes the checkout process.
The customer will then be redirected to your website via the URLs that were provided in your request.
Tamara will send an authorised notification by POST method to your notification URL that was provided by you in the checkout request.
After receiving the notification, your system needs to call back Tamara to confirm the receipt of the transaction response.
You then need to send the capture API for the payment when the order is shipped.
2a: Get payment types¶
The response of this API returns a list of supported payment types from Tamara for instance: Shop now, pay later, or Pay in Installments.
2b: Create a checkout session¶
Before starting the checkout flow on the Tamara side, you need to call this API to create a checkout session then redirect the customer to the Tamara-hosted checkout page afterward.
Checkout creation is the process in which a customer uses Tamara to pay for a purchase on your website or in your app.
Create a Checkout session and pass through all the payment information, like the amount, currency, customer information, and reference.
2c: Get order details¶
You should be able to fetch the details of the order in Tamara using your own unique order ID. This can be used in case your systems did not receive the order update for any reason.
2d. Authorise an order¶
After the order payment is approved from the checkout flow, you need to call this API to authorise the order after receiving the notification from Tamara. You can consider the order paid after the authorizing stage and proceed as so.
Step 3: Payment¶
3a. Capture a payment/order¶
After you shipped the order to the customer, you have to call this API to capture your payment.
3b. Refund a payment/order¶
After the customer returned the items, you have to call this API to refund the payment. Tamara will refund the money to the customer's card right away, and those refunded amount would be deducted from your next settlement.
Customers may receive the refund amount in their cards in several days, this depends on banks.