frontier
frontier copied to clipboard
refactor(billing): Billing simplification entitlement usage
Summary
Simplify billing entitlement and usage APIs by automatically inferring billing_id from org_id. Clients now only need to provide org_id when calling these RPCs.
Changes
Proto Updates
- Deprecated
billing_idandproject_idfields in:CheckFeatureEntitlementRequestCreateBillingUsageRequestRevertBillingUsageRequest
- Updated proton ref to
4144445eb0f9cbd1a801a3d0aa5cfce4cc0ea551
Backend Updates
All handlers now always fetch billing_id from org_id:
CheckFeatureEntitlement: UsescustomerService.GetByOrgID()CreateBillingUsage: UsescustomerService.GetByOrgID()RevertBillingUsage: UsescustomerService.GetByOrgID()
Removed ensureBillingAccountBelongToOrg validation from CreateBillingUsage authorization interceptor (now redundant).
Error Handling
ErrNotFound: Empty response for CheckFeatureEntitlement, CodeNotFound for othersErrInvalidUUID/ErrInvalidID: CodeInvalidArgument- Other errors: CodeInternal with logging
Benefits
- Simpler API: Single required parameter (
org_id) - More secure: Users cannot provide arbitrary
billing_id - Consistent: Same behavior across all requests
- Cleaner code: No conditional logic for inferring billing_id
Breaking Changes
None - deprecated fields are still accepted for backward compatibility but ignored.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| frontier | Preview | Comment | Dec 4, 2025 5:01am |
Pull Request Test Coverage Report for Build 19918211554
Details
- 18 of 45 (40.0%) changed or added relevant lines in 2 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage increased (+0.001%) to 37.645%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| internal/api/v1beta1connect/billing_check.go | 12 | 15 | 80.0% |
| internal/api/v1beta1connect/billing_usage.go | 6 | 30 | 20.0% |
| <!-- | Total: | 18 | 45 |
| Totals | |
|---|---|
| Change from base Build 19819539745: | 0.001% |
| Covered Lines: | 15705 |
| Relevant Lines: | 41719 |