> For the complete documentation index, see [llms.txt](https://docs.peakcommerce.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peakcommerce.com/developers/api-groups/invoices.md).

# Invoices

The **Invoices API** is a thin pass-through over the active billing adapter — invoices live in the connected billing system (Zuora, Stripe Billing, etc.), not in the platform database, and this API surfaces them per-account and offers a one-shot "pay this invoice" entry point.

The two endpoints in this group are the high-traffic ones for a customer portal: list the invoices on an account, then start a payment session for a specific open invoice. The payment-session lifecycle then continues under [Payments](/developers/api-groups/payments.md).

Reads require the `read` scope; the pay endpoint requires `commerce`. Adapter outages surface as `502`; missing accounts surface as `404`.

## Endpoints

### `GET /api/v1/accounts/{id}/invoices`

{% openapi src="<https://api.peakcommerce.com/api/v1/openapi.json>" path="/accounts/{id}/invoices" method="get" %}
<https://api.peakcommerce.com/api/v1/openapi.json>
{% endopenapi %}

Returns every invoice for the given account, sourced from the active billing adapter (`fetchInvoices`). The `id` must be a valid external billing-account id — invoices are not stored locally, so a local-only `organizations.id` will not resolve invoices unless the row also carries an `externalId`.

Each entry includes the adapter's invoice id, status (`open` / `paid` / `void` / `uncollectible`), amount, currency, due date, and a hosted-invoice URL when the gateway provides one. Pair with [`POST /invoices/{id}/pay`](#post-apiv1invoicesidpay) for the open ones.

Requires the `read` scope.

### `POST /api/v1/invoices/{id}/pay`

{% openapi src="<https://api.peakcommerce.com/api/v1/openapi.json>" path="/invoices/{id}/pay" method="post" %}
<https://api.peakcommerce.com/api/v1/openapi.json>
{% endopenapi %}

Convenience wrapper that opens a payment session bound to a specific invoice. Equivalent to `POST /payments` with `invoiceId` set, but takes the invoice id from the URL and lets you pass `accountId`, `amountCents`, and `currency` explicitly to avoid an extra adapter round-trip.

The returned `201` carries the new payment session — continue the flow under [Payments](/developers/api-groups/payments.md). On `complete`, the linked invoice is settled through the active billing adapter.

Requires the `commerce` scope.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.peakcommerce.com/developers/api-groups/invoices.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
