Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Latest commit

 

History

History
863 lines (585 loc) · 33.8 KB

V1EmployeesApi.md

File metadata and controls

863 lines (585 loc) · 33.8 KB

SquareConnect.V1EmployeesApi

All URIs are relative to https://connect.squareup.com

Method HTTP request Description
createEmployee POST /v1/me/employees CreateEmployee
createEmployeeRole POST /v1/me/roles CreateEmployeeRole
createTimecard POST /v1/me/timecards CreateTimecard
deleteTimecard DELETE /v1/me/timecards/{timecard_id} DeleteTimecard
listCashDrawerShifts GET /v1/{location_id}/cash-drawer-shifts ListCashDrawerShifts
listEmployeeRoles GET /v1/me/roles ListEmployeeRoles
listEmployees GET /v1/me/employees ListEmployees
listTimecardEvents GET /v1/me/timecards/{timecard_id}/events ListTimecardEvents
listTimecards GET /v1/me/timecards ListTimecards
retrieveCashDrawerShift GET /v1/{location_id}/cash-drawer-shifts/{shift_id} RetrieveCashDrawerShift
retrieveEmployee GET /v1/me/employees/{employee_id} RetrieveEmployee
retrieveEmployeeRole GET /v1/me/roles/{role_id} RetrieveEmployeeRole
retrieveTimecard GET /v1/me/timecards/{timecard_id} RetrieveTimecard
updateEmployee PUT /v1/me/employees/{employee_id} UpdateEmployee
updateEmployeeRole PUT /v1/me/roles/{role_id} UpdateEmployeeRole
updateTimecard PUT /v1/me/timecards/{timecard_id} UpdateTimecard

createEmployee

V1Employee createEmployee(body)

CreateEmployee

Use the CreateEmployee endpoint to add an employee to a Square account. Employees created with the Connect API have an initial status of `INACTIVE`. Inactive employees cannot sign in to Square Point of Sale until they are activated from the Square Dashboard. Employee status cannot be changed with the Connect API. Employee entities cannot be deleted. To disable employee profiles, set the employee's status to <code>INACTIVE</code>

Example

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.V1EmployeesApi();

var body = SquareConnect.V1EmployeesApi.constructFromObject({}); // V1Employee | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

