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

# Public Invoices

> Share invoices with customers via secure public URLs — no login required.

Every invoice can be shared via a **public URL** that lets customers view their invoice without needing a Fluxrate account.

## Generating a Public Token

```bash theme={null}
curl -X POST https://api.fluxrate.co/api/v1/invoices/<invoice_id>/generate-token \
  -H "Cookie: access_token=<token>"
```

The response includes a `public_token` field. The public invoice URL is:

```
https://app.fluxrate.co/p/<public_token>
```

## Accessing a Public Invoice

The public invoice endpoint requires no authentication:

```bash theme={null}
GET /api/v1/invoices/public/<token>
```

Returns the full invoice with:

* Customer details
* Organization branding (logo, colors)
* All line items
* Tax breakdown
* Total due
* Bank account details (if configured)
* Payment link (if a gateway is configured)

## Security

* Public tokens are cryptographically random UUIDs
* Tokens can be regenerated (invalidating old links) by calling generate-token again
* Public pages don't expose any other customer or organization data

## Use Cases

1. **Email delivery** — Include the public link in invoice emails
2. **Customer portal embedding** — Link from your app directly to the invoice
3. **Manual sharing** — Copy-paste the URL to share with finance contacts
4. **Payment collection** — The public page includes a payment button when a gateway is connected

<Tip>
  Regenerate the public token if a link is accidentally shared with the wrong person. The old link immediately becomes invalid.
</Tip>
