Skip to main content

Wallet

4 API calls in this section.

Get Wallet Dashboard

Customer Portal / Delivery Management / Wallet
GET/customer/wallet/dashboard?page=1&limit=5&type=all

Customer wallet dashboard data for UI cards + transaction history. Rules: - No currency field returned. - Cards: Total Top-ups (lifetime), Total Spent (lifetime), This Month (current month spent). - Withdraw tab returns payout transactions (wallet_transactions.type = 'payout'). - Per transaction running balance is returned in running_balance (from wallet_transactions.balance_snapshot column).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/customer/wallet/dashboard?page=1&limit=5&type=all" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

pageOptional
query string

1

Page number (default: 1)

limitOptional
query string

5

Page size (frontend default: 5)

typeOptional
query string

all

Transaction tab: all | topup | payment | withdraw

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success200OK
Response body
json
1{2  "success": true,3  "data": {4    "wallet": {5      "balance": 1006    },7    "cards": {8      "total_topups": {9        "amount": 100,10        "transactions_count": 111      },12      "total_spent": {13        "amount": 40.5,14        "orders_paid_count": 215      },16      "this_month": {17        "amount": 018      }19    },20    "history": {21      "type": "all",22      "statuses": [23        {24          "key": "all",25          "label": "All",26          "count": 327        },28        {29          "key": "topup",30          "label": "Top-ups",31          "count": 132        },33        {34          "key": "payment",35          "label": "Payment",36          "count": 237        },38        {39          "key": "withdraw",40          "label": "Withdraw",41          "count": 042        }43      ],44      "transactions": [45        {46          "id": "uuid",47          "type": "topup",48          "title": "Top-up",49          "subtitle": "Wallet top-up via card",50          "amount": 100,51          "running_balance": 100,52          "created_at": "2024-01-25T15:30:00Z",53          "reference_id": "uuid",54          "reference_type": "payment"55        },56        {57          "id": "uuid",58          "type": "payment",59          "title": "Order payment",60          "subtitle": "Payment for order ORD-2024-001",61          "amount": -15.5,62          "running_balance": 84.5,63          "created_at": "2024-01-29T15:30:00Z",64          "reference_id": "ORD-2024-001",65          "reference_type": "delivery"66        }67      ],68      "pagination": {69        "current_page": 1,70        "per_page": 5,71        "total_items": 2,72        "total_pages": 1,73        "has_next_page": false,74        "has_previous_page": false75      }76    }77  }78}

Create Payout Request

Customer Portal / Delivery Management / Wallet
POST/customer/wallet/payout-requests

Customer creates a payout request (allowed user types configured in customer portal settings: individual and/or business). Rules: - Workflow only. No wallet debit happens here. - Wallet balance is checked (must be >= amount). Request Body: - amount (required) - reference (optional) - notes (optional)

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/customer/wallet/payout-requests" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "amount": 0,7  "reference": "",8  "notes": ""9}'
Request body
json
1{2  "amount": 0,3  "reference": "",4  "notes": ""5}

Request body fields

amountExample
number

Example field from the request body.

referenceExample
string

Example field from the request body.

notesExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

No response example is available for this endpoint yet.

List Payout Requests

Customer Portal / Delivery Management / Wallet
GET/customer/wallet/payout-requests?page=1&limit=10&status=all

Lists customer-owned payout requests. Access controlled by customer portal wallet_settings.allowed_payout_user_types (individual and/or business).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/customer/wallet/payout-requests?page=1&limit=10&status=all" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

pageOptional
query string

1

Page number (>=1)

limitOptional
query string

10

Items per page (1-50)

statusOptional
query string

all

all | pending | approved | rejected

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

Get Payout Request

Customer Portal / Delivery Management / Wallet
GET/customer/wallet/payout-requests/:id

Gets customer-owned payout request detail. Access controlled by customer portal wallet_settings.allowed_payout_user_types (individual and/or business).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/customer/wallet/payout-requests/:id" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

idRequired
path string

payout-request-uuid

Payout request ID

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.