> For the complete documentation index, see [llms.txt](https://developers.cryptopay.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.cryptopay.me/guides/invoices/callbacks.md).

# Invoice callbacks

{% hint style="danger" %}
Handling callbacks correctly is crucial to ensure your integration’s business logic works as expected. It is highly recommended to validate payment statuses and callbacks before acting on it inside your system.
{% endhint %}

Refer to [this section](/guides/api-basics/callbacks.md) to get more information on what callbacks are and how to validate them before acting on it inside your system.

<table><thead><tr><th width="206">Event</th><th>status</th><th>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 broadcast the transaction on the bitcoin network</td></tr><tr><td><code>transaction_confirmed</code></td><td><code>new</code></td><td><code>null</code></td><td>The transaction has just been confirmed on the network</td></tr><tr><td><code>status_changed</code></td><td><code>completed</code></td><td><code>null</code></td><td>The invoice status has been changed</td></tr><tr><td></td><td><code>unresolved</code></td><td><code>illicit_resource</code></td><td></td></tr><tr><td></td><td><code>unresolved</code></td><td><code>overpaid</code></td><td></td></tr><tr><td></td><td><code>unresolved</code></td><td><code>underpaid</code></td><td></td></tr><tr><td></td><td><code>unresolved</code></td><td><code>paid_late</code></td><td></td></tr><tr><td></td><td><code>refunded</code></td><td><code>null</code></td><td></td></tr><tr><td></td><td><code>cancelled</code></td><td><code>null</code></td><td></td></tr></tbody></table>

{% tabs %}
{% tab title="Transaction created" %}

```javascript
{
    "data": {
        "id": "1bbc11e1-1f91-11c1-11ec-cea1ad12345e",
        "fee": "2.55",
        "uri": "TSKh8uZnkt12345teYPNNNdRbspqW12345",
        "name": null,
        "status": "new",
        "address": "TSKh8uZnkt12345teYPNNNdRbspqW12345",
        "network": "tron",
        "exchange": {
            "fee": "0.0",
            "pair": "USDTUSD",
            "rate": "0.9982",
            "fee_currency": "USD"
        },
        "metadata": null,
        "custom_id": "123412345",
        "created_at": "2025-08-01T10:16:55+00:00",
        "expires_at": "2025-08-01T10:26:55+00:00",
        "pay_amount": "300.55",
        "customer_id": null,
        "description": null,
        "paid_amount": "301.0",
        "fee_currency": "USD",
        "pay_currency": "USDT",
        "price_amount": "300.0",
        "transactions": [
            {
                "risk": null,
                "txid": "cc5806d7498aa123451b1ea16709a8de12345232af08c9df104d626271212345",
                "source_addresses": [
                    "TK4ykR48c12345cZ5N12345sBaHcg12345"
                ]
            }
        ],
        "price_currency": "USD",
        "status_context": null,
        "hosted_page_url": "https://business-hosted.cryptopay.me/invoices/1bbc11e1-1f91-11c1-11ec-cea1ad12345e",
        "subscription_id": null,
        "success_redirect_url": null,
        "unsuccess_redirect_url": null
    },
    "type": "Invoice",
    "event": "transaction_created"
}
```

{% endtab %}

{% tab title="Transaction confirmed" %}

```javascript
{
    "data": {
        "id": "caa1fe11-b11f-12f1-1cde-bb11da012345",
        "fee": "7.84",
        "uri": "TWUQTqrfus1tra12345FkLBgiVYd112345",
        "name": null,
        "status": "new",
        "address": "TWUQTqrfus112345btqFkLBgiVYd112345",
        "network": "tron",
        "exchange": {
            "fee": "0.0",
            "pair": "USDTUSD",
            "rate": "0.9987",
            "fee_currency": "USD"
        },
        "metadata": null,
        "custom_id": "123456",
        "created_at": "2025-08-01T10:09:33+00:00",
        "expires_at": "2025-08-01T10:19:33+00:00",
        "pay_amount": "785.03",
        "customer_id": null,
        "description": null,
        "paid_amount": "785.03",
        "fee_currency": "USD",
        "pay_currency": "USDT",
        "price_amount": "784.0",
        "transactions": [
            {
                "risk": null,
                "txid": "ffb111c111fe964387a111112345ac12345ce0b23bcb1dde5aee1b1bc11111c11",
                "source_addresses": [
                    "TAzsQ9Gx8eq12345beXrbi45CuVPH12345"
                ]
            }
        ],
        "price_currency": "USD",
        "status_context": null,
        "hosted_page_url": "https://business-hosted.cryptopay.me/invoices/caa1fe11-b11f-12f1-1cde-bb11da012345",
        "subscription_id": null,
        "success_redirect_url": "success_redirect_url",
        "unsuccess_redirect_url": "unsuccess_redirect_url"
    },
    "type": "Invoice",
    "event": "transaction_confirmed"
}
```

{% endtab %}

{% tab title="Status change" %}

```javascript
{
    "data": {
        "id": "caa1fe11-b11f-12f1-1cde-bb11da012345",
        "fee": "7.84",
        "uri": "TWUQTqrfus1tra12345FkLBgiVYd112345",
        "name": null,
        "status": "completed",
        "address": "TWUQTqrfus1tra12345FkLBgiVYd112345",
        "network": "tron",
        "exchange": {
            "fee": "0.0",
            "pair": "USDTUSD",
            "rate": "0.9987",
            "fee_currency": "USD"
        },
        "metadata": null,
        "custom_id": "123456",
        "created_at": "2025-08-01T10:09:33+00:00",
        "expires_at": "2025-08-01T10:19:33+00:00",
        "pay_amount": "785.03",
        "customer_id": null,
        "description": null,
        "paid_amount": "785.03",
        "fee_currency": "USD",
        "pay_currency": "USDT",
        "price_amount": "784.0",
        "transactions": [
            {
                "risk": {
                    "level": "low",
                    "score": 0,
                    "resource_name": "Binance.com",
                    "resource_category": null
                },
                "txid": "ffb111c111fe964387a111112345ac12345ce0b23bcb1dde5aee1b1bc11111c11",
                "source_addresses": [
                    "TAzsQ9Gx8eq12345beXrbi45CuVPH12345"
                ]
            }
        ],
        "price_currency": "USD",
        "status_context": null,
        "hosted_page_url": "https://business-hosted.cryptopay.me/invoices/caa1fe11-b11f-12f1-1cde-bb11da012345",
        "subscription_id": null,
        "success_redirect_url": "success_redirect_url",
        "unsuccess_redirect_url": "unsuccess_redirect_url"
    },
    "type": "Invoice",
    "event": "status_changed"
}
```

{% endtab %}

{% tab title="Illicit resource" %}

```javascript
{
    "data": {
        "id": "caa1fe11-b11f-12f1-1cde-bb11da012345",
        "fee": "138.89",
        "uri": "TWUQTqrfus1tra12345FkLBgiVYd112345",
        "name": null,
        "status": "unresolved",
        "address": "TWUQTqrfus1tra12345FkLBgiVYd112345",
        "network": "tron",
        "exchange": {
            "fee": "0.0",
            "pair": "USDTCNY",
            "rate": "7.2294",
            "fee_currency": "CNY"
        },
        "metadata": null,
        "custom_id": "123456",
        "created_at": "2024-12-20T04:13:21+00:00",
        "expires_at": "2024-12-20T04:23:21+00:00",
        "pay_amount": "3842.227571",
        "customer_id": "nb8888",
        "description": "Deposit request",
        "paid_amount": "3842.227571",
        "fee_currency": "CNY",
        "pay_currency": "USDT",
        "price_amount": "27777.0",
        "transactions": [
            {
                "risk": {
                    "level": "high",
                    "score": 0,
                    "resource_name": "Hydra Marketplace",
                    "resource_category": Dark Market - Centralised"
                },
                "txid": "ffb111c111fe964387a111112345ac12345ce0b23bcb1dde5aee1b1bc11111c11"
            }
        ],
        "price_currency": "CNY",
        "status_context": "illicit_resource",
        "hosted_page_url": "https://business-hosted.cryptopay.me/invoices/caa1fe11-b11f-12f1-1cde-bb11da012345",
        "subscription_id": null,
        "success_redirect_url": null,
        "unsuccess_redirect_url": null
    },
    "type": "Invoice",
    "event": "status_changed"
```

{% endtab %}
{% endtabs %}

Navigate to the [Invoice statuses](/guides/invoices/invoice-statuses.md) section to get more information about invoice statuses and exceptions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers.cryptopay.me/guides/invoices/callbacks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
