#Stefan

1 messages · Page 1 of 1 (latest)

modern sleetBOT
somber spire
#

Hi, proration_behavior: always_invoice, https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior would send an invoice immediately for this proration. It returns 200, because the request succeeded. 500 error is something entirely different and you likely would not want this, https://stripe.com/docs/api/errors as it means something is wrong on Stripe's end. Can you add more details on what you're exactly trying to do step by step so I can see what solutions I can offer?

hearty comet
#

I need to do some data sync after stripe subscription is successfully updated and the payment went through.

Since POST /subscriptions/:id finishes successfully with 200 status code and the payment collection fails, I'm ending up with bad unsynced data.

somber spire
hearty comet
#

Ok. Webhooks are surely one way to do so. I'm actually looking for an alternative. Can I manually control the invoice that is created when updating a subscription ? So that I can attempt to process the invoice (collect payment) via an API call. If that fails, I can rollback the updated subscription and halt next operation.

somber spire
#

Hmm, can you confirm what you mean by 'manually control the invoice that is created when updating a subscription'?

hearty comet
#

I can see that Stripe exposes invoices api. Specifically, I was wondering if I can use POST /v1/invoices/:id/pay endpoint to controll the invoice that is automatically created after POST /subscriptions/:id (always_invoice) finishes