Skip to content

Withdraw from a card ​

Move unused card balance back to the FluxA Wallet linked to your agent. Withdrawals do not need a mandate: the money always goes back to the linked wallet, and the request body cannot change the destination.

A withdrawal is processed in the background. Externally it has only three states: processing, completed, failed.

CLI

bash
fluxa-wallet card withdraw --id card_7Hq2LmX9pRt4               # full remaining balance
fluxa-wallet card withdraw --id card_7Hq2LmX9pRt4 --amount 5.00
fluxa-wallet card withdrawals --id card_7Hq2LmX9pRt4
fluxa-wallet card withdrawal --id card_7Hq2LmX9pRt4 --withdrawal-id wdr_…

Request a withdrawal ​

POST/api/v2/cards/{cardId}/withdrawBearer agent-vc
bash
curl -X POST https://agentcard.fluxapay.xyz/api/v2/cards/card_7Hq2LmX9pRt4/withdraw \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AGENT_VC" \
  -d '{ "amountUsd": "5.00" }'
FieldTypeRequiredDescription
amountUsdstringnoAmount to take off the card, in USD. Omit to withdraw the full live balance. Must not exceed the balance and must be larger than the withdrawal fee.

The withdrawal fee (feeUsd) is deducted from amountUsd; the wallet receives amountUsd − feeUsd.

Response 202:

json
{
  "withdrawalId": "wdr_5e2a9c1f-7b3d-4e6a-8f0c-2d4b6a8e1c37",
  "status": "processing",
  "amountUsd": "5.00",
  "feeUsd": "0.50",
  "payoutTarget": "…"
}

Keep withdrawalId and poll Get a withdrawal. Only one withdrawal can be in progress per card; do not submit another while one is processing.


List withdrawals ​

GET/api/v2/cards/{cardId}/withdrawalsBearer agent-vc
bash
curl https://agentcard.fluxapay.xyz/api/v2/cards/card_7Hq2LmX9pRt4/withdrawals \
  -H "Authorization: Bearer $AGENT_VC"

Returns { "withdrawals": [ … ] }, newest first, each in the shape below.


Get a withdrawal ​

GET/api/v2/cards/{cardId}/withdrawals/{withdrawalId}Bearer agent-vc
bash
curl https://agentcard.fluxapay.xyz/api/v2/cards/card_7Hq2LmX9pRt4/withdrawals/wdr_5e2a9c1f-7b3d-4e6a-8f0c-2d4b6a8e1c37 \
  -H "Authorization: Bearer $AGENT_VC"
json
{
  "withdrawal": {
    "withdrawalId": "wdr_5e2a9c1f-7b3d-4e6a-8f0c-2d4b6a8e1c37",
    "status": "completed",
    "cardDebited": true,
    "cardRestored": false,
    "amountUsd": "5.00",
    "feeUsd": "0.50",
    "payoutTarget": "…",
    "payoutTxHash": "0x…",
    "failureReason": null,
    "progressMessage": null,
    "createdAt": "2026-10-27T12:00:00.000Z",
    "updatedAt": "2026-10-27T12:01:30.000Z"
  }
}
FieldDescription
statusprocessing, completed or failed.
cardDebitedtrue once the amount has been taken off the card.
cardRestoredtrue if the amount was put back on the card because the transfer to the wallet could not be made.
amountUsd, feeUsdAmount taken off the card and the fee.
payoutTargetIdentifies the destination (your linked wallet). Treat as opaque.
payoutTxHashOn-chain transaction hash of the transfer to the wallet, once sent.
failureReasonOnly when status is failed: a short explanation. Otherwise null.
progressMessageOptional human-readable note while processing (for example, that the request will resume automatically). Show it to the user as-is.

Statuses ​

statusMeaningWhat to do
processingIn progress. This can take a while.Keep polling. Do not submit another withdrawal.
completedThe funds were sent to the wallet.Done.
failedThe withdrawal did not complete.Check cardRestored and the card balance. If the problem persists, contact FluxA support with the withdrawalId.

Withdrawals also appear in transactions with type: "withdrawal".


Errors ​

StatuscodeWhat to do
400invalid_amountThe amount is invalid or does not cover the fee.
400insufficient_card_balanceThe amount is more than the card balance.
400withdraw_not_supportedWithdrawals are not available for this card.
404card_not_found, withdrawal_not_foundCheck the IDs.
409withdrawal_in_progressWait for the current withdrawal to finish.
429daily_withdraw_limit_reachedWithdrawals are temporarily limited. Try again tomorrow.
5xx—The live balance could not be read; nothing was withdrawn. Retry later.

Released under the MIT License.