BLB Charge Shift - Prepay to Postpay
Updated at:2025-10-16
Prepay to Postpay API
Description
Changes to the billing type and charge type of a BLB instance. The following modifications are permitted.
- Switching from prepay to postpay. Both the charge type and the performance specifications for postpay can be set at the same time. If the postpay uses a pay-as-you-go mode ("ByCapacityUnit"), it also allows the "unlimited" speed option.
- Changing postpay with specific specifications to postpay in pay-as-you-go mode.
- Changing postpay in pay-as-you-go mode to postpay with specific specifications.
Request structure
Text
1POST /v{version}/blb/{blbId}/charge?action=TO_POSTPAY&clientToken={clientToken}
2Host: blb.bj.baidubce.com
3Authorization: authorization string
4{
5 "billingMethod": "BySpec",
6 "performanceLevel": "small2"
7}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| blbId | String | Yes | URL parameter | LoadBalancer identifier |
| clientToken | String | Yes | Query | Idempotency Token, with length no more than 64 characters. |
| action | String | Yes | Query | Current value "TO_POSTPAY" |
| billingMethod | String | No | Request Body parameters | Charge type: "BySpec" denotes being charged based on fixed specifications (default), while "ByCapacityUnit" denotes being charged in pay-as-you-go mode. |
| performanceLevel | String | No | Request Body parameters | Performance specification parameters: These are the default specifications of the current instance. Options include "small1" for Standard 1, "small2" for Standard 2, "medium1" for Enhanced 1, "medium2" for Enhanced 2, "large1" for Extra Large 1, "large2" for Extra Large 2, and "large3" for Extra Large 3. Only postpay in pay-as-you-go mode supports "unlimited" speed. |
| effectiveImmediately | Boolean | No | RequestBody | Does it take effect immediately? By default, it is set to false. |
Response Status Code
Respond with 200 after successful operation, and respond with error codes after failed operation, as shown in [Error Codes](BLB/API Reference/Error code.md)
Response headers No special headers beyond common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| orderId | String | Prepaid to postpaid order ID |
Request example
Text
1POST /v1/blb/lb-6x7atqxl/charge?action=TO_POSTPAY&clientToken=0fc2497e-6216-4702-a841-e5f2f6e366ce
2Host: blb.bj.baidubce.com
3Authorization: authorization string
4{
5 "billingMethod": "BySpec",
6 "performanceLevel": "small2"
7}
Response example
Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Fri, 16 Aug 2024 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "orderId": "38f903d90ae84fd28a71d70e47fb6406"
8}
