#sahillakhwani_api
1 messages ¡ Page 1 of 1 (latest)
đ 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/1394551481079824545
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Invoice ID is #1D0493F7-0008
hi there, could you share with my the invoice ID? it would be prefixed with in_xxxx
@ornate pier it looks like the invoice's paymentIntent has been cancelled due to multiple declines: https://dashboard.stripe.com/payments/pi_3Rh3J2Loz3M8FCeu0kghwK2d
let me check
To share abit more, it is expected for payment intents to get cancelled after multiple failed retries. There's a variable limit to how many times a PaymentIntent can be confirmed: https://docs.stripe.com/api/payment_intents/confirm
how can I query that payment intent using APIs?
Do you mean retrieving it from the API using the PaymentIntent ID?
yeah
here you go: https://docs.stripe.com/api/payment_intents/retrieve
you can call GET /v1/payment_intents/:id ; there's a code sample in curl on the page I linked above
ok, I see the cancelled_at field set to a value, does that indicate this payment intent was cancelled?
Yes you can use that field. You could also look up the PaymentIntent's status using the status param: https://docs.stripe.com/api/payment_intents/object#payment_intent_object-status
ok, and the reason is multiple declines?
yes
ok, what's the solution for this? Should the user check their payment method?
And should I raise a new invoice?
You will need to raise a new invoice
I see that in_1Rfz8kLoz3M8FCeut1417gwC is actually linked to a subscription
yeah it is
What you could consider is leave in_1Rfz8kLoz3M8FCeut1417gwC as-is for now. Then, raise a one-time invoice of the same payment amount and share the new invoice payment link with the customer for payment. Once the new invoice has been paid, you can manually mark in_1Rfz8kLoz3M8FCeut1417gwC as paid so that the subscription can continue
You can then add a reference on in_1Rfz8kLoz3M8FCeut1417gwC mentioning that it was paid using another invoice
ok, and Stripe won't try to pay for this current invoice anymore right?
Nope. Stripe will not retry payments on in_1Rfz8kLoz3M8FCeut1417gwC anymore. The underlying payment intent has already been cancelled and that's a terminal state.
ok, is it possible to mark invoice as paid using API? ( I can find the API, just wanted to know if it is possible)
Yes, this is the API endpoint: https://docs.stripe.com/api/invoices/pay#pay_invoice-paid_out_of_band
thanks
just to confirm, this just marks the invoice as paid and doesn't actually charge the user right?
yup! I would encourage you to test it in Sandbox or Test Mode to be familiar with how it works first