curl --request POST \
--url https://sandbox-b2b.ripio.com/api/v1/withdrawals/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"end_user": "customer_10",
"currency": "BTC",
"address": "0x36f672385c060290f4785F1ECFF58aE4aBB2FD15",
"network": "BITCOIN_TESTNET",
"amount": 1.5,
"external_ref": "ac243840-ac04-4b3a-9efb-176554d4a029",
"withdrawal_fee": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"update_date": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"confirmation_date": null,
"txn_hash": null,
"end_user_id": "customer_10",
"currency": "ETH",
"amount": "0.002",
"address": "0x36f672385c060290f4785F1ECFF58aE4aBB2FD15",
"network_name": "BITCOIN",
"status": "PENDING",
"transaction_id": "8df65b81-8227-4d03-950d-0d8d5fef9402",
"provisory_txn_hash": null,
"risk_score": null,
"is_blocked": false,
"reason": "",
"external_ref": "8df65b81-8227-4d03-950d-0d8d5fef9402",
"memo": null,
"debited_amount": "0.0025"
}Create Withdrawal
This endpoint allows the creation of a withdrawal. It will debit from the end user’s currency’s balance and credit the amount in the destination address.
curl --request POST \
--url https://sandbox-b2b.ripio.com/api/v1/withdrawals/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"end_user": "customer_10",
"currency": "BTC",
"address": "0x36f672385c060290f4785F1ECFF58aE4aBB2FD15",
"network": "BITCOIN_TESTNET",
"amount": 1.5,
"external_ref": "ac243840-ac04-4b3a-9efb-176554d4a029",
"withdrawal_fee": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"update_date": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"confirmation_date": null,
"txn_hash": null,
"end_user_id": "customer_10",
"currency": "ETH",
"amount": "0.002",
"address": "0x36f672385c060290f4785F1ECFF58aE4aBB2FD15",
"network_name": "BITCOIN",
"status": "PENDING",
"transaction_id": "8df65b81-8227-4d03-950d-0d8d5fef9402",
"provisory_txn_hash": null,
"risk_score": null,
"is_blocked": false,
"reason": "",
"external_ref": "8df65b81-8227-4d03-950d-0d8d5fef9402",
"memo": null,
"debited_amount": "0.0025"
}Authorizations
B2B’s White Label API uses OAuth2. Currently there is only one supported authentication flow:
- clientCredentials allows you to access your own B2B account (First-Party Integration) and performs transactions against the public API. This oauth2 flow is well suited for this API, as it allows machine-to-machine communication.
Every call to the API has to be authenticated with an OAuth2 Token. In order to request this token, you will need to have sandbox or production API Keys (client id and client secret) that will be needed to generate a credential in order to negotiate an ephemeral access token.
Every request must be accompianed by an Authorization header with a value that follows the following schema: Bearer ACCESS_TOKEN
Body
Destination tag or memo to send along with the withdrawal. Optional in general, but mandatory on the networks that use one: RIPPLE, STELLAR, TERRA2, TON and their testnets. On those networks the destination is often a shared address and the memo is the only thing identifying the recipient, so a withdrawal without it is rejected with error 20088. Sending a memo to any other network is rejected with error 20089. Up to 64 characters.
64Response
Created
Specifies the withdrawal status. Possible values: COMPLETED (successfully completed), PENDING (being processed), ERROR (failed due to external error), CANCELLED (cancelled due to internal reason), BLOCKED_LIMIT_EXCEEDED (blocked due to exceeding withdrawal limits).
COMPLETED, PENDING, ERROR, CANCELLED, BLOCKED_LIMIT_EXCEEDED Was this page helpful?