List monthly bills¶
List monthly bills for an account, from newest to oldest billing period.
GET https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/monthly-bills
Before you begin¶
Prepare a valid personal access token for the account owner.
Call List current accounts to obtain the target account’s ID.
Request example¶
Replace $MOI_PERSONAL_ACCESS_TOKEN and $ACCOUNT_ID in the example with your personal access token and the selected account’s ID.
curl -X GET \
"https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/monthly-bills?page_size=2" \
-H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target account ID from |
Query parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
Page size, 1–100; omitted, nonpositive, or greater than 100 uses 50. |
|
string |
No |
Next-page token. Omit for the first request; then use |
Successful response¶
Returns HTTP 200 with the list of generated monthly bills; the list is empty when no bills exist.
{
"items": [],
"total": 0,
"next_page_token": ""
}
Field |
Type |
Description |
|---|---|---|
|
array of object |
Records returned by this request. |
|
string |
Billing period in |
|
string |
Monthly bill status. |
|
string |
First day of the billing period, in |
|
string |
Usage charges in Credit, as a decimal string. |
|
string |
Subscription charges in Credit, as a decimal string. |
|
string |
Adjustments in Credit, as a decimal string. |
|
string |
Bill total in Credit, as a decimal string. |
|
string |
Cleared overdraft in Credit, as a decimal string. |
|
string |
Paid charges in Credit, as a decimal string. |
|
string |
Outstanding charges in Credit, as a decimal string. |
|
string |
Closing time as a Unix-seconds string; may be omitted before closing. |
|
integer |
Total records matching the filters. |
|
string |
Next-page token; an empty string marks the last page. |
In field paths, [] denotes each array item. For example, items[].period refers to the corresponding field in each item.
For the next page, set $NEXT_PAGE_TOKEN to next_page_token from the preceding response and retain the same filters. Stop when the token is empty.
curl -X GET \
"https://billing.moi.matrixorigin.cn/api/v1/billing/accounts/$ACCOUNT_ID/monthly-bills?page_size=2&page_token=$NEXT_PAGE_TOKEN" \
-H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
Error response¶
Missing authentication returns HTTP 401; provide a valid personal access token.
{
"code": "unauthenticated",
"message": "missing bearer token",
"error": "missing bearer token"
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code. |
|
string |
Error message. |
|
string |
Compatibility error message, with the same content as message. |