# Cancel Change Reservation
The merchant business system cancels all pending (PENDING) change reservations for a subscription via the Cancel Change Reservation API, clears the pending plan fields, and closes the associated orphan supplement pay orders.
# API Description
API
Request API: /api/subscription/change/cancel
Request Method: POST
Request Type: application/json or application/x-www-form-urlencoded
# Request Parameters
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Merchant No | mchNo | Yes | String(30) | M1621873433953 | Merchant Number |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Subscription ID | subscriptionId | Yes | String(32) | SUB_20210618164232 | Subscription ID |
| Request Time | reqTime | Yes | long | 1622016572190 | Request timestamp (13 digits) |
| API Version | version | Yes | String(3) | 1.0 | API version, fixed: 1.0 |
| Sign | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value, see signature algorithm |
| Sign Type | signType | Yes | String(32) | MD5 | Signature type, currently only supports MD5 |
# Request Example Data
{
"mchNo": "M1623984572",
"appId": "60cc09bce4b0f1c0b83761c9",
"subscriptionId": "SUB_20210618164232",
"reqTime": "1622016572190",
"version": "1.0",
"signType": "MD5",
"sign": "84F606FA25A6EC4783BECC08D4FDC681"
}
# Response Parameters
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Return State | code | Yes | int | 0 | 0-Success, others-Error, see error codes |
| Return Msg | msg | No | String(128) | Signature failed | Specific error reason |
| Sign Info | sign | No | String(32) | CCD9083A6DAD9A2DA9F668C3D4517A84 | Signature for data |
| Return Data | data | No | Object | data is empty on successful cancellation |
# Response Example Data
{
"code": 0,
"msg": "SUCCESS",
"data": null
}
# Business Rules
Note
- This API cancels all pending (PENDING) change reservations for the subscription, updates the associated change log state to canceled, and clears the subscription's pending plan fields (pendingPlanId/pendingPlanCode, etc.).
- Supplement Order Handling: If an associated supplement pay order exists, it is handled by state:
- Pending payment (INIT): order is closed directly.
- In payment (ING): cancellation is rejected with "Supplement order is in payment, please wait for the payment result before canceling".
- Payment success (SUCCESS): cancellation is rejected with "Supplement order has been paid successfully, cannot cancel, the change will take effect soon".
- On successful cancellation, a
SUBSCRIPTION_CHANGE_CANCELEDnotification is sent for each canceled change (the notification carrieschangeId, deduplicated by change). - Difference from cashier cancel: Merchant cancel clears all PENDING changes by subscription; cashier cancel (
/cancelForCheckout) cancels a single change by changeId and only unconfirmed changes.