Introduction to Wallets
Every eDRV User now supports a Wallet deeply integrated with charging session management. Wallets make it easy for developers to offer a friction-free charging experience for your drivers.
Pre-Conditions
Every user object has a property called wallet.balance
which will reflect the user's current balance. As a developer, you should be aware of the following conditions that can apply to the user's wallet balance:
- The amounts specified (in every API call request and response) are in Cents (100¢ = 1 USD, 10008¢ = 100.08 USD etc )
- To start a session, the user must have a minimum wallet balance. This value is configurable at an organizational level. (
user.wallet.balance
>=organization.minimum_balance_to_start_session
). Users cannot start a session until their wallet balance exceeds that defined value. - The user can run a session until their balance reaches 0. After that, the system will auto-terminate any running sessions.
- Currently, eDRV Payment Links and Wallets support USD (US Dollars) as the default currency. We will add support for other currencies in the near future.
Backward Compatibility: Creating a Wallet for Existing Users
For existing eDRV users you can force the creation of a wallet, by calling the GET /users/:id/wallet
API. This creates a wallet if the user does not have one and returns the user object with a wallet.
{
"_id": "63e0d8e8d53c887204076733",
"firstname": "Test",
"lastname": "Test",
"active": true,
"address": {},
"phone": {},
"email": "[email protected]",
"favorite_chargestations": [],
"wallet": {
"_id": "63e0d8e8d53c887204076733",
"test_mode": true,
"balance": 0,
"currency": "USD",
"auto_top_up": {
"active": false,
"payment_method": null,
"amount": 0
},
"createdAt": "2023-02-06T10:39:36.942Z",
"updatedAt": "2023-02-06T10:39:36.942Z"
},
"role": "user",
"payment_methods": [],
"createdAt": "2023-01-27T23:14:23.139Z",
"updatedAt": "2023-02-06T10:39:37.017Z"
}
Updated almost 2 years ago