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

# Invoices

> Create an invoice, send its pay link, and see it paid.

An invoice is a **payment request**: the amount, who it's for, and a link where your customer pays by card. Mojo
Payments emails or texts the link, and the payment is deposited with your other card payments.

Needs: invoice payments turned on for your account, and an API key with `payments.create` (to create and send) and
`payments.view` (to read).

## Create one

Pick the MID it's paid to (`GET /accounts`, its `id`), then:

```bash theme={null}
curl https://api.paymentsmojo.com/payment-requests \
  -H "Authorization: Bearer eyJ…" \
  -H "Idempotency-Key: inv-1042" \
  -H "Content-Type: application/json" \
  -d '{
    "merchantAccountId": "4d2a9c71-8e3b-4f05-b6d2-91c7e0a5f318",
    "invoiceNumber": "1042",
    "amount": 50.00,
    "poNumber": "PO-7781",
    "dueDate": "2026-10-31",
    "customerCompany": "Buyer Industries",
    "customerName": "Pat Buyer",
    "customerEmail": "ap@buyer.example",
    "customerPhone": "405-555-0101",
    "delivery": "Email",
    "memo": "Thanks for your order.",
    "lines": [
      { "description": "Sourdough loaves", "quantity": 10, "unitCost": 4.30 },
      { "description": "Delivery", "quantity": 1, "unitCost": 7.00 }
    ]
  }'
```

| Field | Rules |
| - | - |
| `invoiceNumber` | Required, up to 50 characters. |
| `amount` | Required, $0.01 to $999,999.99. |
| `customerEmail` | Required: it's how Mojo Payments knows the customer. |
| `customerCompany`, `customerName` | At least one. |
| `customerPhone` | A US number; required to send by text. |
| `delivery` | `Email` (default) or `Text`. Once a customer chooses how they get invoices, their choice wins. |
| `lines` | Optional, up to 200: `description`, `quantity`, `unitCost`, and optionally `uom`, `commodityCode`, `upc`. They must add up to `amount`. |
| `send` | `false` creates the invoice and its link without sending anything. |

The answer (`201`) is the invoice, with its `id`, its `status` and the customer's pay `link`. Send an
[`Idempotency-Key`](/developers/idempotency) so a retry can't create it twice.

Business customers' cards cost less to accept when the invoice carries its lines and PO number (Level 3 data): Mojo
Payments sends them with the payment.

## Send it later

`POST /payment-requests/{id}/send` sends (or re-sends) an open or part-paid invoice, by the customer's choice of email or
text, else the invoice's `delivery`. The invoice's `sentAt`, `sentVia` and `sendProblem` say what happened.

## Follow it

`GET /payment-requests/{id}` gives the invoice with its lines, every payment made toward it, and the customer's saved
cards. `GET /payment-requests` lists them, a page at a time ([Pagination](/developers/pagination)): `q` searches
invoice and PO numbers, the customer's company, name, email and phone, and amounts; `status` keeps one status.

| `status` | Means |
| - | - |
| `Open` | Waiting to be paid. (`Paying` while a payment is going through.) |
| `PartiallyPaid` | Paid in part: the customer can pay the `balance` later. |
| `Paid` | Paid in full (`paidAt`). |
| `Locked` | Five declined cards: the link stopped taking payments. |
| `Unconfirmed` | The card processor didn't answer, so the payment's outcome is unknown. Check before collecting again. |
| `Cancelled` | Cancelled: the link no longer works. |

A customer can pay with up to three cards. Each approved card is one entry in `payments`, with its amount, last four
digits and `retRef` (the processor's reference, also on your [deposits](/developers/deposits)).

## Cancel it

`POST /payment-requests/{id}/cancel` stops an unpaid or part-paid invoice. What was paid stays paid.

## Saved cards

When you let customers save a card (**Settings → Payment page**), an invoice lists that customer's saved cards
(`savedCards`: brand, last four, expiry). `DELETE /saved-cards/{id}` removes one, at the processor too.


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