Process withdrawals to external bank accounts in USD, EUR, MXN, and BRL currencies.
Create Withdrawal
POST /v1/withdrawal/:currency
Process a withdrawal to an external bank account in the specified currency.
curl -X POST "https://api.useonion.xyz/v1/withdrawal/usd" \
-H "Content-Type: application/json" \
-H "x-api-key: sk_live_…" \
-d '{
"userId": "user_abc123",
"firstName": "John",
"lastName": "Doe",
"dob": "1990-01-15",
"amount": 100.50,
"bankAccount": {
"account": "123456789",
"routing": "021000021",
"type": "checking"
}
}'
- x-api-key (header): Active API key for authentication
Path Parameters
- currency (path): Currency code - one of:
USD, EUR, MXN, BRL
Body Parameters
| field | type | required | description |
|---|
| userId | string | yes | User identifier |
| firstName | string | yes | Account holder’s first name |
| lastName | string | yes | Account holder’s last name |
| dob | string | yes | Date of birth (YYYY-MM-DD) |
| amount | number | yes | Withdrawal amount (minimum: 0.01) |
| bankAccount.account | string | yes | Bank account number |
| bankAccount.routing | string | yes | Bank routing number |
| bankAccount.type | string | yes | Account type: checking or savings |
Response: 200 OK
{
"success": true,
"message": "USD withdrawal initiated successfully",
"currency": "USD",
"amount": 100.50
}
Response: 400 Bad Request
{
"error": "Invalid currency. Supported currencies: USD, EUR, MXN, BRL"
}
Response: 500 Internal Server Error
{
"error": "Failed to process USD withdrawal",
"details": "Insufficient funds in account"
}
Examples by Currency
USD Withdrawal
curl -X POST "https://api.useonion.xyz/v1/withdrawal/usd" \
-H "Content-Type: application/json" \
-H "x-api-key: sk_live_…" \
-d '{
"userId": "user_abc123",
"firstName": "John",
"lastName": "Doe",
"dob": "1990-01-15",
"amount": 100.50,
"bankAccount": {
"account": "123456789",
"routing": "021000021",
"type": "checking"
}
}'
EUR Withdrawal
curl -X POST "https://api.useonion.xyz/v1/withdrawal/eur" \
-H "Content-Type: application/json" \
-H "x-api-key: sk_live_…" \
-d '{
"userId": "user_abc123",
"firstName": "John",
"lastName": "Doe",
"dob": "1990-01-15",
"amount": 85.75,
"bankAccount": {
"account": "DE89370400440532013000",
"routing": "DEUTDEBBXXX",
"type": "checking"
}
}'
MXN Withdrawal
curl -X POST "https://api.useonion.xyz/v1/withdrawal/mxn" \
-H "Content-Type: application/json" \
-H "x-api-key: sk_live_…" \
-d '{
"userId": "user_abc123",
"firstName": "Juan",
"lastName": "Pérez",
"dob": "1990-01-15",
"amount": 2000.00,
"bankAccount": {
"account": "012345678901234567",
"routing": "036180000",
"type": "checking"
}
}'
BRL Withdrawal
curl -X POST "https://api.useonion.xyz/v1/withdrawal/brl" \
-H "Content-Type: application/json" \
-H "x-api-key: sk_live_…" \
-d '{
"userId": "user_abc123",
"firstName": "João",
"lastName": "Silva",
"dob": "1990-01-15",
"amount": 500.00,
"bankAccount": {
"account": "12345678901",
"routing": "00000000",
"type": "checking"
}
}'
Get Supported Currencies
GET /v1/withdrawal/currencies
Get list of supported withdrawal currencies and their descriptions.
curl -X GET "https://api.useonion.xyz/v1/withdrawal/currencies" \
-H "x-api-key: sk_live_…"
Response: 200 OK
{
"supportedCurrencies": ["USD", "EUR", "MXN", "BRL"],
"description": {
"USD": "United States Dollar",
"EUR": "Euro",
"MXN": "Mexican Peso",
"BRL": "Brazilian Real"
}
}