GET
/
v1
/
customers
/
{customer_id}
/
invoices
/
breakdowns
List invoice breakdowns
curl --request GET \
  --url https://api.metronome.com/v1/customers/{customer_id}/invoices/breakdowns \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "6a37bb88-8538-48c5-b37b-a41c836328bd",
      "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989",
      "type": "USAGE",
      "start_timestamp": "2021-01-01T00:00:00Z",
      "end_timestamp": "2021-02-01T00:00:00Z",
      "breakdown_start_timestamp": "2021-01-01T00:00:00Z",
      "breakdown_end_timestamp": "2021-01-02T00:00:00Z",
      "credit_type": {
        "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
        "name": "USD (cents)"
      },
      "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1",
      "line_items": [
        {
          "credit_type": {
            "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
            "name": "USD (cents)"
          },
          "name": "CPU hours",
          "type": "usage",
          "quantity": 1488,
          "total": 14392,
          "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8"
        }
      ],
      "status": "DRAFT",
      "subtotal": 14392,
      "total": 14392
    },
    {
      "id": "6a37bb88-8538-48c5-b37b-a41c836328bd",
      "customer_id": "617e39d8-68f4-4592-b8d2-c2bf26a76989",
      "type": "USAGE",
      "start_timestamp": "2021-01-01T00:00:00Z",
      "end_timestamp": "2021-02-01T00:00:00Z",
      "breakdown_start_timestamp": "2021-01-02T00:00:00Z",
      "breakdown_end_timestamp": "2021-01-03T00:00:00Z",
      "credit_type": {
        "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
        "name": "USD (cents)"
      },
      "contract_id": "9de042a1-b955-43ce-9ab4-e3c2004570d1",
      "line_items": [
        {
          "credit_type": {
            "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
            "name": "USD (cents)"
          },
          "name": "CPU hours",
          "type": "usage",
          "quantity": 1488,
          "total": 14392,
          "product_id": "5c1f40cd-9ff8-4e90-ae53-5f81b0e9d1e8"
        }
      ],
      "status": "DRAFT",
      "subtotal": 14392,
      "total": 14392
    }
  ],
  "next_page": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

customer_id
string<uuid>
required

Query Parameters

next_page
string

Cursor that indicates where the next page of results should start.

status
string

Invoice status, e.g. DRAFT or FINALIZED

skip_zero_qty_line_items
boolean

If set, all zero quantity line items will be filtered out of the response

limit
integer

Max number of results that should be returned. For daily breakdowns, the response can return up to 35 days worth of breakdowns. For hourly breakdowns, the response can return up to 24 hours. If there are more results, a cursor to the next page is returned.

Required range: 1 <= x <= 100
window_size
enum<string>

The granularity of the breakdowns to return. Defaults to day.

Available options:
hour,
day,
HOUR,
DAY,
Hour,
Day
sort
enum<string>

Invoice sort order by issued_at, e.g. date_asc or date_desc. Defaults to date_asc.

Available options:
date_asc,
date_desc
credit_type_id
string

Only return invoices for the specified credit type

starting_on
string<date-time>
required

RFC 3339 timestamp. Breakdowns will only be returned for time windows that start on or after this time.

ending_before
string<date-time>
required

RFC 3339 timestamp. Breakdowns will only be returned for time windows that end on or before this time.

Response

Success

The response is of type object.