#taviksha-akar_code

1 messages ¡ Page 1 of 1 (latest)

tawny lagoonBOT
#

👋 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.

weak cloud
#

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

static parcel
#

$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?

weak cloud
static parcel
#

price will take one price id so should i use price_data for multiple prouducts?

weak cloud
#

Should do the same

#

You can have multiple Invoice Item, each for one Price

#

and multiple Prices on a Product

static parcel
#

Is it ok to create multiple invoice items for one invoice

weak cloud
#

Yes!

static parcel
#

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?

#

?

weak cloud
static parcel
#

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?

#

?

weak cloud
#

Did you specify the Invoice Id on each InvoiceItem?

static parcel
#

"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?

weak cloud
#

That's because of the Coupon settings. When you create it specify duration=once

tawny lagoonBOT