Antom, leading provider of tailored payment solutions

notifySubscription

Antom uses the notifySubscription API to send the subscription result to the merchant when the subscription creation reaches a final state of success or failure. 

Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Note: Set the data type of each field (except array) as String. This means that you must use double quotation marks (" ") to enclose the field value. Examples:
  • If the data type of a field is Integer and its value is ​20​, set it as "​20​".
  • If the data type of a field is Boolean and its value is ​true​, set it as "​true​".  

Request parameters

subscriptionRequestId String  REQUIRED

The unique ID assigned by a merchant to identify a subscription request.  

More information:

  • Maximum length: 64 characters

subscriptionId String  

The unique ID assigned by Antom to identify a subscription.
This parameter is not returned when the user fails to create subscription plan.

More information:

  • Maximum length: 64 characters

subscriptionStatus String  REQUIRED

The subscription status. Valid values are:
  • ACTIVE: indicates that the subscription becomes active. 
  • TERMINATED: indicates that the subscription is terminated.  

More information:

  • Maximum length: 32 characters

subscriptionNotificationType String  REQUIRED

The notification type about the subscription. 
  • CREATE: indicates that the subscription was created. 
  • CHANGE: indicates that the subscription was changed. 
  • CANCEL: indicates that the subscription is canceled and the service is not provided after the current subscription period ends. 
  • TERMINATE: indicates that the subscription is terminated and the service is not provided.   

More information:

  • Maximum length: 32 characters

subscriptionStartTime Datetime  REQUIRED

The date and time when the subscription becomes active.  

More information:

  • The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00".

subscriptionEndTime Datetime  REQUIRED

The date and time when the subscription ends.  

More information:

  • The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00".

periodRule PeriodRule  REQUIRED

The subscription period rule, used to define a subscription's billing period. 

allowAccumulate Boolean  

Indicates whether to allow to accumulate the previous billing cycle to subsequent subscription billing.
This parameter is returned when you pass it in create API and the value is true.

maxAccumulateAmount Amount  

The maximum allowed cumulative amount. This parameter is returned when you pass allowAccumulate in create API and its value is true.

Response parameters

result Result  REQUIRED

A fixed value, which is sent to Antom to acknowledge that the notification is received. 
API Explorer

Request

Case
json
{
  "periodRule": {
    "periodType": "MONTH",
    "periodCount": 1
  },
  "subscriptionEndTime": "2023-11-06T08:00:00-08:00",
  "subscriptionId": "20221205190000000000000450000007269",
  "subscriptionRequestId": "amsmdsubscription_20221206_033332_074",
  "subscriptionStartTime": "2022-10-04T09:00:00-07:00",
  "subscriptionStatus": "ACTIVE",
  "subscriptionNotificationType": "CREATE"
}

Response

json
{
  "result": {
    "resultStatus": "S",
    "resultCode": "SUCCESS",
    "resultMessage": "success."
  }
}

Result process logic

Send the following message with fixed values to Antom after receiving the notification, to acknowledge that the notification from Antom is received:
Sample Codetext
{
 "result": {
    "resultCode":"SUCCESS",
    "resultStatus":"S",
    "resultMessage":"success"
 }
}
If no such message is returned to Antom due to operation issues or network issues, Antom automatically resends the notification up to eight times within 24 hours or until the correct response is received. The sending intervals are as follows: 0 sec, 2 min, 10 min, 10 min, 1 h, 2 h, 6 h, and 15 h.