Field Name | Description | Required? | |
---|---|---|---|
Create Withdrawal | |||
cmd | create_withdrawal | Yes | |
amount | The amount of the withdrawal in the currency below. | Yes | |
add_tx_fee | If set to 1, add the coin TX fee to the withdrawal amount so the sender pays the TX fee instead of the receiver. | No | |
currency | The cryptocurrency to withdraw. (BTC, LTC, etc.) | Yes | |
currency2 | Optional currency to use to to withdraw 'amount' worth of 'currency2' in 'currency' coin. This is for exchange rate calculation only and will not convert coins or change which currency is withdrawn. For example, to withdraw 1.00 USD worth of BTC you would specify 'currency'='BTC', 'currency2'='USD', and 'amount'='1.00' | No | |
address | The address to send the funds to, either this OR pbntag must be specified. Remember: this must be an address in currency's network. | See Desc | |
pbntag | The $PayByName tag to send the withdrawal to, either this OR address must be specified. This will also override any destination tag specified. | See Desc | |
domain | An Unstoppable Domain to send to. Setting a destination tag along with domain is undefined and should not be attempted. | See Desc | |
dest_tag | The extra tag to use for the withdrawal for coins that need it (Destination Tag for Ripple, Payment ID for Monero, Message for XEM, etc.) | No | |
ipn_url | URL for your IPN callbacks. If not set it will use the IPN URL in your Edit Settings page if you have one set. | No | |
auto_confirm | If set to 1, withdrawal will complete without email confirmation. | No | |
note | This lets you set the note for the withdrawal. | No | |
Create Mass Withdrawal | |||
cmd | create_mass_withdrawal | Yes | |
wd | The withdrawals are passed in an associative array called wd, each having the parameters from 'create_withdrawal' except auto_confirm which is always 1 in mass withdrawals. The key of each withdrawal is used to return the result (same as 'create_withdrawal' again.) The key can contain ONLY a-z, A-Z, and 0-9. Withdrawals with empty keys or containing other characters will be silently ignored. | Yes |
{ "error":"ok", "result":{ "id":"hex string", "status":0, "amount":1.00, // The amount withdrawn } }The result wil have the following fields:
$req = array( 'wd[wd1][amount]' => 1.00, 'wd[wd1][address]' => '1BitcoinAddress', 'wd[wd1][currency]' => 'BTC', 'wd[wd2][amount]' => 0.0001, 'wd[wd2][address]' => '1BitcoinAddress', 'wd[wd2][currency]' => 'BTC', 'wd[wd3][amount]' => 0.0001, 'wd[wd3][address]' => '1BitcoinAddress', 'wd[wd3][currency]' => 'LTC', 'wd[wd4][amount]' => 0.01, 'wd[wd4][address]' => '1BitcoinAddress', 'wd[wd4][currency]' => 'BTC', ); $return = coinpayments_api_call('create_mass_withdrawal', $req); print_r($return);
( [error] => ok [result] => Array ( [wd1] => Array ( [error] => That amount is larger than your balance! ) [wd2] => Array ( [error] => Minimum withdrawal amount is 0.00020000 for this coin! ) [wd3] => Array ( [error] => That is not a valid address for that coin! ) [wd4] => Array ( [error] => ok [id] => 5d2b60b70c2ee37b954c197f6907f7743286693163c388815dd18bb49188aa48 [status] => 1 [amount] => 0.01000000 ) ) )