Create a fiat account
curl --request POST \
--url https://api.privy.io/v1/users/{user_id}/fiat/accounts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"provider": "bridge-sandbox",
"account_owner_name": "John Doe",
"currency": "usd",
"bank_name": "Chase",
"account": {
"account_number": "1234567899",
"routing_number": "121212121",
"checking_or_savings": "checking"
},
"address": {
"street_line_1": "123 Washington St",
"street_line_2": "Apt 2F",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "USA"
},
"first_name": "John",
"last_name": "Doe"
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/users/{user_id}/fiat/accounts")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"bridge-sandbox\",\n \"account_owner_name\": \"John Doe\",\n \"currency\": \"usd\",\n \"bank_name\": \"Chase\",\n \"account\": {\n \"account_number\": \"1234567899\",\n \"routing_number\": \"121212121\",\n \"checking_or_savings\": \"checking\"\n },\n \"address\": {\n \"street_line_1\": \"123 Washington St\",\n \"street_line_2\": \"Apt 2F\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\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',
account_owner_name: 'John Doe',
currency: 'usd',
bank_name: 'Chase',
account: {
account_number: '1234567899',
routing_number: '121212121',
checking_or_savings: 'checking'
},
address: {
street_line_1: '123 Washington St',
street_line_2: 'Apt 2F',
city: 'New York',
state: 'NY',
postal_code: '10001',
country: 'USA'
},
first_name: 'John',
last_name: 'Doe'
})
};
fetch('https://api.privy.io/v1/users/{user_id}/fiat/accounts', 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/accounts",
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',
'account_owner_name' => 'John Doe',
'currency' => 'usd',
'bank_name' => 'Chase',
'account' => [
'account_number' => '1234567899',
'routing_number' => '121212121',
'checking_or_savings' => 'checking'
],
'address' => [
'street_line_1' => '123 Washington St',
'street_line_2' => 'Apt 2F',
'city' => 'New York',
'state' => 'NY',
'postal_code' => '10001',
'country' => 'USA'
],
'first_name' => 'John',
'last_name' => 'Doe'
]),
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/accounts"
payload := strings.NewReader("{\n \"provider\": \"bridge-sandbox\",\n \"account_owner_name\": \"John Doe\",\n \"currency\": \"usd\",\n \"bank_name\": \"Chase\",\n \"account\": {\n \"account_number\": \"1234567899\",\n \"routing_number\": \"121212121\",\n \"checking_or_savings\": \"checking\"\n },\n \"address\": {\n \"street_line_1\": \"123 Washington St\",\n \"street_line_2\": \"Apt 2F\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\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": "a068d2dd-743a-4011-9b62-8ad33cc7a7be",
"bank_name": "Chase",
"currency": "usd",
"account_type": "us",
"last_4": "7899"
}Create fiat account
Sets up external bank account object for the user through the configured default provider. Requires the user to already be KYC’ed.
POST
/
v1
/
users
/
{user_id}
/
fiat
/
accounts
Create a fiat account
curl --request POST \
--url https://api.privy.io/v1/users/{user_id}/fiat/accounts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '
{
"provider": "bridge-sandbox",
"account_owner_name": "John Doe",
"currency": "usd",
"bank_name": "Chase",
"account": {
"account_number": "1234567899",
"routing_number": "121212121",
"checking_or_savings": "checking"
},
"address": {
"street_line_1": "123 Washington St",
"street_line_2": "Apt 2F",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "USA"
},
"first_name": "John",
"last_name": "Doe"
}
'HttpResponse<String> response = Unirest.post("https://api.privy.io/v1/users/{user_id}/fiat/accounts")
.header("privy-app-id", "<privy-app-id>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"bridge-sandbox\",\n \"account_owner_name\": \"John Doe\",\n \"currency\": \"usd\",\n \"bank_name\": \"Chase\",\n \"account\": {\n \"account_number\": \"1234567899\",\n \"routing_number\": \"121212121\",\n \"checking_or_savings\": \"checking\"\n },\n \"address\": {\n \"street_line_1\": \"123 Washington St\",\n \"street_line_2\": \"Apt 2F\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\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',
account_owner_name: 'John Doe',
currency: 'usd',
bank_name: 'Chase',
account: {
account_number: '1234567899',
routing_number: '121212121',
checking_or_savings: 'checking'
},
address: {
street_line_1: '123 Washington St',
street_line_2: 'Apt 2F',
city: 'New York',
state: 'NY',
postal_code: '10001',
country: 'USA'
},
first_name: 'John',
last_name: 'Doe'
})
};
fetch('https://api.privy.io/v1/users/{user_id}/fiat/accounts', 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/accounts",
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',
'account_owner_name' => 'John Doe',
'currency' => 'usd',
'bank_name' => 'Chase',
'account' => [
'account_number' => '1234567899',
'routing_number' => '121212121',
'checking_or_savings' => 'checking'
],
'address' => [
'street_line_1' => '123 Washington St',
'street_line_2' => 'Apt 2F',
'city' => 'New York',
'state' => 'NY',
'postal_code' => '10001',
'country' => 'USA'
],
'first_name' => 'John',
'last_name' => 'Doe'
]),
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/accounts"
payload := strings.NewReader("{\n \"provider\": \"bridge-sandbox\",\n \"account_owner_name\": \"John Doe\",\n \"currency\": \"usd\",\n \"bank_name\": \"Chase\",\n \"account\": {\n \"account_number\": \"1234567899\",\n \"routing_number\": \"121212121\",\n \"checking_or_savings\": \"checking\"\n },\n \"address\": {\n \"street_line_1\": \"123 Washington St\",\n \"street_line_2\": \"Apt 2F\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\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": "a068d2dd-743a-4011-9b62-8ad33cc7a7be",
"bank_name": "Chase",
"currency": "usd",
"account_type": "us",
"last_4": "7899"
}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 to create the fiat account for
Body
application/json
Valid set of onramp providers
Available options:
bridge, bridge-sandbox Example:
"bridge"
Required string length:
3 - 256Supported fiat currencies.
Available options:
usd, eur Required string length:
3 - 256Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required string length:
1 - 1024Required string length:
1 - 1024Was this page helpful?
⌘I

