#jenOng
1 messages · Page 1 of 1 (latest)
You would add it as another parameter in that update request: https://stripe.com/docs/api/metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So something like:
proration_behavior: 'always_invoice',
items: [
{
id: payload.subscriptionItemId,
plan: payload.newPlan.yearly_price_id,
},
],
proration_date: payload.prorationDate,
metadata: {
'order_id': '6735',
},
});```
I've tried this, however, when I check the charge.succeeded event, the metadata does not show.
Metadata isn't automatically copied between objects
Metadata on the Subscription will get copied to the Invoice Items that are associated with the subscription but it won't get copied to the payments
You can copy the metadata down to the charge when you get that event, but you will need to retrieve it from the subscription itself first