Skip to content

TypeScript types are invalid when expanding responses #1556

@isaachinman

Description

@isaachinman

Describe the bug

When expanding responses as per the documentation here, the return types for various Stripe methods are not updated to accurately reflect the modified responses.

To Reproduce

const stripeCustomer = await stripe.customers.retrieve(
  stripeCustomerId,
  {
    expand: ['subscriptions'],
  },
)

Expected behavior

The returned data does indeed contain a nested subscriptions object:

"subscriptions": {
  "object": "list",
  "data": [...]
}

However, the TypeScript types do not declare this at all.

Code snippets

No response

OS

macOS

Node version

Node v16.4.2

Library version

stripe-node v10.8.0

API version

2022-08-01

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions