REST Message Service

The rest message service provides endpoints which allows a user to send messages to a printed card number or account id

Endpoints

Send Marketing Message By Printed Card Number

POST messaging/sendMarketingMessageByPrintedCardNumber.json

Sends a message to a given Printed Card Number

The following authentication methods are allowed for this endpoint:

JSON Parameters:
 
  • merchantId (Integer) – (required) Paytronix-assigned merchant ID to perform the operation in
  • campaignMessageTemplateCode (Integer) – (required) Campaign Message Template Code that uniquely identifies the Campaign Message Template
  • printedCardNumber (String) – (required) Printed Card Number to send message too
  • replacementParams (Map[String->String]) – (required) Key-Value relation for the external_field replacement the key is specified by the user when the Email Template was created
  • deliveryMethod (String) – (required) String specifying message type current this is only enabled for EMAIL
"result": "success"
JSON Parameters:
 
  • result (String) – (required) success
"result": "failure"
JSON Parameters:
 
  • result (String) – (required) failure
  • errorCode (String) – (required) The error code of the failure.
  • errorMessage (String) – (required) The (human readable) error message of the failure.

Send Marketing Message By Account Id

POST messaging/sendMarketingMessageByAccountId.json

Sends a message to a given Account Id

The following authentication methods are allowed for this endpoint:

JSON Parameters:
 
  • merchantId (Integer) – (required) Paytronix-assigned merchant ID to perform the operation in.
  • campaignMessageTemplateCode (Integer) – (required) Campaign Message Template Code that uniquely identifies the Campaign Message Template
  • accountId (Integer) – (required) Paytronix-assigned unique identifier for the Account
  • replacementParams (Map[String->String]) – (required) Key-Value relation for the external_field replacement the key is specified by the user when the Email Template was created
  • deliveryMethod (String) – (required) String specifying message type current this is only enabled for EMAIL
"result": "success"
JSON Parameters:
 
  • result (String) – (required) success
"result": "failure"
JSON Parameters:
 
  • result (String) – (required) failure
  • errorCode (String) – (required) The error code of the failure.
  • errorMessage (String) – (required) The (human readable) error message of the failure.

Send Transactional Message By Printed Card Number

POST messaging/sendTransactionalMessageByPrintedCardNumber.json

Sends a message to a given Printed Card Number ignoring the opted-in status

The following authentication methods are allowed for this endpoint:

JSON Parameters:
 
  • merchantId (Integer) – (required) Paytronix-assigned merchant ID to perform the operation in.
  • campaignMessageTemplateCode (Integer) – (required) Campaign Message Template Code that uniquely identifies the Campaign Message Template
  • printedCardNumber (String) – (required) Printed Card Number to send message too
  • replacementParams (Map[String->String]) – (required) Key-Value relation for the external_field replacement the key is specified by the user when the Email Template was created
  • deliveryMethod (String) – (required) String specifying message type current this is only enabled for EMAIL
"result": "success"
JSON Parameters:
 
  • result (String) – (required) success
"result": "failure"
JSON Parameters:
 
  • result (String) – (required) failure
  • errorCode (String) – (required) The error code of the failure.
  • errorMessage (String) – (required) The (human readable) error message of the failure.

Send Transactional Message By Account Id

POST messaging/sendTransactionalMessageAccountId.json

Sends a message to a given Account Id ignoring the opted-in status

The following authentication methods are allowed for this endpoint:

JSON Parameters:
 
  • merchantId (Integer) – (required) Paytronix-assigned merchant ID to perform the operation in.
  • campaignMessageTemplateCode (Integer) – (required) Campaign Message Template Code that uniquely identifies the Campaign Message Template
  • accountId (Integer) – (required) Printed Card Number to send message too
  • replacementParams (Map[String->String]) – (required) Key-Value relation for the external_field replacement the key is specified by the user when the Email Template was created
  • deliveryMethod (String) – (required) String specifying message type current this is only enabled for EMAIL
"result": "success"
JSON Parameters:
 
  • result (String) – (required) success
"result": "failure"
JSON Parameters:
 
  • result (String) – (required) failure
  • errorCode (String) – (required) The error code of the failure.
  • errorMessage (String) – (required) The (human readable) error message of the failure.

Constant Values

deliveryMethod Values

EMAIL
Send an email message

Error Codes

The following are the possible codes and messages that can be returned by the Message Service.

There are other system-level errors which may be returned which are not documented here.

The caller of the endpoint can use the returned message to display to the end user or, if different wording is desired, can provide their own mapping of code to message.

Code Message
restmessaging.invalid_template_code Campaign Message Template code is invalid
restmessaging.invalid_user User does not exist
restmessaging.user_opted_out User is opted out
restmessaging.user_email_failed User’s email is marked failed
restmessaging.delivery_method Delivery method is invalid
restmessaging.system_error System error