Keys / Square
SQUARE_TOKEN
The access token your server calls the Square API with. A personal access token has full access to your Square account.
- Expires
- never, for personal access tokens
- API
- none for personal access tokens; Developer Console only
Get it
Create one on developer.squareup.com/apps. The steps aren't recorded yet.
Set it
SQUARE_TOKEN=...
The Node.js, Python, Go, Java, .NET, PHP and Ruby SDKs read it from this variable when you don't pass a token. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Each application has one production and one Sandbox token. Open the application in the Developer Console, choose Credentials, and replace the token for that environment.
- Square's docs don't say whether the old token keeps working after you replace it. Plan for it to stop.
- Deploy the new token everywhere that reads
SQUARE_TOKEN.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.
Sources, checked 2026-11-16
- Square: Access tokens and other Square credentials
- Square: Move OAuth from the Sandbox to production
- Square: Node.js SDK quickstart
- Square Developer Forums: RevokeToken error for a personal access token
- square-nodejs-sdk: reads SQUARE_TOKEN
- square-python-sdk: reads SQUARE_TOKEN
- square-go-sdk: reads SQUARE_TOKEN
- square-java-sdk: reads SQUARE_TOKEN
- square-dotnet-sdk: reads SQUARE_TOKEN
- square-php-sdk: reads SQUARE_TOKEN
- square-ruby-sdk: reads SQUARE_TOKEN