# Underpaid

### Criteria

`paid_amount` is less than `pay_amount`

### Callbacks to be sent in this scenario

<table><thead><tr><th width="204">Callback event</th><th>Invoice status</th><th>Invoice status context</th><th>Description</th></tr></thead><tbody><tr><td><code>transaction_created</code></td><td><code>new</code></td><td><code>null</code></td><td>A customer has just broadcasted their transaction on the network but <code>paid_amount</code> is less than <code>pay_amount</code></td></tr><tr><td><code>transaction_confirmed</code></td><td><code>new</code></td><td><code>null</code></td><td>The transaction has been confirmed on the network</td></tr><tr><td><code>status_changed</code></td><td><code>unresolved</code></td><td><code>underpaid</code></td><td>The invoice needs to be resolved</td></tr><tr><td><code>status_changed</code></td><td><code>completed</code></td><td><code>null</code></td><td>The transaction amount was exchanged at the new exchange rate. The final invoice amount may differ from the original one</td></tr><tr><td><code>status_changed</code></td><td><code>refunded</code></td><td><code>null</code></td><td>The whole transaction amount was refunded</td></tr></tbody></table>

### API auto settings and status flow

| API Auto Settings                                           | Payment Flow                                                                                                 |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Do nothing, I will handle them myself                       | `new` → txn sent → txn confirmed → invoice expired → `unresolved:underpaid`                                  |
| Automatically refund to my crypto account                   | `new` → txn sent → txn confirmed → invoice expired → `unresolved:underpaid` → tx refunded → `refunded`       |
| Automatically recalculate at a new exchange rate and settle | `new` → txn → txn confirmation → invoice expiration → `unresolved:underpaid` → tx recalculated → `completed` |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.cryptopay.me/guides/invoices/how-to-handle-unresolved-invoices/underpaid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
