Driver Finance
1 API call in this section.
Driver finance management endpoints
manual wallet transactions (credit/debit), accounting summaries, and wallet transaction history.
Create Manual Driver Transaction
/delivery/drivers/:driverId/manual-transactionCreate a manual credit or debit transaction on a driver's wallet.
Permissions Required
manage:wallets OR manage:operations:tenant OR is_system_admin
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Transaction amount (must be > 0) |
type | string | Yes | credit or debit |
reason | string | Yes | Reason for the transaction (max 500 chars) |
reference | string | No | External reference (max 200 chars) |
notes | string | No | Additional notes (max 500 chars) |
Business Logic
Credit: Adds funds to driver wallet (
e.g., bonuses, corrections)Debit: Removes funds from driver wallet (
e.g., penalties, adjustments)For debit: fails if insufficient wallet balance
Transaction metadata records actor ID, the authenticated actor-name snapshot, reason, and reference for the audit trail. The driver wallet history exposes the saved name through
recorded_by.name; older records without a name snapshot resolve the current name using their saved actor ID.
Path parameters
| Parameter | Type | Description |
|---|---|---|
driverIdRequired | string | The driver's ID |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_idOptional | string | Tenant ID (optional if in auth token) |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
amount | number | — |
type | string | — |
reason | string | — |
reference | string | — |
notes | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/delivery/drivers/${DRIVERID}/manual-transaction?tenant_id=&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "amount": 50,6 "type": "credit",7 "reason": "Bonus for excellent performance",8 "reference": "BON-2024-001",9 "notes": "Q1 performance bonus"10}'Response examples
1{2 "success": true,3 "message": "Credit was added to the driver wallet successfully",4 "transaction": {5 "id": "txn-uuid",6 "wallet_id": "wallet-uuid",7 "amount": 50,8 "type": "credit",9 "description": "Bonus for excellent performance",10 "reference_type": "manual_credit",11 "previous_balance": 200,12 "new_balance": 250,13 "created_at": "2024-01-15T10:00:00Z"14 }15}