palbaseDocs

Palbase Payments · API

POST/payments/wallets/charge

Charge customer wallet

Atomically debits a customer's closed-loop wallet (by customer_id or single-use QR spend_token) with double-entry ledger accounting and FIFO lot expiry. Requires Idempotency-Key.

Called by your server, with the project's secret key.

Headers

Idempotency-Keystring · requiredUnique client-supplied idempotency key (1-255 chars) ensuring safe retries without duplicate charges, refunds, or ledger movements.

Request body

amountinteger (int64) · requiredAmount to debit in minor units.
customer_idstring · optionalCustomer UID (required unless spend_token is supplied).
metadataobject · optionalArbitrary JSON metadata.
reasonstring · optionalCharge reason.
referencestring · optionalMerchant order reference.
spend_tokenstring · optionalSingle-use QR spend token (`pst_...`).
wallet_keystring · optionalWallet key (optional when spend_token is supplied).
curl
curl -X POST "https://<your-ref>.palbase.studio/payments/wallets/charge" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"amount":0}'

Responses

200OK

defaultStandard Palbase JSON error envelope (`error` and `error_description`).

Operation ChargeWallet of payments's contract.