#natesmith_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1425653453472010370
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! You set the metadata on the subscription_data, so it will only show on the corresponding subscription object.
If you want it to show on the Checkout Session, you must also set the metadata in https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata. Give it a try and see if it works
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
no dice with this event id: evt_1SG8ffBjUrRZ1WNLZzY7CmfH
async function testCheckout() {
const metadata = {
test: 'this is a test',
};
const sessionData: Stripe.Checkout.SessionCreateParams = {
ui_mode: 'custom',
customer: 'cus_TBTF68oO3or4nI',
payment_method_types: ['card'],
line_items: [
{
price: 'price_1SExEHBjUrRZ1WNL1aSwOKmS',
quantity: 1,
},
],
metadata,
mode: 'subscription',
return_url: 'https://example.com',
subscription_data: {
metadata, // Metadata attached to the subscription
},
};
console.log('๐ ~ testCheckout ~ sessionData:', sessionData);
const session = await stripe.checkout.sessions.create(sessionData);
console.log('๐ ~ testCheckout ~ session:', session);
}
https://dashboard.stripe.com/test/logs/req_rkNYrO9p0HtyXv - i don't see you passing in metadata in the Checkout Session when you created cs_test_a11SUuwfjftJdaU8m4tChL6oc1GhIDv7a0U2oSZQe0BpTSEbcnJlnVbiFO
you are right. Idk why that happened though. I mustve not properly change my clientSecretPromise.
evt_1SG8m0BjUrRZ1WNL0jiJjC1j
we are good now
how would I get this info to also propagate to invoice events?
If you pass the metadata into subscription_data.metadata (this is for mode="subscription") - the Subscription will contain that metadata, and so will the Invoice Line Items : https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-metadata
great! feel free to reach out again if you're running into issue ๐
thanks man I really appreciate it. having someone to reach out to when these things can be hard to find in the many docs is a real game changer
โ๏ธ Stripe developers have stepped away for a short while
Please leave your questions here, and weโll respond as soon as we're back! If you need help urgently, you can contact Stripe support for help.