# Pay an invoice

> Find your unpaid invoices, pay one with credit, a saved method or a new one, and read an invoice's lines and status.

Source: https://docs.coritan.com/billing/invoices/

In the dashboard:

- /dashboard/billing/invoices: https://www.coritan.com/dashboard/billing/invoices

Coritan raises an invoice for every order, every renewal and every plan upgrade. Invoices are in US dollars. Pay one to start a new service, to keep a service running past its renewal date, or to lift a suspension.

## Before you begin

- Sign in to the [dashboard](https://www.coritan.com/dashboard).
- To pay with credit, have credit on your balance. [Add credit to your balance](/billing/add-credit/) explains how.
- To pay with a saved card or PayPal account, save it first on the **Payment methods** tab ([Manage payment methods](/billing/payment-methods/)). You can also enter a new card or use PayPal while you pay.

## Find an invoice

1. In the sidebar, select **Billing**, then the **Invoices** tab.
2. Choose a filter:
   - **Unpaid** lists every invoice you still owe on: unpaid and overdue ones, however old.
   - **Paid** lists the invoices you have paid.
   - **All** lists everything, newest first.
3. Select **View** beside an invoice to read it.

The table shows each invoice's number, **Status**, **Total**, the date it was **Issued** and the date it is **Due**. Choose how many rows a page shows at the bottom of the table, and move between pages with **Previous** and **Next**.

## Pay an invoice

1. Select **Pay** beside the invoice. The same button is on the **Overview** tab of **Billing**, in **Waiting for payment**.
   The dialog opens with the **Amount due**: the invoice total less anything already paid.
2. Choose how to pay:
   - **Account credit** takes the amount from your balance. It is greyed out when your balance is empty.
   - A saved card or PayPal account pays with that method. Your default method is marked `Default`.
   - **Card** opens a card form. It reads **New card** when you already have a saved method.
   - **PayPal** shows PayPal's buttons in the dialog. Approve the payment in the PayPal window that opens; you stay on the page.
   - Any other provider opens that provider's checkout page, then brings you back to the **Invoices** tab.
3. Select the button at the bottom of the dialog. It says what happens next:
   - **Pay with credit** when your credit covers the whole amount.
   - **Apply credit** when it covers part. The rest stays due, and you pay it the same way.
   - `Pay $12.99` (with the amount due) for a saved method or a new card.
   - `Continue to` and the provider's name for a checkout page.
4. If a card form opens (**Pay by card**, or **Confirm with your bank** when your bank asks for a check), complete it and select **Pay now**. You enter card details with Coritan's card processor; Coritan does not store them.

## Result

A message confirms the payment, for example `Invoice INV-20260925-48213 paid.` The invoice moves to the **Paid** filter and Coritan emails you a receipt. Paying in full also does what the invoice was for:

- A new service starts setting up.
- A renewal moves the service's next renewal date on by one billing period.
- An upgrade applies the new plan ([Change a service's plan](/billing/change-plan/)).
- A service suspended over this invoice is resumed.

When a payment is accepted but not yet settled, you see `Payment submitted. The invoice updates once your bank settles it.` The invoice stays unpaid until the payment clears. Every payment also appears on the **Transactions** tab ([Transactions and payment attempts](/billing/transactions/)).

## Read an invoice

Select **View** to open an invoice. It shows:

- **Issued**, **Due** and **Paid** (the date and time it was paid, or `Not yet`).
- **Notes**, when the invoice has any.
- One line per charge, with the **Item**, **Qty**, **Unit price** and **Amount**.
- The **Subtotal**, **Tax** and **Total**. When part of the invoice is paid, **Already paid** and **Left to pay** follow.

An unpaid invoice has a pay button at the bottom of the dialog, beside **Close**.

Each invoice has one of these statuses:

| Status | Meaning |
| --- | --- |
| `unpaid` | Issued and waiting for payment. |
| `overdue` | Its due date has passed and it is still unpaid. The services on it are suspended soon after; [Failed payments and suspended services](/billing/failed-payments/) has the timeline. |
| `paid` | Paid in full. |
| `cancelled` | Voided. You owe nothing on it. Coritan cancels an invoice when you cancel its service, or when a newer upgrade replaces an unpaid one. |
| `refunded` | Paid, then refunded. |
| `draft` | Not issued yet. |

## Troubleshooting

**No way to pay is available right now**
: Nothing is set up to take a payment for this invoice. [Contact support](/support/).

**Could not load the ways to pay**
: The dialog could not read the payment options. Select **Try again**.

**Could not take the payment**
: The payment did not start. The message under it gives the reason, for example `Payment method 812 not found or inactive` when the saved method has been removed.

**Could not start the payment**
: The card form or the provider's checkout page could not be created. The message under it gives the reason. Try again, or choose another way to pay.

`The payment was declined.`
: Your bank or PayPal refused the charge. The message may give the bank's reason instead. Pay another way, or see [Failed payments and suspended services](/billing/failed-payments/).

`The bank did not approve the payment.`
: The check your bank asked for failed or was abandoned. Nothing was charged. Try again, or pay another way.

`Payment cancelled; the invoice is still due.`
: You left the provider's checkout page before paying. Nothing was charged.

`Back from checkout. The invoice updates once the payment clears.`
: You came back from a checkout page before the provider confirmed the payment. Check the invoice again later; do not pay twice.

**Could not open PayPal**
: PayPal did not load in the dialog. Select **Try again**. If the message says `PayPal is not available in this browser. Choose another way to pay.`, use a card or another method.

**Could not open the card form**
: The card form did not load. Select **Try again**.

**Could not apply your credit**
: The message gives the reason, for example `No credit balance available`.

The **Pay** button is missing
: Only unpaid and overdue invoices can be paid. The invoice is already paid, cancelled or refunded.

## Related

- [Add credit to your balance](/billing/add-credit/)
- [Manage payment methods](/billing/payment-methods/)
- [Failed payments and suspended services](/billing/failed-payments/)
- [Currencies and countries](/billing/currencies-and-regions/)

## With the API

### List your invoices

[`GET /billing/invoices`](/api/reference/client/billing/#op-get-api-v1-billing-invoices) lists your invoices, newest first. It takes:

`status_filter`
: `open` (unpaid or overdue, what the **Unpaid** filter shows), or one status: `draft`, `unpaid`, `paid`, `cancelled`, `refunded` or `overdue`. Leave it out for every invoice.

`page` and `limit`
: The page to return (from `1`) and how many invoices a page holds (default `50`, at most `200`).

`with_total`
: `true` wraps the page in an object with the total and the count per status. Without it, the answer is a bare array of invoices.

```bash
curl "https://api.coritan.com/api/v1/billing/invoices?status_filter=open&with_total=true" \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

```json
{
  "items": [
    {
      "id": 5011,
      "invoice_number": "INV-20260925-48213",
      "user_id": 4821,
      "subtotal": 12.99,
      "tax": 0.0,
      "total": 12.99,
      "amount_paid": 0.0,
      "currency": "USD",
      "status": "unpaid",
      "due_date": "2026-09-28T00:00:00",
      "paid_at": null,
      "notes": null,
      "items": [
        {
          "id": 9120,
          "service_id": 311,
          "description": "Service renewal - survival-smp",
          "item_type": "recurring",
          "quantity": 1.0,
          "unit_price": 12.99,
          "total": 12.99
        }
      ],
      "created_at": "2026-09-25T02:00:00"
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 50,
  "counts": {"all": 14, "open": 1, "draft": 0, "unpaid": 1, "paid": 13, "cancelled": 0, "refunded": 0, "overdue": 0}
}
```

`total` counts the invoices that match the filter. `counts` holds every status whatever the filter, with `all` and `open` added.

In each invoice:

`id` and `invoice_number`
: The number the API uses in paths, and the number printed on the invoice.

`subtotal`, `tax` and `total`
: The amounts in US dollars.

`amount_paid`
: What credit and earlier payments have covered. What is left to pay is `total` minus `amount_paid`.

`currency`
: `USD`.

`status`
: One of the statuses in the table above.

`due_date`, `paid_at` and `created_at`
: When the invoice falls due, when it was paid (or `null`) and when it was issued.

`items`
: The lines. `service_id` is the service a line bills, and `item_type` is `recurring`, `one_time`, `proration`, `addon`, `discount` or `manual`.

[`GET /billing/invoices/{invoice_id}`](/api/reference/client/billing/#op-get-api-v1-billing-invoices-invoice-id) returns one invoice in the same shape. It answers `404` with `Invoice not found`, or `403` with `Access denied` for an invoice on another account.

### Pay with credit

[`POST /billing/invoices/{invoice_id}/apply-credit`](/api/reference/client/billing/#op-post-api-v1-billing-invoices-invoice-id-apply-credit) takes as much of the amount due as your balance covers:

```bash
curl -X POST https://api.coritan.com/api/v1/billing/invoices/5011/apply-credit \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

```json
{
  "invoice_id": 5011,
  "applied": "12.99",
  "fully_paid": true,
  "credit_balance": "12.01",
  "message": "Invoice paid with credit"
}
```

When credit covers only part, `fully_paid` is `false` and `message` is `Partial credit applied`. When nothing can be applied, the answer is `400` with the reason, such as `No credit balance available`.

### Pay with a saved method

[`POST /payments/invoices/{invoice_id}/charge`](/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-charge) charges a saved method. Find its `id` with `GET /payments/methods` ([Manage payment methods](/billing/payment-methods/#with-the-api)).

```bash
curl -X POST https://api.coritan.com/api/v1/payments/invoices/5011/charge \
  -H "Authorization: Bearer $CORITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: pay-inv-5011-1" \
  -d '{"payment_method_id": 812}'
```

The body takes:

`payment_method_id`
: The saved method to charge. Required.

`amount_usd`
: Pay part of the invoice: this many US dollars, at most what is left. Leave it out to pay the rest in full.

`currency`
: The currency to charge the method in. Leave it out to use your account's currency ([Currencies and countries](/billing/currencies-and-regions/)).

Send an `Idempotency-Key` header so that retrying a request whose answer you did not receive does not charge twice ([Idempotency](/api/idempotency/)).

The answer is the payment attempt:

```json
{
  "id": 7730,
  "invoice_id": 5011,
  "user_id": 4821,
  "user_email": "alex@example.com",
  "gateway_name": "stripe",
  "gateway_config_id": 3,
  "payment_method_id": 812,
  "amount": 1299,
  "currency": "USD",
  "base_amount": "12.99",
  "fx_rate": "1",
  "status": "succeeded",
  "gateway_reference": "pi_3Qexample",
  "error_message": null,
  "decline_type": null,
  "decline_code": null,
  "is_auto_charge": false,
  "charge_schedule_id": null,
  "idempotency_key": "pay-inv-5011-1",
  "refunded_amount": null,
  "created_at": "2026-09-25T09:12:40",
  "completed_at": "2026-09-25T09:12:42",
  "gateway_response": {"id": "pi_3Qexample", "status": "succeeded"},
  "client_secret": null
}
```

`amount` is in the charged currency's smallest unit (cents here). `base_amount` is the US dollar amount it pays and `fx_rate` the exchange rate used, both as decimal strings. `gateway_reference` is the provider's id for the payment, and `gateway_response` holds the provider's own answer. `status` is one of:

`succeeded`
: Paid.

`processing`
: Accepted but not settled. The invoice updates when it settles.

`requires_action`
: The bank wants the cardholder to confirm. `client_secret` lets a browser page finish it with Stripe.js; then call `confirm-payment` as below. A script alone cannot complete this step.

`failed`
: Declined. `error_message` gives the reason, and `decline_type` says whether retrying can work (`soft`) or not (`hard`).

`POST /payments/invoices/{invoice_id}/pay` is the older path for the same charge, with the same body and answer.

### Pay with a new card, PayPal or a checkout page

These flows need a browser for the cardholder's part; the API creates and finishes each payment.

1. List what can take this invoice with [`GET /payments/invoices/{invoice_id}/gateways`](/api/reference/client/payments/#op-get-api-v1-payments-invoices-invoice-id-gateways). Each entry has a `name` to send as `gateway_name`, and `adapter` says what it is (`stripe` for cards, `paypal`, or another provider).
2. For a card, create a payment with [`POST /payments/invoices/{invoice_id}/pay-intent`](/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-pay-intent). The answer's `client_secret` is for Stripe.js in the browser. Asking again for the same invoice and amount returns the same payment. After the card is confirmed, call [`POST /payments/invoices/{invoice_id}/confirm-payment`](/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-confirm-payment) with the query parameters `gateway_name` and `payment_intent_id`. It answers `succeeded`, `pending` or `requires_action`, or `402` with `Payment not completed`.
3. For PayPal or another provider, call [`POST /payments/invoices/{invoice_id}/checkout`](/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-checkout) with `gateway_name`, `return_url` and `cancel_url`. Both must be absolute `http` or `https` URLs on a real host: the API answers `400` for a placeholder host such as `example.com` or `localhost`. Send the payer to `checkout_url`. For PayPal, `session_id` is the PayPal order; once the payer approves it, call [`POST /payments/invoices/{invoice_id}/paypal-capture`](/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-paypal-capture) with the query parameters `order_id` and `gateway_name`.

```bash
curl -X POST https://api.coritan.com/api/v1/payments/invoices/5011/checkout \
  -H "Authorization: Bearer $CORITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"gateway_name": "paypal", "return_url": "https://www.coritan.com/dashboard/billing/invoices", "cancel_url": "https://www.coritan.com/dashboard/billing/invoices"}'
```

A checkout that is still open for the invoice is returned again instead of a new one, with `reused` set to `true`. The checkout answers `400` when the invoice is already paid or cancelled.

## API

- `GET /api/v1/billing/invoices`: Newest first, ties by id so a page boundary never repeats or skips a row (https://docs.coritan.com/api/reference/client/billing/#op-get-api-v1-billing-invoices)
- `GET /api/v1/billing/invoices/{invoice_id}`: Get invoice (https://docs.coritan.com/api/reference/client/billing/#op-get-api-v1-billing-invoices-invoice-id)
- `POST /api/v1/billing/invoices/{invoice_id}/apply-credit`: Apply account credit to an unpaid invoice (unlocks provision / plan change when paid) (https://docs.coritan.com/api/reference/client/billing/#op-post-api-v1-billing-invoices-invoice-id-apply-credit)
- `GET /api/v1/payments/invoices/{invoice_id}/gateways`: List invoice gateways (https://docs.coritan.com/api/reference/client/payments/#op-get-api-v1-payments-invoices-invoice-id-gateways)
- `POST /api/v1/payments/invoices/{invoice_id}/charge`: Canonical saved-method charge for an invoice (alias of /pay) (https://docs.coritan.com/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-charge)
- `POST /api/v1/payments/invoices/{invoice_id}/pay`: Charge a saved payment method for an invoice (legacy path; prefer /charge) (https://docs.coritan.com/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-pay)
- `POST /api/v1/payments/invoices/{invoice_id}/checkout`: Create invoice checkout (https://docs.coritan.com/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-checkout)
- `POST /api/v1/payments/invoices/{invoice_id}/pay-intent`: Create an in-page Stripe Payment Element intent for an invoice (https://docs.coritan.com/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-pay-intent)
- `POST /api/v1/payments/invoices/{invoice_id}/confirm-payment`: Finalize a platform invoice charge after customer completes SCA (https://docs.coritan.com/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-confirm-payment)
- `POST /api/v1/payments/invoices/{invoice_id}/paypal-capture`: Capture an approved PayPal order for a platform invoice (https://docs.coritan.com/api/reference/client/payments/#op-post-api-v1-payments-invoices-invoice-id-paypal-capture)
