How to send payment links using SETU APIs?

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

  1. Create an OAuth token to use the APIs. Read here to know more about generating tokens.
  2. 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
        }
      ]
    }
    customerIdentifiers can be the value you want to send the API.
    For example, if you are sending a phone number, then attributeName can be number and attributeValue will the actual phone number of the user.
    template the parameter will contain information about the HSM template that needs to be sent to the user.

  3. The following is the response format -
    image

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.

Can’t find what you’re looking for? Email us at support@haptik.ai.