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

# Invoice Endpoints

> List and retrieve invoices, and get payment URLs.

All endpoints require authentication.

***

## GET /v1/invoices

List all invoices for the authenticated user.

**Query parameters:**

| Parameter | Type    | Description                                      |
| --------- | ------- | ------------------------------------------------ |
| `page`    | integer | Page number (default: 1)                         |
| `status`  | string  | Filter by status: `pending`, `paid`, `cancelled` |

**Response (200):**

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": 1,
      "uuid": "abc-123-def",
      "amount": "9.99",
      "currency": "USD",
      "status": "paid",
      "gateway": "stripe",
      "created_at": "2026-01-01T10:00:00Z",
      "paid_at": "2026-01-01T10:05:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "total": 6,
    "per_page": 15
  }
}
```

***

## GET /v1/invoices/{invoice}

Get details of a specific invoice.

**Path parameter:** `invoice` — invoice UUID

**Response (200):**

```json theme={null}
{
  "success": true,
  "data": {
    "id": 1,
    "uuid": "abc-123-def",
    "amount": "9.99",
    "currency": "USD",
    "discount": "0.00",
    "promo_code": null,
    "status": "paid",
    "gateway": "stripe",
    "plan": {
      "name": "Premium"
    },
    "cycle": {
      "name": "Monthly",
      "duration_days": 30
    },
    "created_at": "2026-01-01T10:00:00Z",
    "due_date": "2026-01-08T10:00:00Z",
    "paid_at": "2026-01-01T10:05:00Z"
  }
}
```

***

## GET /v1/invoices/{invoice}/payment-url

Get the payment URL for a pending invoice.

**Path parameter:** `invoice` — invoice UUID

**Response (200):**

```json theme={null}
{
  "success": true,
  "data": {
    "url": "https://checkout.stripe.com/pay/...",
    "gateway": "stripe",
    "expires_at": "2026-01-08T10:00:00Z"
  }
}
```

Returns `422` if the invoice is already paid or cancelled.
