CreatePayment endpoint of Square API

There is no way to generate the nonce outside of using the Payment Form or In-App Payments SDK. Those are used to securely capture the card details directly on Square servers.

Any other way would require you handling Personally Identifiable Information (PII) that needs to remain secure to maintain PCI compliance.