Initiate an offramp transaction
curl --request POST \
--url https://api.privy.io/v1/users/{user_id}/fiat/offramp \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"provider": "bridge-sandbox",
"amount": "100.00",
"source": {
"currency": "usdc",
"chain": "base",
"from_address": "0xc24272abc794b973b896715db40a72714a030323"
},
"destination": {
"currency": "usd",
"payment_rail": "ach_push",
"external_account_id": "a068d2dd-743a-4011-9b62-8ad33cc7a7be"
}
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/users/{user_id}/fiat/offramp")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"bridge-sandbox\",\n \"amount\": \"100.00\",\n \"source\": {\n \"currency\": \"usdc\",\n \"chain\": \"base\",\n \"from_address\": \"0xc24272abc794b973b896715db40a72714a030323\"\n },\n \"destination\": {\n \"currency\": \"usd\",\n \"payment_rail\": \"ach_push\",\n \"external_account_id\": \"a068d2dd-743a-4011-9b62-8ad33cc7a7be\"\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({
provider: 'bridge-sandbox',
amount: '100.00',
source: {
currency: 'usdc',
chain: 'base',
from_address: '0xc24272abc794b973b896715db40a72714a030323'
},
destination: {
currency: 'usd',
payment_rail: 'ach_push',
external_account_id: 'a068d2dd-743a-4011-9b62-8ad33cc7a7be'
}
})
};
fetch('https://api.privy.io/v1/users/{user_id}/fiat/offramp', 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/offramp",
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([
'provider' => 'bridge-sandbox',
'amount' => '100.00',
'source' => [
'currency' => 'usdc',
'chain' => 'base',
'from_address' => '0xc24272abc794b973b896715db40a72714a030323'
],
'destination' => [
'currency' => 'usd',
'payment_rail' => 'ach_push',
'external_account_id' => 'a068d2dd-743a-4011-9b62-8ad33cc7a7be'
]
]),
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/offramp"
payload := strings.NewReader("{\n \"provider\": \"bridge-sandbox\",\n \"amount\": \"100.00\",\n \"source\": {\n \"currency\": \"usdc\",\n \"chain\": \"base\",\n \"from_address\": \"0xc24272abc794b973b896715db40a72714a030323\"\n },\n \"destination\": {\n \"currency\": \"usd\",\n \"payment_rail\": \"ach_push\",\n \"external_account_id\": \"a068d2dd-743a-4011-9b62-8ad33cc7a7be\"\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": "d220bcf7-4ad5-4687-8a61-e51c5875225e",
"status": "awaiting_funds",
"deposit_instructions": {
"amount": "100.0",
"currency": "usdc",
"to_address": "0xdeadbeef2usdcbase",
"from_address": "0xc24272abc794b973b896715db40a72714a030323",
"chain": "base"
}
}Initiate offramp
Triggers the offramp flow and gets the on-chain address to send funds to
POST
/
v1
/
users
/
{user_id}
/
fiat
/
offramp
Initiate an offramp transaction
curl --request POST \
--url https://api.privy.io/v1/users/{user_id}/fiat/offramp \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"provider": "bridge-sandbox",
"amount": "100.00",
"source": {
"currency": "usdc",
"chain": "base",
"from_address": "0xc24272abc794b973b896715db40a72714a030323"
},
"destination": {
"currency": "usd",
"payment_rail": "ach_push",
"external_account_id": "a068d2dd-743a-4011-9b62-8ad33cc7a7be"
}
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/users/{user_id}/fiat/offramp")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"bridge-sandbox\",\n \"amount\": \"100.00\",\n \"source\": {\n \"currency\": \"usdc\",\n \"chain\": \"base\",\n \"from_address\": \"0xc24272abc794b973b896715db40a72714a030323\"\n },\n \"destination\": {\n \"currency\": \"usd\",\n \"payment_rail\": \"ach_push\",\n \"external_account_id\": \"a068d2dd-743a-4011-9b62-8ad33cc7a7be\"\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({
provider: 'bridge-sandbox',
amount: '100.00',
source: {
currency: 'usdc',
chain: 'base',
from_address: '0xc24272abc794b973b896715db40a72714a030323'
},
destination: {
currency: 'usd',
payment_rail: 'ach_push',
external_account_id: 'a068d2dd-743a-4011-9b62-8ad33cc7a7be'
}
})
};
fetch('https://api.privy.io/v1/users/{user_id}/fiat/offramp', 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/offramp",
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([
'provider' => 'bridge-sandbox',
'amount' => '100.00',
'source' => [
'currency' => 'usdc',
'chain' => 'base',
'from_address' => '0xc24272abc794b973b896715db40a72714a030323'
],
'destination' => [
'currency' => 'usd',
'payment_rail' => 'ach_push',
'external_account_id' => 'a068d2dd-743a-4011-9b62-8ad33cc7a7be'
]
]),
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/offramp"
payload := strings.NewReader("{\n \"provider\": \"bridge-sandbox\",\n \"amount\": \"100.00\",\n \"source\": {\n \"currency\": \"usdc\",\n \"chain\": \"base\",\n \"from_address\": \"0xc24272abc794b973b896715db40a72714a030323\"\n },\n \"destination\": {\n \"currency\": \"usd\",\n \"payment_rail\": \"ach_push\",\n \"external_account_id\": \"a068d2dd-743a-4011-9b62-8ad33cc7a7be\"\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": "d220bcf7-4ad5-4687-8a61-e51c5875225e",
"status": "awaiting_funds",
"deposit_instructions": {
"amount": "100.0",
"currency": "usdc",
"to_address": "0xdeadbeef2usdcbase",
"from_address": "0xc24272abc794b973b896715db40a72714a030323",
"chain": "base"
}
}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 offramp
Body
application/json
Response
200 - application/json
Deposit instructions for the offramp
Response for an offramp 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 Deposit instructions for an offramp transfer.
Show child attributes
Show child attributes
Was this page helpful?
⌘I

