Cancels subscriptions for instances that you no longer need.
Operation description
Refunds cover only the amount that you paid. Used coupons are not refunded.
Before you cancel a subscription, carefully check the resource information and confirm the refund terms and amount. After a subscription is canceled, the resource cannot be recovered.
This operation can be called only by direct customers, not resellers.
For more information, see Refund rules for the international site.
Try it now
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
bss:RefundBatchRemainRefund | update | *All Resource
| None | None |
Request parameters
Parameter | Type | Required | Description | Example |
ClientToken | string | No | A client-generated universally unique identifier (UUID) that is used to ensure the idempotence of the request. If you make multiple calls with the same ClientToken, the system returns the result of the first call. A successful call returns a refund order ID. | 793F021C-B589-1225-82A9-99232AEBE494 |
ImmediatelyRelease | string | No | This parameter is required for unsubscription. Valid values: 1: The instance is released immediately. 0: The instance is first stopped according to its stop policy. This feature is supported only for some products. By default, instances are released immediately. | 1 |
ProductCode | string | No | The product code. This parameter is required for unsubscription. If an error code indicates that the product is not supported, submit a ticket to request that this feature be enabled. | ecs |
InstanceId | string | No | The ID of the instance. This is not a custom name. This parameter is required for unsubscription. | i-bp1etb69sqxgl4******* |
ProductType | string | No | The product type. This parameter is required for unsubscription. Unless otherwise specified, pass an empty string. In API Explorer, you can automatically enter an empty string by moving your mouse pointer over the input box and clicking the button that appears. When you call this operation from your code, pass an empty string "". | ”“ |
Response elements
Parameter | Type | Description | Example |
object | The response object. | ||
Message | string | The description of the execution result. | success |
RequestId | string | The ID of the request. Provide this ID to our technical support for troubleshooting. | UUID |
| Data | object | The data returned. | |
HostId | string | The website where the host is located. | cn |
OrderId | integer | The ID of the refund order. This parameter is returned only if the unsubscription is successful. | 2100000000*** |
Code | string | The response code. | ResourceNotExists |
Success | boolean | Indicates whether the operation was successful. | false |
Examples
Success response
JSON format
{
"Message": "success",
"RequestId": "UUID",
"Data": {
"HostId": "cn",
"OrderId": 0
},
"Code": "ResourceNotExists",
"Success": false
}Error codes
HTTP status code | Error code | Error message | Description |
400 | ResourceNotExists | The specific resource is not exists. | |
400 | ResourceStatusError | The resource status error. | |
400 | InvalidOwner | The specified owner does not belong to caller. | |
400 | InvalidParameter | The specified request contains invalid parameters. | |
400 | MissingParameter | The specified request lacks essential parameters. | |
400 | NotApplicable | The specified API is not applicable for the user. | |
400 | NotAuthorized | The user is not authorized for the specified API. | |
400 | BindMirrorInstanceError | Charged images that are related to ECS. | |
400 | ExceedRefundQuotaError | The number of unsubscription times has reached the upper limit. | |
400 | ExistUnPaidOrderError | The instance has an unsettled order. | |
400 | ExistRefundingOrderError | The instance ID is invalid: the instance may have expired, been refunded, or been released. | |
400 | NoRestValueError | The refund amount is 0. | |
400 | AmbassadorOrderLimitError | The instance has an ambassador order that may raise risks. | |
400 | ActivityForbiddenError | Promotional orders do not support refunds. | |
400 | ProductCheckError | The cloud service failed SPI preflight verification. | |
400 | CommodityNotSupported | The specified commodity is not supported. | |
500 | InternalError | An error occurred in the internal server. | System exception, please try again |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.