Load JSON data into a PDF file on an iOS app

I have a couple of questions. I’m quite new to Swift, and I wanted to know if it’s possible to do a couple things. I am aware of how to setup the Terminal API thanks to the helpful videos, but the idea I have in mind for an app goes beyond that. Firstly, can I be able to connect to multiple Square Terminals with one device code? If so, how? Next, if every time someone makes a payment to a connected terminal, is there a way where just the payment details alone can be fetched in and loaded into a pdf on an iOS app, similar to how every time you make a purchase on a debit card, your actions immediately reflect in your bank account. Lastly, instead of using webhooks.site all the time, can I use Postman instead?

Hi @dantesauder welcome to the forums!

As far as I know device codes are a one-time use, so you would need to generate new ones each time you need to login to a separate terminal.

As for the payment part, the easiest thing would probably be listening for payment.created webhooks on a backend service (outside of Swift). When the webhook comes in, you would have all the payment details you need; as for generating a PDF that would be something outside of Square’s scope so unfortunately I do not have details on that.

As for not using webhooks.site…ideally you would want to actually have a server running somewhere. Postman will not work as Postman is used for making requests, but for webhooks you need a service listening for requests, so you probably would want to start your own backend service/server that is constantly live waiting for requests (webhooks) to come in.

Thanks for the warm welcome @sjosey, I see what you’re saying and yeah I did some research and realized you’d need a backend service similar to webhooks.site. The multiple device codes is kind of a bummer, but I’ll figure something out. Thanks for responding.