#ryan3358_invoice-metadata

1 messages ยท Page 1 of 1 (latest)

broken daggerBOT
#

๐Ÿ‘‹ 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/1372631648268718120

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

kind geode
#

As you can see the finalization of the invoice contains metadata, but the top right doesnt have it

#

Which is then present here in the webhook body

past tangle
#

Hi ๐Ÿ‘‹

How are you creating these Invoices?

kind geode
#

JS library

past tangle
#

Sorry that's not what I am asking. What API calls are you making to Stripe to create these Invoices?

kind geode
#

const invoice = await stripe.invoices.create({
customer: customerId,
collection_method: "send_invoice",
description: bundleData.bundleName,
metadata: {
bundle_name: bundleData.bundleName,
bundle_id: bundleId,
bundle_approval_id: bundleApprovalId
},
application_fee_amount: X
days_until_due: 1,
lines: {}
}, {
stripeAccount: connectAccountId,
// apiKey: testMode ? STRIPE_PLATFORM_TEST_SECRET : STRIPE_PLATFORM_LIVE_SECRE });

past tangle
#

Okay so the screenshot you shared shows that the Invoice has the metadata. But what webhook event are you listening for?

kind geode
#

console logged bundleData, bundleId, bundleApporovalId prior so I know it has access to it in the method call

#

invoice.paid

past tangle
#

Do you have an example event ID I could look at?

kind geode
#

const invoice = await stripe.invoices.create({
customer: customerId,
collection_method: "send_invoice",
description: bundleData.bundleName,
metadata: {
bundle_name: bundleData.bundleName,
bundle_id: bundleId,
bundle_approval_id: bundleApprovalId
},
application_fee_amount: 3750, // DO THE PRORATING LATER
days_until_due: 1,
lines: {}
}, {
stripeAccount: connectAccountId,
// apiKey: testMode ? STRIPE_PLATFORM_TEST_SECRET : STRIPE_PLATFORM_LIVE_SECRET
});

#

sorry

#

evt_1RNiGwIG0PHzRMlg219zEgad

past tangle
#

Thanks, taking a look

junior nebula
#

evt_1RP5jOIG0PHzRMlgLDwPEXfB

past tangle
#

The metadata property on Invoice in_1RNiDNIG0PHzRMlgrSup4FoW from event evt_1RNiGwIG0PHzRMlg219zEgad is empty.

#

I see a lot of update requests. Did it get unset at some point?

#

Oh wait, metadata was never set on this invoice

#

For evt_1RP5jOIG0PHzRMlgLDwPEXfB, the Invoice does have metadata

#

But that event is an invoice.finalized event, not invoice.paid

broken daggerBOT