#Stefan
1 messages · Page 1 of 1 (latest)
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?
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.
Are you only trying to sync your data after a successful payment? If so, I think you could listen to invoice.paid , https://stripe.com/docs/api/events/types#event_types-invoice.paid event and then sync your data.
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.
Hmm, can you confirm what you mean by 'manually control the invoice that is created when updating a subscription'?
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