#abi_api

1 messages ¡ Page 1 of 1 (latest)

round knollBOT
amber flickerBOT
#

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.

round knollBOT
#

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

gloomy sail
#

When the customer pays, the checkout can have both subscription and one-off items on the Checkout

carmine locust
#

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.

gloomy sail
#

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?

gloomy sail
#

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?

carmine locust
#

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

gloomy sail
#

you mean the payment_intent on the Invoice object

carmine locust
#

Yup

gloomy sail
#

will a Paid Invoice always have a payment intent? I am asking since the payment_intent object on the invoice is nullable

carmine locust
#

If the invoice is $0 then it won't have a PaymentIntent in which case that parameter would be null

gloomy sail
#

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.

carmine locust
#

but if the customer wants a refund for a subscription on the above invoice, then we use the credit balance?
yes

gloomy sail
#

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?

carmine locust
#

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

gloomy sail
#

but there are 2 products with subscription

carmine locust
#

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)

gloomy sail
#

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?

carmine locust
#

Yup

#

I think so

gloomy sail
#

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

carmine locust
#

Yeah just test it out in test mode. That should clear things up