---
title: "The open period's invoice as it stands"
---

> 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/upcoming`

## Authentication

Requires one of the following:

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

## Path parameters

- `GetUpcomingInvoice.path.orgId` (string, required)
  - format `uuid`

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/invoices/upcoming';
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/upcoming"

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

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "organizationId": "string",
  "periodStart": "2019-08-24T14:15:22Z",
  "periodEnd": "2019-08-24T14:15:22Z",
  "issuesAt": "2019-08-24T14:15:22Z",
  "currency": "string",
  "estimated": true,
  "subtotalMicros": "string",
  "totalCents": "string",
  "roundingMicros": "string",
  "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"
    }
  ]
}
```

- `GetUpcomingInvoice.response.200.organizationId` (string, required)
- `GetUpcomingInvoice.response.200.periodStart` (string, required)
  - format `date-time`
- `GetUpcomingInvoice.response.200.periodEnd` (string, required)
  - format `date-time`
- `GetUpcomingInvoice.response.200.issuesAt` (string, required)
  - format `date-time`
- `GetUpcomingInvoice.response.200.currency` (string, required)
- `GetUpcomingInvoice.response.200.estimated` (boolean, required)
- `GetUpcomingInvoice.response.200.subtotalMicros` (string, required) — Micros.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetUpcomingInvoice.response.200.totalCents` (string, required) — Cents.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetUpcomingInvoice.response.200.roundingMicros` (string, required) — Micros.
  - pattern `^-?[0-9]+(\.[0-9]+)?$`
- `GetUpcomingInvoice.response.200.lines` (array<object>, required)
  - `GetUpcomingInvoice.response.200.lines.position` (integer, required)
  - `GetUpcomingInvoice.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).
  - `GetUpcomingInvoice.response.200.lines.service` (string | null, required)
  - `GetUpcomingInvoice.response.200.lines.projectId` (string | null, required)
  - `GetUpcomingInvoice.response.200.lines.projectName` (string | null, required) — The project's name when the invoice was drafted.
  - `GetUpcomingInvoice.response.200.lines.projectSlug` (string | null, required)
  - `GetUpcomingInvoice.response.200.lines.sku` (string | null, required)
  - `GetUpcomingInvoice.response.200.lines.description` (string, required)
  - `GetUpcomingInvoice.response.200.lines.quantity` (string, required) — In the SKU's unit.
    - pattern `^-?[0-9]+(\.[0-9]+)?$`
  - `GetUpcomingInvoice.response.200.lines.unitPrice` (string | null, required) — Dollars per unit; null for folded lines and SKUs whose price changed within the period.
  - `GetUpcomingInvoice.response.200.lines.amount` (string, required) — Exact dollars.
    - pattern `^-?[0-9]+(\.[0-9]+)?$`
  - `GetUpcomingInvoice.response.200.lines.amountMicros` (string, required) — Micros.
    - pattern `^-?[0-9]+(\.[0-9]+)?$`
  - `GetUpcomingInvoice.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"
      }
    ]
  }
}
```

- `GetUpcomingInvoice.response.401.error` (object, required)
  - `GetUpcomingInvoice.response.401.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUpcomingInvoice.response.401.error.message` (string, required) — What went wrong, for people.
  - `GetUpcomingInvoice.response.401.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUpcomingInvoice.response.401.error.issues.path` (string, required)
    - `GetUpcomingInvoice.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"
      }
    ]
  }
}
```

- `GetUpcomingInvoice.response.403.error` (object, required)
  - `GetUpcomingInvoice.response.403.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUpcomingInvoice.response.403.error.message` (string, required) — What went wrong, for people.
  - `GetUpcomingInvoice.response.403.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUpcomingInvoice.response.403.error.issues.path` (string, required)
    - `GetUpcomingInvoice.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"
      }
    ]
  }
}
```

- `GetUpcomingInvoice.response.404.error` (object, required)
  - `GetUpcomingInvoice.response.404.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUpcomingInvoice.response.404.error.message` (string, required) — What went wrong, for people.
  - `GetUpcomingInvoice.response.404.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUpcomingInvoice.response.404.error.issues.path` (string, required)
    - `GetUpcomingInvoice.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"
      }
    ]
  }
}
```

- `GetUpcomingInvoice.response.429.error` (object, required)
  - `GetUpcomingInvoice.response.429.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUpcomingInvoice.response.429.error.message` (string, required) — What went wrong, for people.
  - `GetUpcomingInvoice.response.429.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUpcomingInvoice.response.429.error.issues.path` (string, required)
    - `GetUpcomingInvoice.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"
      }
    ]
  }
}
```

- `GetUpcomingInvoice.response.500.error` (object, required)
  - `GetUpcomingInvoice.response.500.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUpcomingInvoice.response.500.error.message` (string, required) — What went wrong, for people.
  - `GetUpcomingInvoice.response.500.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUpcomingInvoice.response.500.error.issues.path` (string, required)
    - `GetUpcomingInvoice.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"
      }
    ]
  }
}
```

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


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