Callbacks
Crypto2B provides the ability to generate notifications for the client's system with information about operations (for example, deposits, withdrawals, service operations). Callbacks are used for this purpose.
Configuration
If the client wants to use the callback mechanism to track the processing status of operations, it is necessary to configure the callback URL in the personal account.
Then, during the processing of crypto payments, Crypto2B will send notifications in JSON format to this URL with all the necessary information about the transaction.
Callback Content
Crypto2B callbacks contain all important information about the transaction:
- operation type
- processing status
- currency
- address
- amount
- blockchain transaction hash
- number of confirmations
- fee
and so on
Callback Examples
Deposit
{
"data": {
"type": "Deposit",
"id": 123456,
"status": "Success",
"date": "2024-01-15T10:30:00Z",
"clientDepositId": "client-deposit-001",
"error": null,
"instrument": {
"currencyShortName": "USDT",
"transportProtocol": "trc20"
},
"address": {
"address": "TExampleDepositAddress1234567890abc",
"tag": null,
"foreignId": "user-12345",
"senderAddress": "TExampleSenderAddress0987654321xyz"
},
"transaction": {
"approach": "FullProcessing",
"hash": "abc123def456abc123def456abc123def456abc123def456abc123def456abcd",
"amount": 1000.50,
"confirmations": 21,
"amlRiskGrade": "Low"
},
"fees": [
{
"type": "Commercial",
"currencyShortName": "USDT",
"transportProtocol": "trc20",
"amount": 5.00
}
]
}
}
Withdrawal
{
"data": {
"type": "Withdrawal",
"id": 789012,
"status": "Success",
"date": "2024-01-15T14:45:00Z",
"paymentOrderId": "withdrawal-order-001",
"foreignId": "user-withdrawal-789",
"error": null,
"instrument": {
"currencyShortName": "BTC",
"transportProtocol": "btc"
},
"address": {
"address": "bc1qexamplewithdrawaladdress000000000000000",
"tag": null
},
"transaction": {
"approach": "FullProcessing",
"hash": "00000000000000000000abcdef1234567890abcdef1234567890abcdef123456",
"amount": 0.05,
"confirmations": 6,
"amlRiskGrade": null
},
"fees": [
{
"type": "Commercial",
"currencyShortName": "BTC",
"transportProtocol": "btc",
"amount": 0.0001
},
{
"type": "Technical",
"currencyShortName": "BTC",
"transportProtocol": "btc",
"amount": 0.00005
}
]
}
}
Service Operation
{
"data": {
"type": "Service",
"id": 345678,
"soType": "Collection",
"status": "Success",
"date": "2024-01-15T16:00:00Z",
"error": null,
"instrument": {
"currencyShortName": "ETH",
"transportProtocol": "erc20"
},
"sender": "0x0000000000000000000000000000000000000001",
"recipient": "0x0000000000000000000000000000000000000002",
"transaction": {
"hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"amount": 2.5,
"confirmations": 35
},
"technicalFee": {
"currencyShortName": "ETH",
"transportProtocol": "erc20",
"amount": 0.002
}
}
}
Field Descriptions
| Field | Description |
|---|---|
type | Operation type: Deposit, Withdrawal, Service |
id | Unique operation identifier in the system |
status | Operation processing status |
date | Operation date and time (ISO 8601) |
instrument | Currency and protocol information |
address | Transaction address and additional parameters |
transaction | Blockchain transaction details |
fees | Array of fees (commercial, technical) |
error | Error message (if any) |
Deposit-specific fields
| Field | Description |
|---|---|
clientDepositId | Deposit ID in the client's system |
address.foreignId | External user identifier |
address.senderAddress | Sender's address |
Withdrawal-specific fields
| Field | Description |
|---|---|
paymentOrderId | Payment order ID |
foreignId | External operation identifier |
Service operation-specific fields
| Field | Description |
|---|---|
soType | Service operation type (e.g., Collection) |
sender | Sender's address |
recipient | Recipient's address |
technicalFee | Technical fee for the operation |
Important Note
Please note that due to implementation specifics, the same callback may sometimes be sent multiple times. Always track transaction identifiers to avoid double spending and similar issues.