In case of success, the response body contains a newly created deposit object.
Response codes
Deposit callback
A callback is a notification sent to a user’s callback URL when a new deposit-related transaction occurs in the blockchain. You can use the callback to make changes in your system and notify your payers.
Default callback
By default, the callback is sent after the transaction is confirmed. To get confirmed, a transaction should receive a necessary number of and pass the verification. The required number of confirmations is determined by the confirmation_blocks field in the Currency object. For example, the confirmation_blocks field is set to 3. This means that the callback will be sent after receiving three confirmations and passing the AML check.
Additional callback
It’s possible to trigger an additional callback. To do this, specify a new number in the confirmations_needed field when calling the Create deposit method. For example, the confirmation_blocks value is set to 3 and the confirmations_needed value is set to 1. In this case, two callbacks will be sent: one (additional) after a transaction receives one confirmation and another one (default) after a transaction receives three confirmations.
Callback processing
Upon receiving a required number of confirmations related to a new deposit transaction, the callback is sent to your server if the deposit request body includes a valid callback URL. The callback is sent by a POST-request, which contains useful JSON payload.
To verify that the callback was sent by B2BINPAY, generate an HMAC-signature using sha256 as algorithm: sha256 hash of the concatenation of your login and password as a key, and the concatenation of the transfer.status, transfer.amount, deposit.tracking_id, meta.time fields as message. Refer to the example below for a callback verification example.
After processing the payload, you should send back the HTTP 200 response code without a body. If your server is temporarily unavailable or the status of the response is different from 200, the system will resend the callback several times with the increasing delay time. The number of re-sendings is limited. If the manual resending is required, you can do it on the Wallet management > Events page in the Web UI.
included — the transaction received for this deposit. Contains the Currency object and Transfer object (optional). There may be no Transfer object, if only the deposit status has changed. Keep in mind that transfer confirmation and deposit status changes are separate events that trigger two different callbacks.
meta — the metadata used for callback authentication. Contains the following fields:
time (string) — the date and time when the callback was sent.
sign (string) — the HMAC signature for a callback authentication. Refer to the Callback processing section for a callback verification example.
In case of success, the response body contains an array of available methods along with a list of field parameters such as labels, min and max values, regular expressions used for validation, and so on.