Templates
Create a notification message template and generate messages for the targeted audience.
POST /v1/notifications/admin/templates
Auth: API key (VantagePayAdminClient).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
messageType | Information, Warning, Critical | Yes | The delivery channel for the templated message (e.g. push notification, in-app banner). |
messageTarget | None, Portal, Terminal, Email | Yes | The audience segment this template is targeted at (e.g. consumers, merchants). |
messagePlacement | None, Dashboard, Reports, ValueAddedServices, Profile, QR, Transactions, Loans, HelpAndSupport, UserManagement, Devices | No | The placement within the application where messages based on this template will be displayed. |
header | string | Yes | The message heading, limited to 512 characters. |
body | string | Yes | The main body text of the message. |
buttonText | string? | No | The label for the call-to-action button, limited to 128 characters. Omit for messages without a button. |
visibleFromDate | string? | No | The earliest date from which messages generated from this template should be shown. |
visibleUntilDate | string | Yes | The date after which messages generated from this template will no longer be displayed. |
audienceFilters | array<AllMerchants, IndustryRetail, IndustryRestaurant, IndustryForecourt, IndustryWorkshop, MerchantsWithLegacyTerminals, MerchantsWithNewTerminals, MerchantsWithProducts>? | No | Audience filters that restrict which users receive messages generated from this template. |
{
"messageType": "Information",
"messageTarget": "None",
"messagePlacement": "None",
"header": "string",
"body": "string",
"buttonText": "string",
"visibleFromDate": "string",
"visibleUntilDate": "string",
"audienceFilters": [
"AllMerchants"
]
}Responses
| Status | Description |
|---|---|
200 | The request was successful and the message template was created. |
400 | The request failed validation, the error object will contain further information. |
401 | The authorization information provided is not valid, authentication is required to access this resource. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
result | object | No | A configured in-app or push notification message template, including its content, targeting, and visibility schedule. |
{
"success": true,
"result": {
"reference": "00000000-0000-0000-0000-000000000000",
"messageType": "Information",
"messageTarget": "None",
"messagePlacement": "None",
"header": "string",
"body": "string",
"buttonText": "string",
"visibleFromDate": "string",
"visibleUntilDate": "string",
"isExtended": true,
"createdDate": "string",
"messageCount": 0,
"endsSoon": true,
"isExpired": true,
"isActive": true
}
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
using VantagePay.Models.Notifications;
using VantagePay.Models.Notifications.Requests;
var template = await adminClient.Notifications.CreateMessageTemplateAsync(new CreateMessageTemplateRequest
{
MessageType = MessageType.Information,
MessageTarget = MessageTarget.Portal,
MessagePlacement = MessagePlacement.Dashboard,
Header = "Weekly Tips",
Body = "Discover a new feature this week.",
VisibleUntilDate = DateTimeOffset.UtcNow.AddMonths(1),
});Get all message templates.
GET /v1/notifications/admin/templates
Auth: API key (VantagePayAdminClient).
Responses
| Status | Description |
|---|---|
200 | The request was successful and the templates were returned. |
400 | The request failed validation, the error object will contain further information. |
401 | The authorization information provided is not valid, authentication is required to access this resource. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
result | array<object>? | No | Gets the response payload. |
{
"success": true,
"result": [
{}
]
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
var templates = await adminClient.Notifications.GetMessageTemplatesAsync();Get a message template by reference.
GET /v1/notifications/admin/templates/{templateReference}
Auth: API key (VantagePayAdminClient).
Parameters
| Name | In | Required | Description |
|---|---|---|---|
templateReference | path | Yes | The unique reference of the message template. |
Responses
| Status | Description |
|---|---|
200 | The request was successful and the template was returned. |
400 | The request failed validation, the error object will contain further information. |
401 | The authorization information provided is not valid, authentication is required to access this resource. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
404 | The request was successful but does not return any results. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
result | object | No | A configured in-app or push notification message template, including its content, targeting, and visibility schedule. |
{
"success": true,
"result": {
"reference": "00000000-0000-0000-0000-000000000000",
"messageType": "Information",
"messageTarget": "None",
"messagePlacement": "None",
"header": "string",
"body": "string",
"buttonText": "string",
"visibleFromDate": "string",
"visibleUntilDate": "string",
"isExtended": true,
"createdDate": "string",
"messageCount": 0,
"endsSoon": true,
"isExpired": true,
"isActive": true
}
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
var template = await adminClient.Notifications.GetMessageTemplateAsync(Guid.Parse("1f2e3d4c-5b6a-4788-9900-aabbccddeeff"));Delete a message template and all associated messages.
DELETE /v1/notifications/admin/templates/{templateReference}
Auth: API key (VantagePayAdminClient).
Parameters
| Name | In | Required | Description |
|---|---|---|---|
templateReference | path | Yes | The unique reference of the message template. |
Responses
| Status | Description |
|---|---|
200 | The request was successful and the template was deleted. |
400 | The request failed validation, the error object will contain further information. |
401 | The authorization information provided is not valid, authentication is required to access this resource. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
404 | The request was successful but does not return any results. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
{
"success": true
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
await adminClient.Notifications.DeleteMessageTemplateAsync(Guid.Parse("1f2e3d4c-5b6a-4788-9900-aabbccddeeff"));Update the visible dates of a message template.
PATCH /v1/notifications/admin/templates/{templateReference}/dates
Auth: API key (VantagePayAdminClient).
Parameters
| Name | In | Required | Description |
|---|---|---|---|
templateReference | path | Yes | The unique reference of the message template. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
visibleFromDate | string? | No | The earliest date from which messages generated from the template should be shown. If null, the message becomes visible immediately. |
visibleUntilDate | string | Yes | The date after which messages generated from the template will no longer be displayed. |
{
"visibleFromDate": "string",
"visibleUntilDate": "string"
}Responses
| Status | Description |
|---|---|
200 | The request was successful and the template dates were updated. |
400 | The request failed validation, the error object will contain further information. |
401 | The authorization information provided is not valid, authentication is required to access this resource. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
404 | The request was successful but does not return any results. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
result | object | No | A configured in-app or push notification message template, including its content, targeting, and visibility schedule. |
{
"success": true,
"result": {
"reference": "00000000-0000-0000-0000-000000000000",
"messageType": "Information",
"messageTarget": "None",
"messagePlacement": "None",
"header": "string",
"body": "string",
"buttonText": "string",
"visibleFromDate": "string",
"visibleUntilDate": "string",
"isExtended": true,
"createdDate": "string",
"messageCount": 0,
"endsSoon": true,
"isExpired": true,
"isActive": true
}
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
await adminClient.Notifications.UpdateMessageTemplateDatesAsync(
Guid.Parse("1f2e3d4c-5b6a-4788-9900-aabbccddeeff"),
visibleFromDate: DateTimeOffset.UtcNow,
visibleUntilDate: DateTimeOffset.UtcNow.AddMonths(2));