1.Set up your Merchant Account:¶
Once you have signed with Tamara, you will be provided with 2 tokens:
API token: You can authenticate with our API by providing the appropriate API token in the request Authorization header.
Authorization: Bearer your_token
Notification 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. In order to validate this token, please use JWT decode with the HS256 algorithm and your given notification token.
Authorization: Bearer jwt_token
Please keep your tokens securely guarded and don’t share them.
2.Set up the Checkout Process:¶
- Your server would need to fetch the available payment options from us, before displaying Tamara on your checkout page, using this API
The response of this API returns a list of supported payment types from Tamara for instance, PAY_BY_INSTALMENTS, and the minimum and maximum order limits, based on which, you can allow whether or not the customer can pay with Tamara.
- When a customer decides to pay through Tamara and proceeds to checkout, your server would need to create a checkout session request to transmit the details of purchase, such as the amount, currency, customer information, and unique order reference ID, using this API
The response of this API returns a unique order ID and a checkout URL for completing the transaction.
Your server will then redirect the customer to the checkout URL generated in the above step.
Tamara will send the verification code to the customer’s mobile number via an SMS.
The customer will verify themselves with the received code and complete the checkout process.
The customer will then be redirected to your website via the respective status URLs that were provided in your checkout session request.
Tamara will send a webhook payload for ‘approved’ notification by POST method, to the notification URL that was provided in your checkout session request.
After receiving the notification, i.e., once the order payment is ‘approved’ from the checkout flow, your server would need to call back Tamara to confirm the receipt of the transaction response by authorisation, using this API
Once the ‘authorised’ stage is reached, you can consider the order as paid, and proceed further.
After authorising, once the order is shipped, your server would then need to send a capture request for the payment, using this API
Once the ‘captured’ stage is reached, you can consider the amount to be added to your next settlement cycle.
After shipping/ capturing, if a customer returns the items, your server would need to send a refund request for the payment, using this API
Once the ‘refunded’ stage is reached, you can consider the amount to have been refunded by Tamara to the customer's card right away, and the refunded amount would be deducted from your next settlement.
Customers may receive the refunded amount in their cards within several days, as it depends on the respective banks.
You may also check the order status for an order, in case your server did not receive any update, for any unforeseen reason.