diff --git a/src/api/types/campaign.ts b/src/api/types/campaign.ts index a176927..ff1b822 100644 --- a/src/api/types/campaign.ts +++ b/src/api/types/campaign.ts @@ -84,6 +84,14 @@ export interface AdAccount { min_daily_budget?: number; is_prepay_account?: boolean; funding_source?: string; + /** + * On a prepay account, `balance` is the amount owed — 0 even with money + * loaded, because nothing has been billed yet. The wallet amount is only + * available here, as a string Meta has already formatted for display + * (e.g. "Available balance (₹50.00 INR)"); Graph exposes no separate + * number for it. + */ + funding_source_details?: { id?: string; display_string?: string; type?: number }; account_status?: number; } diff --git a/src/pages/Campaigns/index.tsx b/src/pages/Campaigns/index.tsx index 4e85db6..77bf295 100644 --- a/src/pages/Campaigns/index.tsx +++ b/src/pages/Campaigns/index.tsx @@ -134,10 +134,25 @@ export default function CampaignsPage() { {account && ( - + {account.is_prepay_account ? ( + // On a prepay account "balance" means amount owed, which is + // legitimately 0 even with money loaded — nothing has been + // billed yet. Meta only exposes the wallet amount as an + // already-formatted string, not a separate number, so that + // is what gets shown here instead of a confusing "0.00". + + ) : ( + + )}