#TonezeraBR - passing metadata
1 messages · Page 1 of 1 (latest)
Hello 👋
Can you share the API request where you try to pass the metadata?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
that's it
?
That's an event but I can start there
TonezeraBR - passing metadata
Okay so this is for a charge succeeding. When did you try to attach the metadata?
Since this happened because of a Checkout page, I will assume you added the metadata to a Checkout Session, correct?
yes
i try pass metadata in create session
Okay I see that added to the subscription_data in this request: https://dashboard.stripe.com/test/logs/req_9ittODaKV2P4MM
Because metadata from the Subscription will not pass down the Charge
The metadata is there on the Subscription
has an alternative, to pass and return data
But it does not get passed to the Invoice, Payment Intent, or Charge object
has an alternative, to pass and return data
What does that mean?
I'm trying to pass data that will be saved, and I'll return later when I have a successful payment
Is there an alternative other than metadata?
The data is saved on the Subscription. You can access it but you will need to make an additional API call
The Charge object that is returned in that event has an invoice property with the Invoice ID (in_XXXXx)
You can get the User ID you set in the Checkout Session by making an API call to retrieve the Invoice and expanding the subscription property on the Invoice object
Call this API using the Invoice ID: https://stripe.com/docs/api/invoices/retrieve
And use the expand keyword to expand the Subscription: https://stripe.com/docs/api/expanding_objects
Ok, thank you
You can write this into your code for handling the charge,succeeded event
I believe that with this I can already do what I thought, thank you