0.0.5 • Published 7 years ago

square-connect-api v0.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

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

ParamTypeDefaultDescription
locationIdStringSquare Location ID
accessTokenStringAccess Token per location
extendedDebugInfoBooleanfalseExtended 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

ParamTypeDescription
callbackfunctionRead More

squareConnect.listLocations(callback)

Returns a list of all locations for this merchant

Kind: instance method of SquareConnect

ParamTypeDescription
callbackfunctionRead More

squareConnect.listRoles(queryParams, callback)

Returns known Square Roles for Merchant based on Instance Auth Token

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.getRole(roleId, callback)

Returns a role, queried by Id

Kind: instance method of SquareConnect

ParamTypeDescription
roleIdStringId of role to query Read More
callbackfunction

squareConnect.createRole(data, callback)

Creates a Role

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.updateRole(roleId, data, callback)

Updates a Role based on roleId and provided data

Kind: instance method of SquareConnect

ParamTypeDescription
roleIdStringRole Id to Update
dataObjectProperties
callbackfunction

squareConnect.listEmployees(queryParams, callback)

Returns Employees based on Instance Location Id

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.getEmployee(employeeId, callback)

Returns and Employee by employee Id

Kind: instance method of SquareConnect

ParamTypeDescription
employeeIdStringEmployee Id to Fetch Read More
callbackfunction

squareConnect.createEmployee(data, callback)

Creates an employee

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.updateEmployee(squareEmployeeId, data, callback)

Update Employee based on employee ID

Kind: instance method of SquareConnect

ParamTypeDescription
squareEmployeeIdStringEmployee Id to Update
dataObjectProperties
callbackfunction

squareConnect.listTimecards(callback)

Lists timecards for an instance

Kind: instance method of SquareConnect

ParamTypeDescription
callbackfunctionRead More

squareConnect.getTimecard(timecardId, callback)

Gets a timecard based on Timecard Id

Kind: instance method of SquareConnect

ParamTypeDescription
timecardIdStringTimecard Id to fetch
callbackfunctionRead More

squareConnect.createTimecard(data, callback)

Creates a timecard for an employee

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjecttakes data as a key:value object Properties
callbackfunction

squareConnect.updateTimecard(timecardId, data, callback)

Updates a timecard, takes in Timecard Id and Data Object

Kind: instance method of SquareConnect

ParamTypeDescription
timecardIdStringTimecard Id to update
dataObjectProperties
callbackfunction

squareConnect.deleteTimecard(timecardId, callback)

Deletes a timecard

Kind: instance method of SquareConnect

ParamTypeDescription
timecardIdStringId of Timecard to delete
callbackfunctionRead More

squareConnect.listTimecardEvents(timecardId, callback)

Lists all known events for a timecard

Kind: instance method of SquareConnect

ParamTypeDescription
timecardIdStringId of timecard to look up
callbackfunctionRead More

squareConnect.listCashDrawerShifts(queryParams, callback)

Lists all Cash Drawer Shifts for an instance, takes optional parameters

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.getCashDrawerShift(shiftId, callback)

Gets Cash Drawer Details for a provided Shift Id

Kind: instance method of SquareConnect

ParamTypeDescription
shiftIdStringShift Id to fetch
callbackfunctionRead More

squareConnect.listItems(callback)

list Items based on location ID

Kind: instance method of SquareConnect

ParamTypeDescription
callbackfunctionRead More

squareConnect.createItem(data, callback)

Creates an Item

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.getItem(itemId, callback)

Fetches an Item based on Item ID

Kind: instance method of SquareConnect

ParamTypeDescription
itemIdStringitem ID to fetch Read More
callbackfunction

squareConnect.updateItem(itemId, data, callback)

Updates an Item

Kind: instance method of SquareConnect

ParamTypeDescription
itemIdStringItem ID to update
dataObjectProperties
callbackfunction

squareConnect.deleteItem(itemId, callback)

Deletes an Item

Kind: instance method of SquareConnect

