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

# Get Invoice

> Retrieve a specific invoice by ID

<Note>
  This endpoint retrieves detailed information about a specific invoice including line items, payments, and status.
</Note>

## Authentication

This endpoint requires a valid API key with `invoices:read` permissions.

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the invoice
</ParamField>

## Query Parameters

<ParamField query="expand" type="array">
  Expand related objects. Options: "customer", "payments", "credit\_notes", "events"
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique invoice identifier
</ResponseField>

<ResponseField name="object" type="string">
  Object type, always "invoice"
</ResponseField>

<ResponseField name="invoice_number" type="string">
  Human-readable invoice number
</ResponseField>

<ResponseField name="status" type="string">
  Invoice status: "draft", "sent", "viewed", "partially\_paid", "paid", "overdue", "voided"
</ResponseField>

<ResponseField name="total_amount" type="integer">
  Total invoice amount in cents
</ResponseField>

<ResponseField name="amount_due" type="integer">
  Outstanding amount in cents
</ResponseField>

<ResponseField name="line_items" type="array">
  Array of invoice line items
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://api.stateset.com/v1/invoices/inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
  --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```javascript Node.js theme={null}
  const invoice = await stateset.invoices.retrieve(
    'inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  );
  ```

  ```python Python theme={null}
  invoice = stateset.invoices.retrieve(
    'inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    "object": "invoice",
    "invoice_number": "INV-2024-0001",
    "status": "sent",
    "customer_id": "cust_abc123",
    "customer": {
      "id": "cust_abc123",
      "name": "Acme Corporation",
      "email": "billing@acme.com"
    },
    "issue_date": "2024-01-19",
    "due_date": "2024-02-18",
    "currency": "USD",
    "subtotal": 649500,
    "tax_amount": 48000,
    "discount_amount": 0,
    "total_amount": 697500,
    "amount_paid": 0,
    "amount_due": 697500,
    "line_items": [
      {
        "id": "li_123456",
        "description": "Professional Services - January 2024",
        "quantity": 40,
        "unit_price": 15000,
        "amount": 600000,
        "tax_rate": 0.08,
        "tax_amount": 48000,
        "account_code": "4000"
      },
      {
        "id": "li_123457",
        "description": "Software License",
        "quantity": 5,
        "unit_price": 9900,
        "amount": 49500,
        "product_id": "prod_xyz789",
        "tax_rate": 0,
        "tax_amount": 0,
        "account_code": "4100"
      }
    ],
    "billing_address": {
      "line1": "123 Business St",
      "city": "San Francisco",
      "state": "CA",
      "postal_code": "94105",
      "country": "US"
    },
    "payment_terms": "Net 30",
    "notes": "Thank you for your business!",
    "created_at": "2024-01-19T10:00:00Z",
    "sent_at": "2024-01-19T10:01:00Z",
    "viewed_at": "2024-01-19T14:30:00Z",
    "pdf_url": "https://invoices.stateset.com/inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30.pdf",
    "public_url": "https://pay.stateset.com/inv_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    "metadata": {
      "po_number": "PO-12345",
      "project_code": "PROJ-2024-001"
    }
  }
  ```
</ResponseExample>
