#tungtn1099

1 messages · Page 1 of 1 (latest)

flat bloomBOT
rose oriole
#

👋 Hi there, Happy to help!

worthy sage
#

I'm quite confuse about the type

#

When is it string and when is it Stripe.Invoice

rose oriole
#

that propoerty is an expandable one. By default it has the InvoiceId (as a String)

#

if you expand that field you'll get an Invoice object

worthy sage
#

how do i expand it?

rose oriole
#

For example, in your use case:

    const subscription = await stripe.subscriptions.create({
      customer: customerId,
      items: [{
        price: priceId,
      }],
      payment_behavior: 'default_incomplete',
      payment_settings: { save_default_payment_method: 'on_subscription' },
      expand: ['latest_invoice.payment_intent'],
    });
worthy sage
#

i see, thanks!

#

so if i dont expand it anywhere

#

it just gives me the invoice's id?

rose oriole
#

Yes correct.

worthy sage
#

thanks :D