ParamTypeDescription
itemIdStringItem ID to delete Read More
callbackfunction

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

ParamTypeDescription
itemIdStringItem Id to to receive the uploaded Image
imageLocationStringImage URL or file system path
fileNameStringOptional fileName to provide when uploading, if not included, a filename will be parsed from the imageLocation
callbackfunctionRead More

squareConnect.listInventory(queryParams, callback)

List Inventory of Items & Variations based on Location Id

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.adjustInventory(variationId, data, callback)

Adjusts inventory for a variation

Kind: instance method of SquareConnect

ParamTypeDescription
variationIdStringvariation Id to adjust/update
dataObjectProperties
callbackfunction

squareConnect.listCategories(callback)

list Categories based on location ID

Kind: instance method of SquareConnect

ParamTypeDescription
callbackfunctionRead More

squareConnect.createCategory(data, callback)

Creates a Category

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.updateCategory(categoryId, data, callback)

Updates a Category based on provided Category Id and Data

Kind: instance method of SquareConnect

ParamTypeDescription
categoryIdStringCategory Id to update
dataObjectProperties
callbackfunction

squareConnect.deleteCategory(categoryId, callback)

Deletes a Category

Kind: instance method of SquareConnect

ParamTypeDescription
categoryIdStringcategory ID to delete Read More
callbackfunction

squareConnect.createVariation(itemId, data, callback)

Creates a Variation for an already created Item

Kind: instance method of SquareConnect

ParamTypeDescription
itemIdStringItem ID to create the Variation for
dataObjectProperties
callbackfunction

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

Updates a Variation for an already created Item and Variation

Kind: instance method of SquareConnect

ParamTypeDescription
itemIdStringItem ID for referencing child Variation
variationIdStringVariation ID to update the Variation for
dataObjectProperties
callbackfunction

squareConnect.deleteVariation(itemId, variationId, callback)

Deletes a Variation for an Item

Kind: instance method of SquareConnect

ParamTypeDescription
itemIdStringItem ID for referencing child Variation
variationIdStringVariation ID to Delete Read More
callbackfunction

squareConnect.listOrders(queryParams, callback)

Lists orders for an instance, takes various query parameters

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.getOrder(orderId, callback)

Fetches an Order based on Order Id

Kind: instance method of SquareConnect

ParamTypeDescription
orderIdStringOrder Id to fetch
callbackfunction

squareConnect.updateOrder(orderId, data, callback)

Updates an order based on Order Id and provided Data

Kind: instance method of SquareConnect

ParamTypeDescription
orderIdStringOrder Id to Update
dataObjectProperties
callbackfunction

squareConnect.listBankAccounts(callback)

Lists Bank Accounts for an Instance

Kind: instance method of SquareConnect

ParamTypeDescription
callbackfunctionRead More

squareConnect.getBankAccount(bankAccountId, callback)

Fetches a Bank Account based on Id

Kind: instance method of SquareConnect

ParamTypeDescription
bankAccountIdStringRead More
callbackfunction

squareConnect.listPayments(queryParams, callback)

lists payments based on instance location ID, has various query parameters

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.getPayment(paymentId, callback)

fetches a payment based on payment ID

Kind: instance method of SquareConnect

ParamTypeDescription
paymentIdStringpayment ID to fetch Read More
callbackfunction

squareConnect.listSettlements(queryParams, callback)

lists Settlements based on instance location ID, has various query parameters

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.getSettlement(settlementId, callback)

Fetches a Settlement based on Id

Kind: instance method of SquareConnect

ParamTypeDescription
settlementIdStringSettlement Id to Fetch
callbackfunctionRead More

squareConnect.listRefunds(queryParams, callback)

lists Refunds based on instance location ID, has various query parameters

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.createRefund(data, callback)

Creates a refund

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.listDiscounts(queryParams, callback)

Lists Discounts for an instance location, takes various query parameters

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.createDiscount(data, callback)

Creates a Discount for a location based on provided data

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.updateDiscount(discountId, data, callback)

Updates a Discount based on provided Discount Id and data

Kind: instance method of SquareConnect

ParamTypeDescription
discountIdStringDiscount Id to Update
dataObjectProperties
callbackfunction

squareConnect.deleteDiscount(discountId, callback)

Deletes a Discount based on provided Discount Id

Kind: instance method of SquareConnect

ParamTypeDescription
discountIdStringDiscount Id to delete
callbackfunctionRead More

squareConnect.listFees(queryParams, callback)

Lists Fees for an instance location, takes various query parameters

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction

squareConnect.createFee(data, callback)

Creates a Fee for a location based on provided data

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.updateFee(feeId, data, callback)

Updates a Fee based on provided Fee Id and data

Kind: instance method of SquareConnect

ParamTypeDescription
feeIdStringFee Id to Update
dataObjectProperties
callbackfunction

squareConnect.deleteFee(feeId, callback)

Deletes a Fee based on provided Fee Id

Kind: instance method of SquareConnect

ParamTypeDescription
feeIdStringFee Id to Delete
callbackfunctionRead More

squareConnect.applyFee(feeId, itemId, callback)

Applies a Fee to an Item based on provided Fee and Item Ids

Kind: instance method of SquareConnect

ParamTypeDescription
feeIdStringFee Id to apply
itemIdStringItem Id that will receive the Fee
callbackfunctionRead 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

ParamTypeDescription
feeIdStringFee Id to remove
itemIdStringItem Id to remove the Fee from
callbackfunctionRead More

squareConnect.listModifierLists(callback)

Lists Modifier Lists for an instance location

Kind: instance method of SquareConnect

ParamTypeDescription
callbackfunctionRead More

squareConnect.getModifierList(modifierListId, callback)

Fetches a Modifier List based on provided Modifer List Id

Kind: instance method of SquareConnect

ParamTypeDescription
modifierListIdStringModifier List Id to Fetch
callbackfunctionRead More

squareConnect.createModifierList(data, callback)

Creates a Modifer List based on provided Data

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.updateModifierList(modifierListId, data, callback)

Updates a Modifer List based on provided Modifier List Id and Data

Kind: instance method of SquareConnect

ParamTypeDescription
modifierListIdStringModifier List Id to Update
dataObjectProperties
callbackfunction

squareConnect.deleteModifierList(modifierListId, callback)

Deletes a Modifier List based on provided Modifier List Id

Kind: instance method of SquareConnect

ParamTypeDescription
modifierListIdStringModifier List Id to Delete
callbackfunction

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

ParamTypeDescription
modifierListIdStringModifier List Id to Apply
itemIdStringItem Id to recieve the Modifier List
callbackfunction

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

ParamTypeDescription
modifierListIdStringModifier List Id to Remove
itemIdStringItem Id to remove the Modifier List from
callbackfunction

squareConnect.createModifierOption(modifierListId, data, callback)

Creates a new Modifier Option for a Modifier List

Kind: instance method of SquareConnect

ParamTypeDescription
modifierListIdStringModifier List Id to Create a new Option for
dataObjectProperties
callbackfunction

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

Updates a Modifier Option based on Id and Provided Data

Kind: instance method of SquareConnect

ParamTypeDescription
modifierListIdStringModifier List Id to Update
modifierOptionIdStringModifier Optioin Id to Update
dataObjectProperties
callbackfunction

squareConnect.deleteModifierOption(modifierListId, modifierOptionId, callback)

Deletes a Modfiier Option based on provided Id

Kind: instance method of SquareConnect

ParamTypeDescription
modifierListIdStringModifier List Id to Modify
modifierOptionIdStringModifier Option Id to Delete
callbackfunctionRead More

squareConnect.listPages(callback)

Lists all pages for an Instace Location

Kind: instance method of SquareConnect

ParamTypeDescription
callbackfunctionRead More

squareConnect.createPage(data, callback)

Creates a new Page with provided Data

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.updatePage(pageId, data, callback)

Updates a Page based on provided Page Id and Data

Kind: instance method of SquareConnect

ParamTypeDescription
pageIdStringPage Id to Update
dataObjectProperties
callbackfunction

squareConnect.deletePage(pageId, callback)

Deletes a Page based on provided Page Id

Kind: instance method of SquareConnect

ParamTypeDescription
pageIdStringPage Id to Delete
callbackfunctionRead More

squareConnect.updateCell(pageId, data, callback)

Updates Cell Structure for a provided Page Id

Kind: instance method of SquareConnect

ParamTypeDescription
pageIdStringPage Id to Update
dataObjectProperties
callbackfunction

squareConnect.deleteCell(pageId, callback)

Delete all Cells on a page for provided Page Id

Kind: instance method of SquareConnect

ParamTypeDescription
pageIdStringPage Id to Delete cells from
callbackfunction

squareConnect.v2listLocations(callback)

Lists Locations for the Square Connect API V2

Kind: instance method of SquareConnect

ParamTypeDescription
callbackfunctionRead More

squareConnect.listCustomers(queryParams, callback)

Lists Customers via instance Auth Token

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - >Properties
callbackfunction

squareConnect.getCustomer(customerId, callback)

Fetches a customer based on Customer ID

Kind: instance method of SquareConnect

ParamTypeDescription
customerIdStringcustomer ID to fetch Read More
callbackfunction

squareConnect.createCustomer(data, callback)

Creates a customer based on provided data

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.updateCustomer(customerId, data, callback)

Updates a customer based on provided Customer ID and Customer Data

Kind: instance method of SquareConnect

ParamTypeDescription
customerIdStringCustomer ID to update
dataObjectProperties
callbackfunction

squareConnect.deleteCustomer(customerId, callback)

Deletes a customer based on proviced Customer Id

Kind: instance method of SquareConnect

ParamTypeDescription
customerIdStringCustomer Id to Delete Read More
callbackfunction

squareConnect.createCustomerCard(customerId, data, callback)

Creates a card for provided Customer Id

Kind: instance method of SquareConnect

ParamTypeDescription
customerIdStringCustomer ID to add card
dataObjectProperties
callbackfunction

squareConnect.deleteCustomerCard(customerId, cardId, callback)

Deletes a card associated with a customer

Kind: instance method of SquareConnect

ParamTypeDescription
customerIdStringprovided Customer Id Read More
cardIdStringCard Id to delete
callbackfunction

squareConnect.listTransactions(queryParams, callback)

lists transactions for a location, has various query parameters

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunctiondescription

squareConnect.getTransaction(transactionId, callback)

Fetches a transaction based on Transaction ID

Kind: instance method of SquareConnect

ParamTypeDescription
transactionIdStringtransaction ID to fetch Read More
callbackfunction

squareConnect.voidTransaction(transactionId, callback)

Voids a transaction based on Transaction ID

Kind: instance method of SquareConnect

ParamTypeDescription
transactionIdStringTransaction ID to void Read More
callbackfunction

squareConnect.chargeTransaction(data, callback)

Charges a transaction with provided data

Kind: instance method of SquareConnect

ParamTypeDescription
dataObjectProperties
callbackfunction

squareConnect.captureTransaction(transactionId, callback)

Captures a transaction based on Transaction ID

Kind: instance method of SquareConnect

ParamTypeDescription
transactionIdStringRead More
callbackfunction

squareConnect.createRefund(transactionId, callback)

Creates a refund for the provided Transaction Id

Kind: instance method of SquareConnect

ParamTypeDescription
transactionIdStringTransaction Id to refund
callbackfunctionRead More

squareConnect.listRefunds(queryParams, callback)

Lists Refunds for an instance

Kind: instance method of SquareConnect

ParamTypeDescription
queryParamsObjecttakes a query as a key:value object and will automatically construct the query string for Square. - Properties
callbackfunction
0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago