Payout methods
Payout object
id
string
The unique system identifier of a payout.
This value is generated automatically at the moment of payout creation and can’t be changed.
amount
string
The payout amount, in the payment currency.
address
string
The blockchain address of a receiver’s wallet.
target_deposit
string or null
The identifier of a B2BINPAY deposit, in the UUID4 format. The same as the payment page identifier.
target_wallet
string or null
For payouts to client’s own wallets (such as payouts from Enterprise/Merchant wallets to Swap wallets and back): the identifier of a wallet to which the payout is made.
For other payouts, the value is null
.
tracking_id
string
The identifier assigned to a payout for easier locating related payments in external systems.
This value is set when creating a payout and can be changed anytime.
label
string
The tag or name assigned to a payout for easier locating it in the system.
This value is set when creating a payout and can be changed anytime.
confirmations_needed
number
The number of confirmations needed to trigger an additional callback.
If this field is not null
, two callbacks are sent: upon receiving the number of confirmations specified here and upon receiving the number of confirmations specified in the system settings. The corresponding transaction is assigned the Confirmed status as soon as the number of confirmations specified in this field received.
fee_amount
string
The blockchain fee charged for processing an on-chain transaction, in the payment currency.
is_fee_included
boolean
If true
, the fee is included in the payment amount, the remaining part is credited to the receiver’s account. If false
, the fee is additionally debited from the wallet.
The fee can’t be included in the amount for tokens and the following currencies:
ADA (Cardano)
ARB (Arbitrium)
AVAX (Avalanche)
BNB (BSC)
ETH
ETH-BASE
MATIC (Polygon)
OPT (Optimism)
TRX (Tron)
XLM (Stellar)
XMR (Monero)
XRP (Ripple)
status
number
The current payout status. Possible values:
1
— Waiting for approval — for a payout created by a user with the Withdrawal with approval role: the payout was created and awaits the approval.2
— Approved — the payout was approved.3
— Cancelled — the payout was cancelled.
rate_requested
string or null
If the payment currency differs from the wallet currency, the value is the exchange rate of the payment currency to the wallet currency; otherwise, the value is 1
.
The exchange rates are updated every 30 seconds.
callback_url
string
The URL for callback notifications on new payments.
force_blockchain
boolean
Applicable for payouts from Merchant wallets only.
If the destination address of a payout also belongs to B2BINPAY, such a transaction is off-chain. As a result, it doesn’t have a txid
and can’t be found in block explorers. Set this value to true
, to obtain txid
.
By default, the value is false
.
exp
number
The payment currency precision, that is the number of digits after the decimal separator.
tag_type
string or null
Applicable for payouts in XLM only.
The tag or memo type. Possible values:
0
— no memo1
— a 64-bit unsigned integer
tag
string or null
For payouts in XRP or XLM: the destination tag.
For other payouts, the value is null
.
destination
object or null
The deposit address.
travel_rule_info
object
The information about a payment receiver.
currency
object
The payment currency.
wallet
object
The wallet to which the deposit was made.
The object contains the string id
field matching the wallet system identifier.
Deposit object example
Get payout
Request
GET
[base]/payout/
{id}
id
string
No
The unique system identifier of a payout.
Filtering by object parameters can be applied according to the JSON API Specification.
Request example
Response
In case of success, the response body contains a payout object or an array of objects (if the id
wasn’t specified).
The wallets list is paginated and the default page size is 10. You can adjust pagination according to the JSON API Specification.
Response codes
200
—
The request succeeded.
—
400
5001: You can not view payout
You don’t have permissions to view the payout.
—
401
2007: No active account found with the given credentials
Incorrect credentials.
Send correct credentials.
404
404: Not found
The deposit with the given id
wasn’t found.
Send a correct id
.
500
—
Internal server error.
Try again later.
502
—
Bad gateway.
Try again later.
503
—
Service unavailable.
Try again later.
504
—
Gateway timeout.
Try again later.
5xx
—
Other server errors.
Try again later.
Create payout
Before creating a payout, you can retrieve parameters of the fields you need to fill in by calling the Payout options method.
For security reasons, an additional HTTP header with a unique idempotency key must be sent in the request. The key is a UUID4 string with hyphens, for example: 2dbcb513-bd35-404f-9709-e34878def180
.
Refer to Useful links for recommended programming packages and libraries that you can use to generate UUID4.
Request
POST
[base]/payout/
label
string
No
The tag or name assigned to a payout for easier locating it in the system.
The maximum string length is 32 characters.
amount
string
Yes
The payout amount, in the payment currency.
The maximum string length is 36 characters.
fee_amount
string
No
The blockchain fee to be charged for processing an on-chain transaction, in the payment currency.
The maximum string length is 36 characters.
address
string
No
The payout destination address.
The maximum string length is 128 characters.
tracking_id
string
No
The identifier assigned to a payout for easier locating related payments in external systems.
The maximum string length is 128 characters.
confirmations_needed
number
No
The number of confirmations needed to trigger an additional callback, in the range from 0
to 100
.
callback_url
string
No
The URL for callback notifications on new payments.
The maximum string length is 256 characters.
travel_rule_info
object
Yes
The information about a payment receiver.
currency
object
Yes
The payment currency.
wallet
object
Yes
The wallet from which the payout was made.
The object contains the string id
field containing the wallet system identifier.
Request example
Response
In case of success, the response body contains a newly created payout object.
Response codes
201
—
The request succeeded.
—
400
1007
An invalid value was specified for a field.
Send valid values.
400
3008
The wallet is inactive or is being registered in the system.
Activate the wallet or wait until the process of wallet registration in the system is finished and try again.
400
3021
A wallet activation transfer is required.
Make a transfer to activate the wallet.
400
3022
An invalid wallet type.
Make sure you specify either Enterprise, or Merchant, or Swap wallet.
400
4002
A payout can’t be made from the specified wallet.
Make sure you have the permission to make payouts from the wallet you have specified.
400
4007
The funds are sent to the wallet from which the payout is being made.
The funds can’t be sent to the wallet from which the payout is being made. Such transactions are allowed for the following blockchains: BTC, BCH, BSC, ADA, DASH, DOGE, ETH, LTC, OMNI, TRX, ZCASH.
400
4008
Insufficient funds.
Top up the wallet or decrease the payout amount.
400
4009
The specified blockchain fee is either too high or too low.
400
4010
The blockchain fee can’t be applied to tokens.
Exclude the fee value from the payout body.
400
4011
A payout amount can’t be zero or negative.
Make sure that the payout amount is greater than zero.
400
4012
The specified tracking_id
isn’t unique for the selected wallet.
Specify a unique tracking_id
.
400
4013
The payout amount is less than the Minimal transfer amount.
Specify the payout amount that is greater than or equal to the minimal transfer amount.
400
4016
The blockchain fee can’t be applied to the selected currency.
Set the is_fee_included
value to false.
400
4019
The blockchain fee amount exceeds the amount of the payout with the included fee.
Increase the payout amount or decrease the fee value.
400
6002
The selected currency is disabled.
Select an active currency.
400
6015
The currency is unavailable for all clients or for a specific client.
Select an available currency.
400
6017
A user is trying to make a transaction with a custom token that wasn’t paid for.
Make a payment for a custom token and proceed with the transaction.
400
7001
An incorrect payment address is specified or the address isn’t whitelisted.
Specify a correct payment address and proceed with the payment.
400
—
Invalid data (serializer errors).
Send valid data.
401
2007
No active account with the given credentials is found.
Send correct credentials or update access tokens.
403
3019
Payouts are blocked for the selected wallet.
Contact the account manager or technical support.
409
1004
A request with the specified idempotency key has already been submitted.
Specify another idempotency key for the request.
428
1003
The idempotency key header is not specified.
Specify the idempotency key header in the request header.
429
—
The request was throttled.
Try again later.
500
500
Internal server error.
Try again later.
500
—
A node-related error.
Try again later.
502
—
Bad gateway.
Try again later.
503
4018
Fee calculation or payout creation for the selected currency is temporarily unavailable.
Change the currency or try again later.
503
—
Service unavailable.
Try again later.
504
—
Gateway timeout.
Try again later.
5xx
—
Other server errors.
Try again later.
Travel rule
The travel_rule_info
object contains information about a payment receiver and must be filled in when creating a payout.
The object fields are different for natural and legal persons.
Natural person
The object contains the following key fields:
primaryIdentifier
string
Yes
The family name, maiden name or married name, main name, surname, or, in some cases, the entire name when the natural person’s name can’t be divided into two parts, or when the sender is unable to divide the natural person’s name into two parts.
secondaryIdentifier
string
Yes
The forename, familiar name, given name, initials, prefixes, suffixes, Roman numerals (if legally part of the name), or any other secondary names.
country
string
No
The ISO-3166-1 alpha-2 code or the value XX.
addressLine
string
Yes
Information that locates and identifies a specific address, as defined by postal services, presented in free format text.
addressType
string
Yes
The nature of the address. Possible values:
HOME
— Residential — the address is the home address.BIZZ
— Business — the address is the business address.GEOG
— Geographic — the address is the unspecified physical (geographical) address suitable for identification of the natural or legal person.
Legal person
The object contains the following key fields:
legalPersonName
string
Yes
The name of a legal person.
legalPersonNameIdentifierType
string
Yes
The nature of name being specified for the legal person. Possible values:
LEGL
— Legal name — the official name under which an organization is registered.SHRT
— Short name — the short name of an organization.TRAD
— Trading name — the name used by a business for business purposes, although its registered legal name used for contracts and other formal situations may be different.
country
string
No
The ISO-3166-1 alpha-2 code or the value XX.
addressLine
string
Yes
Information that locates and identifies a specific address, as defined by postal services, presented in free format text.
addressType
string
Yes
The nature of the address. Possible values:
HOME
— Residential — the address is the home address.BIZZ
— Business — the address is the business address.GEOG
— Geographic — the address is the unspecified physical (geographical) address suitable for identification of the natural or legal person.
Precalculate fee
Use this method to precalculate possible blockchain fee options.
For calculations, you need to provide the identifier of a wallet from which the payout is made along with the destination address and payout amount.
Request
POST
[base]/payout/calculate/
amount
string
Yes
The payout amount, in the payment currency.
to_address
string
Yes
The payout destination address.
wallet
object
Yes
The unique system identifier of a wallet from which the payout is made.
currency
object
No
The payout currency.
Request example
Response
In case of success, the response body contains low, medium, and high blockchain fee values.
is_internal
boolean
If true
, the payout is made to the B2BINPAY address.
fee.low
string
The low mode fee amount.
fee.medium
object
The medium mode fee amount.
fee.high
object
The high mode fee amount.
dust_amount
string
The payout-related dust.
warning
number or null
The blockchain-related warning. Possible values:
1
— the large withdrawal fee.2
— the payout may fail due to low finalizing balance or too low change amount.3
— the final balance may be less than minimal fee and can’t be withdrawn. Applicable for the Ethereum blockchain.
fee.currency
number
The blockchain fee currency.
commission.amount
object
The commission amount.
commission.currency
object
The commission currency.
Response body example
Response codes
200
—
The request succeeded.
—
400
1006
Missing field {field_name}.
Add the missing field to the request body.
400
1007
An invalid value was specified for a field.
Send valid values.
400
3008
The wallet is inactive.
Activate the wallet or choose another one.
400
3021
A wallet activation transfer is required.
Make a transfer to activate the wallet.
400
4007
The funds are sent to the wallet from which the payout is being made.
The funds can’t be sent to the same wallet from which the payout is being made.
400
4008
Insufficient funds.
Top up the wallet or decrease the payout amount.
400
6002
The selected currency is disabled.
Select an active currency.
400
7001
An incorrect payment address is specified or the address isn’t whitelisted.
Specify a correct payment address and proceed with the payment.
400
—
Invalid data (serializer errors).
Send valid data.
401
—
No active account with the given credentials is found.
Send correct credentials or update access tokens.
403
403
Permission denied.
Make sure that:
The registration process is completed, the KYC is passed.
The access token is valid.
The correct wallet is specified in the request.
500
500
Internal server error.
Try again later.
502
—
Bad gateway.
Try again later.
503
(old 400
)
4018
Fee calculation or payout creation for the selected currency is temporarily unavailable.
Change the currency or try again later.
503
—
Service unavailable.
Try again later.
504
—
Gateway timeout.
Try again later.
5xx
—
Other server errors.
Try again later.
Payout callback
A callback is a notification sent to a user’s callback URL when a new payout-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 payout 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 transaction, the callback is sent to your server if the payout 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.
Callback structure
The callback consists of three parts:
data
— the deposit itself. Contains the Payout object.included
— the transaction received for this deposit. Contains the Currency object and Transfer object.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.
Callback body example
Payout options
Request
OPT
[base]/payout
No request parameters.
Request example
Response
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.
Response codes
200
The request succeeded.
—
500
Internal server error.
The request wasn’t completed due to an internal error on the server side.
Response body example
Last updated