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

@datafire/squareup

v6.0.0

Published

DataFire integration for Square Connect

Downloads

10

Readme

@datafire/squareup

Client library for Square Connect

Installation and Usage

npm install --save @datafire/squareup
let squareup = require('@datafire/squareup').create({
  access_token: "",
  refresh_token: "",
  client_id: "",
  client_secret: "",
  redirect_uri: ""
});

.then(data => {
  console.log(data);
});

Description

Client library for accessing the Square Connect APIs

Actions

oauthCallback

Exchange the code passed to your redirect URI for an access_token

squareup.oauthCallback({
  "code": ""
}, context)

Input

  • input object
    • code required string

Output

  • output object
    • access_token string
    • refresh_token string
    • token_type string
    • scope string
    • expiration string

oauthRefresh

Exchange a refresh_token for an access_token

squareup.oauthRefresh(null, context)

Input

This action has no parameters

Output

  • output object
    • access_token string
    • refresh_token string
    • token_type string
    • scope string
    • expiration string

RetrieveBusiness

Get a business's information.

squareup.RetrieveBusiness(null, context)

Input

This action has no parameters

Output

ListEmployees

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

squareup.ListEmployees({}, context)

Input

  • input object
    • order string (values: ASC, DESC): The order in which employees are listed in the response, based on their created_at field. Default value: ASC
    • begin_updated_at string: If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format
    • end_updated_at string: If filtering results by there updated_at field, the end of the requested reporting period, in ISO 8601 format.
    • begin_created_at string: If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 format.
    • end_created_at string: If filtering results by their created_at field, the end of the requested reporting period, in ISO 8601 format.
    • status string (values: ACTIVE, INACTIVE): If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE).
    • external_id string: If provided, the endpoint returns only employee entities with the specified external_id.
    • limit integer: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

CreateEmployee

Creates an employee for a business.

squareup.CreateEmployee({
  "body": {
    "first_name": "",
    "last_name": ""
  }
}, context)

Input

Output

RetrieveEmployee

Provides the details for a single employee.

squareup.RetrieveEmployee({
  "employee_id": ""
}, context)

Input

  • input object
    • employee_id required string: The employee's ID.

Output

UpdateEmployee

V1 UpdateEmployee

squareup.UpdateEmployee({
  "employee_id": "",
  "body": {
    "first_name": "",
    "last_name": ""
  }
}, context)

Input

  • input object
    • employee_id required string: The ID of the role to modify.
    • body required v1Employee

Output

v1.me.locations.get

Provides details for a business's locations, including their IDs.

squareup.v1.me.locations.get(null, context)

Input

This action has no parameters

Output

ListEmployeeRoles

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

squareup.ListEmployeeRoles({}, context)

Input

  • input object
    • order string (values: ASC, DESC): The order in which employees are listed in the response, based on their created_at field.Default value: ASC
    • limit integer: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

CreateEmployeeRole

Creates an employee role you can then assign to employees.

squareup.CreateEmployeeRole({
  "EmployeeRole": {
    "name": "",
    "permissions": []
  }
}, context)

Input

Output

RetrieveEmployeeRole

Provides the details for a single employee role.

squareup.RetrieveEmployeeRole({
  "role_id": ""
}, context)

Input

  • input object
    • role_id required string: The role's ID.

Output

UpdateEmployeeRole

Modifies the details of an employee role.

squareup.UpdateEmployeeRole({
  "role_id": "",
  "body": {
    "name": "",
    "permissions": []
  }
}, context)

Input

  • input object
    • role_id required string: The ID of the role to modify.
    • body required v1EmployeeRole

Output

ListTimecards

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

squareup.ListTimecards({}, context)

Input

  • input object
    • order string (values: ASC, DESC): The order in which timecards are listed in the response, based on their created_at field.
    • employee_id string: If provided, the endpoint returns only timecards for the employee with the specified ID.
    • begin_clockin_time string: If filtering results by their clockin_time field, the beginning of the requested reporting period, in ISO 8601 format.
    • end_clockin_time string: If filtering results by their clockin_time field, the end of the requested reporting period, in ISO 8601 format.
    • begin_clockout_time string: If filtering results by their clockout_time field, the beginning of the requested reporting period, in ISO 8601 format.
    • end_clockout_time string: If filtering results by their clockout_time field, the end of the requested reporting period, in ISO 8601 format.
    • begin_updated_at string: If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format.
    • end_updated_at string: If filtering results by their updated_at field, the end of the requested reporting period, in ISO 8601 format.
    • deleted boolean: If true, only deleted timecards are returned. If false, only valid timecards are returned.If you don't provide this parameter, both valid and deleted timecards are returned.
    • limit integer: The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

