All URIs are relative to https://connect.squareup.com
Method | HTTP request | Description |
---|---|---|
createDeviceCode | POST /v2/devices/codes | CreateDeviceCode |
getDeviceCode | GET /v2/devices/codes/{id} | GetDeviceCode |
listDeviceCodes | GET /v2/devices/codes | ListDeviceCodes |
Note: This endpoint is in beta.
CreateDeviceCodeResponse createDeviceCode(body)
CreateDeviceCode
Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected terminal mode.
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SquareConnect.DevicesApi();
var body = new SquareConnect.CreateDeviceCodeRequest(); // CreateDeviceCodeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
apiInstance.createDeviceCode(body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | CreateDeviceCodeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
- Content-Type: application/json
- Accept: application/json
Note: This endpoint is in beta.
GetDeviceCodeResponse getDeviceCode(id)
GetDeviceCode
Retrieves DeviceCode with the associated ID.
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SquareConnect.DevicesApi();
var id = "id_example"; // String | The unique identifier for the device code.
apiInstance.getDeviceCode(id).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The unique identifier for the device code. |
- Content-Type: application/json
- Accept: application/json
Note: This endpoint is in beta.
ListDeviceCodesResponse listDeviceCodes(opts)
ListDeviceCodes
Lists all DeviceCodes associated with the merchant.
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SquareConnect.DevicesApi();
var opts = {
'cursor': "cursor_example", // String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
'locationId': "locationId_example", // String | If specified, only returns DeviceCodes of the specified location. Returns DeviceCodes of all locations if empty.
'productType': "productType_example" // String | If specified, only returns DeviceCodes targeting the specified product type. Returns DeviceCodes of all product types if empty.
};
apiInstance.listDeviceCodes(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
cursor | String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See Paginating results for more information. | [optional] |
locationId | String | If specified, only returns DeviceCodes of the specified location. Returns DeviceCodes of all locations if empty. | [optional] |
productType | String | If specified, only returns DeviceCodes targeting the specified product type. Returns DeviceCodes of all product types if empty. | [optional] |
- Content-Type: application/json
- Accept: application/json