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

# Invoices: Requesting and Collecting Payments

> Invoices are how IteraPay generates blockchain deposit addresses for customers. Learn the four invoice types and how the payment lifecycle works.

An invoice is a payment request that IteraPay uses to generate a unique blockchain deposit address for your customer. When you create an invoice, IteraPay assigns it a payment method (a specific cryptocurrency) and an amount in USD. Your customer sends crypto to the generated address, and IteraPay records the incoming transaction against that invoice. You choose the invoice type based on how many times you expect the invoice to be paid and what the funds are for.

## Invoice types

IteraPay supports two invoice types. Each serves a different use case.

<Tabs>
  <Tab title="onetime">
    A **onetime** invoice is intended for a single payment from a single customer. Once a payment is received, the invoice is considered fulfilled. Use this type for order payments, subscriptions renewals, or any scenario where you need one customer to pay one specific amount once.

    * Generates a unique deposit address
    * Tracks a single expected payment
    * Ideal for e-commerce checkouts and point-of-sale flows
  </Tab>

  <Tab title="reusable">
    A **reusable** invoice stays active and can accept payments from multiple customers or multiple payments over time. Use this type for donation pages, recurring payment links, or payment buttons embedded in a product UI.

    * A single invoice ID serves many payers
    * Each payment is recorded as a separate transaction
    * Fees apply per payment, not per invoice
  </Tab>
</Tabs>

## How a customer pays

When you create an invoice, IteraPay does not immediately generate a deposit address — addresses are provisioned on demand when a customer views their invoice. The payment flow works as follows:

1. You create an invoice via the API and receive an `invoiceID`.
2. You share the invoice with your customer (typically by directing them to a payment page).
3. Your customer (or your frontend) calls the public invoice endpoint to retrieve invoice details:
   ```http theme={null}
   GET /public/invoices/{invoiceID}
   ```
4. To get the deposit address for a specific payment method, call:
   ```http theme={null}
   GET /public/invoices/{invoiceID}/method/{methodID}/address
   ```
5. To retrieve all deposit addresses already provisioned for an invoice:
   ```http theme={null}
   GET /public/invoices/{invoiceID}/addresses
   ```
6. Your customer sends the exact amount in crypto to the returned address.
7. IteraPay detects the on-chain transaction and records it against the invoice.

<Note>
  The public invoice endpoints require no authentication. This allows your customer-facing frontend or payment page to call them directly without exposing your API credentials.
</Note>

## Invoice lifecycle and states

Every invoice moves through a series of states from creation to completion. The `collectStates` field tracks how the funds collected against an invoice have progressed through the sweep pipeline — from awaiting payment, through on-chain confirmation, to settled and available in your balance.

When listing invoices, you can filter by `state`, `collectStates`, and other fields to find exactly the invoices you need:

```http theme={null}
GET /merchants/{merchantID}/invoices
```

**Available filters:**

| Filter          | Description                                   |
| --------------- | --------------------------------------------- |
| `type`          | Filter by invoice type: `onetime`, `reusable` |
| `state`         | Filter by invoice state                       |
| `tokens`        | Filter by payment method token IDs            |
| `amount`        | Filter by amount range                        |
| `dateRange`     | Filter by creation date range                 |
| `collectStates` | Filter by fund collection progress            |
| `archived`      | Include or exclude archived invoices          |
| `amlOk`         | Filter by AML check status                    |
| `search`        | Free-text search across invoice fields        |

## AML checks

IteraPay performs Anti-Money Laundering (AML) screening on incoming payments. When an invoice receives a payment, the transaction is checked against AML rules before funds are made available for collection. You can filter invoices by `amlOk` to find invoices where all payments have passed screening.

<Warning>
  Payments that fail AML screening will not be released for collection. Contact IteraPay support if a transaction is flagged incorrectly.
</Warning>

## Creating and managing invoices

### Create an invoice

To create an invoice, `POST` to the invoices endpoint with the invoice type, payment method ID, and USD amount:

```http theme={null}
POST /merchants/{merchantID}/invoices
```

```json theme={null}
{
  "type": "onetime",
  "methodID": 1,
  "amount": 49.99
}
```

The response includes the `invoiceID` you use to retrieve addresses and track payments.

### Archive an invoice

You can archive an invoice to remove it from your active list without deleting it. Archived invoices remain queryable:

```http theme={null}
POST /merchants/{merchantID}/invoices/{invoiceID}
```

### Delete an invoice

Deleting an invoice permanently removes it:

```http theme={null}
DELETE /merchants/{merchantID}/invoices/{invoiceID}
```

<Warning>
  Deleting an invoice that has received payments may cause those transactions to become unassociated. Archive rather than delete invoices with payment history.
</Warning>

## Related reference

<CardGroup cols={2}>
  <Card title="Create invoice" icon="file-plus" href="/api-reference/invoices/create">
    Create a new onetime, reusable, collect, or withdraw invoice.
  </Card>

  <Card title="List invoices" icon="list" href="/api-reference/invoices/list">
    Retrieve and filter invoices for your merchant account.
  </Card>

  <Card title="Payment info" icon="qrcode" href="/api-reference/invoices/payment-info">
    Get deposit addresses for customer payment.
  </Card>

  <Card title="Transactions" icon="arrow-right-arrow-left" href="/concepts/transactions">
    Understand how on-chain payments are recorded against invoices.
  </Card>
</CardGroup>