CreateTimecard

Creates a timecard for an employee. Each timecard corresponds to a single shift.

squareup.CreateTimecard({
  "body": {
    "employee_id": ""
  }
}, context)

Input

Output

DeleteTimecard

Deletes a timecard. Deleted timecards are still accessible from Connect API endpoints, but the value of their deleted field is set to true. See Handling deleted timecards for more information.

squareup.DeleteTimecard({
  "timecard_id": ""
}, context)

Input

  • input object
    • timecard_id required string: The ID of the timecard to delete.

Output

  • output object

RetrieveTimecard

Provides the details for a single timecard.

squareup.RetrieveTimecard({
  "timecard_id": ""
}, context)

Input

  • input object
    • timecard_id required string: The timecard's ID.

Output

UpdateTimecard

Modifies a timecard's details. This creates an API_EDIT event for the timecard. You can view a timecard's event history with the List Timecard Events endpoint.

squareup.UpdateTimecard({
  "timecard_id": "",
  "body": {
    "employee_id": ""
  }
}, context)

Input

  • input object
    • timecard_id required string: TThe ID of the timecard to modify.
    • body required v1Timecard

Output

ListTimecardEvents

Provides summary information for all events associated with a particular timecard.

squareup.ListTimecardEvents({
  "timecard_id": ""
}, context)

Input

  • input object
    • timecard_id required string: The ID of the timecard to list events for.

Output

ListBankAccounts

Provides non-confidential details for all of a location's associated bank accounts. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API.

