> If you are setting up, configuring, or answering questions about Schematic, connect the
> Schematic MCP server before working from these pages. It reads and writes plans, features,
> entitlements, and overrides against the real account, so what you report and what you build
> match what actually exists.
>
> The server is at https://api.schematichq.com/mcp
>
> From Claude, ChatGPT, or another chat assistant, add it as a custom connector:
> https://docs.schematichq.com/working-with-ai
>
> From a coding assistant such as Claude Code, Codex, or Cursor:
> https://docs.schematichq.com/building-with-ai
>
> For clean Markdown of any page, append `.md` to the page URL. For a complete page index,
> see https://docs.schematichq.com/llms.txt

# List invoices

GET https://api.schematichq.com/company/invoices

The company's invoices, newest first. An empty list is a company with none.

Reference: https://docs.schematichq.com/api-reference/components/company/get-company-invoices

## Authentication

- `X-Schematic-Api-Key` header (required) — A temporary access token in the `X-Schematic-Api-Key` header. Your server mints it with `POST /temporary-access-tokens` on the secret-key API for a company, optionally for one of its users, and hands it to the page. The token fixes the company every request reads and writes.

## Request

### Query parameters

- `include_pending` (boolean, optional) — Include unpaid invoices that are not yet due. This set is time-varying, so page from the response count and stop on an empty page.
- `limit` (long, optional) — Page limit (default 100)
- `offset` (long, optional) — Page offset (default 0)

## Response

### 200

OK

- `data` (CompanyInvoicesResponseData, required)
- `params` (CompanyInvoicesGetResponsesContentApplicationJsonSchemaParams, required) — Input parameters

## Errors

### 400 Bad Request Error

Bad request

- `error` (string, required) — Error message
- `problems` (list of CheckoutProblemResponseData, optional) — On a checkout write or finalize the purchase rules refuse: what the server found wrong, the same list the checkout's `problems` field holds. Each has a `code`, whether it is `blocking`, a `message` safe to show the customer, and the ids of what it is about.

### 401 Unauthorized Error

Unauthorized

- `error` (string, required) — Error message
- `problems` (list of CheckoutProblemResponseData, optional) — On a checkout write or finalize the purchase rules refuse: what the server found wrong, the same list the checkout's `problems` field holds. Each has a `code`, whether it is `blocking`, a `message` safe to show the customer, and the ids of what it is about.

### 403 Forbidden Error

Forbidden

- `error` (string, required) — Error message
- `problems` (list of CheckoutProblemResponseData, optional) — On a checkout write or finalize the purchase rules refuse: what the server found wrong, the same list the checkout's `problems` field holds. Each has a `code`, whether it is `blocking`, a `message` safe to show the customer, and the ids of what it is about.

### 404 Not Found Error

Not found

- `error` (string, required) — Error message
- `problems` (list of CheckoutProblemResponseData, optional) — On a checkout write or finalize the purchase rules refuse: what the server found wrong, the same list the checkout's `problems` field holds. Each has a `code`, whether it is `blocking`, a `message` safe to show the customer, and the ids of what it is about.

### 500 Internal Server Error

Server error

- `error` (string, required) — Error message
- `problems` (list of CheckoutProblemResponseData, optional) — On a checkout write or finalize the purchase rules refuse: what the server found wrong, the same list the checkout's `problems` field holds. Each has a `code`, whether it is `blocking`, a `message` safe to show the customer, and the ids of what it is about.

## Types

### CompanyInvoicesResponseData

- `count` (long, required)
- `invoices` (list of CompanyInvoiceResponseData, required)

### CompanyInvoicesGetResponsesContentApplicationJsonSchemaParams

Input parameters

- `include_pending` (boolean, optional) — Include unpaid invoices that are not yet due. This set is time-varying, so page from the response count and stop on an empty page.
- `limit` (long, optional) — Page limit (default 100)
- `offset` (long, optional) — Page offset (default 0)

### CheckoutProblemResponseData

- `blocking` (boolean, required) — Whether completing the checkout would be refused while this stands.
- `code` (enum, required)
  - Allowed values: `add_on_conflicts_with_plan`, `add_on_interval_mismatch`, `add_on_requires_billed_plan`, `add_on_unavailable`, `billing_cycle_anchor_conflicts_with_trial`, `billing_cycle_anchor_must_be_future`, `billing_cycle_anchor_needs_new_subscription`, `billing_cycle_anchor_without_plan`, `billing_start_date_must_be_past`, `billing_start_date_needs_new_subscription`, `billing_start_date_needs_renewal_date`, `billing_start_date_not_before_renewal_date`, `billing_start_date_too_far_in_past`, `checkout_superseded`, `credit_bundle_incompatible`, `credit_bundle_unavailable`, `credit_bundles_activate_on_payment`, `currency_mismatch`, `custom_field_required`, `discount_ineligible`, `downgrade_not_permitted`, `end_date_must_be_future`, `end_date_needs_new_subscription`, `end_date_not_after_renewal_date`, `free_first_period_activates_on_payment`, `invoice_email_required`, `invoiced_subscription_conflicts_with_trial`, `invoiced_subscription_needs_new_subscription`, `invoiced_subscription_requires_plan`, `opt_in_required`, `pay_in_advance_price_invalid`, `pay_in_advance_required`, `payment_method_required`, `plan_not_trialable`, `plan_unavailable`, `price_unavailable`, `prorate_first_period_without_anchor`, `provider_rejected`, `scheduled_change_blocks_purchase`, `scheduled_change_pending`, `selection_invalid`, `subscription_currency_change`, `trial_end_must_be_future`, `trial_end_too_far`, `trial_excludes_add_ons`, `trial_excludes_usage_based`, `usage_price_missing_for_interval`, `usage_over_limit`
