#snackdex

1 messages · Page 1 of 1 (latest)

upper coralBOT
sudden shale
#

Then you can use the Payment Intent the Invoice for the first Subscription Period generates with the PaymentSheet.

topaz bolt
#

is the invoice item field relevant only when it relates to the subscription?
in my scenario they are completely unrelated: purchasing a piece of candy and a membership subscription

sudden shale
#

The candy would show up as a separate line item on the Subscription's first Invoice, and would not show up again after that.

#

Typically add_invoice_items is used in scenarios like this, where the things you're adding are not part of the Subscription itself.

topaz bolt
#

oh sweet!

#

so just to make sure i follow:

  • front end makes a backend call to my api, sending the candy id and the membership subscription id that they want to purchase
  • my api creates a stripe subscription and adds the piece of candy as an invoice item
  • then what i get back from that i can pass it to my payment sheet? (and the total would include the subscription + the invoice items)
sudden shale
#

Yep, that's it in a nutshell.

#

You'll get back a Subscription, and you can expand latest_invoice.payment_intent to get to the Payment Intent.

topaz bolt
#

awesome. thank you so much

sudden shale
#

Happy to help!