From d45ea127c255c8d8c9ce9359a37b17a08345f005 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Tue, 17 Feb 2026 20:07:04 -0800 Subject: [PATCH] use billing org id in get subscription status --- server/private/routers/billing/getOrgSubscriptions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/private/routers/billing/getOrgSubscriptions.ts b/server/private/routers/billing/getOrgSubscriptions.ts index d2ee8c5b..718c98f4 100644 --- a/server/private/routers/billing/getOrgSubscriptions.ts +++ b/server/private/routers/billing/getOrgSubscriptions.ts @@ -112,11 +112,13 @@ export async function getOrgSubscriptionsData( throw new Error(`Not found`); } + const billingOrgId = org[0].billingOrgId || org[0].orgId; + // Get customer for org const customer = await db .select() .from(customers) - .where(eq(customers.orgId, orgId)) + .where(eq(customers.orgId, billingOrgId)) .limit(1); const subscriptionsWithItems: Array<{