Send payment reminders

You can send payment reminder notifications to one user at a time. The values you input determine what type of payment message the API sends to the user.

To send a payment reminder, you must first retrieve the vendorPaymentTransactionID. The vendorPaymentTransactionId is provided by the Payment Service Provider (PSP) to the merchant to facilitate the successful transaction by the user.

After retrieving the vendorPaymentTransactionID, pass the parameters in the message payload. Send the HTTPS request to the endpoint with the payment reminder template parameters to generate the reminder message and send to the users.

The following example shows the POST request to send the payment reminder:

POST https://nbupayments.googleapis.com/v1/merchantCommunications:send
Content-type: application/json

{
  "merchantInfo": {
    "googleMerchantId": "Google assigned merchant ID"
  },
  "recipients": [
    {
      "vendorPaymentTransactionId": "35 digit UPI transaction ID"
    },
  ],
  "messagePayload": {
    "merchantMessageId": "Merchant created unique ID for every message",
    "components": [
      {
        "template": {
          "templateType": "PAYMENT_REMINDER",
          "templateParameters": {
            "header": {
              "title": "Title for this payment reminder message.",
              "description": "Short description to explain the content of this payment reminder message."
            },
            "orderDetails": {
             "orderNumber" : "Order number generated by merchant",
            },
            "reminderMessage": "Text message associated with this payment reminder, displayed in the body",
            "currentBalance": {
              "currencyCode": "INR",
              "units": 20,
              "nanos": 0
            },
            "paymentDueDate" : "Due date in RFC 3339 format (2018-05-01T10:50:30Z)",
            "purchaseItems":  [
               {
                  "itemName": "Item1",
                  "totalPrice": {
                    "currencyCode": "INR",
                    "units": 150,
                    "nanos": 0
                   }
               },
               {
                  "itemName": "Item1",
                  "totalPrice": {
                    "currencyCode": "INR",
                    "units": 200,
                    "nanos": 0
                   }
               }
             ],
            "paymentActions": [
              {
                "paymentAmount": {
                  "currencyCode": "INR",
                  "units": 150,
                  "nanos": 0
                },
                "merchantTransactionId": "Merchant generated ID for this transaction",
                "merchantCategoryCode": "MCC of the merchant"
              }
            ]
          }
        }
      }
    ]
  }
}

Parameters

The following data parameters must be passed in the API request:

Parameters Type of value Description Required/Optional
googleMerchantID String Google-assigned identifier or partner assigned identifier. Required
vendorPaymentTransactionId String A unique ID provided to the merchant by PSP after a successful transaction. Required

Message payload

You must pass the merchant created unique ID for every message in the merchantMessageId.

Template

You must pass the value for templateType objects as PAYMENT_REMINDER.

The following are the data parameters to pass in the templateParameters object:

Parameters Type of value Description Required/Optional
title String Title for the payment reminder message. Required
description String Description of the content in the payment reminder message. Optional

Order details

You must pass the order number generated by the merchant for every order in the orderNumber object. The field is required.

Reminder message

Pass the text message you want to send to your customer in the reminderMessage key. The reminder message helps users understand the payment information. The message is required.

Current balance

The following are the data parameters to pass in the currentBalance object.

Parameters Type of value Description Required/Optional
currencyCode String The payment currency. Required
units Number Amount to be paid. Required
nanos Number Number of nano (10^-9) units of the amount. Required
Parameter Type of value Description Required/Optional
paymentDueDate String The last date to pay the amount by the user. It must be defined in the RFC 3339 format (2018-06-02T11:50:30Z). Optional

Purchase items

The following are the parameters to pass in the purchaseItems array.

Parameters Type of value Description Required/Optional
itemName String Name of the item purchased from your website or app. Required
itemQuantity Number Quantity of the item purchased. Required

If more than one item type is purchased, pass the parameters itemName and itemQuantity for each item type.

Total price

The following are the parameters to pass in the totalPrice object under the purchasedItems array. If more than one item is purchased, pass the parameters currencyCode, units, and nanos for each item type.

Parameters Type of value Description Required/Optional
currencyCode String The currency in which you want to make payment. Required
units Number Amount to be paid for the purchased items of same type. Required
nanos Number Number of nano (10^-9) units of the amount. Required

Payment amount

The following are the parameters to pass in the paymentAmount object under paymentActions array. This object is used to define the total amount to be paid by the user for the selected items.

Parameters Type of value Description Required/Optional
currencyCode String The currency in which you want to make payment. Required
units Number Amount to be paid for all the purchased items. Required
nanos Number Number of nano (10^-9) units of the amount. Required

The following are the parameters to pass in the paymentActions array.

Parameter Type of value Description Required/Optional
merchantTransactionId String A unique ID generated by the merchant for every transaction. Required
merchantCategoryCode String A unique ID provided to the merchant by the Payment Service Provider (PSP) or NPCI. Required

The API returns the following response if the request is successful:

{
  "sendMessageResults": [
    {
      "recipient": {
        "userId": {
          "userDetails": {
            "field1": "Field1 value",
            "field2": "Field2 value"
          }
        }
      },
      "status": {
        "code": 200,
        "message": "Success response message"
      }
    },
    {
      "recipient": {
        "userId": {
          "userDetails": {
            "field1": "Field1 value",
            "field2": "Field2 value"
          }
        }
      },
      "status": {
        "code": 200,
        "message": "Success response message"
      }
    }
  ]
}