I know how to get the customer using the API and to get all the subscriptions using the API.
Is there a single call I can do that gets all customers and include their subscriptions information?
Currently I would need to take them separately loop thru them and try to manually match them by Ids.
Any help is appreciated.
There isn’t a single call that would get you all the subscriptions and customer information. You’ll need to pull all the subscriptions and take the
customer_id and call the RetrieveCustomer to get all the information.
Would this be the recommended solution even if you have thousands of subscriptions with tens of thousand of customers.
Will I can blocked or anything If inside a loop of 1000 records I call the RetrieveCustomer method 1000 times? Will that scale performance wise?
Yeah, you can definitely do it this way. You’ll want to make sure you gracefully handle any
429s you may run into. Otherwise you’ll need to pull all the subscriptions and customers and parse the results in your database.
Calling the API inside the loop takes 2 minutes to display 150 customers.
What are my alternatives in implementing a table where I can see the customers from Square with their subscriptions information?
Currently, there isn’t any alternative aside from looping through the subscriptions to pull the customers. Are you looking to build a table that you’ll store in your database and manage?
My goal is the have a side by side comparison of squares and my information.
When I trigger a Cancel Subscription it might either cancel in my app but not square or viceversa.
While I trying to improve the application I want to design a page that show the current status of subscriptions from square displayed next to my systems status for the subscription.
Saving the data from square would defeat the purpose.
Any suggestion on how I can improve the speed or I can batch some API calls?
At this time there isn’t a way to batch the results. In the future I believe GraphQL will help accelerate the speed of the system but it’s currently not available with Customers and Subscriptions at this time.