Socket
Socket
Sign inDemoInstall

square-connect

Package Overview
Dependencies
38
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    square-connect

JavaScript client library for the Square Connect v2 API


Version published
Maintainers
1
Install size
4.03 MB
Created

Changelog

Source

Version 4.20200812.2 (2020-08-12T00:00)

API releases

  • Subscriptions API (beta):
    • For an overview, see Square Subscriptions.
    • For technical reference, see Subscriptions API.

Existing API updates

  • Catalog API
    • CatalogSubscriptionPlan (beta). This catalog type is added in support of the Subscriptions API. Subscription plans are stored as catalog object of the SUBSCRIPTION_PLAN type. For more information, see Set Up and Manage a Subscription Plan.

SqPaymentForm SDK updates

Documentation updates

Readme

Source

Square logo

Square Connect Node SDK


Build Status npm version Apache-2 license

NOTICE: Square Connect Node.js SDK deprecated

This Square Connect SDK will enter a security maintenance phase in Q4 2020 and will be RETIRED (EOL) in Q2 2021. In the security maintenance phase, this SDK will continue to receive support and security patches but will no longer receive bug fixes or product updates. Once it is retired, support and security patches will no longer be available. A new SDK, more bespoke to the language, will be available once this SDK enters its security maintenance phase. The SDK itself will continue to work indefinitely until such time that the underlying APIs are retired at which point portions of the SDK may stop functioning. For a full list of API retirement dates, please see our Square API Lifecycle documentation.

Security MaintenanceNew SDK ReleaseRetired (EOL)
Q4, 2020Q4, 2020Q2, 2021

If you have feedback about the new SDKs, or just want to talk to other Square Developers, request an invite to the new slack community for Square Developers

Requirements

Node.js 6.0 or later

Installation

For Node.js

To install the SDK:

npm install square-connect --save

Getting Started

Please follow the installation instruction and execute the following JS code:

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 api = new SquareConnect.LocationsApi();

api.listLocations().then(function(data) {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data, 0, 1));
}, function(error) {
  console.error(error);
});

How to configure sandbox environment

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Set sandbox url
defaultClient.basePath = 'https://connect.squareupsandbox.com';
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
// Set sandbox access token
oauth2.accessToken = "YOUR SANDBOX ACCESS TOKEN";
// Pass client to API
var api = new SquareConnect.LocationsApi();

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
SquareConnect.ApplePayApiregisterDomainPOST /v2/apple-pay/domainsRegisterDomain
SquareConnect.BankAccountsApigetBankAccountGET /v2/bank-accounts/{bank_account_id}GetBankAccount
SquareConnect.BankAccountsApigetBankAccountByV1IdGET /v2/bank-accounts/by-v1-id/{v1_bank_account_id}GetBankAccountByV1Id
SquareConnect.BankAccountsApilistBankAccountsGET /v2/bank-accountsListBankAccounts
SquareConnect.CashDrawersApilistCashDrawerShiftEventsGET /v2/cash-drawers/shifts/{shift_id}/eventsListCashDrawerShiftEvents
SquareConnect.CashDrawersApilistCashDrawerShiftsGET /v2/cash-drawers/shiftsListCashDrawerShifts
SquareConnect.CashDrawersApiretrieveCashDrawerShiftGET /v2/cash-drawers/shifts/{shift_id}RetrieveCashDrawerShift
SquareConnect.CatalogApibatchDeleteCatalogObjectsPOST /v2/catalog/batch-deleteBatchDeleteCatalogObjects
SquareConnect.CatalogApibatchRetrieveCatalogObjectsPOST /v2/catalog/batch-retrieveBatchRetrieveCatalogObjects
SquareConnect.CatalogApibatchUpsertCatalogObjectsPOST /v2/catalog/batch-upsertBatchUpsertCatalogObjects
SquareConnect.CatalogApicatalogInfoGET /v2/catalog/infoCatalogInfo
SquareConnect.CatalogApideleteCatalogObjectDELETE /v2/catalog/object/{object_id}DeleteCatalogObject
SquareConnect.CatalogApilistCatalogGET /v2/catalog/listListCatalog
SquareConnect.CatalogApiretrieveCatalogObjectGET /v2/catalog/object/{object_id}RetrieveCatalogObject
SquareConnect.CatalogApisearchCatalogItemsPOST /v2/catalog/search-catalog-itemsSearchCatalogItems
SquareConnect.CatalogApisearchCatalogObjectsPOST /v2/catalog/searchSearchCatalogObjects
SquareConnect.CatalogApiupdateItemModifierListsPOST /v2/catalog/update-item-modifier-listsUpdateItemModifierLists
SquareConnect.CatalogApiupdateItemTaxesPOST /v2/catalog/update-item-taxesUpdateItemTaxes
SquareConnect.CatalogApiupsertCatalogObjectPOST /v2/catalog/objectUpsertCatalogObject
SquareConnect.CheckoutApicreateCheckoutPOST /v2/locations/{location_id}/checkoutsCreateCheckout
SquareConnect.CustomerGroupsApicreateCustomerGroupPOST /v2/customers/groupsCreateCustomerGroup
SquareConnect.CustomerGroupsApideleteCustomerGroupDELETE /v2/customers/groups/{group_id}DeleteCustomerGroup
SquareConnect.CustomerGroupsApilistCustomerGroupsGET /v2/customers/groupsListCustomerGroups
SquareConnect.CustomerGroupsApiretrieveCustomerGroupGET /v2/customers/groups/{group_id}RetrieveCustomerGroup
SquareConnect.CustomerGroupsApiupdateCustomerGroupPUT /v2/customers/groups/{group_id}UpdateCustomerGroup
SquareConnect.CustomerSegmentsApilistCustomerSegmentsGET /v2/customers/segmentsListCustomerSegments
SquareConnect.CustomerSegmentsApiretrieveCustomerSegmentGET /v2/customers/segments/{segment_id}RetrieveCustomerSegment
SquareConnect.CustomersApiaddGroupToCustomerPUT /v2/customers/{customer_id}/groups/{group_id}AddGroupToCustomer
SquareConnect.CustomersApicreateCustomerPOST /v2/customersCreateCustomer
SquareConnect.CustomersApicreateCustomerCardPOST /v2/customers/{customer_id}/cardsCreateCustomerCard
SquareConnect.CustomersApideleteCustomerDELETE /v2/customers/{customer_id}DeleteCustomer
SquareConnect.CustomersApideleteCustomerCardDELETE /v2/customers/{customer_id}/cards/{card_id}DeleteCustomerCard
SquareConnect.CustomersApilistCustomersGET /v2/customersListCustomers
SquareConnect.CustomersApiremoveGroupFromCustomerDELETE /v2/customers/{customer_id}/groups/{group_id}RemoveGroupFromCustomer
SquareConnect.CustomersApiretrieveCustomerGET /v2/customers/{customer_id}RetrieveCustomer
SquareConnect.CustomersApisearchCustomersPOST /v2/customers/searchSearchCustomers
SquareConnect.CustomersApiupdateCustomerPUT /v2/customers/{customer_id}UpdateCustomer
SquareConnect.DevicesApicreateDeviceCodePOST /v2/devices/codesCreateDeviceCode
SquareConnect.DevicesApigetDeviceCodeGET /v2/devices/codes/{id}GetDeviceCode
SquareConnect.DevicesApilistDeviceCodesGET /v2/devices/codesListDeviceCodes
SquareConnect.DisputesApiacceptDisputePOST /v2/disputes/{dispute_id}/acceptAcceptDispute
SquareConnect.DisputesApicreateDisputeEvidenceTextPOST /v2/disputes/{dispute_id}/evidence_textCreateDisputeEvidenceText
SquareConnect.DisputesApilistDisputeEvidenceGET /v2/disputes/{dispute_id}/evidenceListDisputeEvidence
SquareConnect.DisputesApilistDisputesGET /v2/disputesListDisputes
SquareConnect.DisputesApiremoveDisputeEvidenceDELETE /v2/disputes/{dispute_id}/evidence/{evidence_id}RemoveDisputeEvidence
SquareConnect.DisputesApiretrieveDisputeGET /v2/disputes/{dispute_id}RetrieveDispute
SquareConnect.DisputesApiretrieveDisputeEvidenceGET /v2/disputes/{dispute_id}/evidence/{evidence_id}RetrieveDisputeEvidence
SquareConnect.DisputesApisubmitEvidencePOST /v2/disputes/{dispute_id}/submit-evidenceSubmitEvidence
SquareConnect.EmployeesApilistEmployeesGET /v2/employeesListEmployees
SquareConnect.EmployeesApiretrieveEmployeeGET /v2/employees/{id}RetrieveEmployee
SquareConnect.InventoryApibatchChangeInventoryPOST /v2/inventory/batch-changeBatchChangeInventory
SquareConnect.InventoryApibatchRetrieveInventoryChangesPOST /v2/inventory/batch-retrieve-changesBatchRetrieveInventoryChanges
SquareConnect.InventoryApibatchRetrieveInventoryCountsPOST /v2/inventory/batch-retrieve-countsBatchRetrieveInventoryCounts
SquareConnect.InventoryApiretrieveInventoryAdjustmentGET /v2/inventory/adjustment/{adjustment_id}RetrieveInventoryAdjustment
SquareConnect.InventoryApiretrieveInventoryChangesGET /v2/inventory/{catalog_object_id}/changesRetrieveInventoryChanges
SquareConnect.InventoryApiretrieveInventoryCountGET /v2/inventory/{catalog_object_id}RetrieveInventoryCount
SquareConnect.InventoryApiretrieveInventoryPhysicalCountGET /v2/inventory/physical-count/{physical_count_id}RetrieveInventoryPhysicalCount
SquareConnect.InvoicesApicancelInvoicePOST /v2/invoices/{invoice_id}/cancelCancelInvoice
SquareConnect.InvoicesApicreateInvoicePOST /v2/invoicesCreateInvoice
SquareConnect.InvoicesApideleteInvoiceDELETE /v2/invoices/{invoice_id}DeleteInvoice
SquareConnect.InvoicesApigetInvoiceGET /v2/invoices/{invoice_id}GetInvoice
SquareConnect.InvoicesApilistInvoicesGET /v2/invoicesListInvoices
SquareConnect.InvoicesApipublishInvoicePOST /v2/invoices/{invoice_id}/publishPublishInvoice
SquareConnect.InvoicesApisearchInvoicesPOST /v2/invoices/searchSearchInvoices
SquareConnect.InvoicesApiupdateInvoicePUT /v2/invoices/{invoice_id}UpdateInvoice
SquareConnect.LaborApicreateBreakTypePOST /v2/labor/break-typesCreateBreakType
SquareConnect.LaborApicreateShiftPOST /v2/labor/shiftsCreateShift
SquareConnect.LaborApideleteBreakTypeDELETE /v2/labor/break-types/{id}DeleteBreakType
SquareConnect.LaborApideleteShiftDELETE /v2/labor/shifts/{id}DeleteShift
SquareConnect.LaborApigetBreakTypeGET /v2/labor/break-types/{id}GetBreakType
SquareConnect.LaborApigetEmployeeWageGET /v2/labor/employee-wages/{id}GetEmployeeWage
SquareConnect.LaborApigetShiftGET /v2/labor/shifts/{id}GetShift
SquareConnect.LaborApilistBreakTypesGET /v2/labor/break-typesListBreakTypes
SquareConnect.LaborApilistEmployeeWagesGET /v2/labor/employee-wagesListEmployeeWages
SquareConnect.LaborApilistWorkweekConfigsGET /v2/labor/workweek-configsListWorkweekConfigs
SquareConnect.LaborApisearchShiftsPOST /v2/labor/shifts/searchSearchShifts
SquareConnect.LaborApiupdateBreakTypePUT /v2/labor/break-types/{id}UpdateBreakType
SquareConnect.LaborApiupdateShiftPUT /v2/labor/shifts/{id}UpdateShift
SquareConnect.LaborApiupdateWorkweekConfigPUT /v2/labor/workweek-configs/{id}UpdateWorkweekConfig
SquareConnect.LocationsApicreateLocationPOST /v2/locationsCreateLocation
SquareConnect.LocationsApilistLocationsGET /v2/locationsListLocations
SquareConnect.LocationsApiretrieveLocationGET /v2/locations/{location_id}RetrieveLocation
SquareConnect.LocationsApiupdateLocationPUT /v2/locations/{location_id}UpdateLocation
SquareConnect.LoyaltyApiaccumulateLoyaltyPointsPOST /v2/loyalty/accounts/{account_id}/accumulateAccumulateLoyaltyPoints
SquareConnect.LoyaltyApiadjustLoyaltyPointsPOST /v2/loyalty/accounts/{account_id}/adjustAdjustLoyaltyPoints
SquareConnect.LoyaltyApicalculateLoyaltyPointsPOST /v2/loyalty/programs/{program_id}/calculateCalculateLoyaltyPoints
SquareConnect.LoyaltyApicreateLoyaltyAccountPOST /v2/loyalty/accountsCreateLoyaltyAccount
SquareConnect.LoyaltyApicreateLoyaltyRewardPOST /v2/loyalty/rewardsCreateLoyaltyReward
SquareConnect.LoyaltyApideleteLoyaltyRewardDELETE /v2/loyalty/rewards/{reward_id}DeleteLoyaltyReward
SquareConnect.LoyaltyApilistLoyaltyProgramsGET /v2/loyalty/programsListLoyaltyPrograms
SquareConnect.LoyaltyApiredeemLoyaltyRewardPOST /v2/loyalty/rewards/{reward_id}/redeemRedeemLoyaltyReward
SquareConnect.LoyaltyApiretrieveLoyaltyAccountGET /v2/loyalty/accounts/{account_id}RetrieveLoyaltyAccount
SquareConnect.LoyaltyApiretrieveLoyaltyRewardGET /v2/loyalty/rewards/{reward_id}RetrieveLoyaltyReward
SquareConnect.LoyaltyApisearchLoyaltyAccountsPOST /v2/loyalty/accounts/searchSearchLoyaltyAccounts
SquareConnect.LoyaltyApisearchLoyaltyEventsPOST /v2/loyalty/events/searchSearchLoyaltyEvents
SquareConnect.LoyaltyApisearchLoyaltyRewardsPOST /v2/loyalty/rewards/searchSearchLoyaltyRewards
SquareConnect.MerchantsApilistMerchantsGET /v2/merchantsListMerchants
SquareConnect.MerchantsApiretrieveMerchantGET /v2/merchants/{merchant_id}RetrieveMerchant
SquareConnect.MobileAuthorizationApicreateMobileAuthorizationCodePOST /mobile/authorization-codeCreateMobileAuthorizationCode
SquareConnect.OAuthApiobtainTokenPOST /oauth2/tokenObtainToken
SquareConnect.OAuthApirenewTokenPOST /oauth2/clients/{client_id}/access-token/renewRenewToken
SquareConnect.OAuthApirevokeTokenPOST /oauth2/revokeRevokeToken
SquareConnect.OrdersApibatchRetrieveOrdersPOST /v2/locations/{location_id}/orders/batch-retrieveBatchRetrieveOrders
SquareConnect.OrdersApicalculateOrderPOST /v2/orders/calculateCalculateOrder
SquareConnect.OrdersApicreateOrderPOST /v2/locations/{location_id}/ordersCreateOrder
SquareConnect.OrdersApipayOrderPOST /v2/orders/{order_id}/payPayOrder
SquareConnect.OrdersApisearchOrdersPOST /v2/orders/searchSearchOrders
SquareConnect.OrdersApiupdateOrderPUT /v2/locations/{location_id}/orders/{order_id}UpdateOrder
SquareConnect.PaymentsApicancelPaymentPOST /v2/payments/{payment_id}/cancelCancelPayment
SquareConnect.PaymentsApicancelPaymentByIdempotencyKeyPOST /v2/payments/cancelCancelPaymentByIdempotencyKey
SquareConnect.PaymentsApicompletePaymentPOST /v2/payments/{payment_id}/completeCompletePayment
SquareConnect.PaymentsApicreatePaymentPOST /v2/paymentsCreatePayment
SquareConnect.PaymentsApigetPaymentGET /v2/payments/{payment_id}GetPayment
SquareConnect.PaymentsApilistPaymentsGET /v2/paymentsListPayments
SquareConnect.RefundsApigetPaymentRefundGET /v2/refunds/{refund_id}GetPaymentRefund
SquareConnect.RefundsApilistPaymentRefundsGET /v2/refundsListPaymentRefunds
SquareConnect.RefundsApirefundPaymentPOST /v2/refundsRefundPayment
SquareConnect.ReportingApilistAdditionalRecipientReceivableRefundsGET /v2/locations/{location_id}/additional-recipient-receivable-refundsListAdditionalRecipientReceivableRefunds
SquareConnect.ReportingApilistAdditionalRecipientReceivablesGET /v2/locations/{location_id}/additional-recipient-receivablesListAdditionalRecipientReceivables
SquareConnect.SubscriptionsApicancelSubscriptionPOST /v2/subscriptions/{subscription_id}/cancelCancelSubscription
SquareConnect.SubscriptionsApicreateSubscriptionPOST /v2/subscriptionsCreateSubscription
SquareConnect.SubscriptionsApilistSubscriptionEventsGET /v2/subscriptions/{subscription_id}/eventsListSubscriptionEvents
SquareConnect.SubscriptionsApiretrieveSubscriptionGET /v2/subscriptions/{subscription_id}RetrieveSubscription
SquareConnect.SubscriptionsApisearchSubscriptionsPOST /v2/subscriptions/searchSearchSubscriptions
SquareConnect.SubscriptionsApiupdateSubscriptionPUT /v2/subscriptions/{subscription_id}UpdateSubscription
SquareConnect.TeamApibulkCreateTeamMembersPOST /v2/team-members/bulk-createBulkCreateTeamMembers
SquareConnect.TeamApibulkUpdateTeamMembersPOST /v2/team-members/bulk-updateBulkUpdateTeamMembers
SquareConnect.TeamApicreateTeamMemberPOST /v2/team-membersCreateTeamMember
SquareConnect.TeamApiretrieveTeamMemberGET /v2/team-members/{team_member_id}RetrieveTeamMember
SquareConnect.TeamApiretrieveWageSettingGET /v2/team-members/{team_member_id}/wage-settingRetrieveWageSetting
SquareConnect.TeamApisearchTeamMembersPOST /v2/team-members/searchSearchTeamMembers
SquareConnect.TeamApiupdateTeamMemberPUT /v2/team-members/{team_member_id}UpdateTeamMember
SquareConnect.TeamApiupdateWageSettingPUT /v2/team-members/{team_member_id}/wage-settingUpdateWageSetting
SquareConnect.TerminalApicancelTerminalCheckoutPOST /v2/terminals/checkouts/{checkout_id}/cancelCancelTerminalCheckout
SquareConnect.TerminalApicreateTerminalCheckoutPOST /v2/terminals/checkoutsCreateTerminalCheckout
SquareConnect.TerminalApigetTerminalCheckoutGET /v2/terminals/checkouts/{checkout_id}GetTerminalCheckout
SquareConnect.TerminalApisearchTerminalCheckoutsPOST /v2/terminals/checkouts/searchSearchTerminalCheckouts
SquareConnect.TransactionsApicaptureTransactionPOST /v2/locations/{location_id}/transactions/{transaction_id}/captureCaptureTransaction
SquareConnect.TransactionsApichargePOST /v2/locations/{location_id}/transactionsCharge
SquareConnect.TransactionsApicreateRefundPOST /v2/locations/{location_id}/transactions/{transaction_id}/refundCreateRefund
SquareConnect.TransactionsApilistRefundsGET /v2/locations/{location_id}/refundsListRefunds
SquareConnect.TransactionsApilistTransactionsGET /v2/locations/{location_id}/transactionsListTransactions
SquareConnect.TransactionsApiretrieveTransactionGET /v2/locations/{location_id}/transactions/{transaction_id}RetrieveTransaction
SquareConnect.TransactionsApivoidTransactionPOST /v2/locations/{location_id}/transactions/{transaction_id}/voidVoidTransaction
SquareConnect.V1EmployeesApicreateEmployeePOST /v1/me/employeesCreateEmployee
SquareConnect.V1EmployeesApicreateEmployeeRolePOST /v1/me/rolesCreateEmployeeRole
SquareConnect.V1EmployeesApicreateTimecardPOST /v1/me/timecardsCreateTimecard
SquareConnect.V1EmployeesApideleteTimecardDELETE /v1/me/timecards/{timecard_id}DeleteTimecard
SquareConnect.V1EmployeesApilistCashDrawerShiftsGET /v1/{location_id}/cash-drawer-shiftsListCashDrawerShifts
SquareConnect.V1EmployeesApilistEmployeeRolesGET /v1/me/rolesListEmployeeRoles
SquareConnect.V1EmployeesApilistEmployeesGET /v1/me/employeesListEmployees
SquareConnect.V1EmployeesApilistTimecardEventsGET /v1/me/timecards/{timecard_id}/eventsListTimecardEvents
SquareConnect.V1EmployeesApilistTimecardsGET /v1/me/timecardsListTimecards
SquareConnect.V1EmployeesApiretrieveCashDrawerShiftGET /v1/{location_id}/cash-drawer-shifts/{shift_id}RetrieveCashDrawerShift
SquareConnect.V1EmployeesApiretrieveEmployeeGET /v1/me/employees/{employee_id}RetrieveEmployee
SquareConnect.V1EmployeesApiretrieveEmployeeRoleGET /v1/me/roles/{role_id}RetrieveEmployeeRole
SquareConnect.V1EmployeesApiretrieveTimecardGET /v1/me/timecards/{timecard_id}RetrieveTimecard
SquareConnect.V1EmployeesApiupdateEmployeePUT /v1/me/employees/{employee_id}UpdateEmployee
SquareConnect.V1EmployeesApiupdateEmployeeRolePUT /v1/me/roles/{role_id}UpdateEmployeeRole
SquareConnect.V1EmployeesApiupdateTimecardPUT /v1/me/timecards/{timecard_id}UpdateTimecard
SquareConnect.V1ItemsApiadjustInventoryPOST /v1/{location_id}/inventory/{variation_id}AdjustInventory
SquareConnect.V1ItemsApiapplyFeePUT /v1/{location_id}/items/{item_id}/fees/{fee_id}ApplyFee
SquareConnect.V1ItemsApiapplyModifierListPUT /v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}ApplyModifierList
SquareConnect.V1ItemsApicreateCategoryPOST /v1/{location_id}/categoriesCreateCategory
SquareConnect.V1ItemsApicreateDiscountPOST /v1/{location_id}/discountsCreateDiscount
SquareConnect.V1ItemsApicreateFeePOST /v1/{location_id}/feesCreateFee
SquareConnect.V1ItemsApicreateItemPOST /v1/{location_id}/itemsCreateItem
SquareConnect.V1ItemsApicreateModifierListPOST /v1/{location_id}/modifier-listsCreateModifierList
SquareConnect.V1ItemsApicreateModifierOptionPOST /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-optionsCreateModifierOption
SquareConnect.V1ItemsApicreatePagePOST /v1/{location_id}/pagesCreatePage
SquareConnect.V1ItemsApicreateVariationPOST /v1/{location_id}/items/{item_id}/variationsCreateVariation
SquareConnect.V1ItemsApideleteCategoryDELETE /v1/{location_id}/categories/{category_id}DeleteCategory
SquareConnect.V1ItemsApideleteDiscountDELETE /v1/{location_id}/discounts/{discount_id}DeleteDiscount
SquareConnect.V1ItemsApideleteFeeDELETE /v1/{location_id}/fees/{fee_id}DeleteFee
SquareConnect.V1ItemsApideleteItemDELETE /v1/{location_id}/items/{item_id}DeleteItem
SquareConnect.V1ItemsApideleteModifierListDELETE /v1/{location_id}/modifier-lists/{modifier_list_id}DeleteModifierList
SquareConnect.V1ItemsApideleteModifierOptionDELETE /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}DeleteModifierOption
SquareConnect.V1ItemsApideletePageDELETE /v1/{location_id}/pages/{page_id}DeletePage
SquareConnect.V1ItemsApideletePageCellDELETE /v1/{location_id}/pages/{page_id}/cellsDeletePageCell
SquareConnect.V1ItemsApideleteVariationDELETE /v1/{location_id}/items/{item_id}/variations/{variation_id}DeleteVariation
SquareConnect.V1ItemsApilistCategoriesGET /v1/{location_id}/categoriesListCategories
SquareConnect.V1ItemsApilistDiscountsGET /v1/{location_id}/discountsListDiscounts
SquareConnect.V1ItemsApilistFeesGET /v1/{location_id}/feesListFees
SquareConnect.V1ItemsApilistInventoryGET /v1/{location_id}/inventoryListInventory
SquareConnect.V1ItemsApilistItemsGET /v1/{location_id}/itemsListItems
SquareConnect.V1ItemsApilistModifierListsGET /v1/{location_id}/modifier-listsListModifierLists
SquareConnect.V1ItemsApilistPagesGET /v1/{location_id}/pagesListPages
SquareConnect.V1ItemsApiremoveFeeDELETE /v1/{location_id}/items/{item_id}/fees/{fee_id}RemoveFee
SquareConnect.V1ItemsApiremoveModifierListDELETE /v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}RemoveModifierList
SquareConnect.V1ItemsApiretrieveItemGET /v1/{location_id}/items/{item_id}RetrieveItem
SquareConnect.V1ItemsApiretrieveModifierListGET /v1/{location_id}/modifier-lists/{modifier_list_id}RetrieveModifierList
SquareConnect.V1ItemsApiupdateCategoryPUT /v1/{location_id}/categories/{category_id}UpdateCategory
SquareConnect.V1ItemsApiupdateDiscountPUT /v1/{location_id}/discounts/{discount_id}UpdateDiscount
SquareConnect.V1ItemsApiupdateFeePUT /v1/{location_id}/fees/{fee_id}UpdateFee
SquareConnect.V1ItemsApiupdateItemPUT /v1/{location_id}/items/{item_id}UpdateItem
SquareConnect.V1ItemsApiupdateModifierListPUT /v1/{location_id}/modifier-lists/{modifier_list_id}UpdateModifierList
SquareConnect.V1ItemsApiupdateModifierOptionPUT /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}UpdateModifierOption
SquareConnect.V1ItemsApiupdatePagePUT /v1/{location_id}/pages/{page_id}UpdatePage
SquareConnect.V1ItemsApiupdatePageCellPUT /v1/{location_id}/pages/{page_id}/cellsUpdatePageCell
SquareConnect.V1ItemsApiupdateVariationPUT /v1/{location_id}/items/{item_id}/variations/{variation_id}UpdateVariation
SquareConnect.V1LocationsApilistLocationsGET /v1/me/locationsListLocations
SquareConnect.V1LocationsApiretrieveBusinessGET /v1/meRetrieveBusiness
SquareConnect.V1TransactionsApicreateRefundPOST /v1/{location_id}/refundsCreateRefund
SquareConnect.V1TransactionsApilistBankAccountsGET /v1/{location_id}/bank-accountsListBankAccounts
SquareConnect.V1TransactionsApilistOrdersGET /v1/{location_id}/ordersListOrders
SquareConnect.V1TransactionsApilistPaymentsGET /v1/{location_id}/paymentsListPayments
SquareConnect.V1TransactionsApilistRefundsGET /v1/{location_id}/refundsListRefunds
SquareConnect.V1TransactionsApilistSettlementsGET /v1/{location_id}/settlementsListSettlements
SquareConnect.V1TransactionsApiretrieveBankAccountGET /v1/{location_id}/bank-accounts/{bank_account_id}RetrieveBankAccount
SquareConnect.V1TransactionsApiretrieveOrderGET /v1/{location_id}/orders/{order_id}RetrieveOrder
SquareConnect.V1TransactionsApiretrievePaymentGET /v1/{location_id}/payments/{payment_id}RetrievePayment
SquareConnect.V1TransactionsApiretrieveSettlementGET /v1/{location_id}/settlements/{settlement_id}RetrieveSettlement
SquareConnect.V1TransactionsApiupdateOrderPUT /v1/{location_id}/orders/{order_id}UpdateOrder

Documentation for Models

Documentation for Authorization

oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://connect.squareup.com/oauth2/authorize
  • Scopes:
    • BANK_ACCOUNTS_READ: HTTP Method: `GET` Grants read access to bank account information associated with the targeted Square account. For example, to call the Connect v1 ListBankAccounts endpoint.
    • CASH_DRAWER_READ: HTTP Method: `GET` Grants read access to cash drawer shift information. For example, to call the ListCashDrawerShifts endpoint.
    • CUSTOMERS_READ: HTTP Method: `GET` Grants read access to customer information. For example, to call the ListCustomers endpoint.
    • CUSTOMERS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to customer information. For example, to create and update customer profiles.
    • DEVICE_CREDENTIAL_MANAGEMENT: HTTP Method: `POST`, `GET` Grants read/write access to device credentials information. For example, to call the CreateDeviceCode endpoint.
    • EMPLOYEES_READ: HTTP Method: `GET` Grants read access to employee profile information. For example, to call the Connect v1 Employees API.
    • EMPLOYEES_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee profile information. For example, to create and modify employee profiles.
    • INVENTORY_READ: HTTP Method: `GET` Grants read access to inventory information. For example, to call the RetrieveInventoryCount endpoint.
    • INVENTORY_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to inventory information. For example, to call the BatchChangeInventory endpoint.
    • ITEMS_READ: HTTP Method: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
    • ITEMS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to product catalog information. For example, to modify or add to a product catalog.
    • LOYALTY_READ: HTTP Method: `GET` Grants read access to loyalty information. For example, to call the ListLoyaltyPrograms endpoint.
    • LOYALTY_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to loyalty information. For example, to call the CreateLoyaltyAccount endpoint.
    • MERCHANT_PROFILE_READ: HTTP Method: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
    • ORDERS_READ: HTTP Method: `GET` Grants read access to order information. For example, to call the BatchRetrieveOrders endpoint.
    • ORDERS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to order information. For example, to call the CreateCheckout endpoint.
    • PAYMENTS_READ: HTTP Method: `GET` Grants read access to transaction and refund information. For example, to call the RetrieveTransaction endpoint.
    • PAYMENTS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to transaction and refunds information. For example, to process payments with the Payments or Checkout API.
    • PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS: HTTP Method: `POST`, `PUT`, `DELETE` Allow third party applications to deduct a portion of each transaction amount. Required to use multiparty transaction functionality with the Payments API.
    • PAYMENTS_WRITE_IN_PERSON: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to payments and refunds information. For example, to process in-person payments.
    • SETTLEMENTS_READ: HTTP Method: `GET` Grants read access to settlement (deposit) information. For example, to call the Connect v1 ListSettlements endpoint.
    • TIMECARDS_READ: HTTP Method: `GET` Grants read access to employee timecard information. For example, to call the Connect v2 SearchShifts endpoint.
    • TIMECARDS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee shift information. For example, to create and modify employee shifts.
    • TIMECARDS_SETTINGS_READ: HTTP Method: `GET` Grants read access to employee timecard settings information. For example, to call the GetBreakType endpoint.
    • TIMECARDS_SETTINGS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee timecard settings information. For example, to call the UpdateBreakType endpoint.

oauth2ClientSecret

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Pagination of V1 Endpoints

V1 Endpoints return pagination information via HTTP headers. In order to obtain response headers and extract the batch_token parameter you will need to follow the following steps:

  1. Use the full information endpoint methods of each API to get the response HTTP Headers. They are named as their simple counterpart with a WithHttpInfo suffix. Hence listEmployeeRoles would be called listEmployeeRolesWithHttpInfo. This method returns a CompleteResponse object with the response data deserialized along with a helper to retrieve the token if present.

  2. Use var batchToken = completeResponse.batch_token; to extract the token and proceed to get the following page if a token is present.

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 api = new SquareConnect.V1EmployeesApi();

var opts = {
  order: "order_example",
  limit: 56,
  batch_token: null
}

function getAllEmployeeRoles(batch_token){
  if (batch_token) {
    api.listEmployeeRolesWithHttpInfo(opts).then(function(resp) {
       var batch_token = resp.batch_token;
       opts['batch_token'] = batch_token;
       getAllEmployeeRoles(token);
    }, function(error) {
      console.error(error);
    });
  }
}

getAllEmployeeRoles(true);

Contributing

Send bug reports, feature requests, and code contributions to the API specifications repository, as this repository contains only the generated SDK code.

License

Copyright 2017 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Keywords

FAQs

Last updated on 12 Aug 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc