#Square Connect Api đź’¸
####View on NPM npm install square-connect-api
Instantiate a SquareConnect client with the main export below, each instance method takes a callback
as the last argument with standard (err, response)
protocol.
Main Export, instantiates a Square Client
Kind: global class
- SquareConnect
- new SquareConnect(locationId, accessToken, [extendedDebugInfo])
- .getMerchantProfile(callback)
- .listLocations(callback)
- .listRoles([queryParams], callback)
- .getRole(roleId, callback)
- .createRole(data, callback)
- .updateRole(roleId, data, callback)
- .listEmployees([queryParams], callback)
- .getEmployee(employeeId, callback)
- .createEmployee(data, callback)
- .updateEmployee(squareEmployeeId, data, callback)
- .listTimecards(callback)
- .getTimecard(timecardId, callback)
- .createTimecard(data, callback)
- .updateTimecard(timecardId, data, callback)
- .deleteTimecard(timecardId, callback)
- .listTimecardEvents(timecardId, callback)
- .listCashDrawerShifts([queryParams], callback)
- .getCashDrawerShift(shiftId, callback)
- .listItems(callback)
- .createItem(data, callback)
- .getItem(itemId, callback)
- .updateItem(itemId, data, callback)
- .deleteItem(itemId, callback)
- .uploadItemImage(itemId, imageLocation, [fileName], callback)
- .listInventory([queryParams], callback)
- .adjustInventory(variationId, data, callback)
- .listCategories(callback)
- .createCategory(data, callback)
- .updateCategory(categoryId, data, callback)
- .deleteCategory(categoryId, callback)
- .createVariation(itemId, data, callback)
- .updateVariation(itemId, variationId, data, callback)
- .deleteVariation(itemId, variationId, callback)
- .listOrders([queryParams], callback)
- .getOrder(orderId, callback)
- .updateOrder(orderId, data, callback)
- .listBankAccounts(callback)
- .getBankAccount(bankAccountId, callback)
- .listPayments([queryParams], callback)
- .getPayment(paymentId, callback)
- .listSettlements([queryParams], callback)
- .getSettlement(settlementId, callback)
- .listRefunds([queryParams], callback)
- .createRefund(data, callback)
- .listDiscounts([queryParams], callback)
- .createDiscount(data, callback)
- .updateDiscount(discountId, data, callback)
- .deleteDiscount(discountId, callback)
- .listFees([queryParams], callback)
- .createFee(data, callback)
- .updateFee(feeId, data, callback)
- .deleteFee(feeId, callback)
- .applyFee(feeId, itemId, callback)
- .removeFee(feeId, itemId, callback)
- .listModifierLists(callback)
- .getModifierList(modifierListId, callback)
- .createModifierList(data, callback)
- .updateModifierList(modifierListId, data, callback)
- .deleteModifierList(modifierListId, callback)
- .applyModifierList(modifierListId, itemId, callback)
- .removeModifierList(modifierListId, itemId, callback)
- .createModifierOption(modifierListId, data, callback)
- .updateModifierOption(modifierListId, modifierOptionId, data, callback)
- .deleteModifierOption(modifierListId, modifierOptionId, callback)
- .listPages(callback)
- .createPage(data, callback)
- .updatePage(pageId, data, callback)
- .deletePage(pageId, callback)
- .updateCell(pageId, data, callback)
- .deleteCell(pageId, callback)
- .v2listLocations(callback)
- .listCustomers([queryParams], callback)
- .getCustomer(customerId, callback)
- .createCustomer(data, callback)
- .updateCustomer(customerId, data, callback)
- .deleteCustomer(customerId, callback)
- .createCustomerCard(customerId, data, callback)
- .deleteCustomerCard(customerId, cardId, callback)
- .listTransactions([queryParams], callback)
- .getTransaction(transactionId, callback)
- .voidTransaction(transactionId, callback)
- .chargeTransaction(data, callback)
- .captureTransaction(transactionId, callback)
- .createRefund(transactionId, callback)
- .listRefunds([queryParams], callback)
Param | Type | Default | Description |
---|---|---|---|
locationId | String |
Square Location ID | |
accessToken | String |
Access Token per location | |
[extendedDebugInfo] | Boolean |
false |
Extended response info, useful for debugging as Square doesn't always return an explicit error |
Returns known Square Data for Merchant based on Auth Token
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Returns a list of all locations for this merchant
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Returns known Square Roles for Merchant based on Instance Auth Token
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Returns a role, queried by Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
roleId | String |
Id of role to query Read More |
callback | function |
Creates a Role
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Updates a Role based on roleId and provided data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
roleId | String |
Role Id to Update |
data | Object |
Properties |
callback | function |
Returns Employees based on Instance Location Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Returns and Employee by employee Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
employeeId | String |
Employee Id to Fetch Read More |
callback | function |
Creates an employee
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Update Employee based on employee ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
squareEmployeeId | String |
Employee Id to Update |
data | Object |
Properties |
callback | function |
Lists timecards for an instance
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Gets a timecard based on Timecard Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
timecardId | String |
Timecard Id to fetch |
callback | function |
Read More |
Creates a timecard for an employee
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
takes data as a key:value object Properties |
callback | function |
Updates a timecard, takes in Timecard Id and Data Object
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
timecardId | String |
Timecard Id to update |
data | Object |
Properties |
callback | function |
Deletes a timecard
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
timecardId | String |
Id of Timecard to delete |
callback | function |
Read More |
Lists all known events for a timecard
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
timecardId | String |
Id of timecard to look up |
callback | function |
Read More |
Lists all Cash Drawer Shifts for an instance, takes optional parameters
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Gets Cash Drawer Details for a provided Shift Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
shiftId | String |
Shift Id to fetch |
callback | function |
Read More |
list Items based on location ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Creates an Item
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Fetches an Item based on Item ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
itemId | String |
item ID to fetch Read More |
callback | function |
Updates an Item
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
itemId | String |
Item ID to update |
data | Object |
Properties |
callback | function |
Deletes an Item
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
itemId | String |
Item ID to delete Read More |
callback | function |
Uploads an Item image. This function takes both url or file syste based locations. It will automatically generate the buffer and file extension data necessary for the Connect API
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
itemId | String |
Item Id to to receive the uploaded Image |
imageLocation | String |
Image URL or file system path |
[fileName] | String |
Optional fileName to provide when uploading, if not included, a filename will be parsed from the imageLocation |
callback | function |
Read More |
List Inventory of Items & Variations based on Location Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Adjusts inventory for a variation
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
variationId | String |
variation Id to adjust/update |
data | Object |
Properties |
callback | function |
list Categories based on location ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Creates a Category
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Updates a Category based on provided Category Id and Data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
categoryId | String |
Category Id to update |
data | Object |
Properties |
callback | function |
Deletes a Category
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
categoryId | String |
category ID to delete Read More |
callback | function |
Creates a Variation for an already created Item
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
itemId | String |
Item ID to create the Variation for |
data | Object |
Properties |
callback | function |
Updates a Variation for an already created Item and Variation
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
itemId | String |
Item ID for referencing child Variation |
variationId | String |
Variation ID to update the Variation for |
data | Object |
Properties |
callback | function |
Deletes a Variation for an Item
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
itemId | String |
Item ID for referencing child Variation |
variationId | String |
Variation ID to Delete Read More |
callback | function |
Lists orders for an instance, takes various query parameters
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Fetches an Order based on Order Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
orderId | String |
Order Id to fetch |
callback | function |
Updates an order based on Order Id and provided Data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
orderId | String |
Order Id to Update |
data | Object |
Properties |
callback | function |
Lists Bank Accounts for an Instance
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Fetches a Bank Account based on Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
bankAccountId | String |
Read More |
callback | function |
lists payments based on instance location ID, has various query parameters
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
fetches a payment based on payment ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
paymentId | String |
payment ID to fetch Read More |
callback | function |
lists Settlements based on instance location ID, has various query parameters
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Fetches a Settlement based on Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
settlementId | String |
Settlement Id to Fetch |
callback | function |
Read More |
lists Refunds based on instance location ID, has various query parameters
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Creates a refund
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Lists Discounts for an instance location, takes various query parameters
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Creates a Discount for a location based on provided data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Updates a Discount based on provided Discount Id and data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
discountId | String |
Discount Id to Update |
data | Object |
Properties |
callback | function |
Deletes a Discount based on provided Discount Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
discountId | String |
Discount Id to delete |
callback | function |
Read More |
Lists Fees for an instance location, takes various query parameters
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
Creates a Fee for a location based on provided data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Updates a Fee based on provided Fee Id and data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
feeId | String |
Fee Id to Update |
data | Object |
Properties |
callback | function |
Deletes a Fee based on provided Fee Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
feeId | String |
Fee Id to Delete |
callback | function |
Read More |
Applies a Fee to an Item based on provided Fee and Item Ids
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
feeId | String |
Fee Id to apply |
itemId | String |
Item Id that will receive the Fee |
callback | function |
Read More |
Removes a Fee from an Item based on provided Fee and Item Id's
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
feeId | String |
Fee Id to remove |
itemId | String |
Item Id to remove the Fee from |
callback | function |
Read More |
Lists Modifier Lists for an instance location
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Fetches a Modifier List based on provided Modifer List Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
modifierListId | String |
Modifier List Id to Fetch |
callback | function |
Read More |
Creates a Modifer List based on provided Data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Updates a Modifer List based on provided Modifier List Id and Data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
modifierListId | String |
Modifier List Id to Update |
data | Object |
Properties |
callback | function |
Deletes a Modifier List based on provided Modifier List Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
modifierListId | String |
Modifier List Id to Delete |
callback | function |
Applies a Modifier List to an Item based on provided Modifier List Id and Item Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
modifierListId | String |
Modifier List Id to Apply |
itemId | String |
Item Id to recieve the Modifier List |
callback | function |
Removes a Modifier List from an Item based on provided Modifier List Id and Item Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
modifierListId | String |
Modifier List Id to Remove |
itemId | String |
Item Id to remove the Modifier List from |
callback | function |
Creates a new Modifier Option for a Modifier List
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
modifierListId | String |
Modifier List Id to Create a new Option for |
data | Object |
Properties |
callback | function |
Updates a Modifier Option based on Id and Provided Data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
modifierListId | String |
Modifier List Id to Update |
modifierOptionId | String |
Modifier Optioin Id to Update |
data | Object |
Properties |
callback | function |
Deletes a Modfiier Option based on provided Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
modifierListId | String |
Modifier List Id to Modify |
modifierOptionId | String |
Modifier Option Id to Delete |
callback | function |
Read More |
Lists all pages for an Instace Location
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Creates a new Page with provided Data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Updates a Page based on provided Page Id and Data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
pageId | String |
Page Id to Update |
data | Object |
Properties |
callback | function |
Deletes a Page based on provided Page Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
pageId | String |
Page Id to Delete |
callback | function |
Read More |
Updates Cell Structure for a provided Page Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
pageId | String |
Page Id to Update |
data | Object |
Properties |
callback | function |
Delete all Cells on a page for provided Page Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
pageId | String |
Page Id to Delete cells from |
callback | function |
Lists Locations for the Square Connect API V2
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
callback | function |
Read More |
Lists Customers via instance Auth Token
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - >Properties |
callback | function |
Fetches a customer based on Customer ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
customerId | String |
customer ID to fetch Read More |
callback | function |
Creates a customer based on provided data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Updates a customer based on provided Customer ID and Customer Data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
customerId | String |
Customer ID to update |
data | Object |
Properties |
callback | function |
Deletes a customer based on proviced Customer Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
customerId | String |
Customer Id to Delete Read More |
callback | function |
Creates a card for provided Customer Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
customerId | String |
Customer ID to add card |
data | Object |
Properties |
callback | function |
Deletes a card associated with a customer
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
customerId | String |
provided Customer Id Read More |
cardId | String |
Card Id to delete |
callback | function |
lists transactions for a location, has various query parameters
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |
[description] |
Fetches a transaction based on Transaction ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
transactionId | String |
transaction ID to fetch Read More |
callback | function |
Voids a transaction based on Transaction ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
transactionId | String |
Transaction ID to void Read More |
callback | function |
Charges a transaction with provided data
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
data | Object |
Properties |
callback | function |
Captures a transaction based on Transaction ID
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
transactionId | String |
Read More |
callback | function |
Creates a refund for the provided Transaction Id
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
transactionId | String |
Transaction Id to refund |
callback | function |
Read More |
Lists Refunds for an instance
Kind: instance method of SquareConnect
Param | Type | Description |
---|---|---|
[queryParams] | Object |
takes a query as a key:value object and will automatically construct the query string for Square. - Properties |
callback | function |