Sending SMS

The SendSMS endpoint enables customers to send custom SMS to their clients. This is done by entering a message into the smsText field and then using EventIDs to populate client data.

You can send an SMS to a client by making a POST request to the endpoint. For example:

{{base-url}}/cards/{{publicToken}}/send-sms

The body can include up to three optional fields:

  • phoneNumber enables you to select a number to send the message to if there is no phone number associated with the publicToken specified in the endpoint
  • smsText enables you enter a message to be sent to the client, including Event IDs
  • amount enables you to enter an amount value if the amount event ID is used in the smsText field
{
"phoneNumber":"07xxxxxxxxx", 
"smsText": "The balance for your card ending with %cardLast4% is %CURRENTBALANCE%"
}

If the request is successful you will receive a 200 response, confirming the message has been sent to the phone number specified in the body.

👍

API Explorer

See the Send an SMS endpoint

Event IDs

Event IDs can be used in the sendSMS endpoint to add client-specific details to the message being sent. For example, the following body shows the event IDs %cardLast4% and %CURRENTBALANCE% being used to add client-specific content to the message being sent.

{
"phoneNumber":"07xxxxxxxxx", 
"smsText": "The balance for your card ending with %cardLast4% is %CURRENTBALANCE%"
}

The following table details each of the event IDs that can be used in the SendSMS endpoint.

Event IDDescription
%CARDSPAN4%The masked PAN, showing the last four digits of the card.
%CURRENCYCODE%The currency code.
%CURRENTBALANCE%The current balance of the card.
%CARDS6DIGITS%The middle six digits of the card's PAN.
%OLDPAN4%The last four digits of the old PAN.
%FIRSTNAME%The first name of the cardholder.
%SENDER%The programme manager.
%GPSEXPIRY%The Thredd card expiry date.
%AMOUNT%A monetary amount to be referenced in the text. Should be used with the amount field in the request body.