Cancel Subscription
- Endpoint:
POST /aggregate-pay/api/gateway/subscriptionCancel - Tags: Collection Service/Subscription Management
Description
After creating a subscription plan, merchants can proactively cancel the subscription. However, cancellation is not permitted under the following circumstances: (1) When any recurring payment of the subscription is in a PENDING payment status.
Parameters
| Field | In | Type | Required | Constraints | Description |
|---|---|---|---|---|---|
Content-Type | header | string | Yes | ||
sign | header | string | Yes | 签名信息请参考技术文档 |
Parameter Examples
Content-Type:"application/json"sign:"FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="
Request Body
Content-Type: application/json
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
version | string | Yes | API version. Current value: 1.5 | ||
keyVersion | string | Yes | Signature Algorithm Version, Current value: 1 | ||
requestTime | string | Yes | Request time, compliant with rfc3339 specification, format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX The time must be within two minutes of the current time | ||
appId | string | Yes | Merchant AppId,The unique identifier assigned to the merchant app by PayerMax | ||
merchantNo | string | No | maxLength: 32 | Merchant Id, the unique identifier generated when the merchant signs the contract with PayerMax | |
data | object | Yes | |||
data.subscriptionNo | string | Yes | maxLength: 64 | PayerMax subscription ID. |
Example
json
{
"version": "1.5",
"keyVersion": "1",
"requestTime": "2025-02-26T05:00:00+00:00",
"appId": "6666c8b036a245799744912345a123456",
"merchantNo": "010213834123456",
"data": {
"subscriptionNo": "SUB20250417120949065211234"
}
}Responses
200
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
code | string | Yes | Return code, ‘APPLY_SUCCESS’ means success | ||
msg | string | Yes | Return message, ‘Success.’ | ||
data | object | Yes | |||
data.subscriptionRequestId | string | Yes | maxLength: 64 | Merchant's request ID for subscription creation. | |
data.userId | string | Yes | maxLength: 64 | User ID. | |
data.subscriptionPlan | object | Yes | |||
data.subscriptionPlan.subscriptionNo | string | Yes | maxLength: 64 | PayerMax subscription ID. | |
data.subscriptionPlan.subscriptionStatus | string | Yes | maxLength: 32 | Subscription plan status. INACTIVE: Not activated ACTIVE_FAILED: Activation failed ACTIVE: Activation is successful EXPIRED: Expired and not activated FINISH: Subscription Completed CANCEL: Subscription Cancel TERMINATE: Subscription termination |
Response Example
json
{
"code": "APPLY_SUCCESS",
"msg": "Success.",
"data": {
"subscriptionRequestId": "testRequestId0001",
"userId": "testUserId0001",
"subscriptionPlan": {
"subscriptionNo": "SUB20250417120949065211234",
"subscriptionStatus": "CANCEL"
}
}
}