Wallet Callbacks

We provide a series of HTTP callbacks that allow you to notify users when funds have been deposited and when they become available. When creating a wallet, you can set a callbackUrl. The following information describes the structure of the callbacks received.

When callbacks are sent

Callbacks are sent whenever a transactional event occurs that will affect the wallet's balance. Examples include:

  • Incoming pending transactions
  • Pending transactions confirmed
  • Outgoing transactions

You may receive two callbacks for a single transaction. This is especially true for transactions on the blockchain. In these cases, you would receive one callback when the transaction is first observed and one callback once the transaction is confirmed.

Callback Acceptance and Retries

Your system should respond to the callback request with a 200 response. We only attempt to send the request once, but we may introduce automatic retries in the future. We can manually resend callbacks upon request.

Payload

The callback payload will be a JSON representation of the transaction that has caused the callback to trigger. An example of such a transaction can be found below:

//Incoming BTC deposit from external BTC wallet.
{
  "createdAt": 1613027293110,
  "id": "TR_7NVXRFRBZJV",
  "source": "bitcoin:EXTERNAL",
  "dest": "wallet:WA_8AFWHMHLYXH",
  "currency": "BTC",
  "amount": 0.01653538,
  "status": "CONFIRMED",
  "confirmedAt": 1613027293110,
  "cancelledAt": null,
  "reversedAt": null,
  "message": null,
  "allowOverdraft": true,
  "authorizer": null,
  "senderProvidedId": null,
  "reversedBy": null,
  "fees": 0,
  "feesDest": null,
  "metadata": {
    "BTCNetworkTxId": "9689d7c675b05f71629696ea9b25c2d61f52406598a4bef759f782c2c35d4f0c"
  },
  "tags": [],
  "destFees": null,
  "sourceFees": null
}
//Incoming ETH deposit from external ETH wallet.
{
  "createdAt": 1614721011262,
  "id": "TR_V8WQDC27BX8",
  "source": "ethereum:0x003bbce1eac59b406dd0e143e856542df3659075",
  "dest": "wallet:WA_3FE7HZHCYBG",
  "currency": "ETH",
  "amount": 6,
  "status": "CONFIRMED",
  "confirmedAt": 1614721011262,
  "cancelledAt": null,
  "reversedAt": null,
  "message": null,
  "allowOverdraft": true,
  "authorizer": null,
  "senderProvidedId": null,
  "reversedBy": null,
  "fees": 0,
  "feesDest": null,
  "metadata": {
    "ETHNetworkTxId": "0x816091d7fd5fe99b6b9f5cefafe01a39e0c4aca6b44e6d8ee32164b6097ea5d6"
  },
  "tags": [],
  "sourceFees": null,
  "destFees": null
}
// Interest payouts require resolving the transfer id.
// GET https://api.testwyre.com/v3/transfers/TF_HTQEQ327NYE
{
  "createdAt": 1617235219704,
  "id": "TR_AE79Q7L6QAT",
  "source": "transfer:TF_HTQEQ327NYE",
  "dest": "wallet:WA_8TJFJ3EQEN9",
  "currency": "BTC",
  "amount": 0.0000106,
  "status": "CONFIRMED",
  "confirmedAt": 1617235219704,
  "cancelledAt": null,
  "reversedAt": null,
  "message": "Deposit for transfer TF_HTQEQ327NYE",
  "allowOverdraft": true,
  "authorizer": "service:Nobody",
  "senderProvidedId": null,
  "reversedBy": null,
  "fees": 0,
  "feesDest": null,
  "metadata": {
    "transferId": "TF_HTQEQ327NYE"
  },
  "tags": [],
  "sourceFees": null,
  "destFees": null
}