#abi_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.
- abi_error, 6 days ago, 12 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/1240290735199359078
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
When the customer pays, the checkout can have both subscription and one-off items on the Checkout
Are you trying to handle this using the API or the dashboard?
Technically, you can't refund based on checkout session object.
You'd need to find specific charge/payment intent ID to refund the payment.
yes, I am using the API. if I checkout just one of items, I have a payment intent that I can use to offer a refund, but if the checkout session has one off and subscription items, then I get an invoice object
so how do I refund in that case?
We have a support article on this: https://support.stripe.com/questions/refunding-credit-balance-to-customer-after-subscription-downgrade-or-cancellation
ok, that support article helps me understand how to downgrade or cancel a subscription and offer a refund.
Lets say the checkout has the following items
$10 One off Item x 2 = $20
$30 One Off Item x 3 = $90
$20 Monthly Subscription x 1 = $20
=====================
Checkout Session Total = $130
=====================
On checkout.session.completed webhook, the Session object's type will be Invoice and it will give me an invoice with 3 line items. Correct
so, if the customer wants a refund for $30 One Off Item x2, how do I go about doing that?
I basicaly need to refund $60 to the customer. Do I still use credit balance for the customer?
Ah so you don't really want to cancel the subscription. The invoice that these one-off items were part of should also have a PaymentIntent ID
You can use that to issue $60 refund
you mean the payment_intent on the Invoice object
Yup
will a Paid Invoice always have a payment intent? I am asking since the payment_intent object on the invoice is nullable
If the invoice is $0 then it won't have a PaymentIntent in which case that parameter would be null
ok
but if the customer wants a refund for a subscription on the above invoice, then we use the credit balance?
i have a similar questions once you answer the above one.
but if the customer wants a refund for a subscription on the above invoice, then we use the credit balance?
yes
ok, similar to the above, lets take the following
$10 One off Item x 2 = $20
$30 One Off Item x 3 = $90
$20 Monthly Subscription x 1 = $20
$40 Monthly Subscription x 1 = $40
=====================
Checkout Session Total = $170
=====================
Lets say the checkout has the following items. In this case, the Invoice would have Subscription Line Item with 2 Subscription LineItems. If I wanted to cancel the $40 subscription, would deleting the Subscription Item from the subscription be enough?
In this case, you'd just cancel the subscription right? Like one-off items won't be affected by cancellation
I'd recommend playing around with the API in test mode to understand the exact behavior here. That might help clarify things much faster
Ah sorry I think I misread your question.
In this case, you'd be updating the subscription to remove the $40 line item (which can be done by deleting the subscription item too)
and if the subscription item has multiple quantities `($40 Monthly Subscription x 2) and if the customer wants to reduce the quantity to 1, then reducing the quantity by updating the Subscription Item would do it right?
I have to take care of these scenarios, because the Stripe Customer Portal doesn't allow it
it doesn't allow altering the subscription items, only does till Subscriptions
Yeah just test it out in test mode. That should clear things up