# Crypto Callbacks

## Crypto Replenishment

{% hint style="info" %}
Notifications for incoming crypto transactions will be simillar for both **Permanent and Rotating addresses.**&#x20;
{% endhint %}

> Notifications will be sent anytime when incoming transactions change their status:
>
> :hourglass:**Pending** – incoming transaction is already in mempool/has at least 1 confirmation.&#x20;
>
> :white\_check\_mark: **Done** – incoming transaction is confirmed and added to your merchant's balance
>
> :white\_check\_mark: **Verified** - transation passed AML verification
>
> :x: **Failed** - incoming transaction was not credited to your merchant's balance.

{% tabs %}
{% tab title="Pending " %}

```
{
  "id": "8c12e071-cd00-439d-90c0-74a8c2f96da2",
  "ticker": "LTT",
  "blockchain": "BINANCE_SMART_CHAIN",
  "merchantId": "b2a46898-7e6d-4c13-8a31-47154c43ee8b",
  "hash": "0x2bdb432c0ccc0edc2b7427e9b5d65a712d2b95cf4d8abd68460fe5beb0181515",
  "from": [
    "0xba85c10f2292aae78754daca380da8557853ac09"
  ],
  "to": "0x2d4221783d2c575ca52ae6c3fb6420a891d1b4fe",
  "amount": "1",
  "fee": "0.01",
  "time": 1674221507732,
  "status": "Pending",
  "meta": "your-user-id-23",
  "kind": "Replenish",
  "internal": false
}
```

{% endtab %}

{% tab title="Done" %}

<pre><code><strong>//With "Done" status IPN, request body will also include "block" field. 
</strong><strong>
</strong><strong>{
</strong>  "id": "8c12e071-cd00-439d-90c0-74a8c2f96da2",
  "ticker": "LTT",
  "blockchain": "BINANCE_SMART_CHAIN",
  "merchantId": "b2a46898-7e6d-4c13-8a31-47154c43ee8b",
  "hash": "0x2bdb432c0ccc0edc2b7427e9b5d65a712d2b95cf4d8abd68460fe5beb0181515",
  "block": 1231231233,
  "from": [
    "0xba85c10f2292aae78754daca380da8557853ac09"
  ],
  "to": "0x2d4221783d2c575ca52ae6c3fb6420a891d1b4fe",
  "amount": "1",
  "fee": "0.01",
  "time": 1674221507732,
  "status": "Done",
  "meta": "your-user-id-23",
  "kind": "Replenish",
  "internal": false
}
</code></pre>

{% endtab %}

{% tab title="Failed" %}

```
//Failed tx's will also display the reason in the "failReason" field 
{
  "id": "8c12e071-cd00-439d-90c0-74a8c2f96da2",
  "ticker": "LTT",
  "blockchain": "BINANCE_SMART_CHAIN",
  "merchantId": "b2a46898-7e6d-4c13-8a31-47154c43ee8b",
  "hash": "0x2bdb432c0ccc0edc2b7427e9b5d65a712d2b95cf4d8abd68460fe5beb0181515",
  "from": [
    "0xba85c10f2292aae78754daca380da8557853ac09"
  ],
  "to": "0x2d4221783d2c575ca52ae6c3fb6420a891d1b4fe",
  "amount": "1",
  "fee": "0.01",
  "time": 1674221507732,
  "status": "Failed",
  "meta": "your-user-id-23",
  "kind": "Replenish",
  "internal": false,
  "failReason": "LESS_THEN_MIN_AMOUNT"
}
```

{% endtab %}

{% tab title="Verified" %}

```
{
    "id": "27f736b1-94oc-4344-b3b1-7adb99006bb0",
    "ticker": "USDT",
    "blockchain": "TRON",
    "merchantId": "g21cce69-4234-4d9e-a4b0-92e257k41ac3",
    "hash": "0725be1026c98397ef25e3bkaa6b0claafe297c4df1497e1e2d6fc6ef98c2e34",
    "from": [
        "TXqGFMiQPTYzfRBSMpryn4pgeeqr9D4JAf"
    ],
    "to": "TXZRUVx7UZRKp5WtEgDkaAMb0WKBMRHhrZ",
    "amount": "100",
    "fee": "1",
    "time": 1692930129826,
    "status": "Verified",
    "meta": "{\"userId\":\"96933484-6c62-423c-b257-f74b40b5c7l5\"}",
    "kind": "Replenish",
    "internal": false,
    "compliance": {
        "url": "https://extrnlapiendpoint.site.com/response/file.pdf", //PDF Report
        "signals": {
            "atm": 0,
            "ico": 0,
            "scam": 0,
            "miner": 0,
            "mixer": 0,
            "other": 0,
            "bridge": 0,
            "ransom": 0,
            "wallet": 0,
            "malware": 0,
            "payment": 0,
            "exchange": 0,
            "gambling": 0,
            "sanctions": 0,
            "fraud_shop": 0,
            "dark_market": 0,
            "marketplace": 0,
            "dark_service": 0,
            "p2p_exchange": 0,
            "stolen_coins": 0,
            "seized_assets": 0,
            "risky_exchange": 1,
            "smart_contract": 0,
            "illegal_service": 0,
            "liquidity_pools": 0,
            "online_pharmacy": 0,
            "unnamed_service": 0,
            "lending_contract": 0,
            "protocol_privacy": 0,
            "special_measures": 0,
            "illicit_actor_org": 0,
            "merchant_services": 0,
            "child_exploitation": 0,
            "enforcement_action": 0,
            "exchange_fraudulent": 0,
            "exchange_mlrisk_low": 0,
            "terrorism_financing": 0,
            "exchange_mlrisk_high": 0,
            "token_smart_contract": 0,
            "high_risk_jurisdiction": 0,
            "nft_platform_collection": 0,
            "p2p_exchange_mlrisk_low": 0,
            "exchange_mlrisk_moderate": 0,
            "exchange_mlrisk_veryhigh": 0,
            "p2p_exchange_mlrisk_high": 0,
            "infrastructure_as_a_service": 0,
            "decentralized_exchange_contract": 0
        },
        "riskScore": 0.54,
        "timestamp": 1692930129826,
        "dangerSignals": {
            "scam": 0,
            "mixer": 0,
            "ransom": 0,
            "malware": 0,
            "gambling": 0,
            "sanctions": 0,
            "fraud_shop": 0,
            "dark_market": 0,
            "dark_service": 0,
            "stolen_coins": 0,
            "illegal_service": 0,
            "online_pharmacy": 0,
            "special_measures": 0,
            "illicit_actor_org": 0,
            "child_exploitation": 0,
            "enforcement_action": 0,
            "exchange_fraudulent": 0,
            "terrorism_financing": 0,
            "high_risk_jurisdiction": 0
        },
        "risky": false
    }
}
```

