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

# GET /api/billing/invoices/{paymentId}/download — download invoice

> Download the e-invoice (电子发票) for a paid China-site payment. Accepts session Bearer or ?token= so plain browser links work directly.

Download the e-invoice (电子发票) for a paid China-site payment. Accepts the session JWT via `Authorization: Bearer` or via `?token=` in the query string so a plain `<a href>` link in the browser works without setting headers.

**Method:** `GET` **Path:** `/api/billing/invoices/{paymentId}/download` **Auth:** Session Bearer or `?token=` query JWT

## Path parameters

<ParamField path="paymentId" type="string" required>
  Paid payment identifier that has an associated invoice.
</ParamField>

## Query parameters

<ParamField query="token" type="string">
  Session JWT for browser-initiated downloads.
</ParamField>

## Response

`200 OK` with the invoice as a PDF or HTML stream, plus a `Content-Disposition: attachment; filename=...` header.

## Example

```bash theme={null}
# Server-side with header auth
curl -L -H "Authorization: Bearer eyJhbGciOi..." \
  https://ariacompute.cn/api/billing/invoices/pay_01H.../download \
  -o invoice.pdf

# Browser-friendly with query token
curl -L "https://ariacompute.cn/api/billing/invoices/pay_01H.../download?token=eyJhbGciOi..." \
  -o invoice.pdf
```

## Errors

| Status | Meaning                                 |
| ------ | --------------------------------------- |
| `401`  | Missing or invalid token.               |
| `404`  | Payment not found or no invoice issued. |


## Related topics

- [GET /api/billing/receipts/{paymentId}/download — download Stripe receipt](/api-reference/billing/receipt-download.md)
- [Prepaid wallet, top-ups, and usage billing](/concepts/wallet-billing.md)
- [GET and POST /api/billing/invoices — list and request invoices](/api-reference/billing/invoices.md)
- [API authentication: session tokens and API keys](/api-reference/authentication.md)
- [Authenticate requests to the Aria Compute API](/authentication.md)
