Get Load Packages
Public list of suggested wallet top-up amounts plus the absolute min/max limits and active currency. Drives the load-amount picker in the wallet UI.
GET /api/v1/wallet/packages — 🌐 Public
Returns the suggested wallet load amounts (e.g. [5, 10, 25]) plus the absolute min / max limits and the active currency code. Drives the chip / button picker in the wallet load screen — the user can pick a suggested amount or type a custom one within the bounds.
Admin-managed catalog. wallet.load_packages (default [5, 10, 25]), wallet.min_load (default 5), wallet.max_load (default 500) are all admin-managed via ConfigService. The currency comes from the platform's default-currency resolver (which reads from the same admin layer).
Kill switch on the controller. @RequireKillSwitch('PAYMENT') is applied at the controller level, so this endpoint also returns 503 features.payment_disabled when admin disables payments. Surface a "wallet is temporarily unavailable" UI when you see that response.
Request
No body, no params, no headers required.
Response
200 OK — ApiResponseOf<WalletPackagesResponseDto>
{
"success": true,
"data": {
"packages": [5, 10, 25],
"min": 5,
"max": 500,
"currency": "USD"
}
}| Field | Type | Notes |
|---|---|---|
packages | number[] | Suggested load amounts (in major units, e.g. dollars). Render as picker chips. |
min | number | Absolute minimum load amount. Reject custom inputs below this client-side. |
max | number | Absolute maximum per-load amount. There's also a wallet.max_balance ceiling enforced server-side at load time (returned as max_balance error if a single load would exceed it). |
currency | string | ISO 4217 currency code (e.g. USD). Reflects the active platform currency. |
Errors
| HTTP | code / i18nKey | Reason |
|---|---|---|
503 | features.payment_disabled | Admin kill switch PAYMENT is active |
Side effects
- Read
wallet.load_packagesJSON config (default[5, 10, 25]). - Read
wallet.min_loadconfig (default5). - Read
wallet.max_loadconfig (default500). - Resolve the active default currency from the platform layer.
- Return
{ packages, min, max, currency }. No mutations, no auth, no per-user state.
Code samples
curl https://api.bio.re/api/v1/wallet/packagestype WalletPackages = {
packages: number[];
min: number;
max: number;
currency: string;
};
async function getWalletPackages(): Promise<WalletPackages> {
const res = await fetch('https://api.bio.re/api/v1/wallet/packages');
const json = await res.json();
if (!res.ok || !json.success) {
throw Object.assign(new Error(json?.error?.message ?? 'Wallet packages fetch failed'), {
code: json?.error?.code,
});
}
return json.data;
}import { useQuery } from '@tanstack/react-query';
export const walletKeys = {
packages: () => ['wallet', 'packages'] as const,
};
export function useWalletPackages() {
return useQuery({
queryKey: walletKeys.packages(),
queryFn: async () => {
const res = await fetch('/api/v1/wallet/packages');
const json = await res.json();
if (!res.ok || !json.success) {
throw Object.assign(new Error(json?.error?.message ?? 'Wallet packages fetch failed'), {
code: json?.error?.code,
i18nKey: json?.error?.i18nKey,
});
}
return json.data as WalletPackages;
},
// Catalog rarely changes within a session
staleTime: 5 * 60_000,
});
}Try it
curl -X GET "https://loading/api/v1/wallet/packages"{
"success": true,
"data": {
"packages": [
5,
10,
25
],
"min": 5,
"max": 500,
"currency": "USD"
}
}Source
| Source | Path | Lines |
|---|---|---|
| Controller | apps/api-core/src/modules/payment/wallet.controller.ts | 21–28 (getPackages) |
| DTO (response) | apps/api-core/src/modules/payment/dto/wallet-response.dto.ts | 9–22 (WalletPackagesResponseDto) |
| Service | apps/api-core/src/modules/payment/wallet.service.ts | 34–40 (getLoadPackages) |
| Config keys | apps/api-core/src/modules/config/config.service.ts | wallet.load_packages, wallet.min_load, wallet.max_load, wallet.max_balance (admin-managed) |
| Kill switch | apps/api-core/src/common/guards/kill-switch.guard.ts | RequireKillSwitch('PAYMENT') (class-level) |
List Web Push Subscriptions
Read the calling user's active web push subscriptions. Returns up to 100 rows ordered newest-first. Public-safe slice — keys NOT exposed.
Get Wallet Balance
Read the calling user's FAN wallet balance and frozen flag. Returns 0.00 + frozen=false if no wallet row exists yet (no auto-create on read).