---
title: "CreateMobileAuthorizationCode"
method: POST
path: "/mobile/authorization-code"
tags: ["MobileAuthorization"]
---

# CreateMobileAuthorizationCode

`POST /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](https://developer.squareup.com/docs/build-basics/access-tokens).

## Request body

- CreateMobileAuthorizationCodeRequest — Defines the body parameters that can be provided in a request to the __CreateMobileAuthorizationCode__ endpoint.
  - `location_id` string — The Square location ID the authorization code should be tied to.

## Response `200`

Success

- CreateMobileAuthorizationCodeResponse — Defines the fields that are included in the response body of a request to the __CreateMobileAuthorizationCode__ endpoint.
  - `authorization_code` string — Generated authorization code that connects a mobile application instance to a Square account.
  - `error` Error — Represents an error encountered during a request to the Connect API. See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information.
    - `category` string, required — The high-level category for the error.
    - `code` string, required — The specific code of the error.
    - `detail` string — A human-readable description of the error for debugging purposes.
    - `field` string — The name of the field provided in the original request (if any) that the error pertains to.
  - `expires_at` string — The timestamp when `authorization_code` expires in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, e.g., "2016-09-04T23:59:33.123Z".

---

[API](https://skmtc.net/square/apis/squareup.md) · [All operations](https://skmtc.net/square/apis/squareup/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/square/squareup/revisions/8d95e3639487/schema)
