#Benoît
1 messages · Page 1 of 1 (latest)
What SKU IDs do you mean here? Are you referring to our Product API or some custom metadata you provided?
Can you share an example event ID I can look at to see how your invoices are set up?
The SKU ID used was "sku_G58sbWs4ZLPmkX", and it belongs to the product "prod_G58sARvgqnJmfV"
In the webhook payload, it seems it has created a new product : "prod_NrDp6Rb9cxZEgz". When i access this ID on the Stripe Dashboard, it says that this product has been archived
Where do you use that? I only see you using an ad-hoc invoice item on that invoice here:
https://dashboard.stripe.com/test/logs/req_IzQLcLCFR3Wi5Q
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yes, because you're defined an ad-hoc amount for the items, a temporary price/product is created for you
That part of our product API is deprecated, but you can more finely control price and product data by creating those yourself and setting metadata to map to other attributes of your system. We recommend setting up explicit Prices to create invoice items with:
https://stripe.com/docs/invoicing/integration#create-prices
Create a price for a product, with optional metadata:
const price = await stripe.prices.create({
product: '{{PRODUCT_ID}}',
unit_amount: 1000,
currency: 'usd',
// metadata: { ... },
});
Create invoice as you're doing already, then:
const invoiceItem = await stripe.invoiceItems.create({
customer: '{{CUSTOMER_ID}}',
price: '{{PRICE_ID}}',
invoice: '{{INVOICE_ID}}',
});
Could i use "metadata" in my invoiceItem object instead ?