curl --request POST \
--url https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "ETH",
"network": "ETHEREUM"
}
'import requests
url = "https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/"
payload = {
"currency": "ETH",
"network": "ETHEREUM"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({currency: 'ETH', network: 'ETHEREUM'})
};
fetch('https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'ETH',
'network' => 'ETHEREUM'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/"
payload := strings.NewReader("{\n \"currency\": \"ETH\",\n \"network\": \"ETHEREUM\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"ETH\",\n \"network\": \"ETHEREUM\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"ETH\",\n \"network\": \"ETHEREUM\"\n}"
response = http.request(request)
puts response.read_body{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"gas_price": "0.00001000",
"expires_at": "2022-08-24T14:15:22Z",
"currency": "ETH",
"network_name": "ETHEREUM"
}Create Withdrawal Fee
This endpoint allows the creation of a withdrawal fee. Withdrawal fees are “held fees” offered by Ripio to withdraw assets at a specific fee within a period of time - for example, the option to transfer out 0.25 ETH within the next 15 seconds for 0.001 ETH. The fee does not depend on the withdrawal amount: it is estimated purely from the currency/network pair.
curl --request POST \
--url https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "ETH",
"network": "ETHEREUM"
}
'import requests
url = "https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/"
payload = {
"currency": "ETH",
"network": "ETHEREUM"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({currency: 'ETH', network: 'ETHEREUM'})
};
fetch('https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'ETH',
'network' => 'ETHEREUM'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/"
payload := strings.NewReader("{\n \"currency\": \"ETH\",\n \"network\": \"ETHEREUM\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"ETH\",\n \"network\": \"ETHEREUM\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-b2b.ripio.com/api/v1/withdrawal-fees/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"ETH\",\n \"network\": \"ETHEREUM\"\n}"
response = http.request(request)
puts response.read_body{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"gas_price": "0.00001000",
"expires_at": "2022-08-24T14:15:22Z",
"currency": "ETH",
"network_name": "ETHEREUM"
}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
- Token URL
- https://sandbox-b2b.ripio.com/oauth2/token/
Body
Currency to estimate the fee for. It needs to be the same currency as the one used later for the withdrawal. The fee in the response will be expressed in this currency.
The blockchain network in which the withdrawal fee needs to be estimated, passed as the network's enum member name (e.g. "ETHEREUM", not "ethereum"). The later withdrawal must be performed in the same network.
Response
Created
UUID used as the withdrawal fee identifier.
Estimated network gas price for this fee, expressed in the requested currency. Returned as "0" whenever the account subsidizes gas for this currency/network.
ISO DateTime indicating expiration date of the withdrawal fee. The fee can no longer be used to perform a withdrawal after this date.
Currency the fee was estimated for.
Blockchain network the fee was estimated for.
Was this page helpful?