Skip to content

Templates

Create a notification message template and generate messages for the targeted audience.

POST /v1/notifications/admin/templates

Auth: API key (VantagePayAdminClient).

Request body

FieldTypeRequiredDescription
messageTypeInformation, Warning, CriticalYesThe delivery channel for the templated message (e.g. push notification, in-app banner).
messageTargetNone, Portal, Terminal, EmailYesThe audience segment this template is targeted at (e.g. consumers, merchants).
messagePlacementNone, Dashboard, Reports, ValueAddedServices, Profile, QR, Transactions, Loans, HelpAndSupport, UserManagement, DevicesNoThe placement within the application where messages based on this template will be displayed.
headerstringYesThe message heading, limited to 512 characters.
bodystringYesThe main body text of the message.
buttonTextstring?NoThe label for the call-to-action button, limited to 128 characters. Omit for messages without a button.
visibleFromDatestring?NoThe earliest date from which messages generated from this template should be shown.
visibleUntilDatestringYesThe date after which messages generated from this template will no longer be displayed.
audienceFiltersarray<AllMerchants, IndustryRetail, IndustryRestaurant, IndustryForecourt, IndustryWorkshop, MerchantsWithLegacyTerminals, MerchantsWithNewTerminals, MerchantsWithProducts>?NoAudience filters that restrict which users receive messages generated from this template.
json
{
  "messageType": "Information",
  "messageTarget": "None",
  "messagePlacement": "None",
  "header": "string",
  "body": "string",
  "buttonText": "string",
  "visibleFromDate": "string",
  "visibleUntilDate": "string",
  "audienceFilters": [
    "AllMerchants"
  ]
}

Responses

StatusDescription
200The request was successful and the message template was created.
400The request failed validation, the error object will contain further information.
401The authorization information provided is not valid, authentication is required to access this resource.
403The authorization header does not contain the correct type or you do not have access to this resource.
422The request payload is invalid, the error object will contain further information.
429Too many requests are being sent concurrently or rate limiting has taken effect.
500An unexpected error occurred, the error object will contain further information.

Response body

FieldTypeRequiredDescription
successbooleanNoGets a value indicating whether the operation was successful.
resultobjectNoA configured in-app or push notification message template, including its content, targeting, and visibility schedule.
json
{
  "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.

csharp
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

StatusDescription
200The request was successful and the templates were returned.
400The request failed validation, the error object will contain further information.
401The authorization information provided is not valid, authentication is required to access this resource.
403The authorization header does not contain the correct type or you do not have access to this resource.
422The request payload is invalid, the error object will contain further information.
429Too many requests are being sent concurrently or rate limiting has taken effect.
500An unexpected error occurred, the error object will contain further information.

Response body

FieldTypeRequiredDescription
successbooleanNoGets a value indicating whether the operation was successful.
resultarray<object>?NoGets the response payload.
json
{
  "success": true,
  "result": [
    {}
  ]
}

Code samples

WARNING

The JavaScript SDK does not cover admin APIs - use the .NET SDK.

csharp
var templates = await adminClient.Notifications.GetMessageTemplatesAsync();

Get a message template by reference.

GET /v1/notifications/admin/templates/{templateReference}

Auth: API key (VantagePayAdminClient).

Parameters

NameInRequiredDescription
templateReferencepathYesThe unique reference of the message template.

Responses

StatusDescription
200The request was successful and the template was returned.
400The request failed validation, the error object will contain further information.
401The authorization information provided is not valid, authentication is required to access this resource.
403The authorization header does not contain the correct type or you do not have access to this resource.
404The request was successful but does not return any results.
422The request payload is invalid, the error object will contain further information.
429Too many requests are being sent concurrently or rate limiting has taken effect.
500An unexpected error occurred, the error object will contain further information.

Response body

FieldTypeRequiredDescription
successbooleanNoGets a value indicating whether the operation was successful.
resultobjectNoA configured in-app or push notification message template, including its content, targeting, and visibility schedule.
json
{
  "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.

csharp
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

NameInRequiredDescription
templateReferencepathYesThe unique reference of the message template.

Responses

StatusDescription
200The request was successful and the template was deleted.
400The request failed validation, the error object will contain further information.
401The authorization information provided is not valid, authentication is required to access this resource.
403The authorization header does not contain the correct type or you do not have access to this resource.
404The request was successful but does not return any results.
422The request payload is invalid, the error object will contain further information.
429Too many requests are being sent concurrently or rate limiting has taken effect.
500An unexpected error occurred, the error object will contain further information.

Response body

FieldTypeRequiredDescription
successbooleanNoGets a value indicating whether the operation was successful.
json
{
  "success": true
}

Code samples

WARNING

The JavaScript SDK does not cover admin APIs - use the .NET SDK.

csharp
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

NameInRequiredDescription
templateReferencepathYesThe unique reference of the message template.

Request body

FieldTypeRequiredDescription
visibleFromDatestring?NoThe earliest date from which messages generated from the template should be shown. If null, the message becomes visible immediately.
visibleUntilDatestringYesThe date after which messages generated from the template will no longer be displayed.
json
{
  "visibleFromDate": "string",
  "visibleUntilDate": "string"
}

Responses

StatusDescription
200The request was successful and the template dates were updated.
400The request failed validation, the error object will contain further information.
401The authorization information provided is not valid, authentication is required to access this resource.
403The authorization header does not contain the correct type or you do not have access to this resource.
404The request was successful but does not return any results.
422The request payload is invalid, the error object will contain further information.
429Too many requests are being sent concurrently or rate limiting has taken effect.
500An unexpected error occurred, the error object will contain further information.

Response body

FieldTypeRequiredDescription
successbooleanNoGets a value indicating whether the operation was successful.
resultobjectNoA configured in-app or push notification message template, including its content, targeting, and visibility schedule.
json
{
  "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.

csharp
await adminClient.Notifications.UpdateMessageTemplateDatesAsync(
    Guid.Parse("1f2e3d4c-5b6a-4788-9900-aabbccddeeff"),
    visibleFromDate: DateTimeOffset.UtcNow,
    visibleUntilDate: DateTimeOffset.UtcNow.AddMonths(2));

Payments for Africa