Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 1.56 KB

mobile-authorization.md

File metadata and controls

57 lines (37 loc) · 1.56 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 codes 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

This method returns a ApiResponse instance. The body property of this instance returns the response data which is of type Create Mobile Authorization Code Response.

Example Usage

body = {
    'location_id': 'YOUR_LOCATION_ID'
}

result = mobile_authorization_api.create_mobile_authorization_code(body)
print(result)

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