Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

change

POST /v1/subscriptions/change

Use this API to change the subscription information, such as the subscription period rule, the payment amount for each subscription period, or other information. Subscription information can only be changed for subscriptions that have not been canceled or terminated.

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

subscriptionChangeRequestId String  REQUIRED

The unique ID assigned by a merchant to identify a subscription change request. Antom uses this field for idempotency control. 

Note: For subscription change requests that are initiated with the same value of subscriptionChangeRequestId and reach a final status of ​S​ or​F​, the same result is to be returned for the request.

More information:

  • This field is an API idempotency field.
  • Maximum length: 64 characters

subscriptionId String  REQUIRED

The unique ID assigned by Antom to identify a subscription. The value of this parameter is the value of the same parameter that is returned by notifyPayment and notifySubscription for the original subscription.  

More information:

  • Maximum length: 64 characters

subscriptionDescription String  

The description of the subscription, used for displaying user consumption records and other actions.

Note: Specify this parameter if you want to change this information.

More information:

  • Maximum length: 256 characters

subscriptionStartTime Datetime  

The date and time when the subscription becomes active. 

Note: Specify this parameter when you want to designate the start time of the changed subscription. If you leave this parameter empty, the default value of this parameter is the time when Antom receives this request.  

More information:

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

subscriptionEndTime Datetime  

The date and time when the subscription ends. The default value of this parameter is 2099-12-31T23:59:59+08:00

Note: Specify this parameter when you want to change this information.  

More information:

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

periodRule PeriodRule  

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

Note: Specify this parameter if you want to change this information.  

Show child parameters

subscriptionExpiryTime Datetime  

A specific date and time after which the created subscription expires. When the subscription expires, the order must be terminated. The default value of this parameter is 30 minutes after the subscription creation request is sent.

Note: Specify this parameter if you want to change the subscription creation expiration time. The specified payment expiration time must be less than 48 hours after the subscription request is sent.

More information:

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

orderInfo OrderInfo  

The order information of the subscription. This field is used for different purposes:

  • During the payment process, this field is mainly used by Antom for risk control or anti-money laundering.
  • After the payment is completed, this field is used for recording and reporting purposes such as purchase tracking and regulatory reporting.

Note: Specify this parameter if you want to change this information.

Show child parameters

paymentAmount Amount  

The payment amount charged to the user per subscription period. 

Note: Specify this parameter if you want to change this information.  

Show child parameters

paymentAmountDifference Amount  

The payment amount for the initial subscription period after changing the payment amount for subsequent subscription periods. 

Note: Specify this parameter if you change the payment amount for each subscription period.  

Show child parameters

Response parameters

result Result  REQUIRED

Indicates whether this API is called successfully.  

This field does not indicate the subscription change result. Antom notifies you of the subscription change result through notifySubscription. 

Show child parameters
API Explorer
Sample CodesRun in Sandbox

Request

URL
Request Body

Response

Response Body

Result/Error codes

CodeValueMessageFurther action
SUCCESSSSuccess

The interface is called successfully.  

ACCESS_DENIEDFAccess is denied.

Contact Antom Technical Support for detailed reasons.  

CLIENT_FORBIDDEN_ACCESS_APIFThe client is not authorized to use this API.

Contact Antom Technical Support for detailed reasons. 

INVALID_APIFThe called API is invalid or not active.

Contact Antom Technical Support to resolve the issue. 

INVALID_CLIENT_STATUSFThe client status is invalid.

Contact Antom Technical Support for detailed reasons.  

INVALID_SIGNATUREFThe signature is not validated. The private key used to sign a request does not match the public key of Antom Dashboard.

Check whether the private key used to sign a request matches the public key of Antom Dashboard. The following signature references are useful:

KEY_NOT_FOUNDFThe private key or public key of <span>Antom</span> or the merchant is not found.

Check whether the private key or public key exists. If not, upload the private key in Antom Dashboard.

MERCHANT_NOT_REGISTEREDFThe merchant is not registered.

Please register the merchant by using the registration interface. Contact Antom Technical Support if failed to call the registration interface.  

OAUTH_FAILEDFOAuth process failed.

Contact Antom Technical Support for detailed reasons.  

PARAM_ILLEGALFThe required parameters are not passed, or illegal parameters exist. For example, a non-numeric input, an invalid date, or the length and type of the parameter are wrong.

Check and verify whether the required request fields (including the header fields and body fields) of the current API are correctly passed and valid.  

PAYMENT_NOT_QUALIFIEDFThe merchant is not qualified to pay because the merchant is not registered, does not have a contract for Auto Debit payment, or is forbidden to make a payment.

Contact Antom Technical Support for detailed reasons. 

PROCESS_FAILFA general business failure occurred.

Do not retry. Human intervention is usually needed. It is recommended that you contact Antom Technical Support to troubleshoot the issue.  

RISK_REJECTFThe transaction cannot be further processed because of risk control. If the user has already paid for the transaction, the transaction will be refunded.

If the user does not receive the refund within two weeks, contact Antom Technical Support.  

UNKNOWN_CLIENTFThe client is unknown.

Contact Antom Technical Support for detailed reasons.  

REQUEST_TRAFFIC_EXCEED_LIMITUThe request traffic exceeds the limit.

Call the interface again to resolve the issue. If not resolved, contact Antom Technical Support.  

UNKNOWN_EXCEPTIONUAn API call has failed, which is caused by unknown reasons.

Call the interface again to resolve the issue. If not resolved, contact Antom Technical Support.