Skip to content

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

FieldInTypeRequiredConstraintsDescription
Content-TypeheaderstringYes
signheaderstringYes签名信息请参考技术文档

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

FieldTypeRequiredConstraintsDescriptionEnum
versionstringYesAPI version. Current value: 1.5
keyVersionstringYesSignature Algorithm Version, Current value: 1
requestTimestringYesRequest 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
appIdstringYesMerchant AppId,The unique identifier assigned to the merchant app by PayerMax
merchantNostringNomaxLength: 32Merchant Id, the unique identifier generated when the merchant signs the contract with PayerMax
dataobjectYes
data.subscriptionNostringYesmaxLength: 64PayerMax 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

FieldTypeRequiredConstraintsDescriptionEnum
codestringYesReturn code, ‘APPLY_SUCCESS’ means success
msgstringYesReturn message, ‘Success.’
dataobjectYes
data.subscriptionRequestIdstringYesmaxLength: 64Merchant's request ID for subscription creation.
data.userIdstringYesmaxLength: 64User ID.
data.subscriptionPlanobjectYes
data.subscriptionPlan.subscriptionNostringYesmaxLength: 64PayerMax subscription ID.
data.subscriptionPlan.subscriptionStatusstringYesmaxLength: 32Subscription 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"
    }
  }
}

Was this page helpful?

Thank you for your help in improving PayerMax Product Docs!

Released under the MIT License.