Skip to main content

Query billing information of the logged-in account

Queries the billing information of the logged-in account.

Request

Basic information
HTTP URLhttps://cloud-api.celerdata.com/api/1.0/bills
HTTP methodGET
Frequency600/minute

Header parameters

ParameterExample valueRequiredTypeDescription
AuthorizationBearer OGQ5MDA4MZGTNJMWNS0ZY2Y2LWFJNZYTOTBINMZIYTGZZDUYYesStringThe access token used to access the CelerData Cloud BYOC API. Format: Bearer <access_token>.

See Obtain access token.

Query parameters

ParameterExample valueRequiredTypeDescription
start_month202304YesStringThe start month of the time range to query. Format: yyyyMM.
end_month202307YesStringThe 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

ParameterExample valueTypeDescription
code20000IntegerThe error code. If the error code returned is 20000, the request succeeded. If any other error code is returned, the request failed.
data-ObjectThe result of the API call. The data object may not be returned for some API actions. It consists of the following elements:
  • account_id
  • begin_month
  • end_month
  • bill_list
data.account_idlbyx0bt7aStringThe ID of the account queried.
data.begin_month202304IntegerThe start month of the time range queried.
data.end_month202307IntegerThe end month of the time range queried.
data.bill_list-ArrayThe 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-ObjectThe billing details of the account on each specific month, which are presented as an object. Each object consists of the following elements:
  • period
  • account_id
  • bill_state
  • charge_usage
  • charge_price
  • pay_state
  • pay_method
  • pay_info_details
data.bill_list.0.period202304StringThe billing month. Format: yyyyMM.
data.bill_list.0.account_idlbyx0bt7aStringThe ID of the account queried.
data.bill_list.0.bill_statePAIDStringThe status of the bill. Valid values:
  • NOT_BILLED: The bill has not been generated.
  • BILLED: The bill has been generated.
  • WAIT_PAY: The bill is waiting to be paid.
  • PAYMENT_SUBMITTED: The payment has been submitted.
  • PAID: The bill has been paid.
  • ERROR: The bill encounters errors.
data.bill_list.0.charge_usage701.536682StringThe 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_price350.76StringThe 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_stateSUCCESSStringThe status of the payment. Valid values:
  • PROCESSING: The payment is being processed.
  • SUCCESS: The payment has been completed.
  • FAILED: The payment failed.
  • VOID: The payment has been cancelled.
This element is returned only when the return value of bill_state is PAYMENT_SUBMITTED or PAID.
data.bill_list.0.pay_methodAccountBalanceStringThe payment method used. Valid values:
  • AccountBalance: The bill is paid by using CCUs available within your account balance.
  • CreditCard: The bill is paid by using a credit card.
  • CombinePay: The bill is paid by using both CCUs and a credit card.
This element is returned only when the return value of bill_state is PAYMENT_SUBMITTED or PAID.
data.bill_list.0.pay_info_details-ArrayThe 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.
  • If the return value of pay_method is AccountBalance or CreditCard, the pay_info_details element consists of only one object.
  • If the return value of pay_method is CombinePay, the pay_info_details element consists of two objects: one object consists of the CCU-based payment details, and the other consists of the credit card-based payment details.
This element is returned only when the return value of bill_state is PAYMENT_SUBMITTED or PAID.
data.bill_list.0.pay_info_details.0-ObjectThe payment details, which are presented as an object. Each object consists of the following elements:
  • pay_method
  • amount
  • currency
  • state
data.bill_list.0.pay_info_details.0.pay_methodAccountBalanceStringThe payment method. Valid values:
  • AccountBalance: The bill is paid by using CCUs available within your account balance.
  • CreditCard: The bill is paid by using a credit card.
data.bill_list.0.pay_info_details.0.amount701.536682StringThe amount paid.
data.bill_list.0.pay_info_details.0.currencyCCUStringThe currency in which the payment is made. Valid values: CCU and USD.
data.bill_list.0.pay_info_details.0.stateSUCCESSStringThe statement of the payment. Valid values:
  • PROCESSING: The payment is being processed.
  • SUCCESS: The payment has been completed.
  • FAILED: The payment failed.
  • VOID: The payment has been cancelled.
messageparam end_month should less than current month.StringThe 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.