#shaharyarilyas
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- shaharyarilyas, 4 days ago, 10 messages
also how to create add one-time item to invoice
Did you click on Add one-time item and follow the steps to create an item?
{
currency: CURRENCY,
customer: "cus_P0Zl2JvoBlSQ2f",
days_until_due: 30,
collection_method: "send_invoice",
metadata: { user_id: _id, account_id },
},
{
stripeAccount: account_id,
}
);
const amountInCents = payload.product.amount * 100;
const product = await stripe.products.create(
{
name: payload.product.name,
description: payload?.product?.description || null,
default_price_data: {
unit_amount: amountInCents,
currency: CURRENCY,
},
},
{
stripeAccount: account_id,
}
);
const invoiceItem = await stripe.invoiceItems.create(
{
customer: "cus_P0Zl2JvoBlSQ2f",
price: product.default_price,
invoice: invoice.id,
quantity: 1,
currency: CURRENCY,
},
{
stripeAccount: account_id,
}
);```
i want to add product only one time using api
What is the issue with the code here?
the issue is items is not adding into invocie
Are you integrating with API or Dashboard? I'm confused. You should only use one of them for invoicing
integrating with api
in this screenshot, you can see items is not added
I see! If you just want to have one-time price for invoice item, i.e. not creating a permanent price, price_data field can be used: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.