Billing /
Get invoice details
Get details about an invoice. If `timestamp` is passed in as a query parameter, this endpoint returns details about the invoice containing that timestamp. Otherwise, returns a preview invoice displaying billing data from after the most recent invoice.
Required permission
Account > Billing > General > Read
Query parameters
timestamp
integerTimestamp of an invoice. If passed in, this endpoint will return details about the invoice that time belongs to.projectId
stringID of a project. If passed in, only details about that project will be returned.addonId
stringID of a addon. If passed in, only details about that addon will be returned.serviceId
stringID of a service. If passed in, only details about that service will be returned.jobId
stringID of a job. If passed in, only details about that job will be returned.
Response body
- {object}Response object.
data
{object} requiredResult data.period
{object} requiredInformation about the billing period of the invoice.start
number requiredUnix timestamp of the start of the billing period.end
number requiredUnix timestamp of the end of the billing period.currency
string requiredCurrency code for the currency the invoice is billed in.total
number requiredTotal cost of the invoice, in cents, including tax.subTotal
number requiredTotal cost of the invoice, in cents, excluding tax.paid
booleanIf `timestamp` is passed in, whether the invoice has been paid.tax
{object} requiredDetails about the tax on the invoice.percent
number requiredPercentage of subtotal to be applied as tax.value
number requiredValue of the tax on the invoice.projects
[array] requiredAn array of projects billed in this invoice. If `projectId` is passed in, only projects with a `projectId` matching the value will be returned.- {object}Billing details about a project.
projectId
string requiredID of the project.duration
string requiredDuration the project has been running in this billing period, in seconds.items
[array] requiredAn array of objects belonging to this project that are billed in this invoice. If `addonId`, `serviceId` or `jobId` are passed in, only objects matching that ID will be returned.- {object}Billing details about an object.
duration
string requiredDuration the object has been running in this billing period, in seconds.price
{object} requiredDetails about the price of a object, broken down by resource type.cpu
number requiredPrice of CPU usage for this object, in cents.memory
number requiredPrice of memory usage for this object, in cents.storage
number requiredPrice of storage usage for this object, in cents.total
number requiredTotal price for this object, in cents.nfObjectId
string requiredThe ID of the object.nfObjectType
string requiredThe type of the object.one ofjob, service, addon, volumeprice
{object} requiredDetails about the price of a project, broken down by resource type.cpu
number requiredPrice of CPU usage for this project, in cents.memory
number requiredPrice of memory usage for this project, in cents.storage
number requiredPrice of storage usage for this project, in cents.total
number requiredTotal price for this project, in cents.objectTypeTotals
{object} requiredDetails about the price of a project, broken down by object type.addon
{object}price
{object}Details about the price for all addons in this project, broken down by resource type.cpu
number requiredPrice of CPU usage for all addons in this project, in cents.memory
number requiredPrice of memory usage for all addons in this project, in cents.storage
number requiredPrice of storage usage for all addons in this project, in cents.total
number requiredTotal price for all addons in this project, in cents.duration
number requiredDuration addons have been running in this billing period, in seconds.service
{object}price
{object}Details about the price for all services in this project, broken down by resource type.cpu
number requiredPrice of CPU usage for all services in this project, in cents.memory
number requiredPrice of memory usage for all services in this project, in cents.storage
number requiredPrice of storage usage for all services in this project, in cents.total
number requiredTotal price for all services in this project, in cents.duration
number requiredDuration services have been running in this billing period, in seconds.job
{object}price
{object}Details about the price for all jobs in this project, broken down by resource type.cpu
number requiredPrice of CPU usage for all jobs in this project, in cents.memory
number requiredPrice of memory usage for all jobs in this project, in cents.storage
number requiredPrice of storage usage for all jobs in this project, in cents.total
number requiredTotal price for all jobs in this project, in cents.duration
number requiredDuration jobs have been running in this billing period, in seconds.
API
CLI
JS Client
GET /v1/billing/invoices/details
Example response
200 OK
Details about an invoice.
JSON
{
"data": {
"period": {
"start": 1655823815,
"end": 1655910214
},
"currency": "usd",
"total": 1200,
"subTotal": 1000,
"tax": {
"percent": 20,
"value": 200
},
"projects": [
{
"projectId": "default-project",
"duration": 259200,
"items": [
{
"duration": 172800,
"price": {
"cpu": 200,
"memory": 200,
"storage": 200,
"total": 600
},
"nfObjectId": "example-service",
"nfObjectType": "service"
}
],
"price": {
"cpu": 200,
"memory": 200,
"storage": 200,
"total": 600
},
"objectTypeTotals": {
"addon": {
"price": {
"cpu": 200,
"memory": 200,
"storage": 200,
"total": 600
},
"duration": 172800
},
"service": {
"price": {
"cpu": 200,
"memory": 200,
"storage": 200,
"total": 600
},
"duration": 172800
},
"job": {
"price": {
"cpu": 200,
"memory": 200,
"storage": 200,
"total": 600
},
"duration": 172800
}
}
}
]
}
}