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​
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id | string | Yes | Your organization ID |
wallet_id | string | Yes | Wallet UUID |
instrument_id | string | Yes | Card UUID |
Request Body​
{
"amount": "100.00"
}
| Field | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Amount 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"
}
}
| Field | Description |
|---|---|
fromTransactionId | Debit transaction ID on the wallet |
toTransactionId | Credit 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.