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

# Invoices

> Create and retrieve invoices, and pay one with a stored payment method.

PayChoice raises invoices automatically as [payment schedule](https://developers.paychoice.com.au/billing/payment-schedule.md) items fall due. You can also create ad-hoc invoices for a customer and pay them on demand with a stored token.

| Action | Request |
| - | - |
| List | `GET /customer/{customer}/invoice` — not paginated |
| Retrieve | `GET /customer/{customer}/invoice/{invoice}` |
| Create | `POST /customer/{customer}/invoice` |
| Pay | `POST /customer/{customer}/invoice/{invoice}/pay` |

`{invoice}` is the integer `invoice_number`.

## Create

```bash theme={null}
curl https://api-sandbox.paychoice.com.au/api/v4/customer/8c34513b-61e0-4f8a-b007-af4fe9479bf4/invoice \
  -u "$PAYCHOICE_USERNAME:$PAYCHOICE_PASSWORD" \
  -H "Accept: application/json" \
  -d due_date=2026-11-22 \
  -d scheduled=1 \
  -d "item[0][description]=Personal training session" \
  -d "item[0][amount]=100"
```

**due\_date** `date` *required*

When the invoice is due.

**item\[0]\[description]** `string` *required*

Line description. Add further lines as `item[1][...]`, `item[2][...]`. At least one line is required.

**item\[0]\[amount]** `decimal` *required*

Line amount, up to two decimal places.

**scheduled** `integer`

`1` scheduled invoice, `0` payment link.

```json theme={null}
{
  "status": "Success",
  "code": 201,
  "messages": [ { "message_text": "Data created", "message_type": "success" } ],
  "invoice": {
    "invoice_number": 25340,
    "invoice_date": "2026-11-22",
    "invoice_amount": "100.00",
    "business_name": "PayFitness & Co",
    "customer_guid": "8c34513b-61e0-4f8a-b007-af4fe9479bf4",
    "customer_address": { "line1": "21 Swanston Street", "line2": "", "suburb": "Box Hill", "state": "VIC", "postcode": "3000", "country": "AU" },
    "line_items": [
      { "description": "100.00", "amount": "Personal training session" }
    ],
    "status": "Pending",
    "payments_list": [],
    "link": { "href": "/api/v4/customer/8c34513b-61e0-4f8a-b007-af4fe9479bf4/invoice/25340", "rel": "self" }
  },
  "object_type": "invoice",
  "link": { "href": "/api/v4/customer/8c34513b-61e0-4f8a-b007-af4fe9479bf4/invoice", "rel": "self" }
}
```

> [!WARNING]
>
> In `line_items[]` the keys are swapped: `description` holds the amount and `amount` holds the description text. Read them accordingly.

**invoice\_number** `integer`

The invoice ID.

**invoice\_date** `date`

Due date.

**invoice\_amount** `string`

Total, decimal.

**status** `string`

`Pending`, `Processing`, `Completed`, `Canceled` or `Dismissed`.

**payments\_list** `array`

Payment attempts: `receipt_number`, `id` (charge ID), `reference`, `amount`, `amount_applied`, `date`, `type`, `status`, `error_code`, `description`, `payment_method` (`Credit Card` / `Bank Account`), `token_name`, `token_number`. Empty until a payment is made.

## Pay

`POST /customer/{customer}/invoice/{invoice}/pay` charges the invoice to a stored token. Pass `card_token` or `bank_token`; if neither is given, the customer's default payment method is used, and an error is returned if there isn't one.

```json theme={null}
{
  "status": "Success",
  "code": 200,
  "messages": [ { "message_text": "charge was sent.", "message_type": "success" } ],
  "invoice_payment": {
    "transaction_id": "a7c21d9e-4f36-4b80-9e5d-3c8f1a2b6d47",
    "reference": "INV25340",
    "status": "Approved",
    "error_code": "00",
    "aggregator": "123456789012"
  },
  "object_type": "invoice_payment",
  "link": { "href": "/api/v4/customer/8c34513b-61e0-4f8a-b007-af4fe9479bf4/invoice/25340", "rel": "self" }
}
```

`transaction_id` is the PayChoice charge ID — use it to match the [webhook](https://developers.paychoice.com.au/getting-the-result/webhooks.md). A bank payment is `Processing` at this point; the final outcome arrives by webhook.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.