Pay via Link Flow for Merchants
The Pay via Link flow is designed to provide flexibility to merchant customers who order medicines through the TATA 1mg APIs. This flow enables customers to complete their payments via a unique payment link generated by TATA 1mg. Instead of handling payments directly within the merchant's application, the payment is completed on a secure page hosted by TATA 1mg.
How It Works
Order Creation: When the merchant initiates an order using the Create Order API, TATA 1mg generates the order and processes the necessary details.
Link Generation: In the response of the Create Order API, TATA 1mg provides a payment link. Merchant can share this link to customers to complete payment from their end users.
Payment Completion: The customer uses this link to make the payment. Once the payment is successful, TATA 1mg updates the order status and notifies the merchant through a webhook.
Order Fulfillment: After successful payment, the order is processed and delivered, as with any standard order flow.
API Flow
The Pay via Link flow is integrated into the existing Create Order API. Below is an example of the response you'll receive after calling the Create Order API:
Example Response:
{
"data": {
"order_id": "PO23324219860017",
"merchant_order_id": "24E222B223IDFD",
"payment_link": "https://www.1mg.com/pay_via_link?data=%2B9QTa%2BSjbBOtwwSAs1P3v2PAeuV8mjdBpgYuCTAIPsE%3D&source=third_party_checkout"
},
"partial_complete": false,
"is_success": true,
"status_code": 200
}
Key Response Fields:
order_id
: Unique identifier for the order.
merchant_order_id
: Merchant Order ID (Unique Identifier) sent from merchant for order creation
payment_link
: Link for Order Payment
Frequently Asked Questions
When is the payment link generated?
The link is generated when a COD order is created and is sent as a response in the same API call.
Will users receive the payment link directly through TATA 1mg communication channels?
No, the payment link must be shared by the merchant.
What is the expiry duration for the payment link?
The expiry time for the link is 30 minutes.
Are there any specific events (e.g., order delivery, order cancellation) that might trigger early link expiration?
No, the link expires after 30 minutes regardless of other events.
Is it possible to include the expiry date directly with the payment link itself?
No, the expiry time is a static value set to 30 minutes and will not change.