Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

Get a month's bill

Returns one month of an organisation meter by meter: what it used, what its plan included and charges, and what each meter was charged. The same is given a day at a time. A plan that changed within the month is charged as it was at each hour.

GET/_luna/orgs/{org}/billing/usage
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:billing:read
Path parameters
orgstringrequired

The organisation, by its slug.

Query parameters
monthstring

The month, as YYYY-MM. This month when left out.

Responses
200

The month, meter by meter.

monthstringrequired

The month, as YYYY-MM.

currentbooleanrequired

Whether it is the month in progress.

planPlanNamerequired

The plan the organisation was on at the end of the month.

Show properties
namestringrequired
titlestringrequired
includedobjectrequired

How many billed units of each meter the plan included, by meter.

ratesobjectrequired

The plan's price for each meter in US dollars per billed unit, by meter.

usageobjectrequired

What the month used, as raw counts by meter.

chargedUsdobjectrequired

What each meter was charged, in US dollars, by meter.

feeUsdnumber<double>required

The plan's fee for the month, in US dollars.

costUsdnumber<double>required

What the month cost in all, in US dollars.

extraUsdnumber<double>required

What no credit covered, in US dollars, with the plan's fee left out.

daysDayUsage[]required

The same a day at a time, in UTC.

Show properties
Array of DayUsage
daystringrequired

The day, as YYYY-MM-DD.

costUsdobjectrequired

What each meter cost that day, in US dollars, by meter.

usageobjectrequired

What the day used, as raw counts by meter.

organisationstringrequired

The organisation's slug.

unitsobjectrequired

What each meter's billed unit is called, by meter.

scalesobjectrequired

How many of a meter's raw counts make one billed unit, by meter.

default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://luna.example.com/_luna/orgs/string/billing/usage' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "month": "string",
  "current": true,
  "plan": {
    "name": "string",
    "title": "string"
  },
  "included": {
    "property1": 0.1,
    "property2": 0.1
  },
  "rates": {
    "property1": 0.1,
    "property2": 0.1
  },
  "usage": {
    "property1": 0,
    "property2": 0
  },
  "chargedUsd": {
    "property1": 0.1,
    "property2": 0.1
  },
  "feeUsd": 0.1,
  "costUsd": 0.1,
  "extraUsd": 0.1,
  "days": [
    {
      "day": "string",
      "costUsd": {
        "property1": 0.1,
        "property2": 0.1
      },
      "usage": {
        "property1": 0,
        "property2": 0
      }
    }
  ],
  "organisation": "string",
  "units": {
    "property1": "string",
    "property2": "string"
  },
  "scales": {
    "property1": 0.1,
    "property2": 0.1
  }
}

Was this page helpful?