Applies to: Mobile Authorization API | Reader SDK
Learn how to request authorization tokens with a command-line tool to initialize Square mobile solutions like the Reader SDK.
Applies to: Mobile Authorization API | Reader SDK
Learn how to request authorization tokens with a command-line tool to initialize Square mobile solutions like the Reader SDK.
The Mobile Authorization API is used by the Reader SDK, which is now deprecated. This API will be retired along with the Reader SDK on December 31, 2025. Developers should migrate their application to the Mobile Payments SDK, which is the successor to the Reader SDK and contains its own authorization methods.
You should generate mobile authorization codes programmatically because they're short lived and cannot be hardcoded or reused. You might, however, need to generate a mobile authorization code manually during development.
To manually generate a mobile authorization code:
Paste the values into the following cURL command:
curl https://connect.squareup.com/mobile/authorization-code \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN' \
-d '{"location_id":"YOUR_LOCATION_ID"}'
You should get a response that looks like this:
squareup.com/mobile/authorization-code { "authorization_code": "YOUR_MOBILE_AUTHORIZATION_CODE", "expires_at": "2018-05-11T02:05:07Z" }
If you need more assistance, contact Developer and App Marketplace Support or ask for help in the Developer Forums.