https://api.velobase.io
Customers
Get customer balance
Retrieve a customer’s total, frozen, and available balances, along with a detailed breakdown of all their wallet categories (accounts).
GET /v1/customers/:customer_id
Path parameters
The unique identifier for this customer in your system.
Response fields
The customer identifier.
The customer’s display name.
The customer’s email address.
Aggregated balance totals across all wallets.
Per-wallet breakdown. Each element represents one wallet category.
ISO 8601 datetime when this customer record was created.
Example request
Example response
Billing & credits
Deposit credits
Add credits to a customer’s account. If the customer does not exist yet, Velobase automatically creates them using thename and email fields you provide.
POST /v1/billing/deposit
Request parameters
The unique identifier for this customer in your system.
Positive integer amount to deposit.
Unique identifier for this deposit to prevent double processing.
The wallet category. Defaults to
"default".ISO 8601 datetime. Credits are ignored before this date.
ISO 8601 datetime. Credits are ignored after this date.
Customer’s display name. Used only when creating a new customer.
Customer’s email address. Used only when creating a new customer.
Optional note for the ledger.
Response fields
The customer identifier.
The wallet (account) that received the credits.
The wallet category.
Total credits in this wallet after the deposit.
Credits added in this operation.
ISO 8601 credit activation date, if set.
ISO 8601 credit expiry date, if set.
The unique ledger record ID.
true if this was a duplicate request that returned the original result.Example request
Example response
Direct deduct
Atomically deduct credits from a customer’s available balance in a single step. Use this for immediate, one-shot charges where you do not need to reserve credits first.POST /v1/billing/deduct
Request parameters
The unique identifier for this customer in your system.
Positive integer amount to deduct.
Unique identifier for this task or job.
Whitelist of wallet categories to deduct from.
Optional note for the ledger.
Response fields
Echo of the request identifier.
Total credits deducted.
Breakdown by wallet. Each item contains
account_id, credit_type, and amount.ISO 8601 timestamp of the deduction.
true if this was a duplicate request.Example request
Example response
Freeze credits
Reserve a specific amount of credits for an ongoing task. Frozen credits are held exclusively for that task and cannot be spent by any other operation until they are consumed or unfrozen.POST /v1/billing/freeze
Request parameters
The unique identifier for this customer in your system.
Positive integer amount to freeze.
Unique identifier for this task or job.
Whitelist of wallet categories to freeze from.
Optional note for the ledger.
Response fields
Echo of the request identifier.
Total credits frozen.
Breakdown by wallet. Each item contains
account_id, credit_type, and amount.true if this was a duplicate request.Example request
Example response
Consume frozen credits
Permanently deduct credits from a previously frozen transaction. You supply the actual amount used — which may be less than what was originally frozen — and Velobase returns any remainder to the customer’s available balance.POST /v1/billing/consume
Request parameters
The
transaction_id used in the original freeze call.Positive integer amount to actually deduct. Must be less than or equal to the originally frozen amount.
Response fields
Echo of the request identifier.
Credits permanently deducted from the frozen amount.
Unused credits returned to the available balance (
frozen - consumed).Breakdown by wallet. Each item contains
account_id, credit_type, and amount.ISO 8601 timestamp of the consumption.
true if this was a duplicate request.Example request
Example response
Unfreeze credits
Release all unused frozen credits back to the customer’s available balance. Use this when a task is canceled or fails and you want to return the reserved credits without consuming any.POST /v1/billing/unfreeze
Request parameters
The
transaction_id used in the original freeze call.Response fields
Echo of the request identifier.
Total credits released back to the available balance.
Breakdown by wallet. Each item contains
account_id, credit_type, and amount.ISO 8601 timestamp of the unfreeze.
true if this was a duplicate request.