#Web integration with your own payment gateway
This quickstart explains how to integrate when you opt for your own payment gateway. Use this guide for Setu’s default UPI payment option.
#The payment flow
The following steps describe a typical payment scenario—
- User initiates bill payment on Setu’s pre-built screen
- Setu calls the Get payment link API from Setu backend to your backend—you give us a one time link where we can redirect your customer for payment
- User is redirected to the one time link, and the payment is handled by you
- User completes payment
- We get webhook event confirming payment
- You redirect the user back to the post payment URL, depending on success or failure of payment.
Get payment link API
You need to implement the following API for this purpose
URL
As shared by you
Headers
X-SETU-BILLPAY-API-KEY: 77kxHrhbKNYXMwzHWFranymXV2xRkSREContent-Type: application/json
Note that the API key is issued by you
Request
{"orderId": "je9V7wWs9N3w","amount": 1201.00,"customerMobileNumber": "9481773053","postPaymentUrl": "https://bills.setu.co/7c58e511-c1f5-4e1b-8470-50fc2fbd30a4/post-payment/c4e154e6-7b2b-4e0a-9749-60499b61ce93","allowedPaymentMethods": ["CASH", "UPI"]}
Response
{"code": "success","data": {"link": "https://example.com/onetimepayment-link"}}
The following codes are supported by Setu—
success
invalid-mobile-number
insufficient-balance
The user will proceed to pay on the link. Once the payment is done, the following steps need to be completed by you—
- Send Setu the webhook event for payment.
- Redirect the user to post payment page at
postPaymentUrl
provided above
Was this page helpful?