Skip to main content

Fund & Defund Card

Move funds between a wallet and a card's individual balance. Both operations are async.


Fund Card​

Tops up the card balance from the parent wallet's available balance.

Endpoint​

PATCH /api/v2/organizations/{org_id}/wallets/{wallet_id}/instruments/{instrument_id}/fund

Path Parameters​

ParameterTypeRequiredDescription
org_idstringYesYour organization ID
wallet_idstringYesWallet UUID
instrument_idstringYesCard UUID

Request Body​

{
"amount": "100.00"
}
FieldTypeRequiredDescription
amountstringYesAmount to add to card balance (dot as decimal)

Request​

curl -X PATCH "https://api.4pay.cc/api/v2/organizations/{org_id}/wallets/{wallet_id}/instruments/{instrument_id}/fund" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": "100.00"}'

Response​

200 OK
{
"data": {
"fromTransactionId": "9f283e59-21ec-4c74-ae32-156d49cd9cf2",
"toTransactionId": "8f3d0c3d-9f3e-4ef6-8fae-c3169025dfcb"
}
}
FieldDescription
fromTransactionIdDebit transaction ID on the wallet
toTransactionIdCredit transaction ID on the card

Defund Card​

Withdraws funds from the card's balance back to the parent wallet.

Endpoint​

PATCH /api/v2/organizations/{org_id}/wallets/{wallet_id}/instruments/{instrument_id}/defund

Request Body​

{
"amount": "50.00"
}

Request​

curl -X PATCH "https://api.4pay.cc/api/v2/organizations/{org_id}/wallets/{wallet_id}/instruments/{instrument_id}/defund" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": "50.00"}'

Response​

200 OK
{
"data": {
"fromTransactionId": "abc123e4-5678-90ab-cdef-1234567890ab",
"toTransactionId": "def456e7-8901-23ab-cdef-4567890abcde"
}
}

tip

The wallet must have sufficient availableBalance for fund operations. Check the wallet balance via Get Wallet Details before funding.