Send Notification
Request URL
POST /public/merchant/notification/send
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 send a payment reminder notification to the customer via the available notification delivery types. The reminder notification will contain payment details such as the invoice number (if applicable), the merchant name, and the payment link.
Schema
Property table for public/merchant/notification/send
Property | Description | Required | Schema |
---|---|---|---|
cFiTransactionIds | Array of transaction IDs from the connectFi system obtained when each transaction was initialized | Yes | array of { "type": "string", "pattern": "^[0-9a-zA-Z_]+$", "minLength": 1, "maxLength": 36, "$id": "common-id" } |
notificationType | notificationType | No | { "type": "string", "enum": [ "sentLink", "paidLink" ] } |
Request Body
Snippet Examples
javascript
const axios = require('axios');
const data = {
"cFiTransactionIds": ["7g5vgpiVqpEManU8FAxY4h"],
"notificationType": "sentLink"
};
const config = {
method: 'POST',
url: '${CONNECTFI_BASE_URL}/public/merchant/notification/send',
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/notification/send" --data "{ \"cFiTransactionIds\":[\"7g5vgpiVqpEManU8FAxY4h\"], \"notificationType\":\"sentLink\"}" --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 PUBLIC/MERCHANT/NOTIFICATION/SEND ERROR 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
RESPONSE BODY