---
title: "An invoice with its lines"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Billing API › Billing

`GET /v1/organizations/{orgId}/invoices/{invoiceId}`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie

## Path parameters

- `GetInvoice.path.orgId` (string, required)
  - format `uuid`
- `GetInvoice.path.invoiceId` (string, required) — The invoice's ID (a UUID).

## Code samples

### cURL

```curl
curl --request GET \
  --url https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/invoices/string \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/invoices/string';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/invoices/string"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "id": "string",
  "number": "string",
  "status": "string",
  "overdue": true,
  "carriedForward": true,
  "carriedIntoInvoiceId": "string",
  "periodStart": "2019-08-24T14:15:22Z",
  "periodEnd": "2019-08-24T14:15:22Z",
  "currency": "string",
  "collectionMethod": "string",
  "totalCents": "string",
  "startingBalanceCents": "string",
  "amountDueCents": "string",
  "amountPaidCents": "string",
  "amountRemainingCents": "string",
  "dueAt": "2019-08-24T14:15:22Z",
  "issuedAt": "2019-08-24T14:15:22Z",
  "finalizedAt": "2019-08-24T14:15:22Z",
  "paidAt": "2019-08-24T14:15:22Z",
  "organizationId": "string",
  "subtotalMicros": "string",
  "roundingMicros": "string",
  "poNumber": "string",
  "customer": {
    "name": "string",
    "email": "string",
    "address": {
      "property1": "string",
      "property2": "string"
    }
  },
  "hostedInvoiceUrl": "string",
  "paymentAttempts": 0,
  "lastPaymentError": "string",
  "pdf": {
    "sha256": "string",
    "sizeBytes": 0
  },
  "lines": [
    {
      "position": 0,
      "kind": "string",
      "service": "string",
      "projectId": "string",
      "projectName": "string",
      "projectSlug": "string",
      "sku": "string",
      "description": "string",
      "quantity": "string",
      "unitPrice": "string",
      "amount": "string",
      "amountMicros": "string",
      "amountCents": "string"
    }
  ]
}
```

- `GetInvoice.response.200.id` (string, required)
- `GetInvoice.response.200.number` (string | null, required) — Assigned when the invoice is issued.
- `GetInvoice.response.200.status` (string, required) — open, paid, void or uncollectible. Treat other values as unknown.
- `GetInvoice.response.200.overdue` (boolean, required) — Open, not carried forward, and past its due date.
- `GetInvoice.response.200.carriedForward` (boolean, required) — Below the minimum charge: added to the next invoice instead.
- `GetInvoice.response.200.carriedIntoInvoiceId` (string | null, required) — The invoice it was carried into, once there is one.
- `GetInvoice.response.200.periodStart` (string, required)
  - format `date-time`
- `GetInvoice.response.200.periodEnd` (string, required)
  - format `date-time`
