About the system in the event of a failed subscription payment

How can I use the python API to detect that a user is not able to complete a subscription payment?

How does the system update the card information in the customer_card if the user fails to pay for the subscription?

Hi @koutaku welcome to the forums!

Right now, the only way to confirm that a subscription has not been paid for is to retrieve the subscription and check for the paid_until date. If the customer does not pay for the invoice, Square will currently still continue to send the invoice without canceling the subscription, as long as the subscription is active.

If the card on file fails to pay for the subscription, then the customer will be emailed an invoice instead. You can also subscribe to invoice.scheduled_charge_failed to get a notification that it failed. There’s also other invoice webhooks that are probably worth listening to, if you want to see when they were paid etc.