You can call the ModifyCdnService operation to change the billing method of the CDN service.

CDN supports the following billing methods:

  • Pay by peak bandwidth
  • Pay by data transfer
Note
  • To call this operation, make sure that the CDN service is activated.
  • The new billing method takes effect at 00:00 the following day. If you change the billing method multiple times, the most recent change takes effect.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Description
Action String  Yes The operation that you want to perform. Set this parameter to ModifyCdnService.
InternetChargeType String  Yes The new billing method. Valid values: PayByTraffic and PayByBandwidth.

Response parameters

Parameter Type Description
RequestId String The ID of the request.

Examples

Sample request

https://cdn.aliyuncs.com?&Action=ModifyCdnService&InternetChargeType=PayByTraffic&<Common request parameters>

Sample success response

JSON format

{
"RequestId":"97C68796-EB7F-4D41-9D5B-12B909D76508"
}

Error codes

Error code Error message HTTP status code Description
OperationDenied Your account does not open CDN service yet. 403 The error message returned because CDN has not been activated for your account.
InvalidParameter The specified value of parameter parameter name is not valid. 400 The error message returned because the specified parameters are invalid.
InsufficientBalance Your account does not have enough balance. 400 The error message returned because your account balance is insufficient.
Forbidden.NotVerified Your account is not verified yet. 403 The error message returned because your account is not verified.