Account - Usage Statements API
Note: you must be account owner to access this API.
List Usage Statements
List all usage statements:
GET /account/usage_statements
Response
status: 200 OK
[
{
"id": 1280,
"plan": "premium_plus",
"year": 2015,
"month": 10,
"start_date": "2015-10-24",
"end_date": "2015-10-31",
"user_months": 3
},
{
"id": 1432,
"plan": "premium_plus",
"year": 2015,
"month": 11,
"start_date": "2015-11-01",
"end_date": "2015-11-30",
"user_months": 12
},
"..."
]
The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of usage statements.
Collection Fields
By default the following fields will appear collections of usage statements:
end_date
id
month
plan
start_date
user_months
year
Obtain a different set of fields using the ?fields= parameter.
Filtering
Filtering is available for the following fields:
id
year
month
Sorting
By default a collection of usage statements is sorted descending by id
.
Get a Usage Statement
GET /account/usage_statements/:id
The following can be used to get the usage statement for October 2015:
GET /account/usage_statements?year=2015&month=10
Response
status: 200 OK
{
"billable_user_ids": [
1205,
1206,
1207,
1208,
1209,
1210,
1211,
1212,
1275,
1267,
1271,
1264
],
"end_date": "2015-11-30",
"id": 1432,
"month": 11,
"plan": "premium_plus",
"start_date": "2015-11-01",
"user_months": 12,
"year": 2015
}
The response contains these fields.
Fields
- billable_user_ids
- Readonly array of references to Person — The IDs of the Person records that are registered in the account and which were enabled and had a role (other than End User or Key Contact) at any time between the start date and the end date.
- end_date
- Readonly date — The date on which the billing period ended.
- id
- Readonly integer — The unique ID of the usage statement.
- month
- Readonly integer — The month for which the usage statement was generated.
- plan
- Readonly enum — The Plan field is used to select the Plan for the account. Valid values are:
-
basic
premium
premium_plus
- start_date
- Readonly date — The date on which the billing period started.
- user_months
- Readonly integer — The number of Person records that are registered in the account and which were enabled and had a role (other than End User or Key Contact) at any time between the start date and the end date.
- year
- Readonly integer — The year for which the usage statement was generated.