Skip to content

Expose relatedResources.subscriptionId on order lines and sync the OpenAPI spec - #76

Merged
sandervanhooft merged 1 commit into
mainfrom
feat/order-line-related-resources
Nov 13, 2026
Merged

sandervanhooft merged 1 commit into
mainfrom
feat/order-line-related-resources

Conversation

@sandervanhooft

Copy link
Copy Markdown
Member

Vatlify Release 2 is live in production. Order lines now carry lines[].relatedResources.subscriptionId. This PR brings the SDK in line.

  • OrderLine->relatedResources and OrderLineData->relatedResources (also on OrderPaid->lines) are a nullable OrderLineRelatedResources with a nullable subscriptionId.
    • null on historical and unrelated lines, and when the key is absent.
    • On an unresolved signup line the object is present with subscriptionId: null.
  • openapi.yaml is now byte-identical to the published bundle on vatlify production (SHA-256 5e648169…def9). That also adds the credit-note links.customerInvoice to the Refund and Chargeback schemas. The SDK already supported it; only the spec copy was stale.
  • The productType/productId docblocks now say that initial signup lines reference the plan (subscription_plan). Their behaviour is unchanged.
  • docs/Orders.md documents the order line properties. The changelog moves the entry to v0.1.0-alpha.33.

Additive: an optional last constructor argument defaulting to null. Webhook payloads are unchanged.

Tests cover a resolved signup line, an unresolved one, an unrelated null line and a missing key, through both GET /orders/{id} and OrderPaid. They fail without the hydration. Locally I also ran the bundle's own order example through WebhookEventFactory, and it hydrates as expected.

…enAPI spec

OrderLine and OrderLineData gain a nullable relatedResources with a
nullable subscriptionId: the subscription a signup, renewal or
immediate-update line belongs to. It is null on historical and unrelated
lines and when the key is absent; an unresolved signup line keeps the
object with a null subscriptionId.

openapi.yaml is synced with the published production bundle, which also
adds links.customerInvoice to the Refund and Chargeback schemas. The
productType/productId docblocks now describe the plan reference on
initial signup lines. Release v0.1.0-alpha.33 in the changelog.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d5d1-d2d3-71cb-987c-ca801d16b2ba
Co-authored-by: Amp <amp@ampcode.com>
@sandervanhooft
sandervanhooft merged commit 235fd1b into main Nov 13, 2026
12 checks passed
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