➕Create a withdrawal
Creates a new withdrawal request.
This method requires authorization We're using different API keys for authorizing Invoicing & withdrawal requests.
Make sure you use correct one.
POST https://api.silus.io/v1/withdrawals
Request body
amount
string
numeric required_without:fiat_amount
Amount to be paid in crypto currency.
If there are pennies in the amount, then send them with a separator '.'
Example: 10.28 You can omit this parameter and send fiat amount using parameters below
fiat_currency
string required_with:fiat_amount
Fiat currency ISO 4217 code. List of supported fiat currencies
fiat_amount
string numeric required_without:amount
Amount to be paid in fiat currency.
If there are pennies in the amount, then send them with a separator '.'
Example: 10.28 You can omit this parameter and send crypto amount using amount parameter. When provided, we will automatically convert it to the target crypto currency based on our exchange rates.
order_id*
string min: 1 max: 255 alpha_dash
Order identifier from your system.
We will send this ID in every webhook request. ⚠️ The order_id must be unique within the merchant withdrawals. When we find an existing withdrawal request with order_id, we return its details, a new withdrawal request will not be created.
address*
string
The address of the wallet to which the withdrawal will be made
is_subtract*
boolean
Defines where the withdrawal fee will be deducted
true - from your balance
false - from payout amount, the payout amount will be decreased
additional_data
nullable array|object max: 255 KB
You can send any additional data with this request, it will be returned to you with the webhook.
user_id field is reserved and value from this field will be displayed in the backoffice.
sign*
string
Request signature. Generation example is provided below
* - mandatory parameter
Request example
curl https://api.silus.io/v1/withdrawals
\-X POST
\-H 'Authorization: Bearer superSecretPrivateKey'
\-H 'Content-Type: application/json'
\-d '{
"amount": "0.05",
"order_id": "1",
"network": "BTC",
"currency": "BTC",
"address": "bc1qa7pumxw8rf7srg74adtks0ramsfv6c3vjvefrm",
"is_subtract": false,
"sign": "1fb726bed664e5115840b6af666f8bdc6ef87cc214ca112b052452019de8d442"
}'Response
Successful response
{
"id": "9c3288f5-3aef-464d-a3fd-57c170163eab",
"network": "BTC",
"currency": "BTC",
"address": "bc1qa7pumxw8rf7srg74adtks0ramsfv6c3vjvefrm",
"amount": 0.05,
"status": "pending",
"order_id": "1",
"additional_data": null,
"created_at": 1717434398,
"updated_at": 1717434398
}id*
Withdrawal id. Can be used to check it's status
amount*
Withdrawal amount in crypto currency
currency*
network*
address*
Crypto wallet address where coins should be sent to
status*
additional_data*
Any data provided during Withdrawal creation request. It will be null if you didn't specify it during invoice creation request.
created_at*
Unix time for withdrawal creation date
update_at*
Unix time for withdrawal last update date
* - mandatory parameter
Possible errors
Sign generation
Each request should be signed with a signature. The concept of signature generation is similar to the one used for verifying webhooks. To ensure that the signature in the request is valid, you must encode the entire webhook payload to JSON (except for the "sign" value). The entire result should be converted to SHA256 using HMAC with a secret key (the one you use to authenticate requests to the Silus Invoice API).
There is a difference when encoding data in PHP compared to other languages. PHP escapes slashes, unlike some other languages. Therefore, you may encounter sign a mismatch.
You have to escape slashes with a backslash to make it work properly.
Example on PHP
<?php
// Pay attention! We're using Invoice API key here, not Withdrawals one.
$secretKey = 'uZfQ0GYNurpCjU5iaB9JSOSrBsNTSPGZAnhNRkMO1MNsq2Qep70cyOiLD5jVDiky';
$payload = [
'amount' => '0.05',
'order_id' => '1',
'network' => 'BTC',
'currency' => 'BTC',
'address' => 'bc1qa7pumxw8rf7srg74adtks0ramsfv6c3vjvefrm',
'is_subtract' => false,
];
$signData = json_encode($payload, JSON_UNESCAPED_UNICODE);
$payload['sign'] = hash_hmac('sha256', $signData, $secretKey);
print_r($payload); // expected body object for request.Last updated