Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.51 KB

mobile-authorization.md

File metadata and controls

57 lines (36 loc) · 1.51 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(body:)

Parameters

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.

Response Type

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.

Example Usage

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