BLB Charge Shift - Postpay to Prepay
Updated at:2025-10-16
Postpay to Prepay API
Description
Users can switch BLB instances from postpay to prepay via the current API. During the conversion, the "performanceLevel" parameter can be specified to adjust the instance configuration, and the prepay duration must also be indicated.
Request structure
Text
1POST /v{version}/blb/{blbId}/charge?action=TO_PREPAY&clientToken={clientToken}
2Host: blb.bj.baidubce.com
3Authorization: authorization string
4{
5 "billingMethod": "BySpec",
6 "performanceLevel":"medium1",
7 "reservationLength": 1
8}
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_REPAY" |
| billingMethod | String | No | Request Body parameters | Billing type: At present, only the default value "BySpec" is supported. |
| performanceLevel | String | No | Request Body parameters | Performance specifications: Leaving this blank means no configuration changes. Available options are: "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. Note: Prepay does not support "unlimited" speed. |
| reservationLength | Int | Yes | Request Body parameters | Purchase duration in months, [1,2,3,4,5,6,7,8,9,12,24,36] |
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 | Postpaid to prepaid order ID |
Request example
Text
1POST /v1/blb/lb-6x7atqxl/charge?action=TO_REPAY&clientToken=0fc2497e-6216-4702-a841-e5f2f6e366ce
2Host: blb.bj.baidubce.com
3Authorization:bce-auth-v1/a43eea003308400587496785f7f5d9ee/2022-04-28T11:06:00Z/3600/host;x-bce-date/25ec3d4baba54ad7397cb31c96cb5e364088ff79f9b853ffb8dc6c11ebcdcf16
4{
5 "billingMethod": "BySpec",
6 "performanceLevel":"medium1",
7 "reservationLength": 2
8}
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": "d79fa3041c6b49edb5b943618c9b5656"
8}
