Query billing information of the logged-in account
Queries the billing information of the logged-in account.
Request
Basic information | |
---|---|
HTTP URL | https://cloud-api.celerdata.com/api/1.0/bills |
HTTP method | GET |
Frequency | 600/minute |
Header parameters
Parameter | Example value | Required | Type | Description |
---|---|---|---|---|
Authorization | Bearer OGQ5MDA4MZGTNJMWNS0ZY2Y2LWFJNZYTOTBINMZIYTGZZDUY | Yes | String | The access token used to access the CelerData Cloud BYOC API. Format: Bearer <access_token> . |
See Obtain access token.
Query parameters
Parameter | Example value | Required | Type | Description |
---|---|---|---|---|
start_month | 202304 | Yes | String | The start month of the time range to query. Format: yyyyMM . |
end_month | 202307 | Yes | String | The end month of the time range to query. Format: yyyyMM .The start_month must be less than or equal to the end_month , and the result of subtracting start_month from start_month must range from 0 to 36. |
Response
Sample response
{
"code":20000,
"data":{
"account_id":"lbyx0bt7a",
"begin_month":202304,
"end_month":202307,
"bill_list":[
{
"period":"202304",
"account_id":"lbyx0bt7a",
"charge_usage":"701.536682",
"charge_price":"350.76",
"bill_state":"PAID",
"pay_state":"SUCCESS",
"pay_method":"AccountBalance",
"pay_info_details":[
{
"pay_method":"AccountBalance",
"amount":"701.536682",
"currency":"CCU",
"state":"SUCCESS"
}
]
}
]
}
}
Response elements
Parameter | Example value | Type | Description |
---|---|---|---|
code | 20000 | Integer | The error code. If the error code returned is 20000 , the request succeeded. If any other error code is returned, the request failed. |
data | - | Object | The result of the API call. The data object may not be returned for some API actions. It consists of the following elements:
|
data.account_id | lbyx0bt7a | String | The ID of the account queried. |
data.begin_month | 202304 | Integer | The start month of the time range queried. |
data.end_month | 202307 | Integer | The end month of the time range queried. |
data.bill_list | - | Array | The billing details of the account over the selected time range. bill_list is an array that consists of one or more objects, each of which consists of the billing details on a specific month, depending on the number of months within the selected time range. |
data.bill_list.0 | - | Object | The billing details of the account on each specific month, which are presented as an object. Each object consists of the following elements:
|
data.bill_list.0.period | 202304 | String | The billing month. Format: yyyyMM . |
data.bill_list.0.account_id | lbyx0bt7a | String | The ID of the account queried. |
data.bill_list.0.bill_state | PAID | String | The status of the bill. Valid values:
|
data.bill_list.0.charge_usage | 701.536682 | String | The usage charged to your account. Unit: CCU. This element is returned only when the return value of bill_state is PAYMENT_SUBMITTED or PAID . |
data.bill_list.0.charge_price | 350.76 | String | The amount charged to your account. Unit: USD. This element is returned only when the return value of bill_state is PAYMENT_SUBMITTED or PAID . |
data.bill_list.0.pay_state | SUCCESS | String | The status of the payment. Valid values:
bill_state is PAYMENT_SUBMITTED or PAID . |
data.bill_list.0.pay_method | AccountBalance | String | The payment method used. Valid values:
bill_state is PAYMENT_SUBMITTED or PAID . |
data.bill_list.0.pay_info_details | - | Array | The payment details. The pay_info_details element is an array that consists of one or more objects, each of which consists of the payment details of a specific payment method, depending on how many payment methods you have used as bundling payment to pay the bill.
bill_state is PAYMENT_SUBMITTED or PAID . |
data.bill_list.0.pay_info_details.0 | - | Object | The payment details, which are presented as an object. Each object consists of the following elements:
|
data.bill_list.0.pay_info_details.0.pay_method | AccountBalance | String | The payment method. Valid values:
|
data.bill_list.0.pay_info_details.0.amount | 701.536682 | String | The amount paid. |
data.bill_list.0.pay_info_details.0.currency | CCU | String | The currency in which the payment is made. Valid values: CCU and USD . |
data.bill_list.0.pay_info_details.0.state | SUCCESS | String | The statement of the payment. Valid values:
|
message | param end_month should less than current month. | String | The error message. This element is returned only when the code returned is not 20000 .NOTICE Do not conclude whether a request succeeded or failed based on the return value of message . |