Get custodial bulk-payment inputs
curl --request POST \
--url https://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"coins": [
"USDT",
"USDC"
]
}
'import requests
url = "https://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}"
payload = { "coins": ["USDT", "USDC"] }
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({coins: ['USDT', 'USDC']})
};
fetch('https://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}', 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://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}",
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([
'coins' => [
'USDT',
'USDC'
]
]),
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://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}"
payload := strings.NewReader("{\n \"coins\": [\n \"USDT\",\n \"USDC\"\n ]\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://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"coins\": [\n \"USDT\",\n \"USDC\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}")
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 \"coins\": [\n \"USDT\",\n \"USDC\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": {
"coin_entries": [
{
"coin": "USDT",
"balance": "<string>",
"allowance": "<string>",
"coin_price": 123
}
],
"gas_price": 1,
"gas_token_price": 123,
"contacts": [
{}
],
"contacts_total": 1,
"contacts_next_cursor": "<string>"
}
}<string><string><string><string><string><string><string>Preflight
Get custodial bulk-payment inputs
Returns balances, BundlePay allowances, gas data, and prices for the selected stablecoins on one chain.
POST
/
v1
/
payment
/
onchain
/
balance_est_fee_bulkpay
/
{user_id}
/
{chain}
Get custodial bulk-payment inputs
curl --request POST \
--url https://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"coins": [
"USDT",
"USDC"
]
}
'import requests
url = "https://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}"
payload = { "coins": ["USDT", "USDC"] }
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({coins: ['USDT', 'USDC']})
};
fetch('https://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}', 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://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}",
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([
'coins' => [
'USDT',
'USDC'
]
]),
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://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}"
payload := strings.NewReader("{\n \"coins\": [\n \"USDT\",\n \"USDC\"\n ]\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://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"coins\": [\n \"USDT\",\n \"USDC\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.payunifi.com/v1/payment/onchain/balance_est_fee_bulkpay/{user_id}/{chain}")
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 \"coins\": [\n \"USDT\",\n \"USDC\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": {
"coin_entries": [
{
"coin": "USDT",
"balance": "<string>",
"allowance": "<string>",
"coin_price": 123
}
],
"gas_price": 1,
"gas_token_price": 123,
"contacts": [
{}
],
"contacts_total": 1,
"contacts_next_cursor": "<string>"
}
}<string><string><string><string><string><string><string>Authorizations
Path Parameters
Query Parameters
Body
application/json