> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.trygrant.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.trygrant.com/_mcp/server.

# List invoices

GET https://api.trygrant.com/v1/invoices

Returns a paginated list of invoices. Supports optional customer_id, and status filters.

Reference: https://docs.trygrant.com/api-reference/grant-events-api/invoices/list

## Authentication

- `Authorization` header (bearer token, required) — API key obtained from the Grant dashboard

## Servers

- `https://api.trygrant.com` (Production, default)
- `http://localhost:8787` (Local development)

## Request

### Query parameters

- `limit` (string, optional, default: 50)
- `cursor` (string, optional)
- `customer_id` (string, optional)
- `status` (enum, optional) — Filter by invoice status
  - Allowed values: `draft`, `open`, `paid`, `void`, `uncollectible`

## Response

### 200

Invoices list

- `success` (boolean, required)
- `invoices` (list of object, required)
  - `id` (string, required)
  - `customer_id` (string, required, nullable)
  - `subscription_id` (string, required, nullable)
  - `status` (enum, required)
    - Allowed values: `draft`, `open`, `paid`, `void`, `uncollectible`
  - `currency` (string, required)
  - `collection_method` (enum, required)
    - Allowed values: `charge_automatically`, `send_invoice`
  - `invoice_number` (string, required, nullable)
  - `public_invoice_url` (string, required, nullable)
  - `due_date` (string, required, nullable)
  - `days_until_due` (integer, required, nullable)
  - `description` (string, required, nullable)
  - `customer_memo` (string, required, nullable)
  - `footer` (string, required, nullable)
  - `subtotal_cents` (integer, required)
  - `discount_cents` (integer, required)
  - `tax_cents` (integer, required)
  - `total_cents` (integer, required)
  - `finalized_at` (string, required, nullable)
  - `paid_at` (string, required, nullable)
  - `period_start` (string, required, nullable)
  - `period_end` (string, required, nullable)
  - `line_items` (list of object, required)
    - `id` (string, required)
    - `description` (string, required, nullable)
    - `quantity` (integer, required)
    - `unit_amount_cents` (integer, required)
    - `tax_amount_cents` (integer, required)
    - `total_amount_cents` (integer, required)
    - `period_start` (string, required, nullable)
    - `period_end` (string, required, nullable)
    - `created_at` (string, required)
    - `updated_at` (string, required)
  - `created_at` (string, required)
  - `updated_at` (string, required)
- `pagination` (object, required)
  - `has_more` (boolean, required) — Whether there are more items after this page
  - `next_cursor` (string, required, nullable) — Cursor to use for the next page, or null if no more items
- `request_id` (string, required)

## Examples

**Response**

```json
{
  "success": true,
  "invoices": [
    {
      "id": "cm5x9z8nv0000h85r7l9p2k1m",
      "customer_id": "cm5x9z8nv0001h85r7l9p2k2m",
      "subscription_id": null,
      "status": "draft",
      "currency": "usd",
      "collection_method": "send_invoice",
      "invoice_number": "INV-0001",
      "public_invoice_url": "https://www.trygrant.com/invoices/abc123",
      "due_date": null,
      "days_until_due": null,
      "description": null,
      "customer_memo": null,
      "footer": null,
      "subtotal_cents": 0,
      "discount_cents": 0,
      "tax_cents": 0,
      "total_cents": 0,
      "finalized_at": null,
      "paid_at": null,
      "period_start": null,
      "period_end": null,
      "line_items": [
        {
          "id": "cm5x9z8nv0000h85r7l9p2k1m",
          "description": "API calls — Feb 2024",
          "quantity": 1,
          "unit_amount_cents": 5000,
          "tax_amount_cents": 0,
          "total_amount_cents": 5000,
          "period_start": null,
          "period_end": null,
          "created_at": "2024-01-15T10:30:00.000Z",
          "updated_at": "2024-01-15T10:30:00.000Z"
        }
      ],
      "created_at": "2024-01-15T10:30:00.000Z",
      "updated_at": "2024-01-15T10:30:00.000Z"
    }
  ],
  "pagination": {
    "has_more": true,
    "next_cursor": "cm5x9z8nv0000h85r7l9p2k1m"
  },
  "request_id": "req_abc123"
}
```

**SDK Code**

```typescript
import { AfternoonClient } from "grant-sdk";

async function main() {
    const client = new AfternoonClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.invoices.list({});
}
main();

```

```python
import requests

url = "https://api.trygrant.com/v1/invoices"

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

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

print(response.json())
```

```go
package main

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

func main() {

	url := "https://api.trygrant.com/v1/invoices"

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

	req.Header.Add("Authorization", "Bearer <token>")

	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.trygrant.com/v1/invoices")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.trygrant.com/v1/invoices")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.trygrant.com/v1/invoices', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.trygrant.com/v1/invoices");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.trygrant.com/v1/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()
```