squareup.ListBankAccounts({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list bank accounts for.

Output

RetrieveBankAccount

Provides non-confidential details for a merchant's associated bank account. This endpoint does not provide full bank account numbers, and there is no way to obtain a full bank account number with the Connect API.

squareup.RetrieveBankAccount({
  "location_id": "",
  "bank_account_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the bank account's associated location.
    • bank_account_id required string: The bank account's Square-issued ID. You obtain this value from Settlement objects returned.

Output

ListCashDrawerShifts

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

squareup.ListCashDrawerShifts({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list cash drawer shifts for.
    • order string (values: ASC, DESC): The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: ASC
    • begin_time string: The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days.
    • end_time string: The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time.

Output

RetrieveCashDrawerShift

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

squareup.RetrieveCashDrawerShift({
  "location_id": "",
  "shift_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list cash drawer shifts for.
    • shift_id required string: The shift's ID.

Output

ListCategories

Lists all of a location's item categories.

squareup.ListCategories({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list categories for.

Output

CreateCategory

Creates an item category.

squareup.CreateCategory({
  "location_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the location to create an item for.
    • body required v1Category

Output

DeleteCategory

Deletes an existing item category.

squareup.DeleteCategory({
  "location_id": "",
  "category_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • category_id required string: The ID of the category to delete.

Output

UpdateCategory

Modifies the details of an existing item category.

squareup.UpdateCategory({
  "location_id": "",
  "category_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the category's associated location.
    • category_id required string: The ID of the category to edit.
    • body required v1Category

Output

ListDiscounts

Lists all of a location's discounts.

squareup.ListDiscounts({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list categories for.

Output

CreateDiscount

Creates a discount.

squareup.CreateDiscount({
  "location_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the location to create an item for.
    • body required v1Discount

Output

DeleteDiscount

Deletes an existing discount.

squareup.DeleteDiscount({
  "location_id": "",
  "discount_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • discount_id required string: The ID of the discount to delete.

Output

UpdateDiscount

Modifies the details of an existing discount.

squareup.UpdateDiscount({
  "location_id": "",
  "discount_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the category's associated location.
    • discount_id required string: The ID of the discount to edit.
    • body required v1Discount

Output

ListFees

Lists all of a location's fees (taxes).

squareup.ListFees({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list fees for.

Output

CreateFee

Creates a fee (tax).

squareup.CreateFee({
  "location_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the location to create a fee for.
    • body required v1Fee

Output

DeleteFee

Deletes an existing fee (tax).

squareup.DeleteFee({
  "location_id": "",
  "fee_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the fee's associated location.
    • fee_id required string: The ID of the fee to delete.

Output

UpdateFee

Modifies the details of an existing fee (tax).

squareup.UpdateFee({
  "location_id": "",
  "fee_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the fee's associated location.
    • fee_id required string: The ID of the fee to edit.
    • body required v1Fee

Output

ListInventory

Provides inventory information for all of a merchant's inventory-enabled item variations.

squareup.ListInventory({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • limit integer: The maximum number of inventory entries to return in a single response. This value cannot exceed 1000.
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

AdjustInventory

Adjusts an item variation's current available inventory.

squareup.AdjustInventory({
  "location_id": "",
  "variation_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • variation_id required string: The ID of the variation to adjust inventory information for.
    • body required v1AdjustInventoryRequest

Output

ListItems

Provides summary information for all of a location's items.

squareup.ListItems({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list items for.
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

CreateItem

Creates an item and at least one variation for it.

squareup.CreateItem({
  "location_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the location to create an item for.
    • body required v1Item

Output

DeleteItem

Deletes an existing item and all item variations associated with it.

squareup.DeleteItem({
  "location_id": "",
  "item_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • item_id required string: The ID of the item to modify.

Output

RetrieveItem

Provides the details for a single item, including associated modifier lists and fees.

squareup.RetrieveItem({
  "location_id": "",
  "item_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • item_id required string: The item's ID.

Output

UpdateItem

Modifies the core details of an existing item.

squareup.UpdateItem({
  "location_id": "",
  "item_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • item_id required string: The ID of the item to modify.
    • body required v1Item

Output

RemoveFee

Removes a fee assocation from an item, meaning the fee is no longer automatically applied to the item in Square Register.

squareup.RemoveFee({
  "location_id": "",
  "item_id": "",
  "fee_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the fee's associated location.
    • item_id required string: The ID of the item to add the fee to.
    • fee_id required string: The ID of the fee to apply.

Output

ApplyFee

Associates a fee with an item, meaning the fee is automatically applied to the item in Square Register.

squareup.ApplyFee({
  "location_id": "",
  "item_id": "",
  "fee_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the fee's associated location.
    • item_id required string: The ID of the item to add the fee to.
    • fee_id required string: The ID of the fee to apply.

Output

RemoveModifierList

Removes a modifier list association from an item, meaning modifier options from the list can no longer be applied to the item.

squareup.RemoveModifierList({
  "location_id": "",
  "modifier_list_id": "",
  "item_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • modifier_list_id required string: The ID of the modifier list to remove.
    • item_id required string: The ID of the item to remove the modifier list from.

Output

ApplyModifierList

Associates a modifier list with an item, meaning modifier options from the list can be applied to the item.

squareup.ApplyModifierList({
  "location_id": "",
  "modifier_list_id": "",
  "item_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • modifier_list_id required string: The ID of the modifier list to apply.
    • item_id required string: The ID of the item to add the modifier list to.

Output

CreateVariation

Creates an item variation for an existing item.

squareup.CreateVariation({
  "location_id": "",
  "item_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • item_id required string: The item's ID.
    • body required v1Variation

Output

DeleteVariation

Deletes an existing item variation from an item.

squareup.DeleteVariation({
  "location_id": "",
  "item_id": "",
  "variation_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • item_id required string: The ID of the item to delete.
    • variation_id required string: The ID of the variation to delete.

Output

UpdateVariation

Modifies the details of an existing item variation.

squareup.UpdateVariation({
  "location_id": "",
  "item_id": "",
  "variation_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • item_id required string: The ID of the item to modify.
    • variation_id required string: The ID of the variation to modify.
    • body required v1Variation

Output

ListModifierLists

Lists all of a location's modifier lists.

squareup.ListModifierLists({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list modifier lists for.

Output

CreateModifierList

Creates an item modifier list and at least one modifier option for it.

squareup.CreateModifierList({
  "location_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the location to create a modifier list for.
    • body required v1ModifierList

Output

DeleteModifierList

Deletes an existing item modifier list and all modifier options associated with it.

squareup.DeleteModifierList({
  "location_id": "",
  "modifier_list_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • modifier_list_id required string: The ID of the modifier list to delete.

Output

RetrieveModifierList

Provides the details for a single modifier list.

squareup.RetrieveModifierList({
  "location_id": "",
  "modifier_list_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • modifier_list_id required string: The modifier list's ID.

Output

UpdateModifierList

Modifies the details of an existing item modifier list.

squareup.UpdateModifierList({
  "location_id": "",
  "modifier_list_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • modifier_list_id required string: The ID of the modifier list to edit.
    • body required v1UpdateModifierListRequest

Output

CreateModifierOption

Creates an item modifier option and adds it to a modifier list.

squareup.CreateModifierOption({
  "location_id": "",
  "modifier_list_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • modifier_list_id required string: The ID of the modifier list to edit.
    • body required v1ModifierOption

Output

DeleteModifierOption

Deletes an existing item modifier option from a modifier list.

squareup.DeleteModifierOption({
  "location_id": "",
  "modifier_list_id": "",
  "modifier_option_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • modifier_list_id required string: The ID of the modifier list to delete.
    • modifier_option_id required string: The ID of the modifier list to edit.

Output

UpdateModifierOption

Modifies the details of an existing item modifier option.

squareup.UpdateModifierOption({
  "location_id": "",
  "modifier_list_id": "",
  "modifier_option_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the item's associated location.
    • modifier_list_id required string: The ID of the modifier list to edit.
    • modifier_option_id required string: The ID of the modifier list to edit.
    • body required v1ModifierOption

Output

ListOrders

Provides summary information for a merchant's online store orders.

squareup.ListOrders({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list online store orders for.
    • order string (values: ASC, DESC): TThe order in which payments are listed in the response.
    • limit integer: The maximum number of payments to return in a single response. This value cannot exceed 200.
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

RetrieveOrder

Provides comprehensive information for a single online store order, including the order's history.

squareup.RetrieveOrder({
  "location_id": "",
  "order_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the order's associated location.
    • order_id required string: The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint

Output

UpdateOrder

Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:

squareup.UpdateOrder({
  "location_id": "",
  "order_id": "",
  "body": {
    "action": ""
  }
}, context)

Input

  • input object
    • location_id required string: The ID of the order's associated location.
    • order_id required string: The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint
    • body required v1UpdateOrderRequest

Output

ListPages

Lists all of a location's Favorites pages in Square Register.

squareup.ListPages({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list Favorites pages for.

Output

CreatePage

Creates a Favorites page in Square Register.

squareup.CreatePage({
  "location_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the location to create an item for.
    • body required v1Page

Output

DeletePage

Deletes an existing Favorites page and all of its cells.

squareup.DeletePage({
  "location_id": "",
  "page_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the Favorites page's associated location.
    • page_id required string: The ID of the page to delete.

Output

UpdatePage

Modifies the details of a Favorites page in Square Register.

squareup.UpdatePage({
  "location_id": "",
  "page_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the Favorites page's associated location
    • page_id required string: The ID of the page to modify.
    • body required v1Page

Output

DeletePageCell

Deletes a cell from a Favorites page in Square Register.

squareup.DeletePageCell({
  "location_id": "",
  "page_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the Favorites page's associated location.
    • page_id required string: The ID of the page to delete.
    • row string: The row of the cell to clear. Always an integer between 0 and 4, inclusive. Row 0 is the top row.
    • column string: The column of the cell to clear. Always an integer between 0 and 4, inclusive. Column 0 is the leftmost column.

Output

UpdatePageCell

Modifies a cell of a Favorites page in Square Register.

squareup.UpdatePageCell({
  "location_id": "",
  "page_id": "",
  "body": {}
}, context)

Input

  • input object
    • location_id required string: The ID of the Favorites page's associated location.
    • page_id required string: The ID of the page the cell belongs to.
    • body required v1PageCell

Output

ListPayments

Provides summary information for all payments taken by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length. See Date ranges for details of inclusive and exclusive dates.

squareup.ListPayments({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list payments for. If you specify me, this endpoint returns payments aggregated from all of the business's locations.
    • order string (values: ASC, DESC): The order in which payments are listed in the response.
    • begin_time string: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.
    • end_time string: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.
    • limit integer: The maximum number of payments to return in a single response. This value cannot exceed 200.
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

RetrievePayment

Provides comprehensive information for a single payment.

squareup.RetrievePayment({
  "location_id": "",
  "payment_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the payment's associated location.
    • payment_id required string: The payment's Square-issued ID. You obtain this value from Payment objects returned by the List Payments endpoint, or Settlement objects returned by the List Settlements endpoint.

Output

v1.location_id.refunds.get

Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length.

squareup.v1.location_id.refunds.get({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list refunds for.
    • order string (values: ASC, DESC): TThe order in which payments are listed in the response.
    • begin_time string: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.
    • end_time string: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.
    • limit integer: The maximum number of payments to return in a single response. This value cannot exceed 200.
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

v1.location_id.refunds.post

Issues a refund for a previously processed payment. You must issue a refund within 60 days of the associated payment.

squareup.v1.location_id.refunds.post({
  "location_id": "",
  "body": {
    "payment_id": "",
    "type": "",
    "reason": ""
  }
}, context)

Input

  • input object
    • location_id required string: The ID of the original payment's associated location.
    • body required v1CreateRefundRequest

Output

ListSettlements

Provides summary information for all deposits and withdrawals initiated by Square to a merchant's bank account during a date range. Date ranges cannot exceed one year in length.

squareup.ListSettlements({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list settlements for. If you specify me, this endpoint returns payments aggregated from all of the business's locations.
    • order string (values: ASC, DESC): TThe order in which payments are listed in the response.
    • begin_time string: The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.
    • end_time string: The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.
    • limit integer: The maximum number of payments to return in a single response. This value cannot exceed 200.
    • status string (values: SENT, FAILED): Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED).
    • batch_token string: A pagination cursor to retrieve the next set of results for your

Output

RetrieveSettlement

Provides comprehensive information for a single settlement, including the entries that contribute to the settlement's total.

squareup.RetrieveSettlement({
  "location_id": "",
  "settlement_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the settlements's associated location.
    • settlement_id required string: The settlement's Square-issued ID. You obtain this value from Settlement objects returned by the List Settlements endpoint.

Output

BatchDeleteCatalogObjects

Deletes a set of CatalogItems based on the provided list of target IDs and returns a set of successfully deleted IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a CatalogItem will also delete all of its CatalogItemVariation children.

BatchDeleteCatalogObjects succeeds even if only a portion of the targeted IDs can be deleted. The response will only include IDs that were actually deleted.

squareup.BatchDeleteCatalogObjects({
  "body": {}
}, context)

Input

Output

BatchRetrieveCatalogObjects

Returns a set of objects based on the provided ID. Each CatalogItem returned in the set includes all of its child information including: all of its CatalogItemVariation objects, references to its CatalogModifierList objects, and the ids of any CatalogTax objects that apply to it.

squareup.BatchRetrieveCatalogObjects({
  "body": {
    "object_ids": []
  }
}, context)

Input

Output

BatchUpsertCatalogObjects

Creates or updates up to 10,000 target objects based on the provided list of objects. The target objects are grouped into batches and each batch is inserted/updated in an all-or-nothing manner. If an object within a batch is malformed in some way, or violates a database constraint, the entire batch containing that item will be disregarded. However, other batches in the same request may still succeed. Each batch may contain up to 1,000 objects, and batches will be processed in order as long as the total object count for the request (items, variations, modifier lists, discounts, and taxes) is no more than 10,000.

squareup.BatchUpsertCatalogObjects({
  "body": {
    "idempotency_key": ""
  }
}, context)

Input

Output

CatalogInfo

Returns information about the Square Catalog API, such as batch size limits for BatchUpsertCatalogObjects.

squareup.CatalogInfo(null, context)

Input

This action has no parameters

Output

ListCatalog

Returns a list of CatalogObjects that includes all objects of a set of desired types (for example, all CatalogItem and CatalogTax objects) in the catalog. The types parameter is specified as a comma-separated list of valid CatalogObject types: ITEM, ITEM_VARIATION, MODIFIER, MODIFIER_LIST, CATEGORY, DISCOUNT, TAX.

squareup.ListCatalog({}, context)

Input

  • input object
    • cursor string: The pagination cursor returned in the previous response. Leave unset for an initial request.
    • types string: An optional case-insensitive, comma-separated list of object types to retrieve, for example

Output

UpsertCatalogObject

Creates or updates the target CatalogObject.

squareup.UpsertCatalogObject({
  "body": {
    "idempotency_key": "",
    "object": {
      "type": "",
      "id": ""
    }
  }
}, context)

Input

Output

DeleteCatalogObject

Deletes a single CatalogObject based on the provided ID and returns the set of successfully deleted IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a CatalogItem will also delete all of its CatalogItemVariation children.

squareup.DeleteCatalogObject({
  "object_id": ""
}, context)

Input

  • input object
    • object_id required string: The ID of the CatalogObject to be deleted. When an object is deleted, other

Output

RetrieveCatalogObject

Returns a single CatalogItem as a CatalogObject based on the provided ID. The returned object includes all of the relevant CatalogItem information including: CatalogItemVariation children, references to its CatalogModifierList objects, and the ids of any CatalogTax objects that apply to it.

squareup.RetrieveCatalogObject({
  "object_id": ""
}, context)

Input

  • input object
    • object_id required string: The object ID of any type of CatalogObjects to be retrieved.
    • include_related_objects boolean: If true, the response will include additional objects that are related to the

Output

SearchCatalogObjects

Queries the targeted catalog using a variety of query types (CatalogQuerySortedAttribute, (CatalogQueryExact, (CatalogQueryRange, (CatalogQueryText, (CatalogQueryItemsForTax, (CatalogQueryItemsForModifierList).

squareup.SearchCatalogObjects({
  "body": {}
}, context)

Input

Output

UpdateItemModifierLists

Updates the CatalogModifierList objects that apply to the targeted CatalogItem without having to perform an upsert on the entire item.

squareup.UpdateItemModifierLists({
  "body": {
    "item_ids": []
  }
}, context)

Input

Output

UpdateItemTaxes

Updates the CatalogTax objects that apply to the targeted CatalogItem without having to perform an upsert on the entire item.

squareup.UpdateItemTaxes({
  "body": {
    "item_ids": []
  }
}, context)

Input

Output

ListCustomers

Lists a business's customers.

squareup.ListCustomers({}, context)

Input

  • input object
    • cursor string: A pagination cursor returned by a previous call to this endpoint.

Output

CreateCustomer

Creates a new customer for a business, which can have associated cards on file.

You must provide at least one of the following values in your request to this endpoint:

  • given_name
  • family_name
  • company_name
  • email_address
  • phone_number

This endpoint does not accept an idempotency key. If you accidentally create a duplicate customer, you can delete it with the DeleteCustomer endpoint.

squareup.CreateCustomer({
  "body": {}
}, context)

Input

Output

DeleteCustomer

Deletes a customer from a business, along with any linked cards on file.

squareup.DeleteCustomer({
  "customer_id": ""
}, context)

Input

  • input object
    • customer_id required string: The ID of the customer to delete.

Output

RetrieveCustomer

Returns details for a single customer.

squareup.RetrieveCustomer({
  "customer_id": ""
}, context)

Input

  • input object
    • customer_id required string: The ID of the customer to retrieve.

Output

UpdateCustomer

Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer.

You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the DeleteCustomerCard endpoint, then create a new one with the CreateCustomerCard endpoint.

squareup.UpdateCustomer({
  "customer_id": "",
  "body": {}
}, context)

Input

  • input object

Output

CreateCustomerCard

Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer.

squareup.CreateCustomerCard({
  "customer_id": "",
  "body": {
    "card_nonce": ""
  }
}, context)

Input

  • input object

Output

DeleteCustomerCard

Removes a card on file from a customer.

squareup.DeleteCustomerCard({
  "customer_id": "",
  "card_id": ""
}, context)

Input

  • input object
    • customer_id required string: The ID of the customer that the card on file belongs to.
    • card_id required string: The ID of the card on file to delete.

Output

v2.locations.get

Provides the details for all of a business's locations.

Most other Connect API endpoints have a required location_id path parameter. The id field of the Location objects returned by this endpoint correspond to that location_id parameter.

squareup.v2.locations.get(null, context)

Input

This action has no parameters

Output

CreateCheckout

Creates a Checkout response that links a checkoutId and checkout_page_url that customers can be directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com.

squareup.CreateCheckout({
  "location_id": "",
  "body": {
    "idempotency_key": "",
    "order": {
      "line_items": []
    }
  }
}, context)

Input

  • input object
    • location_id required string: The ID of the business location to associate the checkout with.
    • body required CreateCheckoutRequest

Output

v2.locations.location_id.refunds.get

Lists refunds for one of a business's locations.

Refunds with a status of PENDING are not currently included in this endpoint's response.

Max results per page: 50

squareup.v2.locations.location_id.refunds.get({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list refunds for.
    • begin_time string: The beginning of the requested reporting period, in RFC 3339 format.
    • end_time string: The end of the requested reporting period, in RFC 3339 format.
    • sort_order string (values: DESC, ASC): The order in which results are listed in the response (ASC for
    • cursor string: A pagination cursor returned by a previous call to this endpoint.

Output

ListTransactions

Lists transactions for a particular location.

Max results per page: 50

squareup.ListTransactions({
  "location_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the location to list transactions for.
    • begin_time string: The beginning of the requested reporting period, in RFC 3339 format.
    • end_time string: The end of the requested reporting period, in RFC 3339 format.
    • sort_order string (values: DESC, ASC): The order in which results are listed in the response (ASC for
    • cursor string: A pagination cursor returned by a previous call to this endpoint.

Output

Charge

Charges a card represented by a card nonce or a customer's card on file.

Your request to this endpoint must include either:

  • A value for the card_nonce parameter (to charge a card nonce generated with the SqPaymentForm)
  • Values for the customer_card_id and customer_id parameters (to charge a customer's card on file)

In order for an e-commerce payment to potentially qualify for Square chargeback protection, you must provide values for the following parameters in your request:

  • buyer_email_address
  • At least one of billing_address or shipping_address

When this response is returned, the amount of Square's processing fee might not yet be calculated. To obtain the processing fee, wait about ten seconds and call RetrieveTransaction. See the processing_fee_money field of each Tender included in the transaction.

squareup.Charge({
  "location_id": "",
  "body": {
    "idempotency_key": "",
    "amount_money": {}
  }
}, context)

Input

  • input object
    • location_id required string: The ID of the location to associate the created transaction with.
    • body required ChargeRequest

Output

RetrieveTransaction

Retrieves details for a single transaction.

squareup.RetrieveTransaction({
  "location_id": "",
  "transaction_id": ""
}, context)

Input

  • input object
    • location_id required string: The ID of the transaction's associated location.
    • transaction_id required string: The ID of the transaction to retrieve.

Output

CaptureTransaction

Captures a transaction that was created with the Charge endpoint with a delay_capture value of true.

See Delayed capture transactions for more information.

squareup.CaptureTransaction({
  "location_id": "",
  "transaction_id": ""
}, context)

Input

  • input object
    • location_id required string
    • transaction_id required string

Output

v2.locations.location_id.transactions.transaction_id.refund.post

Initiates a refund for a previously charged tender.

You must issue a refund within 120 days of the associated payment. See (this article)[https://squareup.com/help/us/en/article/5060] for more information on refund behavior.

squareup.v2.locations.location_id.transactions.transaction_id.refund.post({
  "location_id": "",
  "transaction_id": "",
  "body": {
    "idempotency_key": "",
    "tender_id": "",
    "amount_money": {}
  }
}, context)

Input

  • input object
    • location_id required string: The ID of the original transaction's associated location.
    • transaction_id required string: The ID of the original transaction that includes the tender to refund.
    • body required CreateRefundRequest

Output

VoidTransaction

Cancels a transaction that was created with the Charge endpoint with a delay_capture value of true.

See Delayed capture transactions for more information.

squareup.VoidTransaction({
  "location_id": "",
  "transaction_id": ""
}, context)

Input

  • input object
    • location_id required string
    • transaction_id required string

Output

Definitions

Address

  • Address object: Represents a physical address.
    • address_line_1 string: The first line of the address.
    • address_line_2 string: The second line of the address, if any.
    • address_line_3 string: The third line of the address, if any.
    • administrative_district_level_1 string: A civil entity within the address's country. In the US, this
    • administrative_district_level_2 string: A civil entity within the address's administrative_district_level_1.
    • administrative_district_level_3 string: A civil entity within the address's administrative_district_level_2,
    • country string (values: ZZ, AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW): The address's country, in ISO 3166-1-alpha-2 format.
    • first_name string: Optional first name when it's representing recipient.
    • last_name string: Optional last name when it's representing recipient.
    • locality string: The city or town of the address.
    • organization string: Optional organization name when it's representing recipient.
    • postal_code string: The address's postal code.
    • sublocality string: A civil region within the address's locality, if any.
    • sublocality_2 string: A civil region within the address's sublocality, if any.
    • sublocality_3 string: A civil region within the address's sublocality_2, if any.

BatchDeleteCatalogObjectsRequest

  • BatchDeleteCatalogObjectsRequest object
    • object_ids array: The IDs of the CatalogObjects to be deleted. When an object is deleted, other objects
      • items string

BatchDeleteCatalogObjectsResponse

  • BatchDeleteCatalogObjectsResponse object
    • deleted_at string: The database timestamp of this deletion in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z".
    • deleted_object_ids array: The IDs of all CatalogObjects deleted by this request.
      • items string
    • errors array: The set of Errors encountered.

BatchRetrieveCatalogObjectsRequest

  • BatchRetrieveCatalogObjectsRequest object
    • include_related_objects boolean: If true, the response will include additional objects that are related to the
    • object_ids required array: The IDs of the CatalogObjects to be retrieved.
      • items string

BatchRetrieveCatalogObjectsResponse

BatchUpsertCatalogObjectsRequest

  • BatchUpsertCatalogObjectsRequest object
    • batches array: A batch of CatalogObjects to be inserted/updated atomically.
    • idempotency_key required string: A value you specify that uniquely identifies this

BatchUpsertCatalogObjectsResponse

  • BatchUpsertCatalogObjectsResponse object
    • errors array: The set of Errors encountered.
    • id_mappings array: The mapping between client and server IDs for this Upsert.
    • objects array: The created CatalogObjects
    • updated_at string: The database timestamp of this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z".

CaptureTransactionRequest

  • CaptureTransactionRequest object

CaptureTransactionResponse

  • CaptureTransactionResponse object: Defines the fields that are included in the response body of
    • errors array: Any errors that occurred during the request.

Card

  • Card object: Represents the non-confidential details of a credit card.
    • billing_address Address
    • card_brand string (values: OTHER_BRAND, VISA, MASTERCARD, AMERICAN_EXPRESS, DISCOVER, DISCOVER_DINERS, JCB, CHINA_UNIONPAY, SQUARE_GIFT_CARD): The card's brand (such as VISA). See CardBrand
    • cardholder_name string: The cardholder name. This value is present only if this object
    • exp_month integer: The month of the card's expiration date. This value is always between
    • exp_year integer: The four-digit year of the card's expiration date.
    • fingerprint string: The unique string fingerprint for the card.
    • id string: The card's unique ID, if any.
    • last_4 string: The last 4 digits of the card's number.

CardBrand

  • CardBrand string (values: OTHER_BRAND, VISA, MASTERCARD, AMERICAN_EXPRESS, DISCOVER, DISCOVER_DINERS, JCB, CHINA_UNIONPAY, SQUARE_GIFT_CARD): Indicates a credit card's brand, such as VISA.

CatalogCategory

  • CatalogCategory object: A category to which an CatalogItem belongs in the Catalog object model.
    • name required string: The category's name. Searchable.

CatalogDiscount

  • CatalogDiscount object: A discount in the Catalog object model.
    • amount_money Money
    • discount_type string (values: FIXED_PERCENTAGE, FIXED_AMOUNT, VARIABLE_PERCENTAGE, VARIABLE_AMOUNT): Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale.
    • label_color string: The color of the discount's display label in the Square Point of Sale app.
    • name required string: The discount's name. Searchable.
    • percentage string: The percentage of the discount as a string representation of a decimal number, using a . as the decimal
    • pin_required boolean: Indicates whether a mobile staff member needs to enter their PIN to apply the

CatalogDiscountType

  • CatalogDiscountType string (values: FIXED_PERCENTAGE, FIXED_AMOUNT, VARIABLE_PERCENTAGE, VARIABLE_AMOUNT): How to apply a CatalogDiscount to a CatalogItem.

CatalogIdMapping

  • CatalogIdMapping object: A mapping between a client-supplied temporary ID and a permanent server ID.
    • client_object_id string: The client-supplied, temporary #-prefixed ID for a new CatalogObject.
    • object_id string: The permanent ID for the CatalogObject created by the server.

CatalogInfoRequest

  • CatalogInfoRequest object

CatalogInfoResponse

CatalogInfoResponseLimits

  • CatalogInfoResponseLimits object
    • batch_delete_max_object_ids integer: The maximum number of object IDs that may be included in a single
    • batch_retrieve_max_object_ids integer: The maximum number of object IDs that may appear in a /v2/catalog/batch-retrieve
    • batch_upsert_max_objects_per_batch integer: The maximum number of objects that may appear within a single batch in a
    • batch_upsert_max_total_objects integer: The maximum number of objects that may appear across all batches in a
    • search_max_page_limit integer: The maximum number of results that may be returned in a page of a
    • update_item_modifier_lists_max_item_ids integer: The maximum number of item IDs that may be included in a single
    • update_item_modifier_lists_max_modifier_lists_to_disable integer: The maximum number of modifier list IDs to be disabled that may be included in
    • update_item_modifier_lists_max_modifier_lists_to_enable integer: The maximum number of modifier list IDs to be enabled that may be included in
    • update_item_taxes_max_item_ids integer: The maximum number of item IDs that may be included in a single
    • update_item_taxes_max_taxes_to_disable integer: The maximum number of tax IDs to be disabled that may be included in a single
    • update_item_taxes_max_taxes_to_enable integer: The maximum number of tax IDs to be enabled that may be included in a single

CatalogItem

  • CatalogItem object: An item (i.e., product family) in the Catalog object model.
    • abbreviation string: The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used. Searchable.
    • available_electronically boolean: If true, the item can be added to electronically fulfilled orders from the merchant's online store.
    • available_for_pickup boolean: If true, the item can be added to pickup orders from the merchant's online store.
    • available_online boolean: If true, the item can be added to shipping orders from the merchant's online store.
    • category_id string: The ID of the item's category, if any.
    • description string: The item's description. Searchable.
    • image_url string: The URL of an image representing this item.
    • label_color string: The color of the item's display label in the Square Point of Sale app.
    • modifier_list_info array: A set of CatalogItemModifierListInfo objects
    • name required string: The item's name. Searchable.
    • product_type string (values: REGULAR, GIFT_CARD, APPOINTMENTS_SERVICE, RETAIL_ITEM, RESTAURANT_ITEM): The product type of the item. May not be changed once an item has been created.
    • skip_modifier_screen boolean: If false, the Square Point of Sale app will present the CatalogItem's
    • tax_ids array: A set of IDs indicating the CatalogTaxes that are enabled for
      • items string
    • variations array: A list of CatalogObjects containing the CatalogItemVariations for this item.

CatalogItemModifierListInfo