mobile_authorization_api = client.mobile_authorization
MobileAuthorizationApi
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)
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. |
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
.
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)