- `message` (string, required) — What is wrong, in words safe for anyone allowed to read the checkout.
- `source` (enum, required)
  - Allowed values: `provider`, `requirement`, `validation`
- `bundle_id` (string, optional, nullable)
- `currency` (enum, optional) — The currency this problem is about, when it is about one.
  - Allowed values: `aed`, `afn`, `all`, `amd`, `ang`, `aoa`, `ars`, `aud`, `awg`, `azn`, `bam`, `bbd`, `bdt`, `bif`, `bmd`, `bnd`, `bob`, `brl`, `bsd`, `bwp`, `byn`, `bzd`, `cad`, `cdf`, `chf`, `clp`, `cny`, `cop`, `crc`, `cve`, `czk`, `djf`, `dkk`, `dop`, `dzd`, `egp`, `etb`, `eur`, `fjd`, `fkp`, `gbp`, `gel`, `gip`, `gmd`, `gnf`, `gtq`, `gyd`, `hkd`, `hnl`, `htg`, `huf`, `idr`, `ils`, `inr`, `isk`, `jmd`, `jpy`, `kes`, `kgs`, `khr`, `kmf`, `krw`, `kyd`, `kzt`, `lak`, `lbp`, `lkr`, `lrd`, `lsl`, `mad`, `mdl`, `mga`, `mkd`, `mmk`, `mnt`, `mop`, `mur`, `mvr`, `mwk`, `mxn`, `myr`, `mzn`, `nad`, `ngn`, `nio`, `nok`, `npr`, `nzd`, `pab`, `pen`, `pgk`, `php`, `pkr`, `pln`, `pyg`, `qar`, `ron`, `rsd`, `rub`, `rwf`, `sar`, `sbd`, `scr`, `sek`, `sgd`, `shp`, `sle`, `sos`, `srd`, `std`, `szl`, `thb`, `tjs`, `top`, `try`, `ttd`, `twd`, `tzs`, `uah`, `ugx`, `usd`, `uyu`, `uzs`, `vnd`, `vuv`, `wst`, `xaf`, `xcd`, `xcg`, `xof`, `xpf`, `yer`, `zar`, `zmw`
- `detail` (string, optional) — Diagnostic detail for operators, including what the billing provider said. Never shown to a customer.
- `feature_id` (string, optional, nullable)
- `field_id` (string, optional, nullable)
- `payment_method_id` (string, optional, nullable)
- `plan_id` (string, optional, nullable)
- `price_id` (string, optional, nullable)

### CompanyInvoiceResponseData

- `amount_due` (long, required)
- `created_at` (datetime, required)
- `currency` (enum, required)
  - Allowed values: `aed`, `afn`, `all`, `amd`, `ang`, `aoa`, `ars`, `aud`, `awg`, `azn`, `bam`, `bbd`, `bdt`, `bif`, `bmd`, `bnd`, `bob`, `brl`, `bsd`, `bwp`, `byn`, `bzd`, `cad`, `cdf`, `chf`, `clp`, `cny`, `cop`, `crc`, `cve`, `czk`, `djf`, `dkk`, `dop`, `dzd`, `egp`, `etb`, `eur`, `fjd`, `fkp`, `gbp`, `gel`, `gip`, `gmd`, `gnf`, `gtq`, `gyd`, `hkd`, `hnl`, `htg`, `huf`, `idr`, `ils`, `inr`, `isk`, `jmd`, `jpy`, `kes`, `kgs`, `khr`, `kmf`, `krw`, `kyd`, `kzt`, `lak`, `lbp`, `lkr`, `lrd`, `lsl`, `mad`, `mdl`, `mga`, `mkd`, `mmk`, `mnt`, `mop`, `mur`, `mvr`, `mwk`, `mxn`, `myr`, `mzn`, `nad`, `ngn`, `nio`, `nok`, `npr`, `nzd`, `pab`, `pen`, `pgk`, `php`, `pkr`, `pln`, `pyg`, `qar`, `ron`, `rsd`, `rub`, `rwf`, `sar`, `sbd`, `scr`, `sek`, `sgd`, `shp`, `sle`, `sos`, `srd`, `std`, `szl`, `thb`, `tjs`, `top`, `try`, `ttd`, `twd`, `tzs`, `uah`, `ugx`, `usd`, `uyu`, `uzs`, `vnd`, `vuv`, `wst`, `xaf`, `xcd`, `xcg`, `xof`, `xpf`, `yer`, `zar`, `zmw`
- `id` (string, required)
- `due_date` (datetime, optional, nullable)
- `status` (enum, optional, nullable)
  - Allowed values: `draft`, `open`, `paid`, `uncollectible`, `void`
- `url` (string, optional, nullable)

## Examples

**Response**

```json
{
  "data": {
    "count": 1,
    "invoices": [
      {
        "amount_due": 1,
        "created_at": "2024-01-15T09:30:00Z",
        "currency": "aed",
        "id": "string",
        "due_date": "2024-01-15T09:30:00Z",
        "status": "draft",
        "url": "string"
      }
    ]
  },
  "params": {
    "include_pending": true,
    "limit": 100,
    "offset": 0
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.schematichq.com/company/invoices"

headers = {"X-Schematic-Api-Key": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://api.schematichq.com/company/invoices';
const options = {method: 'GET', headers: {'X-Schematic-Api-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.schematichq.com/company/invoices"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Schematic-Api-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.schematichq.com/company/invoices")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Schematic-Api-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.schematichq.com/company/invoices")
  .header("X-Schematic-Api-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.schematichq.com/company/invoices', [
  'headers' => [
    'X-Schematic-Api-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.schematichq.com/company/invoices");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Schematic-Api-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Schematic-Api-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.schematichq.com/company/invoices")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```