Migrate billing endpoints from billing-service to lc_api-go#281
Merged
Migrate billing endpoints from billing-service to lc_api-go#281
Conversation
Point the v2 Billing SDK at the lc_api-go paths under api.limacharlie.io/v1/ instead of the legacy billing.limacharlie.io service, which is being retired. Mirrors #280 against master. Paths updated: orgs/{oid}/status -> orgs/{oid}/billing/status orgs/{oid}/details -> orgs/{oid}/billing/details orgs/{oid}/invoice_url/... -> orgs/{oid}/billing/invoice/... user/self/plans -> plans All four methods drop the alt_root argument and now use the default api.limacharlie.io/v1/ base. Also updates the help topic to stop directing users to billing.limacharlie.io. Semantic parity was verified against billing-services/billing-service: - /billing/invoice returns only the first invoice per month; the legacy "urls"/"invoices" multi-invoice keys are gone. - /plans response is narrower ({id, name, region}) than the legacy shape that returned MetaProduct and a nested Datacenter block. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The billing.limacharlie.io host is deprecated; all its endpoints have
been folded into lc_api under api.limacharlie.io/v1/. Rather than
break existing callers of 'limacharlie api --target billing', rewrite
the legacy relative paths they pass to their new /v1/ counterparts
and route through the default api host.
Rewrites applied:
orgs/{oid}/status -> orgs/{oid}/billing/status
orgs/{oid}/details -> orgs/{oid}/billing/details
orgs/{oid}/invoice_url/{y}/{m} -> orgs/{oid}/billing/invoice/{y}/{m}
user/self/plans -> plans
Paths with no path change (user/self/auth, domain/{d}/auth,
orgs/{oid}/quota) pass through unchanged but still route to api.
Unrecognized paths also pass through — if a caller hits something
the legacy host served that never migrated, they get a 404 from
api.limacharlie.io instead of a DNS/connection error.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- test_sdk_billing.py: drop the BILLING_URL import/assertion and expect the new /v1/ relative paths with no alt_root. - test_api_cmd.py: replace test_billing_target (which asserted the old alt_root) with coverage of the compat shim — four rewrites (status, details, invoice_url, user/self/plans) plus a passthrough case for paths that kept their shape (user/self/auth). Full unit suite: 3105 passed, 5 skipped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
maximelb
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Billing functionality has been migrated server-side from the legacy
billing.limacharlie.ioservice tolc_api-go(served atapi.limacharlie.io/v1/). This PR points the v2BillingSDK at the new endpoints so consumers don't drift out of sync as the legacy service is retired.Mirrors #280 on master.
Path changes (
limacharlie/sdk/billing.py)get_statusorgs/{oid}/statusorgs/{oid}/billing/statusget_detailsorgs/{oid}/detailsorgs/{oid}/billing/detailsget_invoice_urlorgs/{oid}/invoice_url/{y}/{m}orgs/{oid}/billing/invoice/{y}/{m}get_plansuser/self/plansplansAll four methods drop the
alt_root=BILLING_URLargument and theBILLING_URLconstant is removed.limacharlie/help_topics.pyis updated to stop directing users tobilling.limacharlie.io.limacharlie api --target billingalias incommands/api_cmd.pyis intentionally left in place — it's a raw escape hatch and removing it is a caller-visible breaking change that doesn't belong in this PR.Semantic parity
Compared each migrated endpoint against its legacy counterpart in
billing-services/billing-service:/billing/invoice/{y}/{m}— lc_api-go returns only the first paid/open invoice for a month. The legacyurls[]/invoices[]multi-invoice keys are gone. Consumers readingresponse['url'](the common case) are unaffected./plans— response is narrower ({id, name, region}) vs the legacy shape ({ID, MetaProduct, Datacenter:{Name, Region}}). SDK returns the raw dict, so any consumer readingplan['ID']/plan['MetaProduct']/plan['Datacenter']needs to switch to the new keys./billing/status,/billing/details— identical response shape.Test plan
python3 -m astparse checktests/integration/test_billing.py::test_v2_billing_statusagainst a real orglimacharlie billing status|details|plans|invoiceCLI commands still work end-to-endurls[]/invoices[]response keys fromget_invoice_urlor legacy plan object fields fromget_plans🤖 Generated with Claude Code