Migrate billing endpoints from billing-service to lc_api-go#280
Merged
Migrate billing endpoints from billing-service to lc_api-go#280
Conversation
Point all Billing SDK methods at the lc_api-go paths under
api.limacharlie.io/v1/ instead of the legacy billing.limacharlie.io
service, which is being retired. 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
orgs/{oid}/sku-definitions -> orgs/{oid}/billing/sku
user/self/auth is unchanged in path but now routes to lc_api-go via
the default root. The legacy billing-service never actually served
/orgs/{oid}/sku-definitions, so getSkuDefinitions is now backed by
a real endpoint for the first time.
Semantic parity was verified against billing-services/billing-service
for each migrated endpoint; the only caller-visible differences are:
- /billing/invoice returns only the first invoice for a month; the
legacy "urls"/"invoices" multi-invoice keys are gone.
- /plans response is narrower ({id, name, region}) than the legacy
response that returned full plan objects with MetaProduct and a
nested Datacenter block.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
maximelb
approved these changes
Apr 23, 2026
4 tasks
lc-kirill
added a commit
that referenced
this pull request
Apr 23, 2026
* Migrate billing endpoints from billing-service to lc_api-go 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> * Reroute --target billing to lc_api as a compat shim 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> * Update billing unit tests for lc_api paths and api_cmd shim - 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> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 SDK at the new endpoints so consumers don't drift out of sync as the legacy service is retired.Mirrors go-limacharlie#237.
Path changes
getOrgStatusorgs/{oid}/statusorgs/{oid}/billing/statusgetOrgDetailsorgs/{oid}/detailsorgs/{oid}/billing/detailsgetOrgInvoiceURLorgs/{oid}/invoice_url/{y}/{m}orgs/{oid}/billing/invoice/{y}/{m}getAvailablePlansuser/self/plansplansgetSkuDefinitionsorgs/{oid}/sku-definitionsorgs/{oid}/billing/skugetUserAuthRequirementsuser/self/auth(billing root)user/self/auth(default root)All
altRoot = 'https://billing.limacharlie.io/'arguments are dropped; calls now use the defaultapi.limacharlie.io/v1/base fromManager._restCall.Side note:
billing-services/billing-servicenever actually served/orgs/{oid}/sku-definitions—getSkuDefinitionshad been pointed at a non-existent endpoint. It's now backed bylc_api-go's real/orgs/{oid}/billing/skuhandler.Semantic parity
Compared each migrated endpoint against its legacy counterpart in
billing-services/billing-service. Caller-visible differences:/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. Single-URL consumers (the common case) are unaffected./plans— response is narrower ({id, name, region}) than the legacy shape ({ID, MetaProduct, Datacenter:{Name, Region}}). The SDK passes responses through as dicts, so any consumer readingplan['ID']/plan['MetaProduct']/plan['Datacenter']needs to switch to the new keys./user/self/auth— error message for non-user identities unchanged; lc_api-go additionally returns a top-levelis_unified_billing./billing/status,/billing/details— identical response shape.Test plan
python3 -c 'import ast; ast.parse(open(\"limacharlie/Billing.py\").read())'passesBillingmethod against a real orgurls[]/invoices[]response keys fromgetOrgInvoiceURLor on the legacy plan object fields fromgetAvailablePlans🤖 Generated with Claude Code