# Transaction Webhook

### Status of Transaction

|     Status     | Description                                       |
| :------------: | ------------------------------------------------- |
|     `DONE`     | Successfully deposited and executed.              |
|   `REJECTED`   | Successfully deposited but no execution occurred. |
| `AML_DECLINED` | Transaction has been declined due to AML reasons. |
|    `FAILED`    | Transaction has been failed on the blockchain.    |

### Webhook Payload Examples

<details>

<summary>DONE</summary>

```json
{
  "quantity": 0.05,
  "sourceAddress": "0xEE506212EE33ac1ac66D56e9Ea5D5866e8C7168e",
  "txId": "1ce309d1-e80a-47bb-a18f-affd3a87e1ba",
  "symbol": "ETH",
  "txHash": "0x954f6d87aac739cfd54804dd0b4efcd1ea7834a42e9dc3629b03ac10867933ee",
  "txTime": 1707843915401,
  "username": "helloWorld",
  "address": "0x8dCb581B1B7a7426EF5f3Bf6A7b2177BD00342F8",
  "transactionType": "DEPOSIT",
  "adminApproval": "DONE"
}
```

</details>

<details>

<summary>REJECTED</summary>

```json
{
  "quantity": 0.00009989,
  "sourceAddress": "tb1qwmxjsq283elnzsd306c6h3z08fucyhl565a4s2",
  "subaccount": "deedddff",
  "txId": "e09fef5d-6ab4-4da1-bed6-5a7d6416162d",
  "symbol": "BTC",
  "txHash": "7f9e94c800079ed7ff71da6d02e16885e9ae39cb8c79473649fb00254f20fe1b",
  "txTime": 1649259696838,
  "address": "mtTu1NHfgbWQH2u4iXCfSYnohbQw1w1AJj",
  "tradeSide": "buy"
  "transactionType": "DEPOSIT",
  "username": "helloWorld",
  "adminApproval": "REJECTED"
}
```

</details>

<details>

<summary>AML_DECLINED</summary>

```json
{
  "address": "mzczAqqqNqtozbaT7oJEzYML814Wg7d999",
  "adminApproval": "AML_DECLINED",
  "confirmation": 0,
  "quantity": 0.00002159,
  "sourceAddress": "tb1qx3r63vymgvp0ln5na022zzh7cv6xu3rs94g6ca",
  "subaccount": "deedddff",
  "symbol": "BTC",
  "tradeSide": "buy"
  "transactionType": "DEPOSIT",
  "txHash": "14a8cbac6973374573326ab97891c9fe13eec03143e538e1a3e92987140ab04a",
  "txId": "3e06c4eb-b134-4a93-a78f-a979e1d3a803",
  "username": "helloWorld"
}
```

</details>

<details>

<summary>FAILED</summary>

```json
{
  "quantity": 1,
  "sourceAddress": "0xc08377dF1eF026aeb12dcc57D254173CB6b0A1aA",
  "txId": "dba8b6ba-cd8f-4c75-94e6-6b443dc12bd7",
  "symbol": "ETH",
  "txHash": "0xf62f9fe6c90e85792fef676ddaa711916d9abb6b6b600e3c5b1d4bdcb1a38ec1",
  "username": "deposit_test_user_wmukdf",
  "address": "0xD569F39543D05c3b4d20A23ab37a9FE4882D6a17",
  "transactionType": "DEPOSIT",
  "adminApproval": "FAILED"
}
```

</details>

### Callback Parameter Values

<table><thead><tr><th width="232.4" align="center">Parameter</th><th width="169.7779479326187" align="center">Type</th><th>                  Description</th></tr></thead><tbody><tr><td align="center"><code>sourceAddress</code></td><td align="center">String</td><td>Source address of the transaction</td></tr><tr><td align="center"><code>address</code></td><td align="center">String</td><td>Destination address of deposit</td></tr><tr><td align="center"><code>adminApproval</code></td><td align="center">String</td><td><p><code>'DONE'</code> , <code>'REJECTED'</code> , <code>'AML_DECLINED'</code> or <code>'FAILED'</code></p><p>Status of transaction, see <a href="#status-of-transaction">table</a> for more information.</p></td></tr><tr><td align="center"><code>quantity</code></td><td align="center">Number</td><td>Size of transaction in specified symbol</td></tr><tr><td align="center"><code>subaccount</code></td><td align="center">String</td><td>Payment service provider's user who initiates the deposit request</td></tr><tr><td align="center"><code>symbol</code></td><td align="center">String</td><td>e.g., <code>BTC</code><br>Crypto symbol</td></tr><tr><td align="center"><code>transactionType</code></td><td align="center">String</td><td><code>DEPOSIT</code> | <code>WITHDRAW</code><br>Type of transaction</td></tr><tr><td align="center"><code>txHash</code></td><td align="center">String</td><td>Blockchain transaction Hash</td></tr><tr><td align="center"><code>txId</code></td><td align="center">String</td><td>UUID, unique to the transaction record</td></tr><tr><td align="center"><code>txTime</code></td><td align="center">Number</td><td>Time of transaction confirmation in blockchain in epoch milliseconds</td></tr><tr><td align="center"><code>username</code></td><td align="center">String</td><td>Your username</td></tr><tr><td align="center"><code>fiatReceived</code></td><td align="center">Number, optional</td><td>Amount traded to fiat</td></tr><tr><td align="center"><code>currencyTag</code></td><td align="center">String, optional</td><td>Additional address property (Tag/Memo) that allows identifying the transfer beneficiary or destination for a transaction</td></tr></tbody></table>
