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(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Create Mobile Authorization Code Request Hash |
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 data
property in this instance returns the response data which is of type Create Mobile Authorization Code Response Hash
.
body = {
:location_id => 'YOUR_LOCATION_ID'
}
result = mobile_authorization_api.create_mobile_authorization_code(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end