#taviksha-akar_code
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/1278233732393861222
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- taviksha-akar_api, 1 day ago, 40 messages
- taviksha-akar_api, 4 days ago, 25 messages
- taviksha-akar_api, 5 days ago, 38 messages
- taviksha-akar_api, 6 days ago, 5 messages
- taviksha-akar_api, 6 days ago, 18 messages
- taviksha-akar_api, 6 days ago, 16 messages
and 1 more
When you create the Invoice Item on the Invoice, you would need to specify a Price Id. It belongs to a Product
You can then navigate to the Product to see any information you set there
$stripe->invoiceItems->create([
'customer' => $requestData['customer_id'],
'currency' => 'GBP',
'amount' => $tenPercentAmount * 100, // Stripe expects amount in cents
'description' => $description, // A description of the charge
'invoice' => $invoice->id
]);
this is code of invoice item create.
i have multiple products for which I am creating the invoice, So how can i pass multiple product ids here?
You can use the price field instead, coming from a Price: https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
price will take one price id so should i use price_data for multiple prouducts?
Should do the same
You can have multiple Invoice Item, each for one Price
and multiple Prices on a Product
Is it ok to create multiple invoice items for one invoice
Yes!
by doing this
"lines": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/invoices/in_1PsfhWIE5Vvk0efGMGCtJcvT/lines"
}
it is returing this resposne in invoice, why it is not retuning invoice items?
?
You may want to use this https://docs.stripe.com/api/invoiceitems/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
foreach ($requestData['products'] as $product) {
$stripe->invoiceItems->create([
'customer' => $customerId,
'price_data' => [
'currency' => 'gbp',
'product' => $product['stripe_product_id'],
'unit_amount' => 2000,
]
]);
}
this is my code to insert multiple invoice items , any idea why it is creating 0 amount invoice?
?
Did you specify the Invoice Id on each InvoiceItem?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
"message": "Coupon 50percentoff has duration=repeating and cannot be applied to one-time objects."
I am adding 'discounts' on creating invoice items
so this error is returned. Can you please suggest what does this error means?
That's because of the Coupon settings. When you create it specify duration=once