You are viewing an old version of the API
Create mobile authorization code

Generates code to authorize a mobile application to connect to a Square card reader

Authorization codes are one-time-use and expire 60 minutes after being issued

Important: The Authorization header you provide to this endpoint must have the following format:

Authorization: Bearer ACCESS_TOKEN

Replace ACCESS_TOKEN with a valid production authorization credential.

Required permissions PAYMENTS_WRITE_IN_PERSON

Request Body

Name Description
location_id
string

The Square location ID the authorization code should be tied to.

Response Fields

Name Description
authorization_code
string

Generated authorization code that connects a mobile application instance to a Square account.

error
Error

An error object that provides details about how creation of authorization code failed.

expires_at
string

The timestamp when authorization_code expires in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z".

Examples

You are viewing an old version of the API
POST /mobile/authorization-code
cURL
  • cURL
  • Ruby
  • Python
curl https://connect.squareup.com/mobile/authorization-code \
  -X POST \
  -H 'Square-Version: 2019-11-20' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -d '{
    "location_id": "YOUR_LOCATION_ID"
  }'
Response JSON
{
  "authorization_code": "YOUR_MOBILE_AUTHORIZATION_CODE",
  "expires_at": "2019-01-10T19:42:08Z"
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?