Skip to main content

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

FieldDescription
typeOperation type: Deposit, Withdrawal, Service
idUnique operation identifier in the system
statusOperation processing status
dateOperation date and time (ISO 8601)
instrumentCurrency and protocol information
addressTransaction address and additional parameters
transactionBlockchain transaction details
feesArray of fees (commercial, technical)
errorError message (if any)

Deposit-specific fields

FieldDescription
clientDepositIdDeposit ID in the client's system
address.foreignIdExternal user identifier
address.senderAddressSender's address

Withdrawal-specific fields

FieldDescription
paymentOrderIdPayment order ID
foreignIdExternal operation identifier

Service operation-specific fields

FieldDescription
soTypeService operation type (e.g., Collection)
senderSender's address
recipientRecipient's address
technicalFeeTechnical fee for the operation

Important Note

Deduplication

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.