How it works
When Velobase receives a request, it checks if the provided identifier has already been processed for that specific customer:- First request: The operation is processed, the balance is updated, and the result is returned with
"is_idempotent_replay": false. - Duplicate request: Velobase recognizes the identifier, skips the operation, and immediately returns the exact same result as the original request, but marked with
"is_idempotent_replay": true.
Identifiers by Endpoint
Velobase uses different identifier fields depending on the operation type. These fields must be passed in the JSON request body.| Endpoint | Field | Purpose |
|---|---|---|
POST /v1/billing/deposit | idempotency_key | A unique string (like a UUID) generated by your system for this specific deposit. |
POST /v1/billing/deduct, POST /v1/billing/freeze, POST /v1/billing/consume, POST /v1/billing/unfreeze | transaction_id | The unique ID of the task or job in your system that caused the billing event. |
Error: Transaction Conflict
Identifiers are scoped to the customer (customer_id). If you attempt to reuse the exact same transaction_id or idempotency_key for a different customer, Velobase will reject the request with a 409 Conflict error (transaction_conflict):
user-123-task-456).