Skip to content

Get a postpaid invoice

GET/postpaid-invoices/{invoice}

Overview

Returns one postpaid invoice with its lines. A usage line is one resource's stretch of the month: hours (part hours count as whole ones, at least one and at most 672 a month) at hourly_rate, which is the monthly price over 672 hours rounded up to five decimal places. A monthly_cap line hands back what the rounded rate charged above the monthly price, a charge line is a one-off purchase such as a bandwidth block, and a rounding line takes the total up to the next cent. A draft's lines are worked out to this moment.

Permissions

Requires the account permission invoices.read (View invoices).

curl --request GET \
  --url 'https://console.advinservers.com/api/v1/client/postpaid-invoices/{invoice}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json'
{
  "id": "8f9b2a4c-6d1e-4f3a-9b7c-2e5d8a1f4c6b",
  "uuid_short": "Uuid short",
  "month": "2026-09",
  "month_label": "September 2026",
  "status": "unpaid",
  "status_label": "Unpaid",
  "total": "16.00",
  "currency": "USD",
  "invoice_date": "Invoice date",
  "due_date": "2026-10-07",
  "credit_hold_date": "2026-10-14",
  "suspension_date": "2026-10-14",
  "termination_date": "2026-10-21",
  "paid_at": null,
  "invoice_id": 18342,
  "can_pay": true,
  "lines": [
    {
      "type": "usage",
      "description": "lambda-core",
      "resource": "Virtual Server",
      "team_name": "Anomalous Materials",
      "month": "2026-09",
      "hours": 672,
      "hourly_rate": "0.02381",
      "monthly_rate": "16.00",
      "amount": "16.00032",
      "started_at": "2026-09-01T00:00:00+00:00",
      "ended_at": "2026-09-30T23:59:59+00:00"
    },
    {
      "type": "monthly_cap",
      "description": "Monthly cap adjustment: lambda-core",
      "resource": "Virtual Server",
      "team_name": "Anomalous Materials",
      "month": "2026-09",
      "hours": null,
      "hourly_rate": null,
      "monthly_rate": null,
      "amount": "-0.00032",
      "started_at": null,
      "ended_at": null
    }
  ]
}

Authorization

Authorizationstringheaderrequired

Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.

Send it as Bearer <token>.

Path parameters

invoicestringrequired

The invoice uuid short

Response 200

application/json

The record, as a JSON object. There is no envelope.

idstring | nullrequired

Null for a month with nothing billed yet, which has no row.

uuid_shortstring | nullrequired

The value of uuid_short.

monthstringrequired

The value of month.

month_labelstringrequired

The value of month_label.

statusstringrequired

The value of status.

One of: draft, unpaid, credit_hold, suspended, termination_pending, paid, deferred, cancelled

status_labelstringrequired

The value of status_label.

totalstringrequired

The value of total.

currencystringrequired

The three-letter currency code used for monetary amounts.

invoice_datestring | nullrequired

On a draft, the dates it will be issued (the next month's first day) and due.

due_datestring | nullrequired

The value of due_date.

credit_hold_datestring | nullrequired

The value of credit_hold_date.

suspension_datestring | nullrequired

The value of suspension_date.

termination_datestring | nullrequired

The value of termination_date.

paid_atstring | nullrequired

When payment was recorded, in UTC.

invoice_idinteger | nullrequired

The published invoice, paid like any other through the invoice endpoints. Null until it is published.

can_paybooleanrequired

Whether the customer can pay.

linesobject[] | nullrequired

The value of lines.

Show child attributes
typestringrequired

usage, monthly_cap, charge or rounding.

descriptionstringrequired

An optional description shown to customers.

resourcestring | nullrequired

The kind of resource the line bills, such as "Virtual Server", which the invoice groups by. Null for the rounding line.

team_namestring | nullrequired

The team the line was billed in. Null for the rounding line and for a team since deleted.

monthstringrequired

The month the line was billed for, which is earlier than the invoice's on a carried-over line.

hoursinteger | nullrequired

The value of hours.

hourly_ratestring | nullrequired

Five decimal places, as charged.

monthly_ratestring | nullrequired

The value of monthly_rate.

amountstringrequired

Five decimal places; the invoice total is rounded up to the cent once, on its own line.

started_atstring | nullrequired

The date and time for started at, in UTC.

ended_atstring | nullrequired

The date and time for ended at, in UTC.

Errors

401
The key was missing, malformed, revoked, or belongs to an account that no longer exists.
403
Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
404
The resource was not found in the selected team. Resources in another account or team also return 404.
429
Too many requests. The Retry-After header says how many seconds to wait. Limits are per account, so several keys on one account share them.