Skip to content

Link initial orders to subscriptions via relatedResources.subscriptionId (0.1.0a3) - #3

Merged
sandervanhooft merged 1 commit into
mainfrom
subscription-related-resources
Nov 13, 2026
Merged

sandervanhooft merged 1 commit into
mainfrom
subscription-related-resources

Conversation

@sandervanhooft

Copy link
Copy Markdown
Member

Vatlify Release 2 (#2910) adds lines[].relatedResources.subscriptionId to order lines. vatly-api-python 0.1.0a3 exposes it as OrderLine.related_resources.subscription_id.

  • Pin vatly-api-python==0.1.0a3 from PyPI and drop the vendored a2 wheel (scripts/check_package.py now resolves the SDK from PyPI).
  • link_order (used by order.paid and checkout.paid reactions and reconcile_checkout) links every subscription ID named by relatedResources.subscriptionId, plus subscription renewal product IDs. Plan product IDs are still never treated as subscription IDs.
  • reconcile_checkout fetches those subscriptions with the existing bounded 404 retries. It adds CheckoutResolution.unresolved_line_ids for signup lines whose subscriptionId is still null (reconcile again later; may never resolve). legacy_plan_ids now lists only plan lines without relatedResources (historical orders).
  • No customer or plan ownership fallback. Frozen order.paid snapshots can carry a null subscriptionId; explicit reconciliation reads the current order.
  • Version 0.1.0a3, changelog and docs.

Tests: the webhook out-of-order test and the reconcile test now use the real signup line shape (subscription_plan + relatedResources), including null/omitted relatedResources and {subscriptionId: null}. Both fail on the previous linkage code.

Require vatly-api-python==0.1.0a3 from PyPI and read
lines[].relatedResources.subscriptionId in link_order and
reconcile_checkout. Report unresolved signup lines separately from
historical plan lines. Release 0.1.0a3.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1d5e3-961e-74df-837f-34c2eb0f5a62
@sandervanhooft
sandervanhooft merged commit 693a6ef into main Nov 13, 2026
12 checks passed
@sandervanhooft
sandervanhooft deleted the subscription-related-resources branch November 13, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant