Build with the Mobile Authorization API

Applies to: Mobile Authorization API | Reader SDK

Use the Mobile Authorization API to request authorization tokens to initialize Square mobile solutions like the Reader SDK.

Warning

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.

Link to section

Overview

To embed Square mobile development solutions, you must create a service to request mobile authorization codes. You should integrate this into your existing OAuth process if possible.

Link to section

Requirements and limitations

To build with the Mobile Authorization API, the following must be true:

  • You're using HTTPS - HTTPS is required for all production Square API calls. HTTP calls are only supported for developing and testing on localhost.
  • You're using production credentials - The Mobile Authorization API isn't supported in the Square Sandbox.

Additionally, you need the following information:

  • An active location ID - Copy a valid developer account location ID from the Production mode Locations setting page of your Square application in the Developer Console.
  • A valid access token - For more information, see Access Tokens and Other Square Credentials.
Link to section

Request a mobile authorization code

Add code to use the location ID and OAuth token to request a mobile authorization code. The authorization service should return the mobile authorization code to the calling application but for the sake of this example, Square simply prints it to the screen.

Create mobile authorization code

Important

Mobile authorization codes are short lived and should be used immediately to authorize mobile solutions like the Reader SDK. Mobile authorization doesn't expire after a set amount of time. Authorization remains valid unless it's explicitly revoked (for example, by calling deauthorize in the Reader SDK) or the authorized application fails to take a payment within 90 days.

Link to section

See also