When you want to send payment links to the users between a conversation on a bot, you can use SETU APIs, but the payment link is sent only on WhatsApp as a notification template, and not as a part of Bot Response.
The Fetch Bill and Send API is used to fetch a bill from Setu Collect Integration and send it across to the users.
API endpoint - https://prod.setu.co/v1/message/bill/fetch
- Create an OAuth token to use the APIs. Read here to know more about generating tokens.
- The following is the request format to use the API -
{ "bill": { "customerIdentifiers": [ { "attributeName": "string", "attributeValue": "string" } ] }, "channels": [ { "channel": "whatsapp", "template": { "name": "Alice", "biller": "Apna Finance" }, "campaignID": "xxxx", # This is the Interakt capmaign id "destination": "91xxxxxxxxxx" # This number includes the country code as well } ] }customerIdentifierscan be the value you want to send the API.
For example, if you are sending a phone number, thenattributeNamecan benumberandattributeValuewill the actual phone number of the user.templatethe parameter will contain information about the HSM template that needs to be sent to the user.
- The following is the response format -
The shortURL the parameter contains the link to payment.
You can use this API in your bot to enable users to make payments while having a conversation with the bot.