# Overpaid

### Criteria

`paid_amount` is greater 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 broadcas their transaction on the network but <code>paid_amount</code> is greater 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>overpaid</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><p>The transaction amount was exchanged at the new exchange rate. The final invoice amount may be different from the original one.</p><p></p><p>OR</p><p></p><p>The original invoice amount is added to the merchant's account balance and the overage is refunded</p></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 → `unresolved:overpaid`                                  |
| Settle the invoice and automatically refund the overage to my crypto account | `new` → txn sent → txn confirmed → `unresolved:overpaid` → overage refunded → `completed` |
| Automatically recalculate at a new exchange rate and settle                  | `new` → txn sent → txn confirmed → `unresolved:overpaid` → 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/overpaid.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.
