Square Subscriptions flow and recommended implementation

I want to implement subscriptions for my customers and not sure how is the best approach. I want to make sure I am not missing anything.
My idea would be to create a Plan record in my app then run the square subscription, and if the subscription was created okay updated the just created Plan record with subscription Id and card Id.
After that connect to a webhook for invoice paid and once that is done create an Order record in my app that is tied to the Plan record.

Is there a better way of implementing this? Should I not depend on the hooks?

I am just trying to figure the best possible way for me to keep the information I need as well as to run all the calls to the Square API. The issue appears if at any point I have a fail what would be the recommended practice?

If your plans are clearly defined and you’ve created them in the Catalog you can have the plan_id stored locally in your app. When the customer wants to create the subscription your app will first create the card on file with CreateCard then call CreateSubscription with all the plan_id and card_id.

With webhooks you’ll want to listen to the invoices webhook for notifications on subscriptions payments. With those events you’ll be able to make any additional API call to update the record in your app. :slightly_smiling_face: