npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

square-connect-api

v0.0.5

Published

Node api wrapper for Square Connect v1 and v2

Downloads

15

Readme

#Square Connect Api :money_with_wings:

####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.

SquareConnect

Main Export, instantiates a Square Client

Kind: global class

new SquareConnect(locationId, accessToken, [extendedDebugInfo])

| 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 |

squareConnect.getMerchantProfile(callback)

Returns known Square Data for Merchant based on Auth Token

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.listLocations(callback)

Returns a list of all locations for this merchant

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.listRoles([queryParams], callback)

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 | |

squareConnect.getRole(roleId, callback)

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 | |

squareConnect.createRole(data, callback)

Creates a Role

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.updateRole(roleId, data, callback)

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 | |

squareConnect.listEmployees([queryParams], callback)

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 | |

squareConnect.getEmployee(employeeId, callback)

Returns and Employee by employee Id

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | employeeId | String | Employee Id to Fetch Read More | | callback | function | |

squareConnect.createEmployee(data, callback)

Creates an employee

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.updateEmployee(squareEmployeeId, data, callback)

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 | |

squareConnect.listTimecards(callback)

Lists timecards for an instance

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.getTimecard(timecardId, callback)

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 |

squareConnect.createTimecard(data, callback)

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 | |

squareConnect.updateTimecard(timecardId, data, callback)

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 | |

squareConnect.deleteTimecard(timecardId, callback)

Deletes a timecard

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | timecardId | String | Id of Timecard to delete | | callback | function | Read More |

squareConnect.listTimecardEvents(timecardId, callback)

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 |

squareConnect.listCashDrawerShifts([queryParams], callback)

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 | |

squareConnect.getCashDrawerShift(shiftId, callback)

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 |

squareConnect.listItems(callback)

list Items based on location ID

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.createItem(data, callback)

Creates an Item

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.getItem(itemId, callback)

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 | |

squareConnect.updateItem(itemId, data, callback)

Updates an Item

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | itemId | String | Item ID to update | | data | Object | Properties | | callback | function | |

squareConnect.deleteItem(itemId, callback)

Deletes an Item

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | itemId | String | Item ID to delete Read More | | callback | function | |

squareConnect.uploadItemImage(itemId, imageLocation, [fileName], callback)

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 |

squareConnect.listInventory([queryParams], callback)

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 | |

squareConnect.adjustInventory(variationId, data, callback)

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 | |

squareConnect.listCategories(callback)

list Categories based on location ID

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.createCategory(data, callback)

Creates a Category

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.updateCategory(categoryId, data, callback)

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 | |

squareConnect.deleteCategory(categoryId, callback)

Deletes a Category

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | categoryId | String | category ID to delete Read More | | callback | function | |

squareConnect.createVariation(itemId, data, callback)

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 | |

squareConnect.updateVariation(itemId, variationId, data, callback)

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 | |

squareConnect.deleteVariation(itemId, variationId, callback)

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 | |

squareConnect.listOrders([queryParams], callback)

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 | |

squareConnect.getOrder(orderId, callback)

Fetches an Order based on Order Id

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | orderId | String | Order Id to fetch | | callback | function | |

squareConnect.updateOrder(orderId, data, callback)

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 | |

squareConnect.listBankAccounts(callback)

Lists Bank Accounts for an Instance

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.getBankAccount(bankAccountId, callback)

Fetches a Bank Account based on Id

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | bankAccountId | String | Read More | | callback | function | |

squareConnect.listPayments([queryParams], callback)

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 | |

squareConnect.getPayment(paymentId, callback)

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 | |

squareConnect.listSettlements([queryParams], callback)

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 | |

squareConnect.getSettlement(settlementId, callback)

Fetches a Settlement based on Id

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | settlementId | String | Settlement Id to Fetch | | callback | function | Read More |

squareConnect.listRefunds([queryParams], callback)

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 | |

squareConnect.createRefund(data, callback)

Creates a refund

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.listDiscounts([queryParams], callback)

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 | |

squareConnect.createDiscount(data, callback)

Creates a Discount for a location based on provided data

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.updateDiscount(discountId, data, callback)

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 | |

squareConnect.deleteDiscount(discountId, callback)

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 |

squareConnect.listFees([queryParams], callback)

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 | |

squareConnect.createFee(data, callback)

Creates a Fee for a location based on provided data

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.updateFee(feeId, data, callback)

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 | |

squareConnect.deleteFee(feeId, callback)

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 |

squareConnect.applyFee(feeId, itemId, callback)

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 |

squareConnect.removeFee(feeId, itemId, callback)

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 |

squareConnect.listModifierLists(callback)

Lists Modifier Lists for an instance location

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.getModifierList(modifierListId, callback)

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 |

squareConnect.createModifierList(data, callback)

Creates a Modifer List based on provided Data

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.updateModifierList(modifierListId, data, callback)

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 | |

squareConnect.deleteModifierList(modifierListId, callback)

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 | |

squareConnect.applyModifierList(modifierListId, itemId, callback)

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 | |

squareConnect.removeModifierList(modifierListId, itemId, callback)

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 | |

squareConnect.createModifierOption(modifierListId, data, callback)

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 | |

squareConnect.updateModifierOption(modifierListId, modifierOptionId, data, callback)

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 | |

squareConnect.deleteModifierOption(modifierListId, modifierOptionId, callback)

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 |

squareConnect.listPages(callback)

Lists all pages for an Instace Location

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.createPage(data, callback)

Creates a new Page with provided Data

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.updatePage(pageId, data, callback)

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 | |

squareConnect.deletePage(pageId, callback)

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 |

squareConnect.updateCell(pageId, data, callback)

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 | |

squareConnect.deleteCell(pageId, callback)

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 | |

squareConnect.v2listLocations(callback)

Lists Locations for the Square Connect API V2

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | callback | function | Read More |

squareConnect.listCustomers([queryParams], callback)

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 | |

squareConnect.getCustomer(customerId, callback)

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 | |

squareConnect.createCustomer(data, callback)

Creates a customer based on provided data

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.updateCustomer(customerId, data, callback)

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 | |

squareConnect.deleteCustomer(customerId, callback)

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 | |

squareConnect.createCustomerCard(customerId, data, callback)

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 | |

squareConnect.deleteCustomerCard(customerId, cardId, callback)

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 | |

squareConnect.listTransactions([queryParams], callback)

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] |

squareConnect.getTransaction(transactionId, callback)

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 | |

squareConnect.voidTransaction(transactionId, callback)

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 | |

squareConnect.chargeTransaction(data, callback)

Charges a transaction with provided data

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | data | Object | Properties | | callback | function | |

squareConnect.captureTransaction(transactionId, callback)

Captures a transaction based on Transaction ID

Kind: instance method of SquareConnect

| Param | Type | Description | | --- | --- | --- | | transactionId | String | Read More | | callback | function | |

squareConnect.createRefund(transactionId, callback)

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 |

squareConnect.listRefunds([queryParams], callback)

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 | |