#itaied

1 messages · Page 1 of 1 (latest)

robust graniteBOT
steady snow
#

Hi there!

#

You can't directly set metadata on the Invoice object when creating the Checkout Session. But you could add metadata on the Subscription object (like in your code), and then when you get the invoice.paid event, retrieve the corresponding Subscription to check its metadata.

glass spindle
#

ohh great! thanks!

#

invoice.subscription when will it be a string and when an object?
In the invoice,paid event, is it safe to assume it's a string?

dense drift
#

it's a string in an event body for a webhook

#

if you retrieve the Invoice from the API you can use expand:["subscription"] to have it return an object