feat(integrations): tell a vercel billing endpoint that is not enabled from a month with no costs
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- next.js, typescript
Research direction
Read the live vercel.billing.month_not_found logs from #748 first; the issue says they are needed to learn whether Vercel distinguishes the two 404 cases and how often the disabled endpoint occurs. Eddie must decide which option to pursue before implementation. If a change is chosen, start in src/lib/adapters/vercel/index.ts and its index.test.ts tests, then update docs/providers/vercel.md; done means tests cover both 404 meanings and a disabled endpoint produces the agreed billing error without spend readings.
Written by the indexing model from the issue text.
Description
Context
Vercel documents one 404 on GET /v1/billing/charges for two cases: "The endpoint is not enabled for this team, or no billing costs exist for it in the requested range." The reference and https://vercel.com/openapi.json give it no content schema and no error code (both re-read 2026-12-02; jq '.paths["/v1/billing/charges"].get.responses["404"]' returns only that description).
Since #748 (issue #729), the month request's 404 reads as a month to date of 0 and is logged as vercel.billing.month_not_found with the body's error.code when it has one (src/lib/adapters/vercel/index.ts:518-534 at 4efb943e). A team whose billing endpoint is not enabled therefore shows four verified_spend readings of 0 on every hourly sync (pollIntervalSeconds: 3600, index.ts:922) and no billing:read partial error. First-sync past days are already protected: they are stated only when one of the two requests answered 200 (index.ts:580-596).
The Fable review of #748 (review 6149166937) raised a way to tell the two 404s apart, and said it should wait until the log line shows whether the case occurs at all. Whether to do it, and how, is Eddie's decision.
| Option | Pros | Cons | Effort | Impact |
|---|---|---|---|---|
Status quo: a month 404 reads as 0 and is logged (index.ts:518-534) |
No extra request. The log line and its error.code show whether the not-enabled case happens at all before anything is built |
A not-enabled team sees a verified $0 month to date with no notice for as long as the endpoint stays off; only the server log knows | XS (nothing) | A team owner on Pro or Enterprise whose billing endpoint is off reads $0 spend on the dashboard indefinitely; no data loss, and it self-corrects the first sync after Vercel answers 200 |
Wider-range probe: when the month answers 404, request up to one year back (the documented maximum range); a second 404 returns PermissionMissingError(["billing:read"]) instead of zeros |
Grounded in the docs alone; turns the silent $0 into the same missing-permission notice a 403 gives (index.ts:503-516) |
One extra request per hourly sync while the month is empty, against a per team rate limit whose numbers are undocumented (docs/providers/vercel.md:502). Rests on a Pro team having a Purchase row every billing period, which comes from the review and is not confirmed in Vercel's docs. A team with no charge in a whole year would show a false missing-permission notice |
S | Same users as above get an honest notice instead of $0. Risk: a wrong notice for a team that really had no costs for a year, and rate limit pressure on the 1st of each month when every team's month is empty until its first billing day |
Classify by error.code: once live logs show two distinct codes on vercel.billing.month_not_found, map the not-enabled code to the billing:read partial error |
Exact, and no extra request | Depends on Vercel sending a code at all, which is undocumented; may never be possible. Needs live sync logs first | XS once a code is seen; nothing can be built before | Same users get an honest notice with no false positives, but only if Vercel's bodies differ |
Files each option touches:
| Option | Files |
|---|---|
| Status quo | none |
| Wider-range probe | src/lib/adapters/vercel/index.ts (syncBilling, readCharges), src/lib/adapters/vercel/index.test.ts, docs/providers/vercel.md |
Classify by error.code |
src/lib/adapters/vercel/index.ts (syncBilling), src/lib/adapters/vercel/index.test.ts, docs/providers/vercel.md |
Recommendation: keep the status quo until live logs exist, then choose. The deciding argument: the vercel.billing.month_not_found line with its error.code is the only evidence that can show whether the not-enabled case occurs and whether the cheaper exact option is possible, and it ships with #748. Second choice: classify by error.code, if the logs show two codes; the wider-range probe only if they do not and the case is seen in practice.
Plan
- Wait for live syncs with #748 deployed and read
vercel.billing.month_not_foundlines: how often per team, and whicherror.codevalues appear. - Eddie picks an option from the table above.
- Implement the chosen option in
syncBillingwith tests for both404meanings, and update the404bullet, the Unverified item, and the Sources entry indocs/providers/vercel.md.
Acceptance criteria
- Eddie's decision is recorded on this issue with the reasons that decided it
- If an option other than the status quo is chosen: a team whose billing endpoint is not enabled gets a
billing:readpartial error and no spend readings, and a team with no costs this month still gets a month to date of 0 - Unit tests cover both readings of the month
404; no Playwright coverage needed, because no UI changes
Files and areas
src/lib/adapters/vercel/index.ts, src/lib/adapters/vercel/index.test.ts, docs/providers/vercel.md. Non-goals: the first-sync past-day rule (already settled in #748), any other provider, any change to the dashboard's handling of a partial error.
Verification
npx vitest run src/lib/adapters/vercel src/lib/docs.test.ts, npm run typecheck, npm run lint.
Branch: <issue-number>-vercel-billing-not-enabled
Closes with a Closes #<issue-number> footer on the commit or pull request.
Model: anthropic/claude-opus-5-5 | Reasoning effort: low
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 2
- Avg merge
- 5h 20m
- Merged PRs (30d)
- 287
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eddiejaoude/StackDash
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
area: ops documentation priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
eddiejaoude/StackDash#796 ·
Maintainers usually reply within 1 day
-
area: docs documentation impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eddiejaoude/StackDash#790 ·
Maintainers usually reply within 1 day
-
area: ops bug impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eddiejaoude/StackDash#785 ·
Maintainers usually reply within 1 day
-
area: connections enhancement impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
eddiejaoude/StackDash#768 ·
Maintainers usually reply within 1 day
All issues in eddiejaoude/StackDash
Similar issues
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
effort/l priority/p1 risk/high triage/core
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
iflytek/skillhub#1188 · 1 comment ·
Maintainers usually reply within 1 day