# Get a postpaid invoice

`GET https://console.advinservers.com/api/v1/client/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).

## Authorization

Send `Authorization: Bearer <token>` with the request. 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.

## Path parameters

- `invoice` (string, required): The invoice uuid short

## Response 200

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

- `id` (string | null, required): Null for a month with nothing billed yet, which has no row.
- `uuid_short` (string | null, required): The value of `uuid_short`.
- `month` (string, required): The value of `month`.
- `month_label` (string, required): The value of `month_label`.
- `status` (string, required): The value of `status`. One of: `draft`, `unpaid`, `credit_hold`, `suspended`, `termination_pending`, `paid`, `deferred`, `cancelled`.
- `status_label` (string, required): The value of `status_label`.
- `total` (string, required): The value of `total`.
- `currency` (string, required): The three-letter currency code used for monetary amounts.
- `invoice_date` (string | null, required): On a draft, the dates it will be issued (the next month's first day) and due.
- `due_date` (string | null, required): The value of `due_date`.
- `credit_hold_date` (string | null, required): The value of `credit_hold_date`.
- `suspension_date` (string | null, required): The value of `suspension_date`.
- `termination_date` (string | null, required): The value of `termination_date`.
- `paid_at` (string | null, required): When payment was recorded, in UTC.
- `invoice_id` (integer | null, required): The published invoice, paid like any other through the invoice endpoints. Null until it is published.
- `can_pay` (boolean, required): Whether the customer can pay.
- `lines` (object[] | null, required): The value of `lines`.
  - `type` (string, required): usage, monthly_cap, charge or rounding.
  - `description` (string, required): An optional description shown to customers.
  - `resource` (string | null, required): The kind of resource the line bills, such as "Virtual Server", which the invoice groups by. Null for the rounding line.
  - `team_name` (string | null, required): The team the line was billed in. Null for the rounding line and for a team since deleted.
  - `month` (string, required): The month the line was billed for, which is earlier than the invoice's on a carried-over line.
  - `hours` (integer | null, required): The value of `hours`.
  - `hourly_rate` (string | null, required): Five decimal places, as charged.
  - `monthly_rate` (string | null, required): The value of `monthly_rate`.
  - `amount` (string, required): Five decimal places; the invoice total is rounded up to the cent once, on its own line.
  - `started_at` (string | null, required): The date and time for started at, in UTC.
  - `ended_at` (string | null, required): The date and time for ended at, in UTC.

```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
    }
  ]
}
```

## 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.

## Example request

```bash
curl --request GET \
  --url 'https://console.advinservers.com/api/v1/client/postpaid-invoices/{invoice}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json'
```
