# 存款回調

要接收回調，請確保您在 AkashicPay.com 上註冊了您的 URL。有三個選項，一個是待定[存款](/traditional-chinese/jian-jie/shu-yu.md)，一個是已確認存款，還有一個是存款失敗。

* 等待存款： 一旦（第一層）交易在 [L1](/traditional-chinese/jian-jie/shu-yu.md#di-yi-ceng-layer1) 和 [L2](/traditional-chinese/jian-jie/shu-yu.md#di-er-ceng-layer2) 上註冊，但尚未在 L1 網路上確認之前（即節點尚未驗證或尚未在上面建立/挖掘足夠的區塊之前），即接收回調。
* 存款： 當交易在第一層[網路](/traditional-chinese/jian-jie/shu-yu.md#wang-lu)上被確認（透過足夠的區塊/節點）時接收回調。未能確認的交易也會包含在此。至於 L2 交易，由於它們幾乎是即時的，因此也會包含在此。
* 存款失敗： 如果交易未能在第一層完成，即使可能已經註冊/廣播，也會收到回調。在這種情況下，不應將資金存入。

我們建議始終設置存款 URL。如果您想要更多控制權並更早收到資訊，也可以設定待定存款的 URL - 但請注意，顯示為待定的存款並非最終存款，仍可能會失敗（雖然很少發生）。(它們可能是相同的 URL！）

注意：如果回調的回應狀態代碼 (status code) >= 400，則回調最多會重試 10 次，且延遲時間會增加，自第一次嘗試起最多可延遲約 15 分鐘。

**如果您正在管理您系統中的用戶餘額，請注意回調中的金額不包括向您收取的** [**AkashicPay 費用**](/traditional-chinese/jian-jie/shu-yu.md#fei-yong-kuang-gong-fei)**。如果您想將實際可用的資金存入用戶的帳戶，您應該從金額中減去 `internalFee.deposit`。**

> 注意：在重新嘗試呼叫回調時，系統僅會將請求發送至原始回調建立時所設定的回調網址。任何在首次嘗試後新增的回調網址，或對現有回調網址所做的變更，均不會在重新嘗試過程中被採用。

> **注意:** `l2Txnhash` (「L2-hash」)應該始終用作交易的唯一識別碼。這是 [AkashicChain](/traditional-chinese/jian-jie/shu-yu.md#akashicchain) 上任何交易的唯一交易哈希 (transaction-hash)。它存在於已確認的存款和待定/已確認的付款中。這對於[第二層](/traditional-chinese/jian-jie/shu-yu.md#di-er-ceng-layer2)交易尤其重要，因為第二層交易沒有第一層哈希值 (`txHash`)

> **注意：**`internalFee` 是指在 AkashicChain 上交易的 [L2 相關費用](https://docs.akashicscan.com/traditional-chinese#di-er-ceng-l2-fei-yong)。此類費用始終與交易本身採用相同貨幣計價。

> **注意：**&#x5C0D;於價值小於 1 USD 等值的代幣的第 1 層存款，不會發送存款回調。

> 注意：雖然我們的目標是在 Akashic 的穩定性和一致性，我們不能保證下面的對象保持不變。舉例來說，新的功能可能需要在回調中加入額外的欄位。然而，我們的目標是不移除現有的欄位。為了方便起見，我們建議根據您的需求來過濾和處理回調，同時對未來新增欄位的可能性持開放態度。

## <mark style="color:blue;">範例</mark>

### <mark style="color:blue;">等待存款 (L1Transaction)</mark>

請注意沒有 `l2TxnHash`

```json
{
  "initiatedAt": "2024-08-19T10:02:54.000Z", // ISO8601 format
  "fromAddress": "TTVkK6hGoAFhALG9NTkUDHjcFFXKmWcScU",
  "toAddress": "TQH8ygbS8BAnzSQ9uxR9vXHJYMQVRvbgPg",
  "coinSymbol": "TRX-SHASTA", // NetworkSymbol
  "status": "Pending", // TransactionStatus. Always "Pending" here of course
  "type": "Deposit", // TransactionType. Always "Deposit" here
  "layer": "L1Transaction", // TransactionLayer. Always L1 for pending
  "amount": "10.000000", 
  "txHash": "28a9880ad2ef3b7be1c40763128ec9630ab74e4749a3c81037c3501e4209bfcc", // L1 txHash
  "receiverInfo": {
    "identity": "AS188689e48494c8a452683587138f209d673aada204cb23393140e7f40280e0c5", // Identity/L2-address/Akashic address of receiver
  },
  "receiverIdentity": "AS18...", // DEPRECATED. Same as above. Please use receiverInfo.identity 
  "tokenSymbol": "USDT", // Only here if a token-transaction,
  "identifier": "user123",
  // The below only if matching a requested amount
  "depositRequest": {
    "exchangeRate": "7.182",
    "requestedValue": {
      "amount": "1000",
      "currency": "USD"
    }
  }
}

```

### <mark style="color:blue;">存款 (L1Transaction)</mark>

請參閱上文的 「待定」。指出的差異

請注意，由於費用的關係，您所控制的實際資金為 `10.0 - 0.1 = 9.9`

```json
{
  "initiatedAt": "2024-08-19T10:03:58.649Z",
  "confirmedAt": "2024-08-19T10:05:02.529Z", // Time transaction was safely confirmed
  "fromAddress": "TTVkK6hGoAFhALG9NTkUDHjcFFXKmWcScU",
  "toAddress": "TQH8ygbS8BAnzSQ9uxR9vXHJYMQVRvbgPg",
  "coinSymbol": "TRX-SHASTA",
  "status": "Confirmed", // "Confirmed" or "Failed"
  "type": "Deposit",
  "layer": "L1Transaction", // Could be "L2Transaction" here
  "amount": "10.000000",
  "internalFee": {
    "deposit": "0.100000" // Akashic-fee, not present if Failed
  },
  "txHash": "28a9880ad2ef3b7be1c40763128ec9630ab74e4749a3c81037c3501e4209bfcc",
  "l2TxnHash": "ASe7eb1cb8193787040fcffa02a224a6ced7415ff2205343c0ab661e898e8d6eef", // AkashicChain txHash, only set after confirmation. Not present if Failed
 "receiverInfo": {
    "identity": "AS188689e48494c8a452683587138f209d673aada204cb23393140e7f40280e0c5", // Identity/L2-address/Akashic address of receiver
  },
  "receiverIdentity": "AS18...", // DEPRECATED. Same as above. Please use receiverInfo.identity 
  "tokenSymbol": "USDT", // Only here if a token-transaction,
  "identifier": "user123",
  // The below only if matching a requested amount
  "depositRequest": {
    "exchangeRate": "7.182",
    "requestedValue": {
      "amount": "1000",
      "currency": "USD"
    }
  }
}
```

### <mark style="color:blue;">存款 (L2Transaction)</mark>

如果使用者從 [AkashicLink](/traditional-chinese/jian-jie/shu-yu.md#akashiclink) 傳送資產，將會在 [AkashicChain](/traditional-chinese/jian-jie/shu-yu.md#akashicchain) 執行，這是我們的第二層區塊鏈，以減少第一 層的礦工費和成本。

```json
{
  "initiatedAt": "2024-08-19T10:03:58.649Z",
  "confirmedAt": "2024-08-19T10:03:58.649Z",
  "fromAddress": "AS3ce733d2af1ee530e0e85bd7de45c59626b28f95ac2d8e83a0685a70aac9b764", // Same as senderIdentity
  "toAddress": "AS188689e48494c8a452683587138f209d673aada204cb23393140e7f40280e0c5", // Same as receiverIdentity
  "coinSymbol": "TRX-SHASTA",
  "status": "Confirmed", // "Confirmed" or "Failed"
  "layer": "L2Transaction", // Could be "L2Transaction" here
  "amount": "10.000000",
  "internalFee": {
    "deposit": "0.100000" // Akashic-fee, not present if Failed
  },
  "l2TxnHash": "ASe7eb1cb8193787040fcffa02a224a6ced7415ff2205343c0ab661e898e8d6eef", // AkashicChain txHash
  "receiverInfo": {
    "identity": "AS188689e48494c8a452683587138f209d673aada204cb23393140e7f40280e0c5", // Identity/L2-address/Akashic address of receiver
  },
  "receiverIdentity": "AS18...", // DEPRECATED. Same as above. Please use receiverInfo.identity 
  "tokenSymbol": "USDT", // Only here if a token-transaction,
  "identifier": "user123",
 "senderInfo": {
    "identity": "AS3ce733d2af1ee530e0e85bd7de45c59626b28f95ac2d8e83a0685a70aac9b764", // Akashic Address of sender
  },
  "senderIdentity": "AS3c...", // DEPRECATED. Same as above. Please use senderInfo.identity instead
  // The below only if matching a requested amount
  "depositRequest": {
    "exchangeRate": "7.182",
    "requestedValue": {
      "amount": "1000",
      "currency": "USD"
    }
  }
}
```


---

# 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.akashicpay.com/traditional-chinese/hui-diao/cun-kuan-hui-diao-deposit-callback.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.