{% endtab %}
{% endtabs %}

## Crypto Withdrawal

> Withdrawal notifications will be sent when transaction is in one of three statuses:
>
> * :hourglass\_flowing\_sand:**Pending** – transaction is in the mempool, transaction hash was assigned.
> * :white\_check\_mark: **Done** – withdrawal was included to the block, has at least 1 confirmation.
> * **😡 Failed** - transaction has failed, amount was returned to the merchant's balance.

{% tabs %}
{% tab title="PENDING" %}

```json
{
  "id": "e432c6a9-8f9e-4a8b-ad6e-2128cab29013",
  "ticker": "LTT",
  "blockchain": "BINANCE_SMART_CHAIN",
  "merchantId": "b2a46898-7e6d-4c13-8a31-47154c43ee8b",
  "hash": "0x2bdb432c0cccb015376fe6c1f58b8a7723cbf4d8abd68460fe5beb0181515",
  "from": [
    "0xba123123123123123"
  ],
  "to": "0x2d4222342352345632456324564fe",
  "amount": "10",
  "fee": "0.1",
  "time": 1674221507732,
  "status": "Pending",
  "meta": "your-user-id-23",
  "kind": "Withdraw",
  "internal": false
}
```

{% endtab %}

{% tab title="DONE" %}

```json
{
  "id": "e432c6a9-8f9e-4a8b-ad6e-2128cab29013",
  "ticker": "BNB",
  "blockchain": "BINANCE_SMART_CHAIN",
  "merchantId": "b2a46898-7e6d-4c13-8a31-47154c43ee8b",
  "hash": "0x2bdb41111111181515",
  "block" : 2131234123,
  "from": [
    "0xba123123123123123"
  ],
  "to": "0x0001021323123",
  "amount": "10",
  "fee": "0.1",
  "time": 1674221507732,
  "status": "Done",
  "meta": "your-user-id-23",
  "localId": "your-unique-local-identifier",
  "kind": "Withdraw",
  "internal": false
}
```

{% endtab %}

{% tab title="FAILED" %}

```json
{
  "id": "e432c6a9-8f9e-4a8b-ad6e-2128cab29013",
  "ticker": "BNB",
  "blockchain": "BINANCE_SMART_CHAIN",
  "merchantId": "b2a46898-7e6d-4c13-8a31-47154c43ee8b",
  "hash": "0x2bdb41111111181515",
  "block" : 2131234123,
  "from": [
    "0xba123123123123123"
  ],
  "to": "0x0001021323123",
  "amount": "10",
  "fee": "0.1",
  "time": 1674221507732,
  "status": "Done",
  "meta": "your-user-id-23",
  "localId": "your-unique-local-identifier",
  "kind": "Withdraw",
  "internal": false,
  "failReason": "ERRROR_CODE_GENERIC"
}
```

{% endtab %}
{% endtabs %}

## Crypto Invoice

> Webhooks will be sent on transitions to following statuses:
>
> * :hourglass\_flowing\_sand:**Pending** – client entered his email and went to the final payment page.&#x20;
> * :white\_check\_mark: **Done** – invoice was paid&#x20;
> * ⏱ **Expired** – invoice expired. Expiration time for invoice can be calculated by adding 72 hours to `created date`

{% tabs %}
{% tab title="Pending Invoice" %}

```
{
    "id": "eb929d63-5f05-4d9f-9d3e-854384009ef1",
    "ticker": "ETH",
    "blockchain": "ETHEREUM",
    "amount": "0.5"
    "merchantId": "asdasd-asdasd-asdasd-asdad", 
    "paidAmount": "0.6",
    "description": "Order Payment #123123123",  
    "status": "PENDING", 
    "time": 1666091014270, 
    "meta": "i-want-to-know-about-that",
    "kind": "CryptoInvoice"
}
```

{% endtab %}

{% tab title="Overpaid Invoice" %}

<pre><code><strong>{
</strong>    "id": "eb929d63-5f05-4d9f-9d3e-854384009ef1",
    "ticker": "ETH",
    "blockchain": "ETHEREUM",
    "amount": "0.5"
    "merchantId": "asdasd-asdasd-asdasd-asdad", 
    "fee": "0.0025", 
    "paidAmount": "0.6",
    "description": "Order Payment #123123123",  
    "status": "DONE", 
    "time": 1666091014270, 
    "meta": "i-want-to-know-about-that",
    "kind": "CryptoInvoice"
}
</code></pre>

{% endtab %}
{% endtabs %}


---

# 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://docs.0xpay.app/public-api/notifications/crypto-callbacks.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.
