# When the patient doesn't pay right away

> Invoice, credit check and recourse — and why Completed can take a month.

The patient has had their payment link and reminder but hasn't paid. Now Rivr takes over collection. For the journal this is the most important guide to get right: it is where an order can stay unpaid for weeks — and where it is easy to book too early.

- Market: Sweden (`se`). Norway differs in currency, payment methods and what happens when nobody pays: https://developers.rivr.io/guides/unpaid.md?market=no
- Language: English (`en`). Svenska: https://developers.rivr.io/guides/unpaid.md?lang=sv
- 5 min read · 5 steps
- Page in the portal: https://developers.rivr.io/guides/unpaid

Every example targets the sandbox (`https://api.test.rivr.io`) and needs test credentials. A platform client's tokens come from `https://auth.test.rivr.io`, an organisation key's from `https://auth.test.rivr.tech`.

## 1. Rivr turns the order into an invoice

*Rivr · +30 h*

When the invoice step in the clinic's flow is reached — after 30 hours in the standard flow — and the order is still unpaid, Rivr runs a credit check on the patient. The outcome decides which of two paths the order takes.

> **Note.** The invoice step requires an identity that can be invoiced. If there isn't one, no invoice is created and the order stays `Created`.

**Order status:** `Created` · **The journal shows:** Unpaid

## 2. Path A: approved — paid at once

*Rivr → Journal system*

If the patient is approved, an invoice is sent by a financing partner and the order becomes `Completed` straight away with `PaymentMethod: "Invoice"`. The patient's debt now sits with the partner, not the clinic.

**What your system does:** The same as for card or Swish: mark as paid and move the receivable to Rivr.

**Order status:** `Completed` · **The journal shows:** Paid

**Webhook to you** (`Completed`)

```http
POST /webhooks/rivr
Content-Type: application/json
Rivr-Signature: t=1789640080,v1=5f2b0c…

{
  "id": "7b1e7c3a-2f4d-4a51-9c7e-5d0a6b8e2c14",
  "type": "Order",
  "merchantId": "MERCHANT_ID",
  "status": "Completed",
  "data": {
    "CreatedDate": "2026-09-17T09:12:03Z",
    "Reference": "visit-48213",
    "CompletedDate": "2026-09-17T09:14:40Z",
    "PaymentMethod": "Invoice",
    "Metadata": { "bookingId": "48213" }
  }
}
```

## 3. Path B: not approved — recourse invoice

*Rivr → Journal system*

If the patient isn't approved, Rivr sends its own invoice with recourse. The order becomes `Pending`: payment is under way, but the money isn't there yet.

**Why:** With recourse the risk stays with the clinic until the patient has paid. That is why the receivable must not move to Rivr until that has happened.

**What your system does:** Show the visit as unpaid, ideally with the text "invoice sent". The receivable stays on the patient. Do nothing else.

> **Rule.** Never move the receivable before the `Completed` webhook has arrived — not on `Created`, and not on `Pending`.

**Order status:** `Pending` · **The journal shows:** Unpaid — invoice sent

**Webhook to you** (`Pending`)

```http
POST /webhooks/rivr
Content-Type: application/json
Rivr-Signature: t=1789640080,v1=5f2b0c…

{
  "id": "7b1e7c3a-2f4d-4a51-9c7e-5d0a6b8e2c14",
  "type": "Order",
  "merchantId": "MERCHANT_ID",
  "status": "Pending",
  "data": {
    "CreatedDate": "2026-09-17T09:12:03Z",
    "Reference": "visit-48213",
    "Metadata": { "bookingId": "48213" }
  }
}
```

## 4. Rivr handles reminders and collection

*Rivr → Patient · +30 days*

Throughout the recourse period Rivr collects the payment. It can take 30 days or more. The journal does nothing meanwhile, and no further webhooks arrive until something decisive happens.

**Order status:** `Pending` · **The journal shows:** Unpaid — invoice sent

## 5. The patient pays the invoice

*Rivr → Journal system*

When the recourse invoice is paid the order becomes `Completed` with `PaymentMethod: "Invoice"`, and the clinic gets the money in the next settlement.

**What your system does:** Now, and only now: mark as paid and move the receivable to Rivr.

**Order status:** `Completed` · **The journal shows:** Paid

**Webhook to you** (`Completed`)

```http
POST /webhooks/rivr
Content-Type: application/json
Rivr-Signature: t=1789640080,v1=5f2b0c…

{
  "id": "7b1e7c3a-2f4d-4a51-9c7e-5d0a6b8e2c14",
  "type": "Order",
  "merchantId": "MERCHANT_ID",
  "status": "Completed",
  "data": {
    "CreatedDate": "2026-09-17T09:12:03Z",
    "Reference": "visit-48213",
    "CompletedDate": "2026-09-17T09:14:40Z",
    "PaymentMethod": "Invoice",
    "Metadata": { "bookingId": "48213" }
  }
}
```

## Common pitfalls

- Reading `Pending` as paid. `Pending` means the payment has been handed over — an invoice, financing or a bank payment — but not completed. The money may take a month, or never come.
- Telling path A from path B by `PaymentMethod`. Both normally end with `Invoice`, and a recourse order can even end up paid by card. What tells the paths apart is that the recourse path passes through `Pending`.
- Cancelling a `Pending` order and waiting for `Refunded`. It becomes `Cancelled` — there was no money to pay back.

## Next guide

- [Bookkeeping and payouts](https://developers.rivr.io/guides/bookkeeping.md): Two entries per order: when it is paid, and when the money reaches the bank.
- [Cancel and refund](https://developers.rivr.io/guides/cancel-refund.md): Cancel an unpaid order, pay back a paid one — and wait for the webhook.
