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.