Payouts
Withdraw
Calldata that pays out a wallet’s claimable balance
POST
/
seller-financing
/
api
/
markets
/
{marketId}
/
withdraw
curl -X POST "https://api.trusset.org/seller-financing/api/markets/cmsg4x7k20003sf9q1d8v6b2e/withdraw" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{"from": "0x3E22FdfA28e880239541d9c5B66B3b161F9ED77b"}'
const res = await fetch(
`https://api.trusset.org/seller-financing/api/markets/${marketId}/withdraw`,
{
method: 'POST',
headers: { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' },
body: JSON.stringify({ from: await seller.getAddress() })
}
);
const { data } = await res.json();
const step = data.steps[0];
await (await seller.sendTransaction({ to: step.to, data: step.data, value: 0, gasLimit: step.gasLimit })).wait();
{
"success": true,
"data": {
"action": "SIGN_TRANSACTIONS",
"chainId": 11155111,
"steps": [
{
"to": "0xc35e5f74eC4C1dfB8cE2b8798D6161B706F9B5E1",
"data": "0x51cff8d9...",
"value": "0",
"functionName": "withdraw",
"label": "Withdraw 10000.8633 to 0x3E22...D77b",
"description": "Withdraw 10000.8633 to 0x3E22...D77b",
"gasLimit": "258503",
"chainId": 11155111
}
],
"confirmStepIndex": 0,
"preflight": {
"simulated": true,
"gasEstimate": "198849"
},
"to": "0x3E22FdfA28e880239541d9c5B66B3b161F9ED77b",
"amount": "10000863300",
"amountFormatted": "10000.8633"
},
"error": null,
"metadata": {
"timestamp": "2026-10-18T21:45:31.020Z",
"requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_WOULD_REVERT",
"message": "There is nothing to withdraw for this wallet.",
"details": {
"action": "withdrawal",
"error": "NothingToWithdraw"
}
},
"metadata": {
"timestamp": "2026-10-18T21:45:31.020Z",
"requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
"instanceId": "inst_abc123"
}
}
Seller Financing is in beta and runs on Ethereum Sepolia instances only for now (
DEVELOPMENT instances on Ethereum). A PRODUCTION instance, or one on another network, answers 503 SELLER_FINANCING_UNAVAILABLE. See Seller Financing.to or to itself.
A withdrawal stays open while the market is paused. When the payment token refuses to pay a wallet, for example one its issuer blacklisted, the owner of the balance can name another to. One wallet’s refusal never holds back another’s balance.
The step pays out the balance at the moment it is mined, so amount in the answer can be lower than what arrives when more was credited in between.
Path Parameters
string
required
The market’s record ID, as
id on List Markets.Body Parameters
string
The wallet that receives the payout. It cannot be the market or its adapter. Omitted,
"" or null, the payout goes to from.string
required
The wallet whose balance is paid out, which signs. Without it the answer is
400 FROM_REQUIRED. A wallet with nothing to withdraw answers 409 TX_WOULD_REVERT with NothingToWithdraw.Response Fields
object
Show child attributes
Show child attributes
string
SIGN_TRANSACTIONS.integer
The chain the step is built for.
array
One step,
withdraw on the market, with gasLimit.integer
0.object
{ simulated: true, gasEstimate }.string
The wallet that receives the payout.
string
The balance of
from when the request was built, in the payment token’s smallest unit.string
The same in whole units.
curl -X POST "https://api.trusset.org/seller-financing/api/markets/cmsg4x7k20003sf9q1d8v6b2e/withdraw" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{"from": "0x3E22FdfA28e880239541d9c5B66B3b161F9ED77b"}'
const res = await fetch(
`https://api.trusset.org/seller-financing/api/markets/${marketId}/withdraw`,
{
method: 'POST',
headers: { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' },
body: JSON.stringify({ from: await seller.getAddress() })
}
);
const { data } = await res.json();
const step = data.steps[0];
await (await seller.sendTransaction({ to: step.to, data: step.data, value: 0, gasLimit: step.gasLimit })).wait();
{
"success": true,
"data": {
"action": "SIGN_TRANSACTIONS",
"chainId": 11155111,
"steps": [
{
"to": "0xc35e5f74eC4C1dfB8cE2b8798D6161B706F9B5E1",
"data": "0x51cff8d9...",
"value": "0",
"functionName": "withdraw",
"label": "Withdraw 10000.8633 to 0x3E22...D77b",
"description": "Withdraw 10000.8633 to 0x3E22...D77b",
"gasLimit": "258503",
"chainId": 11155111
}
],
"confirmStepIndex": 0,
"preflight": {
"simulated": true,
"gasEstimate": "198849"
},
"to": "0x3E22FdfA28e880239541d9c5B66B3b161F9ED77b",
"amount": "10000863300",
"amountFormatted": "10000.8633"
},
"error": null,
"metadata": {
"timestamp": "2026-10-18T21:45:31.020Z",
"requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_WOULD_REVERT",
"message": "There is nothing to withdraw for this wallet.",
"details": {
"action": "withdrawal",
"error": "NothingToWithdraw"
}
},
"metadata": {
"timestamp": "2026-10-18T21:45:31.020Z",
"requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
"instanceId": "inst_abc123"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | An address is malformed, or the body carries another field. error.details names it |
FROM_REQUIRED | 400 | from is missing. The message names who signs: the wallet whose claimable balance is paid out |
MARKET_NOT_FOUND | 404 | No market with this ID that your instance reaches on its network |
TX_WOULD_REVERT | 409 | NothingToWithdraw when from has no balance, InvalidAddress when to is the market or its adapter, or a refusal of the payment token such as SafeERC20FailedOperation |
CHAIN_UNAVAILABLE | 503 | The chain could not be read. Nothing was built. Retry shortly |
SELLER_FINANCING_UNAVAILABLE | 503 | The instance is a PRODUCTION instance or not on Ethereum |
WITHDRAW_BUILD_FAILED | 500 | Unexpected failure. Nothing was built. Retry, or contact support with the request ID |
⌘I
curl -X POST "https://api.trusset.org/seller-financing/api/markets/cmsg4x7k20003sf9q1d8v6b2e/withdraw" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{"from": "0x3E22FdfA28e880239541d9c5B66B3b161F9ED77b"}'
const res = await fetch(
`https://api.trusset.org/seller-financing/api/markets/${marketId}/withdraw`,
{
method: 'POST',
headers: { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' },
body: JSON.stringify({ from: await seller.getAddress() })
}
);
const { data } = await res.json();
const step = data.steps[0];
await (await seller.sendTransaction({ to: step.to, data: step.data, value: 0, gasLimit: step.gasLimit })).wait();
{
"success": true,
"data": {
"action": "SIGN_TRANSACTIONS",
"chainId": 11155111,
"steps": [
{
"to": "0xc35e5f74eC4C1dfB8cE2b8798D6161B706F9B5E1",
"data": "0x51cff8d9...",
"value": "0",
"functionName": "withdraw",
"label": "Withdraw 10000.8633 to 0x3E22...D77b",
"description": "Withdraw 10000.8633 to 0x3E22...D77b",
"gasLimit": "258503",
"chainId": 11155111
}
],
"confirmStepIndex": 0,
"preflight": {
"simulated": true,
"gasEstimate": "198849"
},
"to": "0x3E22FdfA28e880239541d9c5B66B3b161F9ED77b",
"amount": "10000863300",
"amountFormatted": "10000.8633"
},
"error": null,
"metadata": {
"timestamp": "2026-10-18T21:45:31.020Z",
"requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
"instanceId": "inst_abc123"
}
}
{
"success": false,
"data": null,
"error": {
"code": "TX_WOULD_REVERT",
"message": "There is nothing to withdraw for this wallet.",
"details": {
"action": "withdrawal",
"error": "NothingToWithdraw"
}
},
"metadata": {
"timestamp": "2026-10-18T21:45:31.020Z",
"requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
"instanceId": "inst_abc123"
}
}
