Initiate an onramp transaction
curl --request POST \
--url https://api.privy.io/v1/users/{user_id}/fiat/onramp \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"amount": "100.00",
"provider": "bridge-sandbox",
"source": {
"currency": "usd",
"payment_rail": "ach_push"
},
"destination": {
"currency": "usdc",
"chain": "base",
"to_address": "0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA"
}
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/users/{user_id}/fiat/onramp")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100.00\",\n \"provider\": \"bridge-sandbox\",\n \"source\": {\n \"currency\": \"usd\",\n \"payment_rail\": \"ach_push\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"chain\": \"base\",\n \"to_address\": \"0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA\"\n }\n}")
.asString();const options = {
method: 'POST',
headers: {
'privy-app-id': '<privy-app-id>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '100.00',
provider: 'bridge-sandbox',
source: {currency: 'usd', payment_rail: 'ach_push'},
destination: {
currency: 'usdc',
chain: 'base',
to_address: '0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA'
}
})
};
fetch('https://api.privy.io/v1/users/{user_id}/fiat/onramp', 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.privy.io/v1/users/{user_id}/fiat/onramp",
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([
'amount' => '100.00',
'provider' => 'bridge-sandbox',
'source' => [
'currency' => 'usd',
'payment_rail' => 'ach_push'
],
'destination' => [
'currency' => 'usdc',
'chain' => 'base',
'to_address' => '0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"privy-app-id: <privy-app-id>"
],
]);
$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.privy.io/v1/users/{user_id}/fiat/onramp"
payload := strings.NewReader("{\n \"amount\": \"100.00\",\n \"provider\": \"bridge-sandbox\",\n \"source\": {\n \"currency\": \"usd\",\n \"payment_rail\": \"ach_push\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"chain\": \"base\",\n \"to_address\": \"0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("privy-app-id", "<privy-app-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}{
"id": "3a61a69a-1f20-4113-85f5-997078166729",
"status": "awaiting_funds",
"deposit_instructions": {
"payment_rail": "ach_push",
"currency": "usd",
"amount": "100.0",
"deposit_message": "BRGFU2Z9TJPJXCS7ZZK2",
"bank_account_number": "11223344556677",
"bank_routing_number": "123456789",
"bank_beneficiary_name": "Bridge Ventures Inc",
"bank_beneficiary_address": "1234 Elm St, Springfield, IL 12345",
"bank_name": "Bank of Nowhere",
"bank_address": "1800 North Pole St., Orlando, FL 32801"
}
}Initiate onramp
Triggers an onramp to the specified recipient blockchain address, returns the bank deposit instructions
POST
/
v1
/
users
/
{user_id}
/
fiat
/
onramp
Initiate an onramp transaction
curl --request POST \
--url https://api.privy.io/v1/users/{user_id}/fiat/onramp \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"amount": "100.00",
"provider": "bridge-sandbox",
"source": {
"currency": "usd",
"payment_rail": "ach_push"
},
"destination": {
"currency": "usdc",
"chain": "base",
"to_address": "0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA"
}
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/users/{user_id}/fiat/onramp")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100.00\",\n \"provider\": \"bridge-sandbox\",\n \"source\": {\n \"currency\": \"usd\",\n \"payment_rail\": \"ach_push\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"chain\": \"base\",\n \"to_address\": \"0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA\"\n }\n}")
.asString();const options = {
method: 'POST',
headers: {
'privy-app-id': '<privy-app-id>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '100.00',
provider: 'bridge-sandbox',
source: {currency: 'usd', payment_rail: 'ach_push'},
destination: {
currency: 'usdc',
chain: 'base',
to_address: '0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA'
}
})
};
fetch('https://api.privy.io/v1/users/{user_id}/fiat/onramp', 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.privy.io/v1/users/{user_id}/fiat/onramp",
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([
'amount' => '100.00',
'provider' => 'bridge-sandbox',
'source' => [
'currency' => 'usd',
'payment_rail' => 'ach_push'
],
'destination' => [
'currency' => 'usdc',
'chain' => 'base',
'to_address' => '0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"privy-app-id: <privy-app-id>"
],
]);
$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.privy.io/v1/users/{user_id}/fiat/onramp"
payload := strings.NewReader("{\n \"amount\": \"100.00\",\n \"provider\": \"bridge-sandbox\",\n \"source\": {\n \"currency\": \"usd\",\n \"payment_rail\": \"ach_push\"\n },\n \"destination\": {\n \"currency\": \"usdc\",\n \"chain\": \"base\",\n \"to_address\": \"0x38Bc05d7b69F63D05337829fA5Dc4896F179B5fA\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("privy-app-id", "<privy-app-id>")
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}{
"id": "3a61a69a-1f20-4113-85f5-997078166729",
"status": "awaiting_funds",
"deposit_instructions": {
"payment_rail": "ach_push",
"currency": "usd",
"amount": "100.0",
"deposit_message": "BRGFU2Z9TJPJXCS7ZZK2",
"bank_account_number": "11223344556677",
"bank_routing_number": "123456789",
"bank_beneficiary_name": "Bridge Ventures Inc",
"bank_beneficiary_address": "1234 Elm St, Springfield, IL 12345",
"bank_name": "Bank of Nowhere",
"bank_address": "1800 North Pole St., Orlando, FL 32801"
}
}Authorizations
Basic Auth header with your app ID as the username and your app secret as the password.
Headers
ID of your Privy app.
Path Parameters
The ID of the user initiating the onramp
Body
application/json
Response
200 - application/json
Bank deposit instructions for the onramp
Response for an onramp transfer initiation.
Status of an onramp or offramp transfer.
Available options:
awaiting_funds, in_review, funds_received, payment_submitted, payment_processed, canceled, error, undeliverable, returned, refunded Bank deposit instructions for an onramp transfer.
Show child attributes
Show child attributes
Was this page helpful?
⌘I

