#pro-pooja_api
1 messages · Page 1 of 1 (latest)
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.
- pro-pooja_webhooks, 5 days ago, 61 messages
- pro-pooja_api, 6 days ago, 25 messages
👋 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.
What's the invoice ID?
in_1PDhoAGVCe8mF8QWKm6f5Gxn
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
The invoice item request wasnt' successful, and that's why the invoice amount is 0
$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?
https://dashboard.stripe.com/test/logs/req_retK9xutaiMrhy you check the request log, the resposne error message already explained why the request failed.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I need to charge user for that subscription price than what is the workaround or what is the ideal way of doing it?
Create another price with the same amount and without recurring
when proration is applied how does stripe under hood create invoice for that price ?
I don't think proration is applicable for one-off invoices.
When the proration is applied on subscription , I want to replicate the same action of creating an immediate invoice
Why not just let stripe billing create the invoice for you? why do you want to create the invoice by yourself?
Due to cutom requirement of application 🥲
I'd suggest you to push back. Proration is complicated and you don't want to do it by yourself.
I don't to replicate complete proration behavior, I just need to charge user and create the invoice.
But how do you plan to come up with the prorated amount?
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
Then just create another price with the same amount and without recurring, like what I suggested earlier.
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
I don't think you can change the price unit_amount after the price is already used.
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.
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?
If I edit price for this price id - price_1NhR3dGVCe8mF8QWgyYzRzLg
Then I have to update this price id -price_1PDioXGVCe8mF8QWhtG9NeMi
I don't think you can update the unit_amount on an existing price, I believe I've mentioned it earlier.
For the subscription item or for one-off ?
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
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
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 ?