# Invoices

An invoice is a request for a cryptocurrency payment which is linked to its unique cryptocurrency address and the amount that has to be paid while the invoice is valid.

The invoice amount can be expressed either in cryptocurrency or fiat currency.&#x20;

As cryptocurrency payments are made over a separate network, when creating an invoice, we generate a unique payment address for each cryptocurrency so we can match customers to their payments. When a customer makes a cryptocurrency payment, the transaction is then broadcast to the cryptocurrency network for validation/confirmation.

Once the invoice is created, we start monitoring its unique address to identify the incoming transaction. Invoices have [statuses](https://developers.cryptopay.me/guides/invoices/invoice-statuses) and each time the invoice changes its status, Cryptopay sends [callbacks](https://developers.cryptopay.me/guides/api-basics/callbacks) to the Callback URL.

Every time the customer sends cryptocurrency to the invoice address, we send the first callback with the `transaction_created` event. It means that the payment has just been identified, but it has not been validated by the network yet. When the transaction is completely verified and confirmed by the network, we send another callback with the `transacion_confirmed` event, and the invoice automatically changes its status from `new` to `completed`.

The invoice is only valid for a limited time (10 minutes max). This is due to the fact that for each invoice Cryptopay freezes the exchange rate for 10 minutes.

In some cases, customers make payments after the invoice has expired. In this case, the invoice status will be updated to `unresolved` with the `paid_late` context.

There are also cases where customers may overpay or underpay the invoices. When this happens, the invoice changes its status to `unresolved` with an `overpaid` or `underpaid` context. In any of the above user scenarios, the `unresolved` payment status can be updated to `completed` or `refunded` manually, or Cryptopay will automatically update the status as soon as the payment is validated by the network if the appropriate settings have been selected on the Integration page > API > [How to handle unresolved invoices](https://developers.cryptopay.me/guides/invoices/how-to-handle-unresolved-invoices) in your account.&#x20;


---

# 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.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.
