Set up a payout account — Step 2
curl --request POST \
--url https://api.example.com/v1/payout/accounts/setup/virtual-account \
--header 'Content-Type: application/json' \
--data '
{
"beneficiaryId": "<string>",
"beneficiaryAccountId": "<string>"
}
'import requests
url = "https://api.example.com/v1/payout/accounts/setup/virtual-account"
payload = {
"beneficiaryId": "<string>",
"beneficiaryAccountId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({beneficiaryId: '<string>', beneficiaryAccountId: '<string>'})
};
fetch('https://api.example.com/v1/payout/accounts/setup/virtual-account', 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.example.com/v1/payout/accounts/setup/virtual-account",
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([
'beneficiaryId' => '<string>',
'beneficiaryAccountId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/payout/accounts/setup/virtual-account"
payload := strings.NewReader("{\n \"beneficiaryId\": \"<string>\",\n \"beneficiaryAccountId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/payout/accounts/setup/virtual-account")
.header("Content-Type", "application/json")
.body("{\n \"beneficiaryId\": \"<string>\",\n \"beneficiaryAccountId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payout/accounts/setup/virtual-account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"beneficiaryId\": \"<string>\",\n \"beneficiaryAccountId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"clabe": "<string>",
"currency": "<string>",
"beneficiaryId": "<string>"
}Global Payout
Set up a payout account — Step 2
Step 2 of the 2-step payout setup. Creates a fiat virtual account (CLABE) tied to the withdrawal address.
POST
/
v1
/
payout
/
accounts
/
setup
/
virtual-account
Set up a payout account — Step 2
curl --request POST \
--url https://api.example.com/v1/payout/accounts/setup/virtual-account \
--header 'Content-Type: application/json' \
--data '
{
"beneficiaryId": "<string>",
"beneficiaryAccountId": "<string>"
}
'import requests
url = "https://api.example.com/v1/payout/accounts/setup/virtual-account"
payload = {
"beneficiaryId": "<string>",
"beneficiaryAccountId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({beneficiaryId: '<string>', beneficiaryAccountId: '<string>'})
};
fetch('https://api.example.com/v1/payout/accounts/setup/virtual-account', 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.example.com/v1/payout/accounts/setup/virtual-account",
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([
'beneficiaryId' => '<string>',
'beneficiaryAccountId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/payout/accounts/setup/virtual-account"
payload := strings.NewReader("{\n \"beneficiaryId\": \"<string>\",\n \"beneficiaryAccountId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/payout/accounts/setup/virtual-account")
.header("Content-Type", "application/json")
.body("{\n \"beneficiaryId\": \"<string>\",\n \"beneficiaryAccountId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payout/accounts/setup/virtual-account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"beneficiaryId\": \"<string>\",\n \"beneficiaryAccountId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"clabe": "<string>",
"currency": "<string>",
"beneficiaryId": "<string>"
}This endpoint closes the 2-step payout account setup. After you created a withdrawal address in step 1, this creates a permanent fiat virtual account (e.g. a CLABE in Mexico) that lets your client deposit fiat to trigger an off-ramp settlement.
1
Step 1 — POST /v1/payout/accounts/setup/liquidation-address
Created the crypto withdrawal address for
(beneficiaryId, beneficiaryAccountId, chain, currency).2
Step 2 — POST /v1/payout/accounts/setup/virtual-account (this endpoint)
Returns the fiat virtual account (CLABE for SPEI, account number + routing for ACH, IBAN for SEPA) backed by the withdrawal address.
3
Operate — quote then execute
POST /v1/payout/accounts/quote to get the rate, then POST /v1/payout/accounts/execute to trigger settlement. Track via GET /v1/orders/{orderId}.Prerequisites
- The recipient exists (
POST /v1/payout/recipients) - The recipient’s bank account is registered (
POST /v1/payout/recipients/{id}/accounts) - Step 1 (withdrawal address) succeeded for this
(beneficiaryId, beneficiaryAccountId)pair
400.
Request body
string
required
The recipient (from
POST /v1/payout/recipients).string
required
The recipient’s bank account ID. Must be the same pair you used in step 1.
Response
string
Internal virtual account ID. You don’t need to store it — call setup again to retrieve.
string
The 18-digit SPEI CLABE for Mexican fiat deposits. Share this with your client.
string
Fiat currency. Today:
MXN (CLABE/SPEI). Other rails (ACH USD, SEPA EUR) will surface here as those go live.string
Echo of the recipient.
This call is idempotent — calling it twice with the same
(beneficiaryId, beneficiaryAccountId) returns the same CLABE. Don’t cache; just call setup before each payment if you want to be sure the account is current.What happens after a deposit
When your client wires MXN to the returned CLABE:- The fiat rails partner detects the deposit and credits the workspace’s float
- An on-chain transfer of equivalent stablecoin is initiated from the withdrawal address
- The stablecoin lands at the on-chain off-ramp partner, triggering the bank wire to the recipient
- An order is created in
/v1/orderswith status transitioning:awaiting_funds→funds_received→payment_submitted→completed
Authentication
Authorization: ApiKey rk_client_key_v1_... — workspace key with payout module enabled and write scope.
Common errors
| Status | Cause | Fix |
|---|---|---|
400 | No withdrawal address exists for the (beneficiaryId, beneficiaryAccountId) pair | Run step 1 (/setup/liquidation-address) first |
403 | Workspace lacks payout module or write scope | Activate Payout Kit in dashboard; check API key scope |
404 | beneficiaryId or beneficiaryAccountId not found | Cross-tenant lookups return 404 (no existence leak) |
422 | Recipient’s bank account is not yet usable (pending rails partner approval) | Wait for the registration to confirm; retry |
Next steps
After step 2 you’re operational. Recommended next reads:POST /v1/payout/accounts/quote— get the exchange rate and fees for a paymentPOST /v1/payout/accounts/execute— trigger settlementGET /v1/orders/{orderId}— track the full timeline- Payout Kit Flow Guide — narrative end-to-end