Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.42 KB

mobile-authorization.md

File metadata and controls

55 lines (35 loc) · 1.42 KB

Mobile Authorization

mobile_authorization_api = client.mobile_authorization

Class Name

MobileAuthorizationApi

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.

def create_mobile_authorization_code(self,
                                    body)

Parameters

Parameter Type Tags Description
body Create Mobile Authorization Code Request Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Create Mobile Authorization Code Response

Example Usage

body = {}
body['location_id'] = 'YOUR_LOCATION_ID'

result = mobile_authorization_api.create_mobile_authorization_code(body)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)