Skip to content

Invoice: Add property 'parent'#254

Merged
adrienverge merged 1 commit intomasterfrom
feat/invoice-parent
Jan 26, 2026
Merged

Invoice: Add property 'parent'#254
adrienverge merged 1 commit intomasterfrom
feat/invoice-parent

Conversation

@adrienverge
Copy link
Owner

This property is supposed to be present in the newer Stripe API version "basil":
https://docs.stripe.com/api/invoices/object?api-version=2025-08-27.basil
… and supposed to be absent in the older Stripe API version "acacia": https://docs.stripe.com/api/invoices/object?api-version=2025-02-24.acacia

However, in practice it is returned by both (tested with curl -H 'Stripe-Version: 2025-02-24.acacia and 2025-08-27.basil: there are differences, but parent is always present).

Here is what is return by the real Stripe for an invoice that is generated in the context of a subscription:

"parent": {
  "quote_details": null,
  "subscription_details": {
    "metadata": {},
    "subscription": "sub_1SiWhdKxWWXl12QBvneJqzRY"
  },
  "type": "subscription_details"
}

And for a draft invoice unrelated to any subscription:

"parent": null

This commit adapts localstripe to mimick this.

This property is supposed to be present in the newer Stripe API version
"basil":
https://docs.stripe.com/api/invoices/object?api-version=2025-08-27.basil
… and supposed to be absent in the older Stripe API version "acacia":
https://docs.stripe.com/api/invoices/object?api-version=2025-02-24.acacia

However, in practice it is returned by both (tested with `curl -H
'Stripe-Version: 2025-02-24.acacia` and `2025-08-27.basil`: there are
differences, but `parent` is always present).

Here is what is return by the real Stripe for an invoice that is
generated in the context of a subscription:

    "parent": {
      "quote_details": null,
      "subscription_details": {
        "metadata": {},
        "subscription": "sub_1SiWhdKxWWXl12QBvneJqzRY"
      },
      "type": "subscription_details"
    }

And for a draft invoice unrelated to any subscription:

    "parent": null

This commit adapts localstripe to mimick this.
@adrienverge adrienverge merged commit 2db7829 into master Jan 26, 2026
12 checks passed
@adrienverge adrienverge deleted the feat/invoice-parent branch January 26, 2026 13:12
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.

3 participants