- `GetInvoice.response.200.currency` (string, required)
- `GetInvoice.response.200.collectionMethod` (string | null, required) — charge_automatically (the default card) or send_invoice.
- `GetInvoice.response.200.totalCents` (string, required) — Cents.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetInvoice.response.200.startingBalanceCents` (string, required) — Carried from earlier invoices, in cents.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetInvoice.response.200.amountDueCents` (string, required) — Cents.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetInvoice.response.200.amountPaidCents` (string, required) — Cents.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetInvoice.response.200.amountRemainingCents` (string, required) — Cents.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetInvoice.response.200.dueAt` (string | null, required)
  - format `date-time`
- `GetInvoice.response.200.issuedAt` (string | null, required) — When it was issued and numbered.
  - format `date-time`
- `GetInvoice.response.200.finalizedAt` (string | null, required) — The same as issuedAt.
  - format `date-time`
- `GetInvoice.response.200.paidAt` (string | null, required)
  - format `date-time`
- `GetInvoice.response.200.organizationId` (string, required)
- `GetInvoice.response.200.subtotalMicros` (string, required) — The lines' exact sum, in micros.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetInvoice.response.200.roundingMicros` (string, required) — subtotalMicros less totalCents, in micros.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetInvoice.response.200.poNumber` (string | null, required)
- `GetInvoice.response.200.customer` (object, required) — Who it was issued to.
  - `GetInvoice.response.200.customer.name` (string | null, required)
  - `GetInvoice.response.200.customer.email` (string | null, required)
  - `GetInvoice.response.200.customer.address` (object | null, required) — As issued: line1, line2, city, region, postalCode, country.
- `GetInvoice.response.200.hostedInvoiceUrl` (string | null, required) — Stripe's payment page.
- `GetInvoice.response.200.paymentAttempts` (integer, required)
- `GetInvoice.response.200.lastPaymentError` (string | null, required)
- `GetInvoice.response.200.pdf` (one of, required) — Null until the PDF is delivered.
  - one of: `object`, `null`
- `GetInvoice.response.200.lines` (array<object>, required)
  - `GetInvoice.response.200.lines.position` (integer, required)
  - `GetInvoice.response.200.lines.kind` (string, required) — usage, other_usage (lines under half a cent) or other_projects (a service's smallest projects, past the line limit).
  - `GetInvoice.response.200.lines.service` (string | null, required)
  - `GetInvoice.response.200.lines.projectId` (string | null, required)
  - `GetInvoice.response.200.lines.projectName` (string | null, required) — The project's name when the invoice was drafted.
  - `GetInvoice.response.200.lines.projectSlug` (string | null, required)
  - `GetInvoice.response.200.lines.sku` (string | null, required)
  - `GetInvoice.response.200.lines.description` (string, required)
  - `GetInvoice.response.200.lines.quantity` (string, required) — In the SKU's unit.
    - pattern `^-?[0-9]+(\.[0-9]+)?$`
  - `GetInvoice.response.200.lines.unitPrice` (string | null, required) — Dollars per unit; null for folded lines and SKUs whose price changed within the period.
  - `GetInvoice.response.200.lines.amount` (string, required) — Exact dollars.
    - pattern `^-?[0-9]+(\.[0-9]+)?$`
  - `GetInvoice.response.200.lines.amountMicros` (string, required) — Micros.
    - pattern `^-?[0-9]+(\.[0-9]+)?$`
  - `GetInvoice.response.200.lines.amountCents` (string, required) — What's billed, in cents.
    - pattern `^-?[0-9]+(\.[0-9]+)?$`

### 401

unauthenticated: no valid credential.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetInvoice.response.401.error` (object, required)
  - `GetInvoice.response.401.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetInvoice.response.401.error.message` (string, required) — What went wrong, for people.
  - `GetInvoice.response.401.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetInvoice.response.401.error.issues.path` (string, required)
    - `GetInvoice.response.401.error.issues.message` (string, required)

### 403

access_denied: the caller isn't allowed to (the message names the action); forbidden_origin: a cookie-authenticated write from another site.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetInvoice.response.403.error` (object, required)
  - `GetInvoice.response.403.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetInvoice.response.403.error.message` (string, required) — What went wrong, for people.
  - `GetInvoice.response.403.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetInvoice.response.403.error.issues.path` (string, required)
    - `GetInvoice.response.403.error.issues.message` (string, required)

### 404

not_found: the organization (or one the caller doesn't belong to), or the resource, doesn't exist.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetInvoice.response.404.error` (object, required)
  - `GetInvoice.response.404.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetInvoice.response.404.error.message` (string, required) — What went wrong, for people.
  - `GetInvoice.response.404.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetInvoice.response.404.error.issues.path` (string, required)
    - `GetInvoice.response.404.error.issues.message` (string, required)

### 429

too_many_requests: slow down.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetInvoice.response.429.error` (object, required)
  - `GetInvoice.response.429.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetInvoice.response.429.error.message` (string, required) — What went wrong, for people.
  - `GetInvoice.response.429.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetInvoice.response.429.error.issues.path` (string, required)
    - `GetInvoice.response.429.error.issues.message` (string, required)

### 500

internal_error: a bug; the details are in the logs, under the request ID.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetInvoice.response.500.error` (object, required)
  - `GetInvoice.response.500.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetInvoice.response.500.error.message` (string, required) — What went wrong, for people.
  - `GetInvoice.response.500.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetInvoice.response.500.error.issues.path` (string, required)
    - `GetInvoice.response.500.error.issues.message` (string, required)

### 503

unavailable, ledger_unavailable or payments_unavailable: retry later.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetInvoice.response.503.error` (object, required)
  - `GetInvoice.response.503.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetInvoice.response.503.error.message` (string, required) — What went wrong, for people.
  - `GetInvoice.response.503.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetInvoice.response.503.error.issues.path` (string, required)
    - `GetInvoice.response.503.error.issues.message` (string, required)


Source: https://docs.ezghcloud.com/billing-api/Billing/GetInvoice/index.md