apiInstance.createEmployee(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body V1Employee An object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

V1Employee

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createEmployeeRole

V1EmployeeRole createEmployeeRole(employeeRole)

CreateEmployeeRole

Creates an employee role you can then assign to employees. Square accounts can include any number of roles that can be assigned to employees. These roles define the actions and permissions granted to an employee with that role. For example, an employee with a &quot;Shift Manager&quot; role might be able to issue refunds in Square Point of Sale, whereas an employee with a &quot;Clerk&quot; role might not. Roles are assigned with the V1UpdateEmployee endpoint. An employee can have only one role at a time. If an employee has no role, they have none of the permissions associated with roles. All employees can accept payments with Square Point of Sale.

Example

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.V1EmployeesApi();

var employeeRole = SquareConnect.V1EmployeesApi.constructFromObject({}); // V1EmployeeRole | An EmployeeRole object with a name and permissions, and an optional owner flag.

apiInstance.createEmployeeRole(employeeRole).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
employeeRole V1EmployeeRole An EmployeeRole object with a name and permissions, and an optional owner flag.

Return type

V1EmployeeRole

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createTimecard

Note: This endpoint is deprecated.

V1Timecard createTimecard(body)

CreateTimecard

Creates a timecard for an employee and clocks them in with an `API_CREATE` event and a `clockin_time` set to the current time unless the request provides a different value. To import timecards from another system (rather than clocking someone in). Specify the `clockin_time` and* `clockout_time` in the request. Timecards correspond to exactly one shift for a given employee, bounded by the `clockin_time` and `clockout_time` fields. An employee is considered clocked in if they have a timecard that doesn't have a `clockout_time` set. An employee that is currently clocked in cannot be clocked in a second time.

Example

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.V1EmployeesApi();

var body = SquareConnect.V1EmployeesApi.constructFromObject({}); // V1Timecard | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

apiInstance.createTimecard(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body V1Timecard An object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

V1Timecard

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteTimecard

Note: This endpoint is deprecated.

Object deleteTimecard(timecardId)

DeleteTimecard

Deletes a timecard. Timecards can also be deleted through the Square Dashboard. Deleted timecards are still accessible through Connect API endpoints, but cannot be modified. The `deleted` field of the `Timecard` object indicates whether the timecard has been deleted. Note: By default, deleted timecards appear alongside valid timecards in results returned by the ListTimecards endpoint. To filter deleted timecards, include the `deleted` query parameter in the list request. Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API.

Example

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.V1EmployeesApi();

var timecardId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The ID of the timecard to delete.

apiInstance.deleteTimecard(timecardId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
timecardId String The ID of the timecard to delete.

Return type

Object

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listCashDrawerShifts

Note: This endpoint is deprecated.

[V1CashDrawerShift] listCashDrawerShifts(locationId, opts)

ListCashDrawerShifts

Provides the details for all of a location's cash drawer shifts during a date range. The date range you specify cannot exceed 90 days.

Example

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.V1EmployeesApi();

var locationId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The ID of the location to list cash drawer shifts for.

var opts = { 
  'order': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: ASC
  'beginTime': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days.
  'endTime': SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time.
};
apiInstance.listCashDrawerShifts(locationId, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
locationId String The ID of the location to list cash drawer shifts for.
order String The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: ASC [optional]
beginTime String The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days. [optional]
endTime String The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time. [optional]

Return type

[V1CashDrawerShift]

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listEmployeeRoles

[V1EmployeeRole] listEmployeeRoles(opts)

ListEmployeeRoles

Provides summary information for all of a business's employee roles.

Example

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.V1EmployeesApi();

var opts = { 
  'order': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | The order in which employees are listed in the response, based on their created_at field.Default value: ASC
  'limit': SquareConnect.V1EmployeesApi.constructFromObject({});, // Number | The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
  'batchToken': SquareConnect.V1EmployeesApi.constructFromObject({}); // String | A pagination cursor to retrieve the next set of results for your original query to the endpoint.
};
apiInstance.listEmployeeRoles(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
order String The order in which employees are listed in the response, based on their created_at field.Default value: ASC [optional]
limit Number The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. [optional]
batchToken String A pagination cursor to retrieve the next set of results for your original query to the endpoint. [optional]

Return type

[V1EmployeeRole]

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listEmployees

[V1Employee] listEmployees(opts)

ListEmployees

Provides summary information for all of a business's employees.

Example

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.V1EmployeesApi();

var opts = { 
  'order': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | The order in which employees are listed in the response, based on their created_at field.      Default value: ASC
  'beginUpdatedAt': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format
  'endUpdatedAt': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by there updated_at field, the end of the requested reporting period, in ISO 8601 format.
  'beginCreatedAt': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 format.
  'endCreatedAt': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their created_at field, the end of the requested reporting period, in ISO 8601 format.
  'status': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE).
  'externalId': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If provided, the endpoint returns only employee entities with the specified external_id.
  'limit': SquareConnect.V1EmployeesApi.constructFromObject({});, // Number | The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
  'batchToken': SquareConnect.V1EmployeesApi.constructFromObject({}); // String | A pagination cursor to retrieve the next set of results for your original query to the endpoint.
};
apiInstance.listEmployees(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
order String The order in which employees are listed in the response, based on their created_at field. Default value: ASC [optional]
beginUpdatedAt String If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format [optional]
endUpdatedAt String If filtering results by there updated_at field, the end of the requested reporting period, in ISO 8601 format. [optional]
beginCreatedAt String If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 format. [optional]
endCreatedAt String If filtering results by their created_at field, the end of the requested reporting period, in ISO 8601 format. [optional]
status String If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE). [optional]
externalId String If provided, the endpoint returns only employee entities with the specified external_id. [optional]
limit Number The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. [optional]
batchToken String A pagination cursor to retrieve the next set of results for your original query to the endpoint. [optional]

Return type

[V1Employee]

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listTimecardEvents

Note: This endpoint is deprecated.

[V1TimecardEvent] listTimecardEvents(timecardId)

ListTimecardEvents

Provides summary information for all events associated with a particular timecard. Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API.

Example

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.V1EmployeesApi();

var timecardId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The ID of the timecard to list events for.

apiInstance.listTimecardEvents(timecardId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
timecardId String The ID of the timecard to list events for.

Return type

[V1TimecardEvent]

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listTimecards

Note: This endpoint is deprecated.

[V1Timecard] listTimecards(opts)

ListTimecards

Provides summary information for all of a business's employee timecards.

Example

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.V1EmployeesApi();

var opts = { 
  'order': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | The order in which timecards are listed in the response, based on their created_at field.
  'employeeId': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If provided, the endpoint returns only timecards for the employee with the specified ID.
  'beginClockinTime': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their clockin_time field, the beginning of the requested reporting period, in ISO 8601 format.
  'endClockinTime': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their clockin_time field, the end of the requested reporting period, in ISO 8601 format.
  'beginClockoutTime': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their clockout_time field, the beginning of the requested reporting period, in ISO 8601 format.
  'endClockoutTime': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their clockout_time field, the end of the requested reporting period, in ISO 8601 format.
  'beginUpdatedAt': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format.
  'endUpdatedAt': SquareConnect.V1EmployeesApi.constructFromObject({});, // String | If filtering results by their updated_at field, the end of the requested reporting period, in ISO 8601 format.
  'deleted': SquareConnect.V1EmployeesApi.constructFromObject({});, // Boolean | If true, only deleted timecards are returned. If false, only valid timecards are returned.If you don't provide this parameter, both valid and deleted timecards are returned.
  'limit': SquareConnect.V1EmployeesApi.constructFromObject({});, // Number | The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
  'batchToken': SquareConnect.V1EmployeesApi.constructFromObject({}); // String | A pagination cursor to retrieve the next set of results for your original query to the endpoint.
};
apiInstance.listTimecards(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
order String The order in which timecards are listed in the response, based on their created_at field. [optional]
employeeId String If provided, the endpoint returns only timecards for the employee with the specified ID. [optional]
beginClockinTime String If filtering results by their clockin_time field, the beginning of the requested reporting period, in ISO 8601 format. [optional]
endClockinTime String If filtering results by their clockin_time field, the end of the requested reporting period, in ISO 8601 format. [optional]
beginClockoutTime String If filtering results by their clockout_time field, the beginning of the requested reporting period, in ISO 8601 format. [optional]
endClockoutTime String If filtering results by their clockout_time field, the end of the requested reporting period, in ISO 8601 format. [optional]
beginUpdatedAt String If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format. [optional]
endUpdatedAt String If filtering results by their updated_at field, the end of the requested reporting period, in ISO 8601 format. [optional]
deleted Boolean If true, only deleted timecards are returned. If false, only valid timecards are returned.If you don't provide this parameter, both valid and deleted timecards are returned. [optional]
limit Number The maximum integer number of employee entities to return in a single response. Default 100, maximum 200. [optional]
batchToken String A pagination cursor to retrieve the next set of results for your original query to the endpoint. [optional]

Return type

[V1Timecard]

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

retrieveCashDrawerShift

Note: This endpoint is deprecated.

V1CashDrawerShift retrieveCashDrawerShift(locationId, shiftId)

RetrieveCashDrawerShift

Provides the details for a single cash drawer shift, including all events that occurred during the shift.

Example

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.V1EmployeesApi();

var locationId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The ID of the location to list cash drawer shifts for.

var shiftId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The shift's ID.

apiInstance.retrieveCashDrawerShift(locationId, shiftId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
locationId String The ID of the location to list cash drawer shifts for.
shiftId String The shift's ID.

Return type

V1CashDrawerShift

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

retrieveEmployee

V1Employee retrieveEmployee(employeeId)

RetrieveEmployee

Provides the details for a single employee.

Example

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.V1EmployeesApi();

var employeeId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The employee's ID.

apiInstance.retrieveEmployee(employeeId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
employeeId String The employee's ID.

Return type

V1Employee

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

retrieveEmployeeRole

V1EmployeeRole retrieveEmployeeRole(roleId)

RetrieveEmployeeRole

Provides the details for a single employee role.

Example

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.V1EmployeesApi();

var roleId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The role's ID.

apiInstance.retrieveEmployeeRole(roleId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
roleId String The role's ID.

Return type

V1EmployeeRole

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

retrieveTimecard

Note: This endpoint is deprecated.

V1Timecard retrieveTimecard(timecardId)

RetrieveTimecard

Provides the details for a single timecard. <aside> Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API. </aside>

Example

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.V1EmployeesApi();

var timecardId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The timecard's ID.

apiInstance.retrieveTimecard(timecardId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
timecardId String The timecard's ID.

Return type

V1Timecard

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateEmployee

V1Employee updateEmployee(employeeId, body)

UpdateEmployee

Example

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.V1EmployeesApi();

var employeeId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The ID of the role to modify.

var body = SquareConnect.V1EmployeesApi.constructFromObject({}); // V1Employee | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

apiInstance.updateEmployee(employeeId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
employeeId String The ID of the role to modify.
body V1Employee An object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

V1Employee

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateEmployeeRole

V1EmployeeRole updateEmployeeRole(roleId, body)

UpdateEmployeeRole

Modifies the details of an employee role.

Example

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.V1EmployeesApi();

var roleId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | The ID of the role to modify.

var body = SquareConnect.V1EmployeesApi.constructFromObject({}); // V1EmployeeRole | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

apiInstance.updateEmployeeRole(roleId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
roleId String The ID of the role to modify.
body V1EmployeeRole An object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

V1EmployeeRole

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateTimecard

Note: This endpoint is deprecated.

V1Timecard updateTimecard(timecardId, body)

UpdateTimecard

Modifies the details of a timecard with an `API_EDIT` event for the timecard. Updating an active timecard with a `clockout_time` clocks the employee out.

Example

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.V1EmployeesApi();

var timecardId = SquareConnect.V1EmployeesApi.constructFromObject({}); // String | TThe ID of the timecard to modify.

var body = SquareConnect.V1EmployeesApi.constructFromObject({}); // V1Timecard | An object containing the fields to POST for the request. See the corresponding object definition for field details.

apiInstance.updateTimecard(timecardId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
timecardId String TThe ID of the timecard to modify.
body V1Timecard An object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

V1Timecard

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json