#pro-pooja_api

1 messages · Page 1 of 1 (latest)

pure ingotBOT
tame cradleBOT
#

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.

pure ingotBOT
#

👋 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/1237301388028153936

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

dense yew
#

What's the invoice ID?

fair hinge
#

in_1PDhoAGVCe8mF8QWKm6f5Gxn

dense yew
#

The invoice item request wasnt' successful, and that's why the invoice amount is 0

fair hinge
#

$invoice = $this->stripe->invoices->create([
'customer' => $customerId,
"collection_method" => "charge_automatically",
'subscription' => $subscription,
]);
$this->stripe->invoiceItems->create([
'customer' => $customerId,
'subscription' => $subscription,
'invoice' => $invoice->id,
'quantity' => 1,
'price' => 'price_1NhR3dGVCe8mF8QWgyYzRzLg'
]);

This is the code I am using, can you please help me identify, what is wrong here?

dense yew
fair hinge
#

I need to charge user for that subscription price than what is the workaround or what is the ideal way of doing it?

dense yew
#

Create another price with the same amount and without recurring

fair hinge
#

when proration is applied how does stripe under hood create invoice for that price ?

dense yew
#

I don't think proration is applicable for one-off invoices.

fair hinge
#

When the proration is applied on subscription , I want to replicate the same action of creating an immediate invoice

dense yew
#

Why not just let stripe billing create the invoice for you? why do you want to create the invoice by yourself?

fair hinge
#

Due to cutom requirement of application 🥲

dense yew
#

I'd suggest you to push back. Proration is complicated and you don't want to do it by yourself.

fair hinge
#

I don't to replicate complete proration behavior, I just need to charge user and create the invoice.

dense yew
#

But how do you plan to come up with the prorated amount?

fair hinge
#

Prorated amount does not needs to be calculated, I need to charge whatever the product's price.
For example - this price id - price_1NhR3dGVCe8mF8QWgyYzRzLg * quantity

£5(price per unit)* 1 = £5

dense yew
#

Then just create another price with the same amount and without recurring, like what I suggested earlier.

fair hinge
#

If the products price change we need to change that also. Is this is only solution? I need to rely on only one source of truth for pricing

dense yew
#

I don't think you can change the price unit_amount after the price is already used.

fair hinge
#

If we update the subscription products price on stripe. Right now, we are charging £5 and increase to £10 then need to create either new one-off price or update the existing one-off price, you are suggestting to create.

#

Don't want to depend on two pricing, one for subscription item and other one-off price.

dense yew
#

I don't quite understand what you want to achieve here. You already said you want to change the price of a subscription from £5 to £10, and yet you said you want to keep one price only.

#

Perhaps you want to walk me through with a concrete example so that I can have a better understanding?

fair hinge
#

If I edit price for this price id - price_1NhR3dGVCe8mF8QWgyYzRzLg
Then I have to update this price id -price_1PDioXGVCe8mF8QWhtG9NeMi

dense yew
#

I don't think you can update the unit_amount on an existing price, I believe I've mentioned it earlier.

tame cradleBOT
fair hinge
#

For the subscription item or for one-off ?

pure ingotBOT
uneven marsh
#

Hey! Taking over for my colleague. Could you please explain this further? what you want to acheive exactly ?

If I edit price for this price id - price_1NhR3dGVCe8mF8QWgyYzRzLg
Then I have to update this price id -price_1PDioXGVCe8mF8QWhtG9NeMi

fair hinge
#

Ohhh no 🥲

#

I need to create invoice and attach invoice items to for the subscription.
Due to some custom requirement we need to create it manually.
How can I create one-off pricing same like this price id - price_1NkTOOGVCe8mF8QWwVFHwdVC

uneven marsh
#

I need to create invoice and attach invoice items to for the subscription.
Why not creating a Subscirption and add customer invoice items to it ?