Skip to content

Create Reminders

Request URL

POST /public/merchant/reminder/create

Description

After authenticating the merchant through your existing front-end merchant portal UI and requesting a merchant JSON Web Token through the `/payment-link/merchant/get-token` endpoint, you may make a call to this endpoint in order to allow the merchant corresponding to the provided 'x-connectfi-jwtoken' header to create and schedule a reminder notification. The reminder will be sent via the selected notificationDeliveryTypes to the customer on the remindDate and will contain payment details such as the invoice number (if applicable), the merchant name, and the payment link. In order to send or schedule a payment reminder notification, the following criteria must be met.

  • The notificationType must be "sentLink".

  • The status of the payment specified by the cFiTransactionId must be "Sent".

  • Reminder notifications are limited to one reminder per cFiTransactionId per day.

  • You may schedule multiple reminder notifications in a single request using the "items" array property.

Schema

Property table for public/merchant/reminder/create

Property Description Required Schema
items items Yes array of items item objects

Property table for items array item object

Property Description Required Schema
cFiTransactionId The transaction ID in the connectFi system Yes {
  "type": "string",
  "pattern": "^[0-9a-zA-Z_]+$",
  "minLength": 1,
  "maxLength": 36,
  "$id": "common-id"
}
remindDate remindDate Yes {
  "type": "string",
  "format": "dateISO",
  "pattern": "^\d{4}-\d{2}-\d{2}$",
  "$id": "common-dateOnly"
}
notificationType notificationType Yes {
  "type": "string",
  "enum": [ "sentLink", "paidLink" ]
}
notificationDeliveryTypes notificationDeliveryTypes No array of {
  "type": "string",
  "enum": [ "SMS", "Email" ]
}

Request Body

{
  "items": [
    {
      "cFiTransactionId": "7g5vgpiVqpEManU8FAxY4h",
      "remindDate": "2024-10-26",
      "notificationType": "sentLink",
      "notificationDeliveryTypes": ["SMS", "Email"]
    }
  ]
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
  "items": [
    {
      "cFiTransactionId": "7g5vgpiVqpEManU8FAxY4h",
      "remindDate": "2024-10-26",
      "notificationType": "sentLink",
      "notificationDeliveryTypes": ["SMS", "Email"]
    }
  ]
};
const config = {
  method: 'POST',
  url: '${CONNECTFI_BASE_URL}/public/merchant/reminder/create',
  headers: {
    'Content-Type': "application/json",
    'x-connectfi-jwtoken': "A long random string token received from /payment-link/merchant/get-token request"
  },
  data
};

let result;
try {
  result = await axios.request(config);
  if (result.status === 200) {
    console.log(JSON.stringify(result.data));
  }
} catch (err) {
  console.log({
    errCode: err.code,
    responseStatus: err.response && err.response.status,
    data: err.response && JSON.stringify(err.response.data)
  });
}

cURL

curl --location "CONNECTFI_BASE_URL/public/merchant/reminder/create" --data "{  \"items\":[    {      \"cFiTransactionId\":\"7g5vgpiVqpEManU8FAxY4h\",     \"remindDate\":\"2024-10-26\",     \"notificationType\":\"sentLink\",     \"notificationDeliveryTypes\":[\"SMS\",\"Email\"]    }  ]}" --header "Content-Type: application/json" --header "x-connectfi-jwtoken: A long random string token received from /payment-link/merchant/get-token request" 

Successful Response Examples

200 SUCCESSFUL RESPONSE

HEADERS

Header Value
Content-Type application/json
x-connectfi-jwtoken A long random string token received from /payment-link/merchant/get-token request

REQUEST BODY

{
  "items": [
    {
      "cFiTransactionId": "7g5vgpiVqpEManU8FAxY4h",
      "remindDate": "2024-10-26",
      "notificationType": "sentLink",
      "notificationDeliveryTypes": ["SMS", "Email"]
    }
  ]
}

RESPONSE BODY

{
    "code": "0",
    "data": [
        {
            "cFiReminderId": "7BzkATAk1fx49MKCS2SW41",
            "cFiTransactionId": "7g5vgpiVqpEManU8FAxY4h",
            "remindDate": "2024-10-26T00:00:00.000Z",
            "notificationType": "sentLink",
            "createType": "planned",
            "status": "Created",
            "notificationDeliveryTypes": [
                "SMS",
                "Email"
            ],
            "dtsCreatedAt": "2024-10-25T17:24:22.919Z",
            "dtsUpdatedAt": "2024-10-25T17:24:22.919Z"
        }
    ],
    "requestId": "f9e741e092f511ef893705725acd1211"
}

200 PUBLIC/MERCHANT/REMINDER/CREATE ERROR RESPONSE - INVALIDREMINDERDATE

HEADERS

Header Value
Content-Type application/json
x-connectfi-jwtoken A long random string token received from /payment-link/merchant/get-token request

REQUEST BODY

{
  "items": [
    {
      "cFiTransactionId": "7g5vgpiVqpEManU8FAxY4h",
      "remindDate": "2024-10-01",
      "notificationType": "sentLink",
      "notificationDeliveryTypes": ["SMS", "Email"]
    }
  ]
}

RESPONSE BODY

{
    "requestId": "6bb5c76092f611ef893705725acd1211",
    "code": "invalidReminderDate",
    "context": {
        "remindDate": "2024-10-01"
    },
    "message": "Payment remindDate cannot be prior to current date."
}