Skip to main content
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

Authorization
string
header
required

Basic Auth header with your app ID as the username and your app secret as the password.

Headers

privy-app-id
string
required

ID of your Privy app.

Path Parameters

user_id
string
required

The ID of the user initiating the offramp

Body

application/json
amount
string
required
Minimum string length: 1
provider
enum<string>
required

Valid set of onramp providers

Available options:
bridge,
bridge-sandbox
Example:

"bridge"

source
object
required
destination
object
required

Response

200 - application/json

Deposit instructions for the offramp

Response for an offramp transfer initiation.

id
string
required
status
enum<string>
required

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
OfframpDepositInstructions · object
required

Deposit instructions for an offramp transfer.