/api/v1/businesses/:id/withdrawals/quotex-api-keySandbox + liveGet withdrawal quote
Estimate treasury availability, sweep requirements, and payout cost before creating a withdrawal.
When to use it
Always quote before presenting a payout option to operators or customers.
| Field | Location | Required | Description | Example / default |
|---|---|---|---|---|
| id | path | Yes | Business ID. | - |
| amount | query | Yes | Requested amount in token display units. | - |
| token | query | Yes | Token symbol. | - |
| chain | query | Yes | Chain family. | - |
| networkId | query | No | Specific network. | - |
| forceSweepAll | query | No | Force sweep all eligible balances before quoting. | - |
Flags and defaults
- forceSweepAll (default: false): Include dust / low-value balances in the sweep plan.
Cautions
- Quote availability is still subject to confirmation, treasury freshness, and runtime network policy at execution time.
- Force sweep does not guarantee fulfillment if net sweepable-to-treasury value is still insufficient.
Common errors
- 401: Missing or invalid API key.
- 400: Payload shape, query params, or business-state validation failed.
Sample response
json{
"requestedAmountUSD": 500,
"token": "USDC",
"chain": "eth",
"networkId": "base-mainnet",
"treasuryBalanceUSD": 220,
"totalAvailableUSD": 760.5,
"addressesWithFunds": 8,
"sweepNeeded": true,
"recommended": "exact",
"message": "Withdrawal feasible. Will sweep 3 address(es) first.",
"options": [
{
"type": "exact_withdrawal",
"label": "Withdraw Exact Amount",
"payoutUSD": 500,
"sweepCount": 3,
"totalCostUSD": 2.34,
"feePercent": 0.47,
"available": true
}
]
}cURL example
bashcurl -X GET "https://api.paychainhq.io/api/v1/businesses/biz_123/withdrawals/quote" \
-H "Content-Type: application/json" \
-H "x-api-key: pk_live_your_business_key"Node.js example
tsconst response = await fetch('https://api.paychainhq.io/api/v1/businesses/biz_123/withdrawals/quote', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'pk_live_your_business_key',
},
});
const payload = await response.json();
console.log(payload);