Reference
May 20, 2026 Β· View on GitHub
OAuth
client.oAuth.revokeToken({ ...params }) -> Square.RevokeTokenResponse
-
π Description
-
-
Revokes an access token generated with the OAuth flow.
If an account has more than one OAuth access token for your application, this endpoint revokes all of them, regardless of which token you specify.
Important: The
Authorizationheader for this endpoint must have the following format:Authorization: Client APPLICATION_SECRETReplace
APPLICATION_SECRETwith the application secret on the OAuth page for your application in the Developer Dashboard.
-
π Usage
-
-
await client.oAuth.revokeToken({ clientId: "CLIENT_ID", accessToken: "ACCESS_TOKEN" });
-
βοΈ Parameters
-
-
request:
Square.RevokeTokenRequest
-
requestOptions:
OAuthClient.RequestOptions
-
-
client.oAuth.obtainToken({ ...params }) -> Square.ObtainTokenResponse
-
π Description
-
-
Returns an OAuth access token and refresh token using the
authorization_codeorrefresh_tokengrant type.When
grant_typeisauthorization_code:- With the code flow,
provide
code,client_id, andclient_secret. - With the PKCE flow,
provide
code,client_id, andcode_verifier.
When
grant_typeisrefresh_token:- With the code flow, provide
refresh_token,client_id, andclient_secret. The response returns the same refresh token provided in the request. - With the PKCE flow, provide
refresh_tokenandclient_id. The response returns a new refresh token.
You can use the
scopesparameter to limit the set of permissions authorized by the access token. You can use theshort_livedparameter to create an access token that expires in 24 hours.Important: OAuth tokens should be encrypted and stored on a secure server. Application clients should never interact directly with OAuth tokens.
- With the code flow,
provide
-
π Usage
-
-
await client.oAuth.obtainToken({ clientId: "sq0idp-uaPHILoPzWZk3tlJqlML0g", clientSecret: "sq0csp-30a-4C_tVOnTh14Piza2BfTPBXyLafLPWSzY1qAjeBfM", code: "sq0cgb-l0SBqxs4uwxErTVyYOdemg", grantType: "authorization_code" });
-
βοΈ Parameters
-
-
request:
Square.ObtainTokenRequest
-
requestOptions:
OAuthClient.RequestOptions
-
-
client.oAuth.retrieveTokenStatus() -> Square.RetrieveTokenStatusResponse
-
π Description
-
-
Returns information about an OAuth access tokenΒ or an applicationβs personal access token.
Add the access token to the Authorization header of the request.
Important: The
Authorizationheader you provide to this endpoint must have the following format:Authorization: Bearer ACCESS_TOKENwhere
ACCESS_TOKENis a valid production authorization credential.If the access token is expired or not a valid access token, the endpoint returns an
UNAUTHORIZEDerror.
-
π Usage
-
-
await client.oAuth.retrieveTokenStatus();
-
βοΈ Parameters
-
-
requestOptions:
OAuthClient.RequestOptions
-
-
client.oAuth.authorize() -> void
-
π Usage
-
-
await client.oAuth.authorize();
-
βοΈ Parameters
-
-
requestOptions:
OAuthClient.RequestOptions
-
-
V1Transactions
client.v1Transactions.v1ListOrders({ ...params }) -> Square.V1Order[]
-
π Description
-
-
Provides summary information for a merchant's online store orders.
-
π Usage
-
-
await client.v1Transactions.v1ListOrders({ locationId: "location_id", order: "DESC", limit: 1, batchToken: "batch_token" });
-
βοΈ Parameters
-
-
request:
Square.V1ListOrdersRequest
-
requestOptions:
V1TransactionsClient.RequestOptions
-
-
client.v1Transactions.v1RetrieveOrder({ ...params }) -> Square.V1Order
-
π Description
-
-
Provides comprehensive information for a single online store order, including the order's history.
-
π Usage
-
-
await client.v1Transactions.v1RetrieveOrder({ locationId: "location_id", orderId: "order_id" });
-
βοΈ Parameters
-
-
request:
Square.V1RetrieveOrderRequest
-
requestOptions:
V1TransactionsClient.RequestOptions
-
-
client.v1Transactions.v1UpdateOrder({ ...params }) -> Square.V1Order
-
π Description
-
-
Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:
-
π Usage
-
-
await client.v1Transactions.v1UpdateOrder({ locationId: "location_id", orderId: "order_id", action: "COMPLETE" });
-
βοΈ Parameters
-
-
request:
Square.V1UpdateOrderRequest
-
requestOptions:
V1TransactionsClient.RequestOptions
-
-
ApplePay
client.applePay.registerDomain({ ...params }) -> Square.RegisterDomainResponse
-
π Description
-
-
Activates a domain for use with Apple Pay on the Web and Square. A validation is performed on this domain by Apple to ensure that it is properly set up as an Apple Pay enabled domain.
This endpoint provides an easy way for platform developers to bulk activate Apple Pay on the Web with Square for merchants using their platform.
Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association, and should be hosted at
.well_known/apple-developer-merchantid-domain-associationon your domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding long-lived caches that might not keep in sync with the correct file version.To learn more about the Web Payments SDK and how to add Apple Pay, see Take an Apple Pay Payment.
-
π Usage
-
-
await client.applePay.registerDomain({ domainName: "example.com" });
-
βοΈ Parameters
-
-
request:
Square.RegisterDomainRequest
-
requestOptions:
ApplePayClient.RequestOptions
-
-
BankAccounts
client.bankAccounts.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a list of BankAccount objects linked to a Square account.
-
π Usage
-
-
const pageableResponse = await client.bankAccounts.list({ cursor: "cursor", limit: 1, locationId: "location_id", customerId: "customer_id" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.bankAccounts.list({ cursor: "cursor", limit: 1, locationId: "location_id", customerId: "customer_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListBankAccountsRequest
-
requestOptions:
BankAccountsClient.RequestOptions
-
-
client.bankAccounts.createBankAccount({ ...params }) -> Square.CreateBankAccountResponse
-
π Description
-
-
Store a bank account on file for a square account
-
π Usage
-
-
await client.bankAccounts.createBankAccount({ idempotencyKey: "4e43559a-f0fd-47d3-9da2-7ea1f97d94be", sourceId: "bnon:CA4SEHsQwr0rx6DbWLD5BQaqMnoYAQ", customerId: "HM3B2D5JKGZ69359BTEHXM2V8M" });
-
βοΈ Parameters
-
-
request:
Square.CreateBankAccountRequest
-
requestOptions:
BankAccountsClient.RequestOptions
-
-
client.bankAccounts.getByV1Id({ ...params }) -> Square.GetBankAccountByV1IdResponse
-
π Description
-
-
Returns details of a BankAccount identified by V1 bank account ID.
-
π Usage
-
-
await client.bankAccounts.getByV1Id({ v1BankAccountId: "v1_bank_account_id" });
-
βοΈ Parameters
-
-
request:
Square.GetByV1IdBankAccountsRequest
-
requestOptions:
BankAccountsClient.RequestOptions
-
-
client.bankAccounts.get({ ...params }) -> Square.GetBankAccountResponse
-
π Description
-
-
Retrieve details of a BankAccount bank account linked to a Square account.
-
π Usage
-
-
await client.bankAccounts.get({ bankAccountId: "bank_account_id" });
-
βοΈ Parameters
-
-
request:
Square.GetBankAccountsRequest
-
requestOptions:
BankAccountsClient.RequestOptions
-
-
client.bankAccounts.disableBankAccount({ ...params }) -> Square.DisableBankAccountResponse
-
π Description
-
-
Disable a bank account.
-
π Usage
-
-
await client.bankAccounts.disableBankAccount({ bankAccountId: "bank_account_id" });
-
βοΈ Parameters
-
-
request:
Square.DisableBankAccountRequest
-
requestOptions:
BankAccountsClient.RequestOptions
-
-
Bookings
client.bookings.list({ ...params }) -> core.Page
-
π Description
-
-
Retrieve a collection of bookings.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_READfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_READandAPPOINTMENTS_READfor the OAuth scope.
-
π Usage
-
-
const pageableResponse = await client.bookings.list({ limit: 1, cursor: "cursor", customerId: "customer_id", teamMemberId: "team_member_id", locationId: "location_id", startAtMin: "start_at_min", startAtMax: "start_at_max" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.bookings.list({ limit: 1, cursor: "cursor", customerId: "customer_id", teamMemberId: "team_member_id", locationId: "location_id", startAtMin: "start_at_min", startAtMax: "start_at_max" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListBookingsRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.create({ ...params }) -> Square.CreateBookingResponse
-
π Description
-
-
Creates a booking.
The required input must include the following:
Booking.location_idBooking.start_atBooking.AppointmentSegment.team_member_idBooking.AppointmentSegment.service_variation_idBooking.AppointmentSegment.service_variation_version
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.create({ booking: {} });
-
βοΈ Parameters
-
-
request:
Square.CreateBookingRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.searchAvailability({ ...params }) -> Square.SearchAvailabilityResponse
-
π Description
-
-
Searches for availabilities for booking.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_READfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_READandAPPOINTMENTS_READfor the OAuth scope.
-
π Usage
-
-
await client.bookings.searchAvailability({ query: { filter: { startAtRange: {} } } });
-
βοΈ Parameters
-
-
request:
Square.SearchAvailabilityRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.bulkRetrieveBookings({ ...params }) -> Square.BulkRetrieveBookingsResponse
-
π Description
-
-
Bulk-Retrieves a list of bookings by booking IDs.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_READfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_READandAPPOINTMENTS_READfor the OAuth scope.
-
π Usage
-
-
await client.bookings.bulkRetrieveBookings({ bookingIds: ["booking_ids"] });
-
βοΈ Parameters
-
-
request:
Square.BulkRetrieveBookingsRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.getBusinessProfile() -> Square.GetBusinessBookingProfileResponse
-
π Description
-
-
Retrieves a seller's booking profile.
-
π Usage
-
-
await client.bookings.getBusinessProfile();
-
βοΈ Parameters
-
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.retrieveLocationBookingProfile({ ...params }) -> Square.RetrieveLocationBookingProfileResponse
-
π Description
-
-
Retrieves a seller's location booking profile.
-
π Usage
-
-
await client.bookings.retrieveLocationBookingProfile({ locationId: "location_id" });
-
βοΈ Parameters
-
-
request:
Square.RetrieveLocationBookingProfileRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.bulkRetrieveTeamMemberBookingProfiles({ ...params }) -> Square.BulkRetrieveTeamMemberBookingProfilesResponse
-
π Description
-
-
Retrieves one or more team members' booking profiles.
-
π Usage
-
-
await client.bookings.bulkRetrieveTeamMemberBookingProfiles({ teamMemberIds: ["team_member_ids"] });
-
βοΈ Parameters
-
-
request:
Square.BulkRetrieveTeamMemberBookingProfilesRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.get({ ...params }) -> Square.GetBookingResponse
-
π Description
-
-
Retrieves a booking.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_READfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_READandAPPOINTMENTS_READfor the OAuth scope.
-
π Usage
-
-
await client.bookings.get({ bookingId: "booking_id" });
-
βοΈ Parameters
-
-
request:
Square.GetBookingsRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.update({ ...params }) -> Square.UpdateBookingResponse
-
π Description
-
-
Updates a booking.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.update({ bookingId: "booking_id", booking: {} });
-
βοΈ Parameters
-
-
request:
Square.UpdateBookingRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
client.bookings.cancel({ ...params }) -> Square.CancelBookingResponse
-
π Description
-
-
Cancels an existing booking.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.cancel({ bookingId: "booking_id" });
-
βοΈ Parameters
-
-
request:
Square.CancelBookingRequest
-
requestOptions:
BookingsClient.RequestOptions
-
-
Cards
client.cards.list({ ...params }) -> core.Page
-
π Description
-
-
Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned.
-
π Usage
-
-
const pageableResponse = await client.cards.list({ cursor: "cursor", customerId: "customer_id", includeDisabled: true, referenceId: "reference_id", sortOrder: "DESC" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.cards.list({ cursor: "cursor", customerId: "customer_id", includeDisabled: true, referenceId: "reference_id", sortOrder: "DESC" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListCardsRequest
-
requestOptions:
CardsClient.RequestOptions
-
-
client.cards.create({ ...params }) -> Square.CreateCardResponse
-
π Description
-
-
Adds a card on file to an existing merchant.
-
π Usage
-
-
await client.cards.create({ idempotencyKey: "4935a656-a929-4792-b97c-8848be85c27c", sourceId: "cnon:uIbfJXhXETSP197M3GB", card: { cardholderName: "Amelia Earhart", billingAddress: { addressLine1: "500 Electric Ave", addressLine2: "Suite 600", locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", country: "US" }, customerId: "VDKXEEKPJN48QDG3BGGFAK05P8", referenceId: "user-id-1" } });
-
βοΈ Parameters
-
-
request:
Square.CreateCardRequest
-
requestOptions:
CardsClient.RequestOptions
-
-
client.cards.get({ ...params }) -> Square.GetCardResponse
-
π Description
-
-
Retrieves details for a specific Card.
-
π Usage
-
-
await client.cards.get({ cardId: "card_id" });
-
βοΈ Parameters
-
-
request:
Square.GetCardsRequest
-
requestOptions:
CardsClient.RequestOptions
-
-
client.cards.disable({ ...params }) -> Square.DisableCardResponse
-
π Description
-
-
Disables the card, preventing any further updates or charges. Disabling an already disabled card is allowed but has no effect.
-
π Usage
-
-
await client.cards.disable({ cardId: "card_id" });
-
βοΈ Parameters
-
-
request:
Square.DisableCardsRequest
-
requestOptions:
CardsClient.RequestOptions
-
-
Catalog
client.catalog.batchDelete({ ...params }) -> Square.BatchDeleteCatalogObjectsResponse
-
π Description
-
-
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.
BatchDeleteCatalogObjectssucceeds even if only a portion of the targeted IDs can be deleted. The response will only include IDs that were actually deleted.To ensure consistency, only one delete request is processed at a time per seller account. While one (batch or non-batch) delete request is being processed, other (batched and non-batched) delete requests are rejected with the
429error code.
-
π Usage
-
-
await client.catalog.batchDelete({ objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"] });
-
βοΈ Parameters
-
-
request:
Square.BatchDeleteCatalogObjectsRequest
-
requestOptions:
CatalogClient.RequestOptions
-
-
client.catalog.batchGet({ ...params }) -> Square.BatchGetCatalogObjectsResponse
-
π Description
-
-
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.
-
π Usage
-
-
await client.catalog.batchGet({ objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], includeRelatedObjects: true });
-
βοΈ Parameters
-
-
request:
Square.BatchGetCatalogObjectsRequest
-
requestOptions:
CatalogClient.RequestOptions
-
-
client.catalog.batchUpsert({ ...params }) -> Square.BatchUpsertCatalogObjectsResponse
-
π Description
-
-
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.
To ensure consistency, only one update request is processed at a time per seller account. While one (batch or non-batch) update request is being processed, other (batched and non-batched) update requests are rejected with the
429error code.
-
π Usage
-
-
await client.catalog.batchUpsert({ idempotencyKey: "789ff020-f723-43a9-b4b5-43b5dc1fa3dc", batches: [{ objects: [{ type: "ITEM", id: "id" }, { type: "ITEM", id: "id" }, { type: "ITEM", id: "id" }, { type: "TAX", id: "id" }] }] });
-
βοΈ Parameters
-
-
request:
Square.BatchUpsertCatalogObjectsRequest
-
requestOptions:
CatalogClient.RequestOptions
-
-
client.catalog.info() -> Square.CatalogInfoResponse
-
π Description
-
-
Retrieves information about the Square Catalog API, such as batch size limits that can be used by the
BatchUpsertCatalogObjectsendpoint.
-
π Usage
-
-
await client.catalog.info();
-
βοΈ Parameters
-
-
requestOptions:
CatalogClient.RequestOptions
-
-
client.catalog.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a list of all CatalogObjects of the specified types in the catalog.
The
typesparameter is specified as a comma-separated list of the CatalogObjectType values, for example, "ITEM,ITEM_VARIATION,MODIFIER,MODIFIER_LIST,CATEGORY,DISCOUNT,TAX,IMAGE".Important: ListCatalog does not return deleted catalog items. To retrieve deleted catalog items, use SearchCatalogObjects and set the
include_deleted_objectsattribute value totrue.
-
π Usage
-
-
const pageableResponse = await client.catalog.list({ cursor: "cursor", types: "types", catalogVersion: BigInt("1000000") }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.catalog.list({ cursor: "cursor", types: "types", catalogVersion: BigInt("1000000") }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListCatalogRequest
-
requestOptions:
CatalogClient.RequestOptions
-
-
client.catalog.search({ ...params }) -> Square.SearchCatalogObjectsResponse
-
π Description
-
-
Searches for CatalogObject of any type by matching supported search attribute values, excluding custom attribute values on items or item variations, against one or more of the specified query filters.
This (
SearchCatalogObjects) endpoint differs from the SearchCatalogItems endpoint in the following aspects:SearchCatalogItemscan only search for items or item variations, whereasSearchCatalogObjectscan search for any type of catalog objects.SearchCatalogItemssupports the custom attribute query filters to return items or item variations that contain custom attribute values, whereSearchCatalogObjectsdoes not.SearchCatalogItemsdoes not support theinclude_deleted_objectsfilter to search for deleted items or item variations, whereasSearchCatalogObjectsdoes.- The both endpoints have different call conventions, including the query filter formats.
-
π Usage
-
-
await client.catalog.search({ objectTypes: ["ITEM"], query: { prefixQuery: { attributeName: "name", attributePrefix: "tea" } }, limit: 100 });
-
βοΈ Parameters
-
-
request:
Square.SearchCatalogObjectsRequest
-
requestOptions:
CatalogClient.RequestOptions
-
-
client.catalog.searchItems({ ...params }) -> Square.SearchCatalogItemsResponse
-
π Description
-
-
Searches for catalog items or item variations by matching supported search attribute values, including custom attribute values, against one or more of the specified query filters.
This (
SearchCatalogItems) endpoint differs from the SearchCatalogObjects endpoint in the following aspects:SearchCatalogItemscan only search for items or item variations, whereasSearchCatalogObjectscan search for any type of catalog objects.SearchCatalogItemssupports the custom attribute query filters to return items or item variations that contain custom attribute values, whereSearchCatalogObjectsdoes not.SearchCatalogItemsdoes not support theinclude_deleted_objectsfilter to search for deleted items or item variations, whereasSearchCatalogObjectsdoes.- The both endpoints use different call conventions, including the query filter formats.
-
π Usage
-
-
await client.catalog.searchItems({ textFilter: "red", categoryIds: ["WINE_CATEGORY_ID"], stockLevels: ["OUT", "LOW"], enabledLocationIds: ["ATL_LOCATION_ID"], limit: 100, sortOrder: "ASC", productTypes: ["REGULAR"], customAttributeFilters: [{ customAttributeDefinitionId: "VEGAN_DEFINITION_ID", boolFilter: true }, { customAttributeDefinitionId: "BRAND_DEFINITION_ID", stringFilter: "Dark Horse" }, { key: "VINTAGE", numberFilter: { min: "min", max: "max" } }, { customAttributeDefinitionId: "VARIETAL_DEFINITION_ID" }] });
-
βοΈ Parameters
-
-
request:
Square.SearchCatalogItemsRequest
-
requestOptions:
CatalogClient.RequestOptions
-
-
client.catalog.updateItemModifierLists({ ...params }) -> Square.UpdateItemModifierListsResponse
-
π Description
-
-
Updates the CatalogModifierList objects that apply to the targeted CatalogItem without having to perform an upsert on the entire item.
-
π Usage
-
-
await client.catalog.updateItemModifierLists({ itemIds: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], modifierListsToEnable: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], modifierListsToDisable: ["7WRC16CJZDVLSNDQ35PP6YAD"] });
-
βοΈ Parameters
-
-
request:
Square.UpdateItemModifierListsRequest
-
requestOptions:
CatalogClient.RequestOptions
-
-
client.catalog.updateItemTaxes({ ...params }) -> Square.UpdateItemTaxesResponse
-
π Description
-
-
Updates the CatalogTax objects that apply to the targeted CatalogItem without having to perform an upsert on the entire item.
-
π Usage
-
-
await client.catalog.updateItemTaxes({ itemIds: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], taxesToEnable: ["4WRCNHCJZDVLSNDQ35PP6YAD"], taxesToDisable: ["AQCEGCEBBQONINDOHRGZISEX"] });
-
βοΈ Parameters
-
-
request:
Square.UpdateItemTaxesRequest
-
requestOptions:
CatalogClient.RequestOptions
-
-
Channels
client.channels.list({ ...params }) -> core.Page
-
π Description
π Usage
-
-
const pageableResponse = await client.channels.list({ referenceType: "UNKNOWN_TYPE", referenceId: "reference_id", status: "ACTIVE", cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.channels.list({ referenceType: "UNKNOWN_TYPE", referenceId: "reference_id", status: "ACTIVE", cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListChannelsRequest
-
requestOptions:
ChannelsClient.RequestOptions
-
-
client.channels.bulkRetrieve({ ...params }) -> Square.BulkRetrieveChannelsResponse
-
π Description
π Usage
-
-
await client.channels.bulkRetrieve({ channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] });
-
βοΈ Parameters
-
-
request:
Square.BulkRetrieveChannelsRequest
-
requestOptions:
ChannelsClient.RequestOptions
-
-
client.channels.get({ ...params }) -> Square.RetrieveChannelResponse
-
π Description
π Usage
-
-
await client.channels.get({ channelId: "channel_id" });
-
βοΈ Parameters
-
-
request:
Square.GetChannelsRequest
-
requestOptions:
ChannelsClient.RequestOptions
-
-
Customers
client.customers.list({ ...params }) -> core.Page
-
π Description
-
-
Lists customer profiles associated with a Square account.
Under normal operating conditions, newly created or updated customer profiles become available for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated profiles can take closer to one minute or longer, especially during network incidents and outages.
-
π Usage
-
-
const pageableResponse = await client.customers.list({ cursor: "cursor", limit: 1, sortField: "DEFAULT", sortOrder: "DESC", count: true }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.customers.list({ cursor: "cursor", limit: 1, sortField: "DEFAULT", sortOrder: "DESC", count: true }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListCustomersRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.create({ ...params }) -> Square.CreateCustomerResponse
-
π Description
-
-
Creates a new customer for a business.
You must provide at least one of the following values in your request to this endpoint:
given_namefamily_namecompany_nameemail_addressphone_number
-
π Usage
-
-
await client.customers.create({ givenName: "Amelia", familyName: "Earhart", emailAddress: "Amelia.Earhart@example.com", address: { addressLine1: "500 Electric Ave", addressLine2: "Suite 600", locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", country: "US" }, phoneNumber: "+1-212-555-4240", referenceId: "YOUR_REFERENCE_ID", note: "a customer" });
-
βοΈ Parameters
-
-
request:
Square.CreateCustomerRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.batchCreate({ ...params }) -> Square.BulkCreateCustomersResponse
-
π Description
-
-
Creates multiple customer profiles for a business.
This endpoint takes a map of individual create requests and returns a map of responses.
You must provide at least one of the following values in each create request:
given_namefamily_namecompany_nameemail_addressphone_number
-
π Usage
-
-
await client.customers.batchCreate({ customers: { "8bb76c4f-e35d-4c5b-90de-1194cd9179f0": { givenName: "Amelia", familyName: "Earhart", emailAddress: "Amelia.Earhart@example.com", address: { addressLine1: "500 Electric Ave", addressLine2: "Suite 600", locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", country: "US" }, phoneNumber: "+1-212-555-4240", referenceId: "YOUR_REFERENCE_ID", note: "a customer" }, "d1689f23-b25d-4932-b2f0-aed00f5e2029": { givenName: "Marie", familyName: "Curie", emailAddress: "Marie.Curie@example.com", address: { addressLine1: "500 Electric Ave", addressLine2: "Suite 601", locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", country: "US" }, phoneNumber: "+1-212-444-4240", referenceId: "YOUR_REFERENCE_ID", note: "another customer" } } });
-
βοΈ Parameters
-
-
request:
Square.BulkCreateCustomersRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.bulkDeleteCustomers({ ...params }) -> Square.BulkDeleteCustomersResponse
-
π Description
-
-
Deletes multiple customer profiles.
The endpoint takes a list of customer IDs and returns a map of responses.
-
π Usage
-
-
await client.customers.bulkDeleteCustomers({ customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"] });
-
βοΈ Parameters
-
-
request:
Square.BulkDeleteCustomersRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.bulkRetrieveCustomers({ ...params }) -> Square.BulkRetrieveCustomersResponse
-
π Description
-
-
Retrieves multiple customer profiles.
This endpoint takes a list of customer IDs and returns a map of responses.
-
π Usage
-
-
await client.customers.bulkRetrieveCustomers({ customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"] });
-
βοΈ Parameters
-
-
request:
Square.BulkRetrieveCustomersRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.bulkUpdateCustomers({ ...params }) -> Square.BulkUpdateCustomersResponse
-
π Description
-
-
Updates multiple customer profiles.
This endpoint takes a map of individual update requests and returns a map of responses.
-
π Usage
-
-
await client.customers.bulkUpdateCustomers({ customers: { "8DDA5NZVBZFGAX0V3HPF81HHE0": { emailAddress: "New.Amelia.Earhart@example.com", note: "updated customer note", version: BigInt("2") }, "N18CPRVXR5214XPBBA6BZQWF3C": { givenName: "Marie", familyName: "Curie", version: BigInt("0") } } });
-
βοΈ Parameters
-
-
request:
Square.BulkUpdateCustomersRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.search({ ...params }) -> Square.SearchCustomersResponse
-
π Description
-
-
Searches the customer profiles associated with a Square account using one or more supported query filters.
Calling
SearchCustomerswithout any explicit query filter returns all customer profiles ordered alphabetically based ongiven_nameandfamily_name.Under normal operating conditions, newly created or updated customer profiles become available for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated profiles can take closer to one minute or longer, especially during network incidents and outages.
-
π Usage
-
-
await client.customers.search({ limit: BigInt("2"), query: { filter: { creationSource: { values: ["THIRD_PARTY"], rule: "INCLUDE" }, createdAt: { startAt: "2018-01-01T00:00:00-00:00", endAt: "2018-02-01T00:00:00-00:00" }, emailAddress: { fuzzy: "example.com" }, groupIds: { all: ["545AXB44B4XXWMVQ4W8SBT3HHF"] } }, sort: { field: "CREATED_AT", order: "ASC" } } });
-
βοΈ Parameters
-
-
request:
Square.SearchCustomersRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.get({ ...params }) -> Square.GetCustomerResponse
-
π Description
-
-
Returns details for a single customer.
-
π Usage
-
-
await client.customers.get({ customerId: "customer_id" });
-
βοΈ Parameters
-
-
request:
Square.GetCustomersRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.update({ ...params }) -> Square.UpdateCustomerResponse
-
π Description
-
-
Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. To add or update a field, specify the new value. To remove a field, specify
null.To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
-
π Usage
-
-
await client.customers.update({ customerId: "customer_id", emailAddress: "New.Amelia.Earhart@example.com", note: "updated customer note", version: BigInt("2") });
-
βοΈ Parameters
-
-
request:
Square.UpdateCustomerRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
client.customers.delete({ ...params }) -> Square.DeleteCustomerResponse
-
π Description
-
-
Deletes a customer profile from a business.
To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
-
π Usage
-
-
await client.customers.delete({ customerId: "customer_id", version: BigInt("1000000") });
-
βοΈ Parameters
-
-
request:
Square.DeleteCustomersRequest
-
requestOptions:
CustomersClient.RequestOptions
-
-
Devices
client.devices.list({ ...params }) -> core.Page
-
π Description
-
-
List devices associated with the merchant. Currently, only Terminal API devices are supported.
-
π Usage
-
-
const pageableResponse = await client.devices.list({ cursor: "cursor", sortOrder: "DESC", limit: 1, locationId: "location_id" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.devices.list({ cursor: "cursor", sortOrder: "DESC", limit: 1, locationId: "location_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListDevicesRequest
-
requestOptions:
DevicesClient.RequestOptions
-
-
client.devices.get({ ...params }) -> Square.GetDeviceResponse
-
π Description
-
-
Retrieves Device with the associated
device_id.
-
π Usage
-
-
await client.devices.get({ deviceId: "device_id" });
-
βοΈ Parameters
-
-
request:
Square.GetDevicesRequest
-
requestOptions:
DevicesClient.RequestOptions
-
-
Disputes
client.disputes.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a list of disputes associated with a particular account.
-
π Usage
-
-
const pageableResponse = await client.disputes.list({ cursor: "cursor", states: "INQUIRY_EVIDENCE_REQUIRED", locationId: "location_id" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.disputes.list({ cursor: "cursor", states: "INQUIRY_EVIDENCE_REQUIRED", locationId: "location_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListDisputesRequest
-
requestOptions:
DisputesClient.RequestOptions
-
-
client.disputes.get({ ...params }) -> Square.GetDisputeResponse
-
π Description
-
-
Returns details about a specific dispute.
-
π Usage
-
-
await client.disputes.get({ disputeId: "dispute_id" });
-
βοΈ Parameters
-
-
request:
Square.GetDisputesRequest
-
requestOptions:
DisputesClient.RequestOptions
-
-
client.disputes.accept({ ...params }) -> Square.AcceptDisputeResponse
-
π Description
-
-
Accepts the loss on a dispute. Square returns the disputed amount to the cardholder and updates the dispute state to ACCEPTED.
Square debits the disputed amount from the sellerβs Square account. If the Square account does not have sufficient funds, Square debits the associated bank account.
-
π Usage
-
-
await client.disputes.accept({ disputeId: "dispute_id" });
-
βοΈ Parameters
-
-
request:
Square.AcceptDisputesRequest
-
requestOptions:
DisputesClient.RequestOptions
-
-
client.disputes.createEvidenceFile({ ...params }) -> Square.CreateDisputeEvidenceFileResponse
-
π Description
-
-
Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats.
-
π Usage
-
-
await client.disputes.createEvidenceFile({ disputeId: "dispute_id" });
-
βοΈ Parameters
-
-
request:
Square.CreateEvidenceFileDisputesRequest
-
requestOptions:
DisputesClient.RequestOptions
-
-
client.disputes.createEvidenceText({ ...params }) -> Square.CreateDisputeEvidenceTextResponse
-
π Description
-
-
Uploads text to use as evidence for a dispute challenge.
-
π Usage
-
-
await client.disputes.createEvidenceText({ disputeId: "dispute_id", idempotencyKey: "ed3ee3933d946f1514d505d173c82648", evidenceType: "TRACKING_NUMBER", evidenceText: "1Z8888888888888888" });
-
βοΈ Parameters
-
-
request:
Square.CreateDisputeEvidenceTextRequest
-
requestOptions:
DisputesClient.RequestOptions
-
-
client.disputes.submitEvidence({ ...params }) -> Square.SubmitEvidenceResponse
-
π Description
-
-
Submits evidence to the cardholder's bank.
The evidence submitted by this endpoint includes evidence uploaded using the CreateDisputeEvidenceFile and CreateDisputeEvidenceText endpoints and evidence automatically provided by Square, when available. Evidence cannot be removed from a dispute after submission.
-
π Usage
-
-
await client.disputes.submitEvidence({ disputeId: "dispute_id" });
-
βοΈ Parameters
-
-
request:
Square.SubmitEvidenceDisputesRequest
-
requestOptions:
DisputesClient.RequestOptions
-
-
Employees
client.employees.list({ ...params }) -> core.Page
-
π Description
π Usage
-
-
const pageableResponse = await client.employees.list({ locationId: "location_id", status: "ACTIVE", limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.employees.list({ locationId: "location_id", status: "ACTIVE", limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListEmployeesRequest
-
requestOptions:
EmployeesClient.RequestOptions
-
-
client.employees.get({ ...params }) -> Square.GetEmployeeResponse
-
π Description
π Usage
-
-
await client.employees.get({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.GetEmployeesRequest
-
requestOptions:
EmployeesClient.RequestOptions
-
-
Events
client.events.searchEvents({ ...params }) -> Square.SearchEventsResponse
-
π Description
-
-
Search for Square API events that occur within a 28-day timeframe.
-
π Usage
-
-
await client.events.searchEvents();
-
βοΈ Parameters
-
-
request:
Square.SearchEventsRequest
-
requestOptions:
EventsClient.RequestOptions
-
-
client.events.disableEvents() -> Square.DisableEventsResponse
-
π Description
-
-
Disables events to prevent them from being searchable. All events are disabled by default. You must enable events to make them searchable. Disabling events for a specific time period prevents them from being searchable, even if you re-enable them later.
-
π Usage
-
-
await client.events.disableEvents();
-
βοΈ Parameters
-
-
requestOptions:
EventsClient.RequestOptions
-
-
client.events.enableEvents() -> Square.EnableEventsResponse
-
π Description
-
-
Enables events to make them searchable. Only events that occur while in the enabled state are searchable.
-
π Usage
-
-
await client.events.enableEvents();
-
βοΈ Parameters
-
-
requestOptions:
EventsClient.RequestOptions
-
-
client.events.listEventTypes({ ...params }) -> Square.ListEventTypesResponse
-
π Description
-
-
Lists all event types that you can subscribe to as webhooks or query using the Events API.
-
π Usage
-
-
await client.events.listEventTypes({ apiVersion: "api_version" });
-
βοΈ Parameters
-
-
request:
Square.ListEventTypesRequest
-
requestOptions:
EventsClient.RequestOptions
-
-
GiftCards
client.giftCards.list({ ...params }) -> core.Page
-
π Description
-
-
Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by
created_atin ascending order.
-
π Usage
-
-
const pageableResponse = await client.giftCards.list({ type: "type", state: "state", limit: 1, cursor: "cursor", customerId: "customer_id" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.giftCards.list({ type: "type", state: "state", limit: 1, cursor: "cursor", customerId: "customer_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListGiftCardsRequest
-
requestOptions:
GiftCardsClient.RequestOptions
-
-
client.giftCards.create({ ...params }) -> Square.CreateGiftCardResponse
-
π Description
-
-
Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift card has a
PENDINGstate. To activate a gift card so that it can be redeemed for purchases, call CreateGiftCardActivity and create anACTIVATEactivity with the initial balance. Alternatively, you can use RefundPayment to refund a payment to the new gift card.
-
π Usage
-
-
await client.giftCards.create({ idempotencyKey: "NC9Tm69EjbjtConu", locationId: "81FN9BNFZTKS4", giftCard: { type: "DIGITAL" } });
-
βοΈ Parameters
-
-
request:
Square.CreateGiftCardRequest
-
requestOptions:
GiftCardsClient.RequestOptions
-
-
client.giftCards.getFromGan({ ...params }) -> Square.GetGiftCardFromGanResponse
-
π Description
-
-
Retrieves a gift card using the gift card account number (GAN).
-
π Usage
-
-
await client.giftCards.getFromGan({ gan: "7783320001001635" });
-
βοΈ Parameters
-
-
request:
Square.GetGiftCardFromGanRequest
-
requestOptions:
GiftCardsClient.RequestOptions
-
-
client.giftCards.getFromNonce({ ...params }) -> Square.GetGiftCardFromNonceResponse
-
π Description
-
-
Retrieves a gift card using a secure payment token that represents the gift card.
-
π Usage
-
-
await client.giftCards.getFromNonce({ nonce: "cnon:7783322135245171" });
-
βοΈ Parameters
-
-
request:
Square.GetGiftCardFromNonceRequest
-
requestOptions:
GiftCardsClient.RequestOptions
-
-
client.giftCards.linkCustomer({ ...params }) -> Square.LinkCustomerToGiftCardResponse
-
π Description
-
-
Links a customer to a gift card, which is also referred to as adding a card on file.
-
π Usage
-
-
await client.giftCards.linkCustomer({ giftCardId: "gift_card_id", customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW" });
-
βοΈ Parameters
-
-
request:
Square.LinkCustomerToGiftCardRequest
-
requestOptions:
GiftCardsClient.RequestOptions
-
-
client.giftCards.unlinkCustomer({ ...params }) -> Square.UnlinkCustomerFromGiftCardResponse
-
π Description
-
-
Unlinks a customer from a gift card, which is also referred to as removing a card on file.
-
π Usage
-
-
await client.giftCards.unlinkCustomer({ giftCardId: "gift_card_id", customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW" });
-
βοΈ Parameters
-
-
request:
Square.UnlinkCustomerFromGiftCardRequest
-
requestOptions:
GiftCardsClient.RequestOptions
-
-
client.giftCards.get({ ...params }) -> Square.GetGiftCardResponse
-
π Description
-
-
Retrieves a gift card using the gift card ID.
-
π Usage
-
-
await client.giftCards.get({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.GetGiftCardsRequest
-
requestOptions:
GiftCardsClient.RequestOptions
-
-
Inventory
client.inventory.deprecatedGetAdjustment({ ...params }) -> Square.GetInventoryAdjustmentResponse
-
π Description
-
-
Deprecated version of RetrieveInventoryAdjustment after the endpoint URL is updated to conform to the standard convention.
-
π Usage
-
-
await client.inventory.deprecatedGetAdjustment({ adjustmentId: "adjustment_id" });
-
βοΈ Parameters
-
-
request:
Square.DeprecatedGetAdjustmentInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.getAdjustment({ ...params }) -> Square.GetInventoryAdjustmentResponse
-
π Description
-
-
Returns the InventoryAdjustment object with the provided
adjustment_id.
-
π Usage
-
-
await client.inventory.getAdjustment({ adjustmentId: "adjustment_id" });
-
βοΈ Parameters
-
-
request:
Square.GetAdjustmentInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.deprecatedBatchChange({ ...params }) -> Square.BatchChangeInventoryResponse
-
π Description
-
-
Deprecated version of BatchChangeInventory after the endpoint URL is updated to conform to the standard convention.
-
π Usage
-
-
await client.inventory.deprecatedBatchChange({ idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", changes: [{ type: "PHYSICAL_COUNT", physicalCount: { referenceId: "1536bfbf-efed-48bf-b17d-a197141b2a92", catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", state: "IN_STOCK", locationId: "C6W5YS5QM06F5", quantity: "53", teamMemberId: "LRK57NSQ5X7PUD05", occurredAt: "2016-11-16T22:25:24.878Z" } }], ignoreUnchangedCounts: true });
-
βοΈ Parameters
-
-
request:
Square.BatchChangeInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.deprecatedBatchGetChanges({ ...params }) -> Square.BatchGetInventoryChangesResponse
-
π Description
-
-
Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL is updated to conform to the standard convention.
-
π Usage
-
-
await client.inventory.deprecatedBatchGetChanges({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["C6W5YS5QM06F5"], types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", updatedBefore: "2016-12-01T00:00:00.000Z" });
-
βοΈ Parameters
-
-
request:
Square.BatchRetrieveInventoryChangesRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.deprecatedBatchGetCounts({ ...params }) -> Square.BatchGetInventoryCountsResponse
-
π Description
-
-
Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL is updated to conform to the standard convention.
-
π Usage
-
-
await client.inventory.deprecatedBatchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], updatedAfter: "2016-11-16T00:00:00.000Z" });
-
βοΈ Parameters
-
-
request:
Square.BatchGetInventoryCountsRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.batchCreateChanges({ ...params }) -> Square.BatchChangeInventoryResponse
-
π Description
-
-
Applies adjustments and counts to the provided item quantities.
On success: returns the current calculated counts for all objects referenced in the request. On failure: returns a list of related errors.
-
π Usage
-
-
await client.inventory.batchCreateChanges({ idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", changes: [{ type: "PHYSICAL_COUNT", physicalCount: { referenceId: "1536bfbf-efed-48bf-b17d-a197141b2a92", catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", state: "IN_STOCK", locationId: "C6W5YS5QM06F5", quantity: "53", teamMemberId: "LRK57NSQ5X7PUD05", occurredAt: "2016-11-16T22:25:24.878Z" } }], ignoreUnchangedCounts: true });
-
βοΈ Parameters
-
-
request:
Square.BatchChangeInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.batchGetChanges({ ...params }) -> core.Page
-
π Description
-
-
Returns historical physical counts and adjustments based on the provided filter criteria.
Results are paginated and sorted in ascending order according their
occurred_attimestamp (oldest first).BatchRetrieveInventoryChanges is a catch-all query endpoint for queries that cannot be handled by other, simpler endpoints.
-
π Usage
-
-
const pageableResponse = await client.inventory.batchGetChanges({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["C6W5YS5QM06F5"], types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", updatedBefore: "2016-12-01T00:00:00.000Z" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.inventory.batchGetChanges({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["C6W5YS5QM06F5"], types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", updatedBefore: "2016-12-01T00:00:00.000Z" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.BatchRetrieveInventoryChangesRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.batchGetCounts({ ...params }) -> core.Page
-
π Description
-
-
Returns current counts for the provided CatalogObjects at the requested Locations.
Results are paginated and sorted in descending order according to their
calculated_attimestamp (newest first).When
updated_afteris specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a "sync" operation, for example in response to receiving a Webhook notification.
-
π Usage
-
-
const pageableResponse = await client.inventory.batchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], updatedAfter: "2016-11-16T00:00:00.000Z" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.inventory.batchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], updatedAfter: "2016-11-16T00:00:00.000Z" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.BatchGetInventoryCountsRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.deprecatedGetPhysicalCount({ ...params }) -> Square.GetInventoryPhysicalCountResponse
-
π Description
-
-
Deprecated version of RetrieveInventoryPhysicalCount after the endpoint URL is updated to conform to the standard convention.
-
π Usage
-
-
await client.inventory.deprecatedGetPhysicalCount({ physicalCountId: "physical_count_id" });
-
βοΈ Parameters
-
-
request:
Square.DeprecatedGetPhysicalCountInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.getPhysicalCount({ ...params }) -> Square.GetInventoryPhysicalCountResponse
-
π Description
-
-
Returns the InventoryPhysicalCount object with the provided
physical_count_id.
-
π Usage
-
-
await client.inventory.getPhysicalCount({ physicalCountId: "physical_count_id" });
-
βοΈ Parameters
-
-
request:
Square.GetPhysicalCountInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.getTransfer({ ...params }) -> Square.GetInventoryTransferResponse
-
π Description
-
-
Returns the InventoryTransfer object with the provided
transfer_id.
-
π Usage
-
-
await client.inventory.getTransfer({ transferId: "transfer_id" });
-
βοΈ Parameters
-
-
request:
Square.GetTransferInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.get({ ...params }) -> core.Page
-
π Description
-
-
Retrieves the current calculated stock count for a given CatalogObject at a given set of Locations. Responses are paginated and unsorted. For more sophisticated queries, use a batch endpoint.
-
π Usage
-
-
const pageableResponse = await client.inventory.get({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.inventory.get({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.GetInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
client.inventory.changes({ ...params }) -> core.Page
-
π Description
-
-
Returns a set of physical counts and inventory adjustments for the provided CatalogObject at the requested Locations.
You can achieve the same result by calling BatchRetrieveInventoryChanges and having the
catalog_object_idslist contain a single element of theCatalogObjectID.Results are paginated and sorted in descending order according to their
occurred_attimestamp (newest first).There are no limits on how far back the caller can page. This endpoint can be used to display recent changes for a specific item. For more sophisticated queries, use a batch endpoint.
-
π Usage
-
-
const pageableResponse = await client.inventory.changes({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.inventory.changes({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ChangesInventoryRequest
-
requestOptions:
InventoryClient.RequestOptions
-
-
Invoices
client.invoices.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a
cursorthat you
use in a subsequent request to retrieve the next set of invoices.
-
π Usage
-
-
const pageableResponse = await client.invoices.list({ locationId: "location_id", cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.invoices.list({ locationId: "location_id", cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListInvoicesRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.create({ ...params }) -> Square.CreateInvoiceResponse
-
π Description
-
-
Creates a draft invoice for an order created using the Orders API.
A draft invoice remains in your account and no action is taken. You must publish the invoice before Square can process it (send it to the customer's email address or charge the customerβs card on file).
-
π Usage
-
-
await client.invoices.create({ invoice: { locationId: "ES0RJRZYEC39A", orderId: "CAISENgvlJ6jLWAzERDzjyHVybY", primaryRecipient: { customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4" }, paymentRequests: [{ requestType: "BALANCE", dueDate: "2030-01-24", tippingEnabled: true, automaticPaymentSource: "NONE", reminders: [{ relativeScheduledDays: -1, message: "Your invoice is due tomorrow" }] }], deliveryMethod: "EMAIL", invoiceNumber: "inv-100", title: "Event Planning Services", description: "We appreciate your business!", scheduledAt: "2030-01-13T10:00:00Z", acceptedPaymentMethods: { card: true, squareGiftCard: false, bankAccount: false, buyNowPayLater: false, cashAppPay: false }, customFields: [{ label: "Event Reference Number", value: "Ref. #1234", placement: "ABOVE_LINE_ITEMS" }, { label: "Terms of Service", value: "The terms of service are...", placement: "BELOW_LINE_ITEMS" }], saleOrServiceDate: "2030-01-24", storePaymentMethodEnabled: false }, idempotencyKey: "ce3748f9-5fc1-4762-aa12-aae5e843f1f4" });
-
βοΈ Parameters
-
-
request:
Square.CreateInvoiceRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.search({ ...params }) -> Square.SearchInvoicesResponse
-
π Description
-
-
Searches for invoices from a location specified in the filter. You can optionally specify customers in the filter for whom to retrieve invoices. In the current implementation, you can only specify one location and optionally one customer.
The response is paginated. If truncated, the response includes a
cursorthat you use in a subsequent request to retrieve the next set of invoices.
-
π Usage
-
-
await client.invoices.search({ query: { filter: { locationIds: ["ES0RJRZYEC39A"], customerIds: ["JDKYHBWT1D4F8MFH63DBMEN8Y4"] }, sort: { field: "INVOICE_SORT_DATE", order: "DESC" } }, limit: 100 });
-
βοΈ Parameters
-
-
request:
Square.SearchInvoicesRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.get({ ...params }) -> Square.GetInvoiceResponse
-
π Description
-
-
Retrieves an invoice by invoice ID.
-
π Usage
-
-
await client.invoices.get({ invoiceId: "invoice_id" });
-
βοΈ Parameters
-
-
request:
Square.GetInvoicesRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.update({ ...params }) -> Square.UpdateInvoiceResponse
-
π Description
-
-
Updates an invoice. This endpoint supports sparse updates, so you only need to specify the fields you want to change along with the required
versionfield. Some restrictions apply to updating invoices. For example, you cannot change theorder_idorlocation_idfield.
-
π Usage
-
-
await client.invoices.update({ invoiceId: "invoice_id", invoice: { version: 1, paymentRequests: [{ uid: "2da7964f-f3d2-4f43-81e8-5aa220bf3355", tippingEnabled: false }] }, idempotencyKey: "4ee82288-0910-499e-ab4c-5d0071dad1be" });
-
βοΈ Parameters
-
-
request:
Square.UpdateInvoiceRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.delete({ ...params }) -> Square.DeleteInvoiceResponse
-
π Description
-
-
Deletes the specified invoice. When an invoice is deleted, the associated order status changes to CANCELED. You can only delete a draft invoice (you cannot delete a published invoice, including one that is scheduled for processing).
-
π Usage
-
-
await client.invoices.delete({ invoiceId: "invoice_id", version: 1 });
-
βοΈ Parameters
-
-
request:
Square.DeleteInvoicesRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.createInvoiceAttachment({ ...params }) -> Square.CreateInvoiceAttachmentResponse
-
π Description
-
-
Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file uploads with a JSON
requestpart and afilepart. Thefilepart must be areadable streamthat contains a file in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF.Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices in the
DRAFT,SCHEDULED,UNPAID, orPARTIALLY_PAIDstate.NOTE: When testing in the Sandbox environment, the total file size is limited to 1 KB.
-
π Usage
-
-
await client.invoices.createInvoiceAttachment({ invoiceId: "invoice_id" });
-
βοΈ Parameters
-
-
request:
Square.CreateInvoiceAttachmentRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.deleteInvoiceAttachment({ ...params }) -> Square.DeleteInvoiceAttachmentResponse
-
π Description
-
-
Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only from invoices in the
DRAFT,SCHEDULED,UNPAID, orPARTIALLY_PAIDstate.
-
π Usage
-
-
await client.invoices.deleteInvoiceAttachment({ invoiceId: "invoice_id", attachmentId: "attachment_id" });
-
βοΈ Parameters
-
-
request:
Square.DeleteInvoiceAttachmentRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.cancel({ ...params }) -> Square.CancelInvoiceResponse
-
π Description
-
-
Cancels an invoice. The seller cannot collect payments for the canceled invoice.
You cannot cancel an invoice in the
DRAFTstate or in a terminal state:PAID,REFUNDED,CANCELED, orFAILED.
-
π Usage
-
-
await client.invoices.cancel({ invoiceId: "invoice_id", version: 0 });
-
βοΈ Parameters
-
-
request:
Square.CancelInvoiceRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
client.invoices.publish({ ...params }) -> Square.PublishInvoiceResponse
-
π Description
-
-
Publishes the specified draft invoice.
After an invoice is published, Square follows up based on the invoice configuration. For example, Square sends the invoice to the customer's email address, charges the customer's card on file, or does nothing. Square also makes the invoice available on a Square-hosted invoice page.
The invoice
statusalso changes fromDRAFTto a status based on the invoice configuration. For example, the status changes toUNPAIDif Square emails the invoice orPARTIALLY_PAIDif Square charges a card on file for a portion of the invoice amount.In addition to the required
ORDERS_WRITEandINVOICES_WRITEpermissions,CUSTOMERS_READandPAYMENTS_WRITEare required when publishing invoices configured for card-on-file payments.
-
π Usage
-
-
await client.invoices.publish({ invoiceId: "invoice_id", version: 1, idempotencyKey: "32da42d0-1997-41b0-826b-f09464fc2c2e" });
-
βοΈ Parameters
-
-
request:
Square.PublishInvoiceRequest
-
requestOptions:
InvoicesClient.RequestOptions
-
-
Labor
client.labor.createScheduledShift({ ...params }) -> Square.CreateScheduledShiftResponse
-
π Description
-
-
Creates a scheduled shift by providing draft shift details such as job ID, team member assignment, and start and end times.
The following
draft_shift_detailsfields are required:location_idjob_idstart_atend_at
-
π Usage
-
-
await client.labor.createScheduledShift({ idempotencyKey: "HIDSNG5KS478L", scheduledShift: { draftShiftDetails: { teamMemberId: "ormj0jJJZ5OZIzxrZYJI", locationId: "PAA1RJZZKXBFG", jobId: "FzbJAtt9qEWncK1BWgVCxQ6M", startAt: "2019-01-25T03:11:00-05:00", endAt: "2019-01-25T13:11:00-05:00", notes: "Dont forget to prep the vegetables", isDeleted: false } } });
-
βοΈ Parameters
-
-
request:
Square.CreateScheduledShiftRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.bulkPublishScheduledShifts({ ...params }) -> Square.BulkPublishScheduledShiftsResponse
-
π Description
-
-
Publishes 1 - 100 scheduled shifts. This endpoint takes a map of individual publish requests and returns a map of responses. When a scheduled shift is published, Square keeps the
draft_shift_detailsfield as is and copies it to thepublished_shift_detailsfield.The minimum
start_atand maximumend_attimestamps of all shifts in aBulkPublishScheduledShiftsrequest must fall within a two-week period.
-
π Usage
-
-
await client.labor.bulkPublishScheduledShifts({ scheduledShifts: { "key": {} }, scheduledShiftNotificationAudience: "AFFECTED" });
-
βοΈ Parameters
-
-
request:
Square.BulkPublishScheduledShiftsRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.searchScheduledShifts({ ...params }) -> Square.SearchScheduledShiftsResponse
-
π Description
-
-
Returns a paginated list of scheduled shifts, with optional filter and sort settings. By default, results are sorted by
start_atin ascending order.
-
π Usage
-
-
await client.labor.searchScheduledShifts({ query: { filter: { assignmentStatus: "ASSIGNED" }, sort: { field: "CREATED_AT", order: "ASC" } }, limit: 2, cursor: "xoxp-1234-5678-90123" });
-
βοΈ Parameters
-
-
request:
Square.SearchScheduledShiftsRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.retrieveScheduledShift({ ...params }) -> Square.RetrieveScheduledShiftResponse
-
π Description
-
-
Retrieves a scheduled shift by ID.
-
π Usage
-
-
await client.labor.retrieveScheduledShift({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.RetrieveScheduledShiftRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.updateScheduledShift({ ...params }) -> Square.UpdateScheduledShiftResponse
-
π Description
-
-
Updates the draft shift details for a scheduled shift. This endpoint supports sparse updates, so only new, changed, or removed fields are required in the request. You must publish the shift to make updates public.
You can make the following updates to
draft_shift_details:- Change the
location_id,job_id,start_at, andend_atfields. - Add, change, or clear the
team_member_idandnotesfields. To clear these fields, set the value to null. - Change the
is_deletedfield. To delete a scheduled shift, setis_deletedto true and then publish the shift.
- Change the
-
π Usage
-
-
await client.labor.updateScheduledShift({ id: "id", scheduledShift: { draftShiftDetails: { teamMemberId: "ormj0jJJZ5OZIzxrZYJI", locationId: "PAA1RJZZKXBFG", jobId: "FzbJAtt9qEWncK1BWgVCxQ6M", startAt: "2019-03-25T03:11:00-05:00", endAt: "2019-03-25T13:18:00-05:00", notes: "Dont forget to prep the vegetables", isDeleted: false }, version: 1 } });
-
βοΈ Parameters
-
-
request:
Square.UpdateScheduledShiftRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.publishScheduledShift({ ...params }) -> Square.PublishScheduledShiftResponse
-
π Description
-
-
Publishes a scheduled shift. When a scheduled shift is published, Square keeps the
draft_shift_detailsfield as is and copies it to thepublished_shift_detailsfield.
-
π Usage
-
-
await client.labor.publishScheduledShift({ id: "id", idempotencyKey: "HIDSNG5KS478L", version: 2, scheduledShiftNotificationAudience: "ALL" });
-
βοΈ Parameters
-
-
request:
Square.PublishScheduledShiftRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.createTimecard({ ...params }) -> Square.CreateTimecardResponse
-
π Description
-
-
Creates a new
Timecard.A
Timecardrepresents a complete workday for a single team member. You must provide the following values in your request to this endpoint:location_idteam_member_idstart_at
An attempt to create a new
Timecardcan result in aBAD_REQUESTerror when:- The
statusof the newTimecardisOPENand the team member has another timecard with anOPENstatus. - The
start_atdate is in the future. - The
start_atorend_atdate overlaps another timecard for the same team member. - The
Breakinstances are set in the request and a breakstart_atis before theTimecard.start_at, a breakend_atis after theTimecard.end_at, or both.
-
π Usage
-
-
await client.labor.createTimecard({ idempotencyKey: "HIDSNG5KS478L", timecard: { locationId: "PAA1RJZZKXBFG", startAt: "2019-01-25T03:11:00-05:00", endAt: "2019-01-25T13:11:00-05:00", wage: { title: "Barista", hourlyRate: { amount: BigInt("1100"), currency: "USD" }, tipEligible: true }, breaks: [{ startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", isPaid: true }], teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), currency: "USD" } } });
-
βοΈ Parameters
-
-
request:
Square.CreateTimecardRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.searchTimecards({ ...params }) -> Square.SearchTimecardsResponse
-
π Description
-
-
Returns a paginated list of
Timecardrecords for a business. The list to be returned can be filtered by:- Location IDs
- Team member IDs
- Timecard status (
OPENorCLOSED) - Timecard start
- Timecard end
- Workday details
The list can be sorted by:
START_ATEND_ATCREATED_ATUPDATED_AT
-
π Usage
-
-
await client.labor.searchTimecards({ query: { filter: { workday: { dateRange: { startDate: "2019-01-20", endDate: "2019-02-03" }, matchTimecardsBy: "START_AT", defaultTimezone: "America/Los_Angeles" } } }, limit: 100 });
-
βοΈ Parameters
-
-
request:
Square.SearchTimecardsRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.retrieveTimecard({ ...params }) -> Square.RetrieveTimecardResponse
-
π Description
-
-
Returns a single
Timecardspecified byid.
-
π Usage
-
-
await client.labor.retrieveTimecard({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.RetrieveTimecardRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.updateTimecard({ ...params }) -> Square.UpdateTimecardResponse
-
π Description
-
-
Updates an existing
Timecard.When adding a
Breakto aTimecard, any earlierBreakinstances in theTimecardhave theend_atproperty set to a valid RFC-3339 datetime string.When closing a
Timecard, allBreakinstances in theTimecardmust be complete withend_atset on eachBreak.
-
π Usage
-
-
await client.labor.updateTimecard({ id: "id", timecard: { locationId: "PAA1RJZZKXBFG", startAt: "2019-01-25T03:11:00-05:00", endAt: "2019-01-25T13:11:00-05:00", wage: { title: "Bartender", hourlyRate: { amount: BigInt("1500"), currency: "USD" }, tipEligible: true }, breaks: [{ id: "X7GAQYVVRRG6P", startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", isPaid: true }], status: "CLOSED", version: 1, teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), currency: "USD" } } });
-
βοΈ Parameters
-
-
request:
Square.UpdateTimecardRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
client.labor.deleteTimecard({ ...params }) -> Square.DeleteTimecardResponse
-
π Description
-
-
Deletes a
Timecard.
-
π Usage
-
-
await client.labor.deleteTimecard({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.DeleteTimecardRequest
-
requestOptions:
LaborClient.RequestOptions
-
-
Locations
client.locations.list() -> Square.ListLocationsResponse
-
π Description
-
-
Provides details about all of the seller's locations, including those with an inactive status. Locations are listed alphabetically by
name.
-
π Usage
-
-
await client.locations.list();
-
βοΈ Parameters
-
-
requestOptions:
LocationsClient.RequestOptions
-
-
client.locations.create({ ...params }) -> Square.CreateLocationResponse
-
π Description
-
-
Creates a location. Creating new locations allows for separate configuration of receipt layouts, item prices, and sales reports. Developers can use locations to separate sales activity through applications that integrate with Square from sales activity elsewhere in a seller's account. Locations created programmatically with the Locations API last forever and are visible to the seller for their own management. Therefore, ensure that each location has a sensible and unique name.
-
π Usage
-
-
await client.locations.create({ location: { name: "Midtown", address: { addressLine1: "1234 Peachtree St. NE", locality: "Atlanta", administrativeDistrictLevel1: "GA", postalCode: "30309" }, description: "Midtown Atlanta store" } });
-
βοΈ Parameters
-
-
request:
Square.CreateLocationRequest
-
requestOptions:
LocationsClient.RequestOptions
-
-
client.locations.get({ ...params }) -> Square.GetLocationResponse
-
π Description
-
-
Retrieves details of a single location. Specify "main" as the location ID to retrieve details of the main location.
-
π Usage
-
-
await client.locations.get({ locationId: "location_id" });
-
βοΈ Parameters
-
-
request:
Square.GetLocationsRequest
-
requestOptions:
LocationsClient.RequestOptions
-
-
client.locations.update({ ...params }) -> Square.UpdateLocationResponse
-
π Description
-
-
Updates a location.
-
π Usage
-
-
await client.locations.update({ locationId: "location_id", location: { businessHours: { periods: [{ dayOfWeek: "FRI", startLocalTime: "07:00", endLocalTime: "18:00" }, { dayOfWeek: "SAT", startLocalTime: "07:00", endLocalTime: "18:00" }, { dayOfWeek: "SUN", startLocalTime: "09:00", endLocalTime: "15:00" }] }, description: "Midtown Atlanta store - Open weekends" } });
-
βοΈ Parameters
-
-
request:
Square.UpdateLocationRequest
-
requestOptions:
LocationsClient.RequestOptions
-
-
client.locations.checkouts({ ...params }) -> Square.CreateCheckoutResponse
-
π Description
-
-
Links a
checkoutIdto acheckout_page_urlthat customers are directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com.NOTE: The Checkout API has been updated with new features. For more information, see Checkout API highlights.
-
π Usage
-
-
await client.locations.checkouts({ locationId: "location_id", idempotencyKey: "86ae1696-b1e3-4328-af6d-f1e04d947ad6", order: { order: { locationId: "location_id", referenceId: "reference_id", customerId: "customer_id", lineItems: [{ name: "Printed T Shirt", quantity: "2", appliedTaxes: [{ taxUid: "38ze1696-z1e3-5628-af6d-f1e04d947fg3" }], appliedDiscounts: [{ discountUid: "56ae1696-z1e3-9328-af6d-f1e04d947gd4" }], basePriceMoney: { amount: BigInt("1500"), currency: "USD" } }, { name: "Slim Jeans", quantity: "1", basePriceMoney: { amount: BigInt("2500"), currency: "USD" } }, { name: "Woven Sweater", quantity: "3", basePriceMoney: { amount: BigInt("3500"), currency: "USD" } }], taxes: [{ uid: "38ze1696-z1e3-5628-af6d-f1e04d947fg3", type: "INCLUSIVE", percentage: "7.75", scope: "LINE_ITEM" }], discounts: [{ uid: "56ae1696-z1e3-9328-af6d-f1e04d947gd4", type: "FIXED_AMOUNT", amountMoney: { amount: BigInt("100"), currency: "USD" }, scope: "LINE_ITEM" }] }, idempotencyKey: "12ae1696-z1e3-4328-af6d-f1e04d947gd4" }, askForShippingAddress: true, merchantSupportEmail: "merchant+support@website.com", prePopulateBuyerEmail: "example@email.com", prePopulateShippingAddress: { addressLine1: "1455 Market St.", addressLine2: "Suite 600", locality: "San Francisco", administrativeDistrictLevel1: "CA", postalCode: "94103", country: "US", firstName: "Jane", lastName: "Doe" }, redirectUrl: "https://merchant.website.com/order-confirm", additionalRecipients: [{ locationId: "057P5VYJ4A5X1", description: "Application fees", amountMoney: { amount: BigInt("60"), currency: "USD" } }] });
-
βοΈ Parameters
-
-
request:
Square.CreateCheckoutRequest
-
requestOptions:
LocationsClient.RequestOptions
-
-
Loyalty
client.loyalty.searchEvents({ ...params }) -> Square.SearchLoyaltyEventsResponse
-
π Description
-
-
Searches for loyalty events.
A Square loyalty program maintains a ledger of events that occur during the lifetime of a buyer's loyalty account. Each change in the point balance (for example, points earned, points redeemed, and points expired) is recorded in the ledger. Using this endpoint, you can search the ledger for events.
Search results are sorted by
created_atin descending order.
-
π Usage
-
-
await client.loyalty.searchEvents({ query: { filter: { orderFilter: { orderId: "PyATxhYLfsMqpVkcKJITPydgEYfZY" } } }, limit: 30 });
-
βοΈ Parameters
-
-
request:
Square.SearchLoyaltyEventsRequest
-
requestOptions:
LoyaltyClient.RequestOptions
-
-
Merchants
client.merchants.list({ ...params }) -> core.Page
-
π Description
-
-
Provides details about the merchant associated with a given access token.
The access token used to connect your application to a Square seller is associated with a single merchant. That means that
ListMerchantsreturns a list with a singleMerchantobject. You can specify your personal access token to get your own merchant information or specify an OAuth token to get the information for the merchant that granted your application access.If you know the merchant ID, you can also use the RetrieveMerchant endpoint to retrieve the merchant information.
-
π Usage
-
-
const pageableResponse = await client.merchants.list({ cursor: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.merchants.list({ cursor: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListMerchantsRequest
-
requestOptions:
MerchantsClient.RequestOptions
-
-
client.merchants.get({ ...params }) -> Square.GetMerchantResponse
-
π Description
-
-
Retrieves the
Merchantobject for the givenmerchant_id.
-
π Usage
-
-
await client.merchants.get({ merchantId: "merchant_id" });
-
βοΈ Parameters
-
-
request:
Square.GetMerchantsRequest
-
requestOptions:
MerchantsClient.RequestOptions
-
-
Checkout
client.checkout.retrieveLocationSettings({ ...params }) -> Square.RetrieveLocationSettingsResponse
-
π Description
-
-
Retrieves the location-level settings for a Square-hosted checkout page.
-
π Usage
-
-
await client.checkout.retrieveLocationSettings({ locationId: "location_id" });
-
βοΈ Parameters
-
-
request:
Square.RetrieveLocationSettingsRequest
-
requestOptions:
CheckoutClient.RequestOptions
-
-
client.checkout.updateLocationSettings({ ...params }) -> Square.UpdateLocationSettingsResponse
-
π Description
-
-
Updates the location-level settings for a Square-hosted checkout page.
-
π Usage
-
-
await client.checkout.updateLocationSettings({ locationId: "location_id", locationSettings: {} });
-
βοΈ Parameters
-
-
request:
Square.UpdateLocationSettingsRequest
-
requestOptions:
CheckoutClient.RequestOptions
-
-
client.checkout.retrieveMerchantSettings() -> Square.RetrieveMerchantSettingsResponse
-
π Description
-
-
Retrieves the merchant-level settings for a Square-hosted checkout page.
-
π Usage
-
-
await client.checkout.retrieveMerchantSettings();
-
βοΈ Parameters
-
-
requestOptions:
CheckoutClient.RequestOptions
-
-
client.checkout.updateMerchantSettings({ ...params }) -> Square.UpdateMerchantSettingsResponse
-
π Description
-
-
Updates the merchant-level settings for a Square-hosted checkout page.
-
π Usage
-
-
await client.checkout.updateMerchantSettings({ merchantSettings: {} });
-
βοΈ Parameters
-
-
request:
Square.UpdateMerchantSettingsRequest
-
requestOptions:
CheckoutClient.RequestOptions
-
-
Orders
client.orders.create({ ...params }) -> Square.CreateOrderResponse
-
π Description
-
-
Creates a new order that can include information about products for purchase and settings to apply to the purchase.
To pay for a created order, see Pay for Orders.
You can modify open orders using the UpdateOrder endpoint.
-
π Usage
-
-
await client.orders.create({ order: { locationId: "057P5VYJ4A5X1", referenceId: "my-order-001", lineItems: [{ name: "New York Strip Steak", quantity: "1", basePriceMoney: { amount: BigInt("1599"), currency: "USD" } }, { quantity: "2", catalogObjectId: "BEMYCSMIJL46OCDV4KYIKXIB", modifiers: [{ catalogObjectId: "CHQX7Y4KY6N5KINJKZCFURPZ" }], appliedDiscounts: [{ discountUid: "one-dollar-off" }] }], taxes: [{ uid: "state-sales-tax", name: "State Sales Tax", percentage: "9", scope: "ORDER" }], discounts: [{ uid: "labor-day-sale", name: "Labor Day Sale", percentage: "5", scope: "ORDER" }, { uid: "membership-discount", catalogObjectId: "DB7L55ZH2BGWI4H23ULIWOQ7", scope: "ORDER" }, { uid: "one-dollar-off", name: "Sale - \$1.00 off", amountMoney: { amount: BigInt("100"), currency: "USD" }, scope: "LINE_ITEM" }] }, idempotencyKey: "8193148c-9586-11e6-99f9-28cfe92138cf" });
-
βοΈ Parameters
-
-
request:
Square.CreateOrderRequest
-
requestOptions:
OrdersClient.RequestOptions
-
-
client.orders.batchGet({ ...params }) -> Square.BatchGetOrdersResponse
-
π Description
-
-
Retrieves a set of orders by their IDs.
If a given order ID does not exist, the ID is ignored instead of generating an error.
-
π Usage
-
-
await client.orders.batchGet({ locationId: "057P5VYJ4A5X1", orderIds: ["CAISEM82RcpmcFBM0TfOyiHV3es", "CAISENgvlJ6jLWAzERDzjyHVybY"] });
-
βοΈ Parameters
-
-
request:
Square.BatchGetOrdersRequest
-
requestOptions:
OrdersClient.RequestOptions
-
-
client.orders.calculate({ ...params }) -> Square.CalculateOrderResponse
-
π Description
-
-
Enables applications to preview order pricing without creating an order.
-
π Usage
-
-
await client.orders.calculate({ order: { locationId: "D7AVYMEAPJ3A3", lineItems: [{ name: "Item 1", quantity: "1", basePriceMoney: { amount: BigInt("500"), currency: "USD" } }, { name: "Item 2", quantity: "2", basePriceMoney: { amount: BigInt("300"), currency: "USD" } }], discounts: [{ name: "50% Off", percentage: "50", scope: "ORDER" }] } });
-
βοΈ Parameters
-
-
request:
Square.CalculateOrderRequest
-
requestOptions:
OrdersClient.RequestOptions
-
-
client.orders.clone({ ...params }) -> Square.CloneOrderResponse
-
π Description
-
-
Creates a new order, in the
DRAFTstate, by duplicating an existing order. The newly created order has only the core fields (such as line items, taxes, and discounts) copied from the original order.
-
π Usage
-
-
await client.orders.clone({ orderId: "ZAISEM52YcpmcWAzERDOyiWS123", version: 3, idempotencyKey: "UNIQUE_STRING" });
-
βοΈ Parameters
-
-
request:
Square.CloneOrderRequest
-
requestOptions:
OrdersClient.RequestOptions
-
-
client.orders.search({ ...params }) -> Square.SearchOrdersResponse
-
π Description
-
-
Search all orders for one or more locations. Orders include all sales, returns, and exchanges regardless of how or when they entered the Square ecosystem (such as Point of Sale, Invoices, and Connect APIs).
SearchOrdersrequests need to specify which locations to search and define a SearchOrdersQuery object that controls how to sort or filter the results. YourSearchOrdersQuerycan:Set filter criteria. Set the sort order. Determine whether to return results as complete
Orderobjects or as OrderEntry objects.Note that details for orders processed with Square Point of Sale while in offline mode might not be transmitted to Square for up to 72 hours. Offline orders have a
created_atvalue that reflects the time the order was created, not the time it was subsequently transmitted to Square.
-
π Usage
-
-
await client.orders.search({ locationIds: ["057P5VYJ4A5X1", "18YC4JDH91E1H"], query: { filter: { stateFilter: { states: ["COMPLETED"] }, dateTimeFilter: { closedAt: { startAt: "2018-03-03T20:00:00+00:00", endAt: "2019-03-04T21:54:45+00:00" } } }, sort: { sortField: "CLOSED_AT", sortOrder: "DESC" } }, limit: 3, returnEntries: true });
-
βοΈ Parameters
-
-
request:
Square.SearchOrdersRequest
-
requestOptions:
OrdersClient.RequestOptions
-
-
client.orders.get({ ...params }) -> Square.GetOrderResponse
-
π Description
-
-
Retrieves an Order by ID.
-
π Usage
-
-
await client.orders.get({ orderId: "order_id" });
-
βοΈ Parameters
-
-
request:
Square.GetOrdersRequest
-
requestOptions:
OrdersClient.RequestOptions
-
-
client.orders.update({ ...params }) -> Square.UpdateOrderResponse
-
π Description
-
-
Updates an open order by adding, replacing, or deleting fields. Orders with a
COMPLETEDorCANCELEDstate cannot be updated.An
UpdateOrderrequest requires the following:- The
order_idin the endpoint path, identifying the order to update. - The latest
versionof the order to update. - The sparse order containing only the fields to update and the version to which the update is being applied.
- If deleting fields, the dot notation paths identifying the fields to clear.
To pay for an order, see Pay for Orders.
- The
-
π Usage
-
-
await client.orders.update({ orderId: "order_id", order: { locationId: "location_id", lineItems: [{ uid: "cookie_uid", name: "COOKIE", quantity: "2", basePriceMoney: { amount: BigInt("200"), currency: "USD" } }], version: 1 }, fieldsToClear: ["discounts"], idempotencyKey: "UNIQUE_STRING" });
-
βοΈ Parameters
-
-
request:
Square.UpdateOrderRequest
-
requestOptions:
OrdersClient.RequestOptions
-
-
client.orders.pay({ ...params }) -> Square.PayOrderResponse
-
π Description
-
-
Pay for an order using one or more approved payments or settle an order with a total of
0.The total of the
payment_idslisted in the request must be equal to the order total. Orders with a total amount of0can be marked as paid by specifying an empty array ofpayment_idsin the request.To be used with
PayOrder, a payment must:- Reference the order by specifying the
order_idwhen creating the payment. Any approved payments that reference the sameorder_idnot specified in thepayment_idsis canceled. - Be approved with delayed capture.
Using a delayed capture payment with
PayOrdercompletes the approved payment.
- Reference the order by specifying the
-
π Usage
-
-
await client.orders.pay({ orderId: "order_id", idempotencyKey: "c043a359-7ad9-4136-82a9-c3f1d66dcbff", paymentIds: ["EnZdNAlWCmfh6Mt5FMNST1o7taB", "0LRiVlbXVwe8ozu4KbZxd12mvaB"] });
-
βοΈ Parameters
-
-
request:
Square.PayOrderRequest
-
requestOptions:
OrdersClient.RequestOptions
-
-
Payments
client.payments.list({ ...params }) -> core.Page
-
π Description
-
-
Retrieves a list of payments taken by the account making the request.
Results are eventually consistent, and new payments or changes to payments might take several seconds to appear.
The maximum results per page is 100.
-
π Usage
-
-
const pageableResponse = await client.payments.list({ beginTime: "begin_time", endTime: "end_time", sortOrder: "sort_order", cursor: "cursor", locationId: "location_id", total: BigInt("1000000"), last4: "last_4", cardBrand: "card_brand", limit: 1, isOfflinePayment: true, offlineBeginTime: "offline_begin_time", offlineEndTime: "offline_end_time", updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", sortField: "CREATED_AT" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.payments.list({ beginTime: "begin_time", endTime: "end_time", sortOrder: "sort_order", cursor: "cursor", locationId: "location_id", total: BigInt("1000000"), last4: "last_4", cardBrand: "card_brand", limit: 1, isOfflinePayment: true, offlineBeginTime: "offline_begin_time", offlineEndTime: "offline_end_time", updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", sortField: "CREATED_AT" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListPaymentsRequest
-
requestOptions:
PaymentsClient.RequestOptions
-
-
client.payments.create({ ...params }) -> Square.CreatePaymentResponse
-
π Description
-
-
Creates a payment using the provided source. You can use this endpoint to charge a card (credit/debit card or
Square gift card) or record a payment that the seller received outside of Square (cash payment from a buyer or a payment that an external entity processed on behalf of the seller).The endpoint creates a
Paymentobject and returns it in the response.
-
π Usage
-
-
await client.payments.create({ sourceId: "ccof:GaJGNaZa8x4OgDJn4GB", idempotencyKey: "7b0f3ec5-086a-4871-8f13-3c81b3875218", amountMoney: { amount: BigInt("1000"), currency: "USD" }, appFeeMoney: { amount: BigInt("10"), currency: "USD" }, autocomplete: true, customerId: "W92WH6P11H4Z77CTET0RNTGFW8", locationId: "L88917AVBK2S5", referenceId: "123456", note: "Brief description" });
-
βοΈ Parameters
-
-
request:
Square.CreatePaymentRequest
-
requestOptions:
PaymentsClient.RequestOptions
-
-
client.payments.cancelByIdempotencyKey({ ...params }) -> Square.CancelPaymentByIdempotencyKeyResponse
-
π Description
-
-
Cancels (voids) a payment identified by the idempotency key that is specified in the request.
Use this method when the status of a
CreatePaymentrequest is unknown (for example, after you send aCreatePaymentrequest, a network error occurs and you do not get a response). In this case, you can direct Square to cancel the payment using this endpoint. In the request, you provide the same idempotency key that you provided in yourCreatePaymentrequest that you want to cancel. After canceling the payment, you can submit yourCreatePaymentrequest again.Note that if no payment with the specified idempotency key is found, no action is taken and the endpoint returns successfully.
-
π Usage
-
-
await client.payments.cancelByIdempotencyKey({ idempotencyKey: "a7e36d40-d24b-11e8-b568-0800200c9a66" });
-
βοΈ Parameters
-
-
request:
Square.CancelPaymentByIdempotencyKeyRequest
-
requestOptions:
PaymentsClient.RequestOptions
-
-
client.payments.get({ ...params }) -> Square.GetPaymentResponse
-
π Description
-
-
Retrieves details for a specific payment.
-
π Usage
-
-
await client.payments.get({ paymentId: "payment_id" });
-
βοΈ Parameters
-
-
request:
Square.GetPaymentsRequest
-
requestOptions:
PaymentsClient.RequestOptions
-
-
client.payments.update({ ...params }) -> Square.UpdatePaymentResponse
-
π Description
-
-
Updates a payment with the APPROVED status. You can update the
amount_moneyandtip_moneyusing this endpoint.
-
π Usage
-
-
await client.payments.update({ paymentId: "payment_id", payment: { amountMoney: { amount: BigInt("1000"), currency: "USD" }, tipMoney: { amount: BigInt("100"), currency: "USD" }, versionToken: "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o" }, idempotencyKey: "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de" });
-
βοΈ Parameters
-
-
request:
Square.UpdatePaymentRequest
-
requestOptions:
PaymentsClient.RequestOptions
-
-
client.payments.cancel({ ...params }) -> Square.CancelPaymentResponse
-
π Description
-
-
Cancels (voids) a payment. You can use this endpoint to cancel a payment with the APPROVED
status.
-
π Usage
-
-
await client.payments.cancel({ paymentId: "payment_id" });
-
βοΈ Parameters
-
-
request:
Square.CancelPaymentsRequest
-
requestOptions:
PaymentsClient.RequestOptions
-
-
client.payments.complete({ ...params }) -> Square.CompletePaymentResponse
-
π Description
-
-
Completes (captures) a payment. By default, payments are set to complete immediately after they are created.
You can use this endpoint to complete a payment with the APPROVED
status.
-
π Usage
-
-
await client.payments.complete({ paymentId: "payment_id" });
-
βοΈ Parameters
-
-
request:
Square.CompletePaymentRequest
-
requestOptions:
PaymentsClient.RequestOptions
-
-
Payouts
client.payouts.list({ ...params }) -> core.Page
-
π Description
-
-
Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. To call this endpoint, set
PAYOUTS_READfor the OAuth scope.
-
π Usage
-
-
const pageableResponse = await client.payouts.list({ locationId: "location_id", status: "SENT", beginTime: "begin_time", endTime: "end_time", sortOrder: "DESC", cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.payouts.list({ locationId: "location_id", status: "SENT", beginTime: "begin_time", endTime: "end_time", sortOrder: "DESC", cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListPayoutsRequest
-
requestOptions:
PayoutsClient.RequestOptions
-
-
client.payouts.get({ ...params }) -> Square.GetPayoutResponse
-
π Description
-
-
Retrieves details of a specific payout identified by a payout ID. To call this endpoint, set
PAYOUTS_READfor the OAuth scope.
-
π Usage
-
-
await client.payouts.get({ payoutId: "payout_id" });
-
βοΈ Parameters
-
-
request:
Square.GetPayoutsRequest
-
requestOptions:
PayoutsClient.RequestOptions
-
-
client.payouts.listEntries({ ...params }) -> core.Page
-
π Description
-
-
Retrieves a list of all payout entries for a specific payout. To call this endpoint, set
PAYOUTS_READfor the OAuth scope.
-
π Usage
-
-
const pageableResponse = await client.payouts.listEntries({ payoutId: "payout_id", sortOrder: "DESC", cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.payouts.listEntries({ payoutId: "payout_id", sortOrder: "DESC", cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListEntriesPayoutsRequest
-
requestOptions:
PayoutsClient.RequestOptions
-
-
Refunds
client.refunds.list({ ...params }) -> core.Page
-
π Description
-
-
Retrieves a list of refunds for the account making the request.
Results are eventually consistent, and new refunds or changes to refunds might take several seconds to appear.
The maximum results per page is 100.
-
π Usage
-
-
const pageableResponse = await client.refunds.list({ beginTime: "begin_time", endTime: "end_time", sortOrder: "sort_order", cursor: "cursor", locationId: "location_id", status: "status", sourceType: "source_type", limit: 1, updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", sortField: "CREATED_AT" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.refunds.list({ beginTime: "begin_time", endTime: "end_time", sortOrder: "sort_order", cursor: "cursor", locationId: "location_id", status: "status", sourceType: "source_type", limit: 1, updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", sortField: "CREATED_AT" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListRefundsRequest
-
requestOptions:
RefundsClient.RequestOptions
-
-
client.refunds.refundPayment({ ...params }) -> Square.RefundPaymentResponse
-
π Description
-
-
Refunds a payment. You can refund the entire payment amount or a portion of it. You can use this endpoint to refund a card payment or record a refund of a cash or external payment. For more information, see Refund Payment.
-
π Usage
-
-
await client.refunds.refundPayment({ idempotencyKey: "9b7f2dcf-49da-4411-b23e-a2d6af21333a", amountMoney: { amount: BigInt("1000"), currency: "USD" }, appFeeMoney: { amount: BigInt("10"), currency: "USD" }, paymentId: "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", reason: "Example" });
-
βοΈ Parameters
-
-
request:
Square.RefundPaymentRequest
-
requestOptions:
RefundsClient.RequestOptions
-
-
client.refunds.get({ ...params }) -> Square.GetPaymentRefundResponse
-
π Description
-
-
Retrieves a specific refund using the
refund_id.
-
π Usage
-
-
await client.refunds.get({ refundId: "refund_id" });
-
βοΈ Parameters
-
-
request:
Square.GetRefundsRequest
-
requestOptions:
RefundsClient.RequestOptions
-
-
Sites
client.sites.list() -> Square.ListSitesResponse
-
π Description
-
-
Lists the Square Online sites that belong to a seller. Sites are listed in descending order by the
created_atdate.Note: Square Online APIs are publicly available as part of an early access program. For more information, see Early access program for Square Online APIs.
-
π Usage
-
-
await client.sites.list();
-
βοΈ Parameters
-
-
requestOptions:
SitesClient.RequestOptions
-
-
Snippets
client.snippets.get({ ...params }) -> Square.GetSnippetResponse
-
π Description
-
-
Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet applications, but you can retrieve only the snippet that was added by your application.
You can call ListSites to get the IDs of the sites that belong to a seller.
Note: Square Online APIs are publicly available as part of an early access program. For more information, see Early access program for Square Online APIs.
-
π Usage
-
-
await client.snippets.get({ siteId: "site_id" });
-
βοΈ Parameters
-
-
request:
Square.GetSnippetsRequest
-
requestOptions:
SnippetsClient.RequestOptions
-
-
client.snippets.upsert({ ...params }) -> Square.UpsertSnippetResponse
-
π Description
-
-
Adds a snippet to a Square Online site or updates the existing snippet on the site. The snippet code is appended to the end of the
headelement on every page of the site, except checkout pages. A snippet application can add one snippet to a given site.You can call ListSites to get the IDs of the sites that belong to a seller.
Note: Square Online APIs are publicly available as part of an early access program. For more information, see Early access program for Square Online APIs.
-
π Usage
-
-
await client.snippets.upsert({ siteId: "site_id", snippet: { content: "<script>var js = 1;</script>" } });
-
βοΈ Parameters
-
-
request:
Square.UpsertSnippetRequest
-
requestOptions:
SnippetsClient.RequestOptions
-
-
client.snippets.delete({ ...params }) -> Square.DeleteSnippetResponse
-
π Description
-
-
Removes your snippet from a Square Online site.
You can call ListSites to get the IDs of the sites that belong to a seller.
Note: Square Online APIs are publicly available as part of an early access program. For more information, see Early access program for Square Online APIs.
-
π Usage
-
-
await client.snippets.delete({ siteId: "site_id" });
-
βοΈ Parameters
-
-
request:
Square.DeleteSnippetsRequest
-
requestOptions:
SnippetsClient.RequestOptions
-
-
Subscriptions
client.subscriptions.create({ ...params }) -> Square.CreateSubscriptionResponse
-
π Description
-
-
Enrolls a customer in a subscription.
If you provide a card on file in the request, Square charges the card for the subscription. Otherwise, Square sends an invoice to the customer's email address. The subscription starts immediately, unless the request includes the optional
start_date. Each individual subscription is associated with a particular location.For more information, see Create a subscription.
-
π Usage
-
-
await client.subscriptions.create({ idempotencyKey: "8193148c-9586-11e6-99f9-28cfe92138cf", locationId: "S8GWD5R9QB376", planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", customerId: "CHFGVKYY8RSV93M5KCYTG4PN0G", startDate: "2023-06-20", cardId: "ccof:qy5x8hHGYsgLrp4Q4GB", timezone: "America/Los_Angeles", source: { name: "My Application" }, phases: [{ ordinal: BigInt("0"), orderTemplateId: "U2NaowWxzXwpsZU697x7ZHOAnCNZY" }] });
-
βοΈ Parameters
-
-
request:
Square.CreateSubscriptionRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.bulkSwapPlan({ ...params }) -> Square.BulkSwapPlanResponse
-
π Description
-
-
Schedules a plan variation change for all active subscriptions under a given plan variation. For more information, see Swap Subscription Plan Variations.
-
π Usage
-
-
await client.subscriptions.bulkSwapPlan({ newPlanVariationId: "FQ7CDXXWSLUJRPM3GFJSJGZ7", oldPlanVariationId: "6JHXF3B2CW3YKHDV4XEM674H", locationId: "S8GWD5R9QB376" });
-
βοΈ Parameters
-
-
request:
Square.BulkSwapPlanRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.search({ ...params }) -> Square.SearchSubscriptionsResponse
-
π Description
-
-
Searches for subscriptions.
Results are ordered chronologically by subscription creation date. If the request specifies more than one location ID, the endpoint orders the result by location ID, and then by creation date within each location. If no locations are given in the query, all locations are searched.
You can also optionally specify
customer_idsto search by customer. If left unset, all customers associated with the specified locations are returned. If the request specifies customer IDs, the endpoint orders results first by location, within location by customer ID, and within customer by subscription creation date.
-
π Usage
-
-
await client.subscriptions.search({ query: { filter: { customerIds: ["CHFGVKYY8RSV93M5KCYTG4PN0G"], locationIds: ["S8GWD5R9QB376"], sourceNames: ["My App"] } } });
-
βοΈ Parameters
-
-
request:
Square.SearchSubscriptionsRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.get({ ...params }) -> Square.GetSubscriptionResponse
-
π Description
-
-
Retrieves a specific subscription.
-
π Usage
-
-
await client.subscriptions.get({ subscriptionId: "subscription_id", include: "include" });
-
βοΈ Parameters
-
-
request:
Square.GetSubscriptionsRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.update({ ...params }) -> Square.UpdateSubscriptionResponse
-
π Description
-
-
Updates a subscription by modifying or clearing
subscriptionfield values. To clear a field, set its value tonull.
-
π Usage
-
-
await client.subscriptions.update({ subscriptionId: "subscription_id", subscription: { cardId: "{NEW CARD ID}" } });
-
βοΈ Parameters
-
-
request:
Square.UpdateSubscriptionRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.deleteAction({ ...params }) -> Square.DeleteSubscriptionActionResponse
-
π Description
-
-
Deletes a scheduled action for a subscription.
-
π Usage
-
-
await client.subscriptions.deleteAction({ subscriptionId: "subscription_id", actionId: "action_id" });
-
βοΈ Parameters
-
-
request:
Square.DeleteActionSubscriptionsRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.changeBillingAnchorDate({ ...params }) -> Square.ChangeBillingAnchorDateResponse
-
π Description
-
-
Changes the billing anchor date for a subscription.
-
π Usage
-
-
await client.subscriptions.changeBillingAnchorDate({ subscriptionId: "subscription_id", monthlyBillingAnchorDate: 1 });
-
βοΈ Parameters
-
-
request:
Square.ChangeBillingAnchorDateRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.cancel({ ...params }) -> Square.CancelSubscriptionResponse
-
π Description
-
-
Schedules a
CANCELaction to cancel an active subscription. This sets thecanceled_datefield to the end of the active billing period. After this date, the subscription status changes from ACTIVE to CANCELED.
-
π Usage
-
-
await client.subscriptions.cancel({ subscriptionId: "subscription_id" });
-
βοΈ Parameters
-
-
request:
Square.CancelSubscriptionsRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.listEvents({ ...params }) -> core.Page
-
π Description
-
-
Lists all events for a specific subscription.
-
π Usage
-
-
const pageableResponse = await client.subscriptions.listEvents({ subscriptionId: "subscription_id", cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.subscriptions.listEvents({ subscriptionId: "subscription_id", cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.ListEventsSubscriptionsRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.pause({ ...params }) -> Square.PauseSubscriptionResponse
-
π Description
-
-
Schedules a
PAUSEaction to pause an active subscription.
-
π Usage
-
-
await client.subscriptions.pause({ subscriptionId: "subscription_id" });
-
βοΈ Parameters
-
-
request:
Square.PauseSubscriptionRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.resume({ ...params }) -> Square.ResumeSubscriptionResponse
-
π Description
-
-
Schedules a
RESUMEaction to resume a paused or a deactivated subscription.
-
π Usage
-
-
await client.subscriptions.resume({ subscriptionId: "subscription_id" });
-
βοΈ Parameters
-
-
request:
Square.ResumeSubscriptionRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.subscriptions.swapPlan({ ...params }) -> Square.SwapPlanResponse
-
π Description
-
-
Schedules a
SWAP_PLANaction to swap a subscription plan variation in an existing subscription. For more information, see Swap Subscription Plan Variations.
-
π Usage
-
-
await client.subscriptions.swapPlan({ subscriptionId: "subscription_id", newPlanVariationId: "FQ7CDXXWSLUJRPM3GFJSJGZ7", phases: [{ ordinal: BigInt("0"), orderTemplateId: "uhhnjH9osVv3shUADwaC0b3hNxQZY" }] });
-
βοΈ Parameters
-
-
request:
Square.SwapPlanRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
TeamMembers
client.teamMembers.create({ ...params }) -> Square.CreateTeamMemberResponse
-
π Description
-
-
Creates a single
TeamMemberobject. TheTeamMemberobject is returned on successful creates. You must provide the following values in your request to this endpoint:given_namefamily_name
Learn about Troubleshooting the Team API.
-
π Usage
-
-
await client.teamMembers.create({ idempotencyKey: "idempotency-key-0", teamMember: { referenceId: "reference_id_1", status: "ACTIVE", givenName: "Joe", familyName: "Doe", emailAddress: "joe_doe@gmail.com", phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] }, wageSetting: { jobAssignments: [{ payType: "SALARY", annualRate: { amount: BigInt("3000000"), currency: "USD" }, weeklyHours: 40, jobId: "FjS8x95cqHiMenw4f1NAUH4P" }, { payType: "HOURLY", hourlyRate: { amount: BigInt("2000"), currency: "USD" }, jobId: "VDNpRv8da51NU8qZFC5zDWpF" }], isOvertimeExempt: true } } });
-
βοΈ Parameters
-
-
request:
Square.CreateTeamMemberRequest
-
requestOptions:
TeamMembersClient.RequestOptions
-
-
client.teamMembers.batchCreate({ ...params }) -> Square.BatchCreateTeamMembersResponse
-
π Description
-
-
Creates multiple
TeamMemberobjects. The createdTeamMemberobjects are returned on successful creates. This process is non-transactional and processes as much of the request as possible. If one of the creates in the request cannot be successfully processed, the request is not marked as failed, but the body of the response contains explicit error information for the failed create.Learn about Troubleshooting the Team API.
-
π Usage
-
-
await client.teamMembers.batchCreate({ teamMembers: { "idempotency-key-1": { teamMember: { referenceId: "reference_id_1", givenName: "Joe", familyName: "Doe", emailAddress: "joe_doe@gmail.com", phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] } } }, "idempotency-key-2": { teamMember: { referenceId: "reference_id_2", givenName: "Jane", familyName: "Smith", emailAddress: "jane_smith@gmail.com", phoneNumber: "+14159223334", assignedLocations: { assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS" } } } } });
-
βοΈ Parameters
-
-
request:
Square.BatchCreateTeamMembersRequest
-
requestOptions:
TeamMembersClient.RequestOptions
-
-
client.teamMembers.batchUpdate({ ...params }) -> Square.BatchUpdateTeamMembersResponse
-
π Description
-
-
Updates multiple
TeamMemberobjects. The updatedTeamMemberobjects are returned on successful updates. This process is non-transactional and processes as much of the request as possible. If one of the updates in the request cannot be successfully processed, the request is not marked as failed, but the body of the response contains explicit error information for the failed update. Learn about Troubleshooting the Team API.
-
π Usage
-
-
await client.teamMembers.batchUpdate({ teamMembers: { "AFMwA08kR-MIF-3Vs0OE": { teamMember: { referenceId: "reference_id_2", isOwner: false, status: "ACTIVE", givenName: "Jane", familyName: "Smith", emailAddress: "jane_smith@gmail.com", phoneNumber: "+14159223334", assignedLocations: { assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS" } } }, "fpgteZNMaf0qOK-a4t6P": { teamMember: { referenceId: "reference_id_1", isOwner: false, status: "ACTIVE", givenName: "Joe", familyName: "Doe", emailAddress: "joe_doe@gmail.com", phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] } } } } });
-
βοΈ Parameters
-
-
request:
Square.BatchUpdateTeamMembersRequest
-
requestOptions:
TeamMembersClient.RequestOptions
-
-
client.teamMembers.search({ ...params }) -> Square.SearchTeamMembersResponse
-
π Description
-
-
Returns a paginated list of
TeamMemberobjects for a business. The list can be filtered by location IDs,ACTIVEorINACTIVEstatus, or whether the team member is the Square account owner.
-
π Usage
-
-
await client.teamMembers.search({ query: { filter: { locationIds: ["0G5P3VGACMMQZ"], status: "ACTIVE" } }, limit: 10 });
-
βοΈ Parameters
-
-
request:
Square.SearchTeamMembersRequest
-
requestOptions:
TeamMembersClient.RequestOptions
-
-
client.teamMembers.get({ ...params }) -> Square.GetTeamMemberResponse
-
π Description
-
-
Retrieves a
TeamMemberobject for the givenTeamMember.id. Learn about Troubleshooting the Team API.
-
π Usage
-
-
await client.teamMembers.get({ teamMemberId: "team_member_id" });
-
βοΈ Parameters
-
-
request:
Square.GetTeamMembersRequest
-
requestOptions:
TeamMembersClient.RequestOptions
-
-
client.teamMembers.update({ ...params }) -> Square.UpdateTeamMemberResponse
-
π Description
-
-
Updates a single
TeamMemberobject. TheTeamMemberobject is returned on successful updates. Learn about Troubleshooting the Team API.
-
π Usage
-
-
await client.teamMembers.update({ teamMemberId: "team_member_id", body: { teamMember: { referenceId: "reference_id_1", status: "ACTIVE", givenName: "Joe", familyName: "Doe", emailAddress: "joe_doe@gmail.com", phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] }, wageSetting: { jobAssignments: [{ payType: "SALARY", annualRate: { amount: BigInt("3000000"), currency: "USD" }, weeklyHours: 40, jobId: "FjS8x95cqHiMenw4f1NAUH4P" }, { payType: "HOURLY", hourlyRate: { amount: BigInt("1200"), currency: "USD" }, jobId: "VDNpRv8da51NU8qZFC5zDWpF" }], isOvertimeExempt: true } } } });
-
βοΈ Parameters
-
-
request:
Square.UpdateTeamMembersRequest
-
requestOptions:
TeamMembersClient.RequestOptions
-
-
Team
client.team.listJobs({ ...params }) -> Square.ListJobsResponse
-
π Description
-
-
Lists jobs in a seller account. Results are sorted by title in ascending order.
-
π Usage
-
-
await client.team.listJobs({ cursor: "cursor" });
-
βοΈ Parameters
-
-
request:
Square.ListJobsRequest
-
requestOptions:
TeamClient.RequestOptions
-
-
client.team.createJob({ ...params }) -> Square.CreateJobResponse
-
π Description
-
-
Creates a job in a seller account. A job defines a title and tip eligibility. Note that compensation is defined in a job assignment in a team member's wage setting.
-
π Usage
-
-
await client.team.createJob({ job: { title: "Cashier", isTipEligible: true }, idempotencyKey: "idempotency-key-0" });
-
βοΈ Parameters
-
-
request:
Square.CreateJobRequest
-
requestOptions:
TeamClient.RequestOptions
-
-
client.team.retrieveJob({ ...params }) -> Square.RetrieveJobResponse
-
π Description
-
-
Retrieves a specified job.
-
π Usage
-
-
await client.team.retrieveJob({ jobId: "job_id" });
-
βοΈ Parameters
-
-
request:
Square.RetrieveJobRequest
-
requestOptions:
TeamClient.RequestOptions
-
-
client.team.updateJob({ ...params }) -> Square.UpdateJobResponse
-
π Description
-
-
Updates the title or tip eligibility of a job. Changes to the title propagate to all
JobAssignment,Shift, andTeamMemberWageobjects that reference the job ID. Changes to tip eligibility propagate to allTeamMemberWageobjects that reference the job ID.
-
π Usage
-
-
await client.team.updateJob({ jobId: "job_id", job: { title: "Cashier 1", isTipEligible: true } });
-
βοΈ Parameters
-
-
request:
Square.UpdateJobRequest
-
requestOptions:
TeamClient.RequestOptions
-
-
Terminal
client.terminal.dismissTerminalAction({ ...params }) -> Square.DismissTerminalActionResponse
-
π Description
-
-
Dismisses a Terminal action request if the status and type of the request permits it.
See Link and Dismiss Actions for more details.
-
π Usage
-
-
await client.terminal.dismissTerminalAction({ actionId: "action_id" });
-
βοΈ Parameters
-
-
request:
Square.DismissTerminalActionRequest
-
requestOptions:
TerminalClient.RequestOptions
-
-
client.terminal.dismissTerminalCheckout({ ...params }) -> Square.DismissTerminalCheckoutResponse
-
π Description
-
-
Dismisses a Terminal checkout request if the status and type of the request permits it.
-
π Usage
-
-
await client.terminal.dismissTerminalCheckout({ checkoutId: "checkout_id" });
-
βοΈ Parameters
-
-
request:
Square.DismissTerminalCheckoutRequest
-
requestOptions:
TerminalClient.RequestOptions
-
-
client.terminal.dismissTerminalRefund({ ...params }) -> Square.DismissTerminalRefundResponse
-
π Description
-
-
Dismisses a Terminal refund request if the status and type of the request permits it.
-
π Usage
-
-
await client.terminal.dismissTerminalRefund({ terminalRefundId: "terminal_refund_id" });
-
βοΈ Parameters
-
-
request:
Square.DismissTerminalRefundRequest
-
requestOptions:
TerminalClient.RequestOptions
-
-
TransferOrders
client.transferOrders.create({ ...params }) -> Square.CreateTransferOrderResponse
-
π Description
-
-
Creates a new transfer order in DRAFT status. A transfer order represents the intent to move CatalogItemVariations from one Location to another. The source and destination locations must be different and must belong to your Square account.
In DRAFT status, you can:
- Add or remove items
- Modify quantities
- Update shipping information
- Delete the entire order via DeleteTransferOrder
The request requires source_location_id and destination_location_id. Inventory levels are not affected until the order is started via StartTransferOrder.
Common integration points:
- Sync with warehouse management systems
- Automate regular stock transfers
- Initialize transfers from inventory optimization systems
Creates a transfer_order.created webhook event.
-
π Usage
-
-
await client.transferOrders.create({ idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", transferOrder: { sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", expectedAt: "2025-11-09T05:00:00Z", notes: "Example transfer order for inventory redistribution between locations", trackingNumber: "TRACK123456789", createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", lineItems: [{ itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", quantityOrdered: "5" }, { itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", quantityOrdered: "3" }] } });
-
βοΈ Parameters
-
-
request:
Square.CreateTransferOrderRequest
-
requestOptions:
TransferOrdersClient.RequestOptions
-
-
client.transferOrders.search({ ...params }) -> core.Page
-
π Description
-
-
Searches for transfer orders using filters. Returns a paginated list of matching TransferOrders sorted by creation date.
Common search scenarios:
- Find orders for a source Location
- Find orders for a destination Location
- Find orders in a particular TransferOrderStatus
-
π Usage
-
-
const pageableResponse = await client.transferOrders.search({ query: { filter: { sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], statuses: ["STARTED", "PARTIALLY_RECEIVED"] }, sort: { field: "UPDATED_AT", order: "DESC" } }, cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", limit: 10 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.transferOrders.search({ query: { filter: { sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], statuses: ["STARTED", "PARTIALLY_RECEIVED"] }, sort: { field: "UPDATED_AT", order: "DESC" } }, cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", limit: 10 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.SearchTransferOrdersRequest
-
requestOptions:
TransferOrdersClient.RequestOptions
-
-
client.transferOrders.get({ ...params }) -> Square.RetrieveTransferOrderResponse
-
π Description
-
-
Retrieves a specific TransferOrder by ID. Returns the complete order details including:
- Basic information (status, dates, notes)
- Line items with ordered and received quantities
- Source and destination Locations
- Tracking information (if available)
-
π Usage
-
-
await client.transferOrders.get({ transferOrderId: "transfer_order_id" });
-
βοΈ Parameters
-
-
request:
Square.GetTransferOrdersRequest
-
requestOptions:
TransferOrdersClient.RequestOptions
-
-
client.transferOrders.update({ ...params }) -> Square.UpdateTransferOrderResponse
-
π Description
-
-
Updates an existing transfer order. This endpoint supports sparse updates, allowing you to modify specific fields without affecting others.
Creates a transfer_order.updated webhook event.
-
π Usage
-
-
await client.transferOrders.update({ transferOrderId: "transfer_order_id", idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", transferOrder: { sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", expectedAt: "2025-11-10T08:00:00Z", notes: "Updated: Priority transfer due to low stock at destination", trackingNumber: "TRACK987654321", lineItems: [{ uid: "1", quantityOrdered: "7" }, { itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", quantityOrdered: "2" }, { uid: "2", remove: true }] }, version: BigInt("1753109537351") });
-
βοΈ Parameters
-
-
request:
Square.UpdateTransferOrderRequest
-
requestOptions:
TransferOrdersClient.RequestOptions
-
-
client.transferOrders.delete({ ...params }) -> Square.DeleteTransferOrderResponse
-
π Description
-
-
Deletes a transfer order in DRAFT status. Only draft orders can be deleted. Once an order is started via StartTransferOrder, it can no longer be deleted.
Creates a transfer_order.deleted webhook event.
-
π Usage
-
-
await client.transferOrders.delete({ transferOrderId: "transfer_order_id", version: BigInt("1000000") });
-
βοΈ Parameters
-
-
request:
Square.DeleteTransferOrdersRequest
-
requestOptions:
TransferOrdersClient.RequestOptions
-
-
client.transferOrders.cancel({ ...params }) -> Square.CancelTransferOrderResponse
-
π Description
-
-
Cancels a transfer order in STARTED or PARTIALLY_RECEIVED status. Any unreceived quantities will no longer be receivable and will be immediately returned to the source Location's inventory.
Common reasons for cancellation:
- Items no longer needed at destination
- Source location needs the inventory
- Order created in error
Creates a transfer_order.updated webhook event.
-
π Usage
-
-
await client.transferOrders.cancel({ transferOrderId: "transfer_order_id", idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", version: BigInt("1753117449752") });
-
βοΈ Parameters
-
-
request:
Square.CancelTransferOrderRequest
-
requestOptions:
TransferOrdersClient.RequestOptions
-
-
client.transferOrders.receive({ ...params }) -> Square.ReceiveTransferOrderResponse
-
π Description
-
-
Records receipt of CatalogItemVariations for a transfer order. This endpoint supports partial receiving - you can receive items in multiple batches.
For each line item, you can specify:
- Quantity received in good condition (added to destination inventory with InventoryState of IN_STOCK)
- Quantity damaged during transit/handling (added to destination inventory with InventoryState of WASTE)
- Quantity canceled (returned to source location's inventory)
The order must be in STARTED or PARTIALLY_RECEIVED status. Received quantities are added to the destination Location's inventory according to their condition. Canceled quantities are immediately returned to the source Location's inventory.
When all items are either received, damaged, or canceled, the order moves to COMPLETED status.
Creates a transfer_order.updated webhook event.
-
π Usage
-
-
await client.transferOrders.receive({ transferOrderId: "transfer_order_id", idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", receipt: { lineItems: [{ transferOrderLineUid: "1", quantityReceived: "3", quantityDamaged: "1", quantityCanceled: "1" }, { transferOrderLineUid: "2", quantityReceived: "2", quantityCanceled: "1" }] }, version: BigInt("1753118664873") });
-
βοΈ Parameters
-
-
request:
Square.ReceiveTransferOrderRequest
-
requestOptions:
TransferOrdersClient.RequestOptions
-
-
client.transferOrders.start({ ...params }) -> Square.StartTransferOrderResponse
-
π Description
-
-
Changes a DRAFT transfer order to STARTED status. This decrements inventory at the source Location and marks it as in-transit.
The order must be in DRAFT status and have all required fields populated. Once started, the order can no longer be deleted, but it can be canceled via CancelTransferOrder.
Creates a transfer_order.updated webhook event.
-
π Usage
-
-
await client.transferOrders.start({ transferOrderId: "transfer_order_id", idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", version: BigInt("1753109537351") });
-
βοΈ Parameters
-
-
request:
Square.StartTransferOrderRequest
-
requestOptions:
TransferOrdersClient.RequestOptions
-
-
Vendors
client.vendors.batchCreate({ ...params }) -> Square.BatchCreateVendorsResponse
-
π Description
-
-
Creates one or more Vendor objects to represent suppliers to a seller.
-
π Usage
-
-
await client.vendors.batchCreate({ vendors: { "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe": { name: "Joe's Fresh Seafood", address: { addressLine1: "505 Electric Ave", addressLine2: "Suite 600", locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", country: "US" }, contacts: [{ name: "Joe Burrow", emailAddress: "joe@joesfreshseafood.com", phoneNumber: "1-212-555-4250", ordinal: 1 }], accountNumber: "4025391", note: "a vendor" } } });
-
βοΈ Parameters
-
-
request:
Square.BatchCreateVendorsRequest
-
requestOptions:
VendorsClient.RequestOptions
-
-
client.vendors.batchGet({ ...params }) -> Square.BatchGetVendorsResponse
-
π Description
-
-
Retrieves one or more vendors of specified Vendor IDs.
-
π Usage
-
-
await client.vendors.batchGet({ vendorIds: ["INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4"] });
-
βοΈ Parameters
-
-
request:
Square.BatchGetVendorsRequest
-
requestOptions:
VendorsClient.RequestOptions
-
-
client.vendors.batchUpdate({ ...params }) -> Square.BatchUpdateVendorsResponse
-
π Description
-
-
Updates one or more of existing Vendor objects as suppliers to a seller.
-
π Usage
-
-
await client.vendors.batchUpdate({ vendors: { "FMCYHBWT1TPL8MFH52PBMEN92A": { vendor: {} }, "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { vendor: {} } } });
-
βοΈ Parameters
-
-
request:
Square.BatchUpdateVendorsRequest
-
requestOptions:
VendorsClient.RequestOptions
-
-
client.vendors.create({ ...params }) -> Square.CreateVendorResponse
-
π Description
-
-
Creates a single Vendor object to represent a supplier to a seller.
-
π Usage
-
-
await client.vendors.create({ idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", vendor: { name: "Joe's Fresh Seafood", address: { addressLine1: "505 Electric Ave", addressLine2: "Suite 600", locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", country: "US" }, contacts: [{ name: "Joe Burrow", emailAddress: "joe@joesfreshseafood.com", phoneNumber: "1-212-555-4250", ordinal: 1 }], accountNumber: "4025391", note: "a vendor" } });
-
βοΈ Parameters
-
-
request:
Square.CreateVendorRequest
-
requestOptions:
VendorsClient.RequestOptions
-
-
client.vendors.search({ ...params }) -> Square.SearchVendorsResponse
-
π Description
-
-
Searches for vendors using a filter against supported Vendor properties and a supported sorter.
-
π Usage
-
-
await client.vendors.search();
-
βοΈ Parameters
-
-
request:
Square.SearchVendorsRequest
-
requestOptions:
VendorsClient.RequestOptions
-
-
client.vendors.get({ ...params }) -> Square.GetVendorResponse
-
π Description
-
-
Retrieves the vendor of a specified Vendor ID.
-
π Usage
-
-
await client.vendors.get({ vendorId: "vendor_id" });
-
βοΈ Parameters
-
-
request:
Square.GetVendorsRequest
-
requestOptions:
VendorsClient.RequestOptions
-
-
client.vendors.update({ ...params }) -> Square.UpdateVendorResponse
-
π Description
-
-
Updates an existing Vendor object as a supplier to a seller.
-
π Usage
-
-
await client.vendors.update({ vendorId: "vendor_id", body: { idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", vendor: { id: "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", name: "Jack's Chicken Shack", version: 1, status: "ACTIVE" } } });
-
βοΈ Parameters
-
-
request:
Square.UpdateVendorsRequest
-
requestOptions:
VendorsClient.RequestOptions
-
-
Bookings CustomAttributeDefinitions
client.bookings.customAttributeDefinitions.list({ ...params }) -> core.Page
-
π Description
-
-
Get all bookings custom attribute definitions.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_READfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_READandAPPOINTMENTS_READfor the OAuth scope.
-
π Usage
-
-
const pageableResponse = await client.bookings.customAttributeDefinitions.list({ limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.bookings.customAttributeDefinitions.list({ limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.bookings.ListCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.bookings.customAttributeDefinitions.create({ ...params }) -> Square.CreateBookingCustomAttributeDefinitionResponse
-
π Description
-
-
Creates a bookings custom attribute definition.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.customAttributeDefinitions.create({ customAttributeDefinition: {} });
-
βοΈ Parameters
-
-
request:
Square.bookings.CreateBookingCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.bookings.customAttributeDefinitions.get({ ...params }) -> Square.RetrieveBookingCustomAttributeDefinitionResponse
-
π Description
-
-
Retrieves a bookings custom attribute definition.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_READfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_READandAPPOINTMENTS_READfor the OAuth scope.
-
π Usage
-
-
await client.bookings.customAttributeDefinitions.get({ key: "key", version: 1 });
-
βοΈ Parameters
-
-
request:
Square.bookings.GetCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.bookings.customAttributeDefinitions.update({ ...params }) -> Square.UpdateBookingCustomAttributeDefinitionResponse
-
π Description
-
-
Updates a bookings custom attribute definition.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: {} });
-
βοΈ Parameters
-
-
request:
Square.bookings.UpdateBookingCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.bookings.customAttributeDefinitions.delete({ ...params }) -> Square.DeleteBookingCustomAttributeDefinitionResponse
-
π Description
-
-
Deletes a bookings custom attribute definition.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.customAttributeDefinitions.delete({ key: "key" });
-
βοΈ Parameters
-
-
request:
Square.bookings.DeleteCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
Bookings CustomAttributes
client.bookings.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteBookingCustomAttributesResponse
-
π Description
-
-
Bulk deletes bookings custom attributes.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.customAttributes.batchDelete({ values: { "key": { bookingId: "booking_id", key: "key" } } });
-
βοΈ Parameters
-
-
request:
Square.bookings.BulkDeleteBookingCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.bookings.customAttributes.batchUpsert({ ...params }) -> Square.BulkUpsertBookingCustomAttributesResponse
-
π Description
-
-
Bulk upserts bookings custom attributes.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.customAttributes.batchUpsert({ values: { "key": { bookingId: "booking_id", customAttribute: {} } } });
-
βοΈ Parameters
-
-
request:
Square.bookings.BulkUpsertBookingCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.bookings.customAttributes.list({ ...params }) -> core.Page
-
π Description
-
-
Lists a booking's custom attributes.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_READfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_READandAPPOINTMENTS_READfor the OAuth scope.
-
π Usage
-
-
const pageableResponse = await client.bookings.customAttributes.list({ bookingId: "booking_id", limit: 1, cursor: "cursor", withDefinitions: true }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.bookings.customAttributes.list({ bookingId: "booking_id", limit: 1, cursor: "cursor", withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.bookings.ListCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.bookings.customAttributes.get({ ...params }) -> Square.RetrieveBookingCustomAttributeResponse
-
π Description
-
-
Retrieves a bookings custom attribute.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_READfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_READandAPPOINTMENTS_READfor the OAuth scope.
-
π Usage
-
-
await client.bookings.customAttributes.get({ bookingId: "booking_id", key: "key", withDefinition: true, version: 1 });
-
βοΈ Parameters
-
-
request:
Square.bookings.GetCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.bookings.customAttributes.upsert({ ...params }) -> Square.UpsertBookingCustomAttributeResponse
-
π Description
-
-
Upserts a bookings custom attribute.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.customAttributes.upsert({ bookingId: "booking_id", key: "key", customAttribute: {} });
-
βοΈ Parameters
-
-
request:
Square.bookings.UpsertBookingCustomAttributeRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.bookings.customAttributes.delete({ ...params }) -> Square.DeleteBookingCustomAttributeResponse
-
π Description
-
-
Deletes a bookings custom attribute.
To call this endpoint with buyer-level permissions, set
APPOINTMENTS_WRITEfor the OAuth scope. To call this endpoint with seller-level permissions, setAPPOINTMENTS_ALL_WRITEandAPPOINTMENTS_WRITEfor the OAuth scope.For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to Appointments Plus or Appointments Premium.
-
π Usage
-
-
await client.bookings.customAttributes.delete({ bookingId: "booking_id", key: "key" });
-
βοΈ Parameters
-
-
request:
Square.bookings.DeleteCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
Bookings LocationProfiles
client.bookings.locationProfiles.list({ ...params }) -> core.Page
-
π Description
-
-
Lists location booking profiles of a seller.
-
π Usage
-
-
const pageableResponse = await client.bookings.locationProfiles.list({ limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.bookings.locationProfiles.list({ limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.bookings.ListLocationProfilesRequest
-
requestOptions:
LocationProfilesClient.RequestOptions
-
-
Bookings TeamMemberProfiles
client.bookings.teamMemberProfiles.list({ ...params }) -> core.Page
-
π Description
-
-
Lists booking profiles for team members.
-
π Usage
-
-
const pageableResponse = await client.bookings.teamMemberProfiles.list({ bookableOnly: true, limit: 1, cursor: "cursor", locationId: "location_id" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.bookings.teamMemberProfiles.list({ bookableOnly: true, limit: 1, cursor: "cursor", locationId: "location_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.bookings.ListTeamMemberProfilesRequest
-
requestOptions:
TeamMemberProfilesClient.RequestOptions
-
-
client.bookings.teamMemberProfiles.get({ ...params }) -> Square.GetTeamMemberBookingProfileResponse
-
π Description
-
-
Retrieves a team member's booking profile.
-
π Usage
-
-
await client.bookings.teamMemberProfiles.get({ teamMemberId: "team_member_id" });
-
βοΈ Parameters
-
-
request:
Square.bookings.GetTeamMemberProfilesRequest
-
requestOptions:
TeamMemberProfilesClient.RequestOptions
-
-
CashDrawers Shifts
client.cashDrawers.shifts.list({ ...params }) -> core.Page
-
π Description
-
-
Provides the details for all of the cash drawer shifts for a location in a date range.
-
π Usage
-
-
const pageableResponse = await client.cashDrawers.shifts.list({ locationId: "location_id", sortOrder: "DESC", beginTime: "begin_time", endTime: "end_time", limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.cashDrawers.shifts.list({ locationId: "location_id", sortOrder: "DESC", beginTime: "begin_time", endTime: "end_time", limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.cashDrawers.ListShiftsRequest
-
requestOptions:
ShiftsClient.RequestOptions
-
-
client.cashDrawers.shifts.get({ ...params }) -> Square.GetCashDrawerShiftResponse
-
π Description
-
-
Provides the summary details for a single cash drawer shift. See ListCashDrawerShiftEvents for a list of cash drawer shift events.
-
π Usage
-
-
await client.cashDrawers.shifts.get({ shiftId: "shift_id", locationId: "location_id" });
-
βοΈ Parameters
-
-
request:
Square.cashDrawers.GetShiftsRequest
-
requestOptions:
ShiftsClient.RequestOptions
-
-
client.cashDrawers.shifts.listEvents({ ...params }) -> core.Page
-
π Description
-
-
Provides a paginated list of events for a single cash drawer shift.
-
π Usage
-
-
const pageableResponse = await client.cashDrawers.shifts.listEvents({ shiftId: "shift_id", locationId: "location_id", limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.cashDrawers.shifts.listEvents({ shiftId: "shift_id", locationId: "location_id", limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.cashDrawers.ListEventsShiftsRequest
-
requestOptions:
ShiftsClient.RequestOptions
-
-
Catalog Images
client.catalog.images.create({ ...params }) -> Square.CreateCatalogImageResponse
-
π Description
-
-
Uploads an image file to be represented by a CatalogImage object that can be linked to an existing CatalogObject instance. The resulting
CatalogImageis unattached to anyCatalogObjectif theobject_idis not specified.This
CreateCatalogImageendpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
-
π Usage
-
-
await client.catalog.images.create({});
-
βοΈ Parameters
-
-
request:
Square.catalog.CreateImagesRequest
-
requestOptions:
ImagesClient.RequestOptions
-
-
client.catalog.images.update({ ...params }) -> Square.UpdateCatalogImageResponse
-
π Description
-
-
Uploads a new image file to replace the existing one in the specified CatalogImage object.
This
UpdateCatalogImageendpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
-
π Usage
-
-
await client.catalog.images.update({ imageId: "image_id" });
-
βοΈ Parameters
-
-
request:
Square.catalog.UpdateImagesRequest
-
requestOptions:
ImagesClient.RequestOptions
-
-
Catalog Object
client.catalog.object.upsert({ ...params }) -> Square.UpsertCatalogObjectResponse
-
π Description
-
-
Creates a new or updates the specified CatalogObject.
To ensure consistency, only one update request is processed at a time per seller account. While one (batch or non-batch) update request is being processed, other (batched and non-batched) update requests are rejected with the
429error code.
-
π Usage
-
-
await client.catalog.object.upsert({ idempotencyKey: "af3d1afc-7212-4300-b463-0bfc5314a5ae", object: { type: "ITEM", id: "id" } });
-
βοΈ Parameters
-
-
request:
Square.catalog.UpsertCatalogObjectRequest
-
requestOptions:
ObjectClient.RequestOptions
-
-
client.catalog.object.get({ ...params }) -> Square.GetCatalogObjectResponse
-
π Description
-
-
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.
-
π Usage
-
-
await client.catalog.object.get({ objectId: "object_id", includeRelatedObjects: true, catalogVersion: BigInt("1000000"), includeCategoryPathToRoot: true });
-
βοΈ Parameters
-
-
request:
Square.catalog.GetObjectRequest
-
requestOptions:
ObjectClient.RequestOptions
-
-
client.catalog.object.delete({ ...params }) -> Square.DeleteCatalogObjectResponse
-
π Description
-
-
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.
To ensure consistency, only one delete request is processed at a time per seller account. While one (batch or non-batch) delete request is being processed, other (batched and non-batched) delete requests are rejected with the
429error code.
-
π Usage
-
-
await client.catalog.object.delete({ objectId: "object_id" });
-
βοΈ Parameters
-
-
request:
Square.catalog.DeleteObjectRequest
-
requestOptions:
ObjectClient.RequestOptions
-
-
Checkout PaymentLinks
client.checkout.paymentLinks.list({ ...params }) -> core.Page
-
π Description
-
-
Lists all payment links.
-
π Usage
-
-
const pageableResponse = await client.checkout.paymentLinks.list({ cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.checkout.paymentLinks.list({ cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.checkout.ListPaymentLinksRequest
-
requestOptions:
PaymentLinksClient.RequestOptions
-
-
client.checkout.paymentLinks.create({ ...params }) -> Square.CreatePaymentLinkResponse
-
π Description
-
-
Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services.
-
π Usage
-
-
await client.checkout.paymentLinks.create({ idempotencyKey: "cd9e25dc-d9f2-4430-aedb-61605070e95f", quickPay: { name: "Auto Detailing", priceMoney: { amount: BigInt("10000"), currency: "USD" }, locationId: "A9Y43N9ABXZBP" } });
-
βοΈ Parameters
-
-
request:
Square.checkout.CreatePaymentLinkRequest
-
requestOptions:
PaymentLinksClient.RequestOptions
-
-
client.checkout.paymentLinks.get({ ...params }) -> Square.GetPaymentLinkResponse
-
π Description
-
-
Retrieves a payment link.
-
π Usage
-
-
await client.checkout.paymentLinks.get({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.checkout.GetPaymentLinksRequest
-
requestOptions:
PaymentLinksClient.RequestOptions
-
-
client.checkout.paymentLinks.update({ ...params }) -> Square.UpdatePaymentLinkResponse
-
π Description
-
-
Updates a payment link. You can update the
payment_linkfields such asdescription,checkout_options, andpre_populated_data. You cannot update other fields such as theorder_id,version,URL, ortimestampfield.
-
π Usage
-
-
await client.checkout.paymentLinks.update({ id: "id", paymentLink: { version: 1, checkoutOptions: { askForShippingAddress: true } } });
-
βοΈ Parameters
-
-
request:
Square.checkout.UpdatePaymentLinkRequest
-
requestOptions:
PaymentLinksClient.RequestOptions
-
-
client.checkout.paymentLinks.delete({ ...params }) -> Square.DeletePaymentLinkResponse
-
π Description
-
-
Deletes a payment link.
-
π Usage
-
-
await client.checkout.paymentLinks.delete({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.checkout.DeletePaymentLinksRequest
-
requestOptions:
PaymentLinksClient.RequestOptions
-
-
Customers CustomAttributeDefinitions
client.customers.customAttributeDefinitions.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the customer-related custom attribute definitions that belong to a Square seller account.
When all response pages are retrieved, the results include all custom attribute definitions that are visible to the requesting application, including those that are created by other applications and set to
VISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
const pageableResponse = await client.customers.customAttributeDefinitions.list({ limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.customers.customAttributeDefinitions.list({ limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.customers.ListCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.customers.customAttributeDefinitions.create({ ...params }) -> Square.CreateCustomerCustomAttributeDefinitionResponse
-
π Description
-
-
Creates a customer-related custom attribute definition for a Square seller account. Use this endpoint to define a custom attribute that can be associated with customer profiles.
A custom attribute definition specifies the
key,visibility,schema, and other properties for a custom attribute. After the definition is created, you can call UpsertCustomerCustomAttribute or BulkUpsertCustomerCustomAttributes to set the custom attribute for customer profiles in the seller's Customer Directory.Sellers can view all custom attributes in exported customer data, including those set to
VISIBILITY_HIDDEN.
-
π Usage
-
-
await client.customers.customAttributeDefinitions.create({ customAttributeDefinition: { key: "favoritemovie", schema: { "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" }, name: "Favorite Movie", description: "The favorite movie of the customer.", visibility: "VISIBILITY_HIDDEN" } });
-
βοΈ Parameters
-
-
request:
Square.customers.CreateCustomerCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.customers.customAttributeDefinitions.get({ ...params }) -> Square.GetCustomerCustomAttributeDefinitionResponse
-
π Description
-
-
Retrieves a customer-related custom attribute definition from a Square seller account.
To retrieve a custom attribute definition created by another application, the
visibilitysetting must beVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.customers.customAttributeDefinitions.get({ key: "key", version: 1 });
-
βοΈ Parameters
-
-
request:
Square.customers.GetCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.customers.customAttributeDefinitions.update({ ...params }) -> Square.UpdateCustomerCustomAttributeDefinitionResponse
-
π Description
-
-
Updates a customer-related custom attribute definition for a Square seller account.
Use this endpoint to update the following fields:
name,description,visibility, or theschemafor aSelectiondata type.Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to
VISIBILITY_HIDDEN.
-
π Usage
-
-
await client.customers.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", visibility: "VISIBILITY_READ_ONLY" } });
-
βοΈ Parameters
-
-
request:
Square.customers.UpdateCustomerCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.customers.customAttributeDefinitions.delete({ ...params }) -> Square.DeleteCustomerCustomAttributeDefinitionResponse
-
π Description
-
-
Deletes a customer-related custom attribute definition from a Square seller account.
Deleting a custom attribute definition also deletes the corresponding custom attribute from all customer profiles in the seller's Customer Directory.
Only the definition owner can delete a custom attribute definition.
-
π Usage
-
-
await client.customers.customAttributeDefinitions.delete({ key: "key" });
-
βοΈ Parameters
-
-
request:
Square.customers.DeleteCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.customers.customAttributeDefinitions.batchUpsert({ ...params }) -> Square.BatchUpsertCustomerCustomAttributesResponse
-
π Description
-
-
Creates or updates custom attributes for customer profiles as a bulk operation.
Use this endpoint to set the value of one or more custom attributes for one or more customer profiles. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateCustomerCustomAttributeDefinition endpoint.
This
BulkUpsertCustomerCustomAttributesendpoint accepts a map of 1 to 25 individual upsert requests and returns a map of individual upsert responses. Each upsert request has a unique ID and provides a customer ID and custom attribute. Each upsert response is returned with the ID of the corresponding request.To create or update a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.customers.customAttributeDefinitions.batchUpsert({ values: { "id1": { customerId: "N3NCVYY3WS27HF0HKANA3R9FP8", customAttribute: { key: "favoritemovie", value: "Dune" } }, "id2": { customerId: "SY8EMWRNDN3TQDP2H4KS1QWMMM", customAttribute: { key: "ownsmovie", value: false } }, "id3": { customerId: "SY8EMWRNDN3TQDP2H4KS1QWMMM", customAttribute: { key: "favoritemovie", value: "Star Wars" } }, "id4": { customerId: "N3NCVYY3WS27HF0HKANA3R9FP8", customAttribute: { key: "square:a0f1505a-2aa1-490d-91a8-8d31ff181808", value: "10.5" } }, "id5": { customerId: "70548QG1HN43B05G0KCZ4MMC1G", customAttribute: { key: "sq0ids-0evKIskIGaY45fCyNL66aw:backupemail", value: "fake-email@squareup.com" } } } });
-
βοΈ Parameters
-
-
request:
Square.customers.BatchUpsertCustomerCustomAttributesRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
Customers Groups
client.customers.groups.list({ ...params }) -> core.Page
-
π Description
-
-
Retrieves the list of customer groups of a business.
-
π Usage
-
-
const pageableResponse = await client.customers.groups.list({ cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.customers.groups.list({ cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.customers.ListGroupsRequest
-
requestOptions:
GroupsClient.RequestOptions
-
-
client.customers.groups.create({ ...params }) -> Square.CreateCustomerGroupResponse
-
π Description
-
-
Creates a new customer group for a business.
The request must include the
namevalue of the group.
-
π Usage
-
-
await client.customers.groups.create({ group: { name: "Loyal Customers" } });
-
βοΈ Parameters
-
-
request:
Square.customers.CreateCustomerGroupRequest
-
requestOptions:
GroupsClient.RequestOptions
-
-
client.customers.groups.get({ ...params }) -> Square.GetCustomerGroupResponse
-
π Description
-
-
Retrieves a specific customer group as identified by the
group_idvalue.
-
π Usage
-
-
await client.customers.groups.get({ groupId: "group_id" });
-
βοΈ Parameters
-
-
request:
Square.customers.GetGroupsRequest
-
requestOptions:
GroupsClient.RequestOptions
-
-
client.customers.groups.update({ ...params }) -> Square.UpdateCustomerGroupResponse
-
π Description
-
-
Updates a customer group as identified by the
group_idvalue.
-
π Usage
-
-
await client.customers.groups.update({ groupId: "group_id", group: { name: "Loyal Customers" } });
-
βοΈ Parameters
-
-
request:
Square.customers.UpdateCustomerGroupRequest
-
requestOptions:
GroupsClient.RequestOptions
-
-
client.customers.groups.delete({ ...params }) -> Square.DeleteCustomerGroupResponse
-
π Description
-
-
Deletes a customer group as identified by the
group_idvalue.
-
π Usage
-
-
await client.customers.groups.delete({ groupId: "group_id" });
-
βοΈ Parameters
-
-
request:
Square.customers.DeleteGroupsRequest
-
requestOptions:
GroupsClient.RequestOptions
-
-
client.customers.groups.add({ ...params }) -> Square.AddGroupToCustomerResponse
-
π Description
-
-
Adds a group membership to a customer.
The customer is identified by the
customer_idvalue and the customer group is identified by thegroup_idvalue.
-
π Usage
-
-
await client.customers.groups.add({ customerId: "customer_id", groupId: "group_id" });
-
βοΈ Parameters
-
-
request:
Square.customers.AddGroupsRequest
-
requestOptions:
GroupsClient.RequestOptions
-
-
client.customers.groups.remove({ ...params }) -> Square.RemoveGroupFromCustomerResponse
-
π Description
-
-
Removes a group membership from a customer.
The customer is identified by the
customer_idvalue and the customer group is identified by thegroup_idvalue.
-
π Usage
-
-
await client.customers.groups.remove({ customerId: "customer_id", groupId: "group_id" });
-
βοΈ Parameters
-
-
request:
Square.customers.RemoveGroupsRequest
-
requestOptions:
GroupsClient.RequestOptions
-
-
Customers Segments
client.customers.segments.list({ ...params }) -> core.Page
-
π Description
-
-
Retrieves the list of customer segments of a business.
-
π Usage
-
-
const pageableResponse = await client.customers.segments.list({ cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.customers.segments.list({ cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.customers.ListSegmentsRequest
-
requestOptions:
SegmentsClient.RequestOptions
-
-
client.customers.segments.get({ ...params }) -> Square.GetCustomerSegmentResponse
-
π Description
-
-
Retrieves a specific customer segment as identified by the
segment_idvalue.
-
π Usage
-
-
await client.customers.segments.get({ segmentId: "segment_id" });
-
βοΈ Parameters
-
-
request:
Square.customers.GetSegmentsRequest
-
requestOptions:
SegmentsClient.RequestOptions
-
-
Customers Cards
client.customers.cards.create({ ...params }) -> Square.CreateCustomerCardResponse
-
π Description
-
-
Adds a card on file to an existing customer.
As with charges, calls to
CreateCustomerCardare idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the first call.
-
π Usage
-
-
await client.customers.cards.create({ customerId: "customer_id", cardNonce: "YOUR_CARD_NONCE", billingAddress: { addressLine1: "500 Electric Ave", addressLine2: "Suite 600", locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", country: "US" }, cardholderName: "Amelia Earhart" });
-
βοΈ Parameters
-
-
request:
Square.customers.CreateCustomerCardRequest
-
requestOptions:
CardsClient.RequestOptions
-
-
client.customers.cards.delete({ ...params }) -> Square.DeleteCustomerCardResponse
-
π Description
-
-
Removes a card on file from a customer.
-
π Usage
-
-
await client.customers.cards.delete({ customerId: "customer_id", cardId: "card_id" });
-
βοΈ Parameters
-
-
request:
Square.customers.DeleteCardsRequest
-
requestOptions:
CardsClient.RequestOptions
-
-
Customers CustomAttributes
client.customers.customAttributes.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the custom attributes associated with a customer profile.
You can use the
with_definitionsquery parameter to also retrieve custom attribute definitions in the same call.When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to
VISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
const pageableResponse = await client.customers.customAttributes.list({ customerId: "customer_id", limit: 1, cursor: "cursor", withDefinitions: true }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.customers.customAttributes.list({ customerId: "customer_id", limit: 1, cursor: "cursor", withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.customers.ListCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.customers.customAttributes.get({ ...params }) -> Square.GetCustomerCustomAttributeResponse
-
π Description
-
-
Retrieves a custom attribute associated with a customer profile.
You can use the
with_definitionquery parameter to also retrieve the custom attribute definition in the same call.To retrieve a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.customers.customAttributes.get({ customerId: "customer_id", key: "key", withDefinition: true, version: 1 });
-
βοΈ Parameters
-
-
request:
Square.customers.GetCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.customers.customAttributes.upsert({ ...params }) -> Square.UpsertCustomerCustomAttributeResponse
-
π Description
-
-
Creates or updates a custom attribute for a customer profile.
Use this endpoint to set the value of a custom attribute for a specified customer profile. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateCustomerCustomAttributeDefinition endpoint.
To create or update a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.customers.customAttributes.upsert({ customerId: "customer_id", key: "key", customAttribute: { value: "Dune" } });
-
βοΈ Parameters
-
-
request:
Square.customers.UpsertCustomerCustomAttributeRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.customers.customAttributes.delete({ ...params }) -> Square.DeleteCustomerCustomAttributeResponse
-
π Description
-
-
Deletes a custom attribute associated with a customer profile.
To delete a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.customers.customAttributes.delete({ customerId: "customer_id", key: "key" });
-
βοΈ Parameters
-
-
request:
Square.customers.DeleteCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
Devices Codes
client.devices.codes.list({ ...params }) -> core.Page
-
π Description
-
-
Lists all DeviceCodes associated with the merchant.
-
π Usage
-
-
const pageableResponse = await client.devices.codes.list({ cursor: "cursor", locationId: "location_id", productType: "TERMINAL_API", status: "UNKNOWN" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.devices.codes.list({ cursor: "cursor", locationId: "location_id", productType: "TERMINAL_API", status: "UNKNOWN" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.devices.ListCodesRequest
-
requestOptions:
CodesClient.RequestOptions
-
-
client.devices.codes.create({ ...params }) -> Square.CreateDeviceCodeResponse
-
π Description
-
-
Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected terminal mode.
-
π Usage
-
-
await client.devices.codes.create({ idempotencyKey: "01bb00a6-0c86-4770-94ed-f5fca973cd56", deviceCode: { name: "Counter 1", productType: "TERMINAL_API", locationId: "B5E4484SHHNYH" } });
-
βοΈ Parameters
-
-
request:
Square.devices.CreateDeviceCodeRequest
-
requestOptions:
CodesClient.RequestOptions
-
-
client.devices.codes.get({ ...params }) -> Square.GetDeviceCodeResponse
-
π Description
-
-
Retrieves DeviceCode with the associated ID.
-
π Usage
-
-
await client.devices.codes.get({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.devices.GetCodesRequest
-
requestOptions:
CodesClient.RequestOptions
-
-
Disputes Evidence
client.disputes.evidence.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a list of evidence associated with a dispute.
-
π Usage
-
-
const pageableResponse = await client.disputes.evidence.list({ disputeId: "dispute_id", cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.disputes.evidence.list({ disputeId: "dispute_id", cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.disputes.ListEvidenceRequest
-
requestOptions:
EvidenceClient.RequestOptions
-
-
client.disputes.evidence.get({ ...params }) -> Square.GetDisputeEvidenceResponse
-
π Description
-
-
Returns the metadata for the evidence specified in the request URL path.
You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it.
-
π Usage
-
-
await client.disputes.evidence.get({ disputeId: "dispute_id", evidenceId: "evidence_id" });
-
βοΈ Parameters
-
-
request:
Square.disputes.GetEvidenceRequest
-
requestOptions:
EvidenceClient.RequestOptions
-
-
client.disputes.evidence.delete({ ...params }) -> Square.DeleteDisputeEvidenceResponse
-
π Description
-
-
Removes specified evidence from a dispute. Square does not send the bank any evidence that is removed.
-
π Usage
-
-
await client.disputes.evidence.delete({ disputeId: "dispute_id", evidenceId: "evidence_id" });
-
βοΈ Parameters
-
-
request:
Square.disputes.DeleteEvidenceRequest
-
requestOptions:
EvidenceClient.RequestOptions
-
-
GiftCards Activities
client.giftCards.activities.list({ ...params }) -> core.Page
-
π Description
-
-
Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to filter the list. For example, you can get a list of gift card activities for a gift card, for all gift cards in a specific region, or for activities within a time window.
-
π Usage
-
-
const pageableResponse = await client.giftCards.activities.list({ giftCardId: "gift_card_id", type: "type", locationId: "location_id", beginTime: "begin_time", endTime: "end_time", limit: 1, cursor: "cursor", sortOrder: "sort_order" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.giftCards.activities.list({ giftCardId: "gift_card_id", type: "type", locationId: "location_id", beginTime: "begin_time", endTime: "end_time", limit: 1, cursor: "cursor", sortOrder: "sort_order" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.giftCards.ListActivitiesRequest
-
requestOptions:
ActivitiesClient.RequestOptions
-
-
client.giftCards.activities.create({ ...params }) -> Square.CreateGiftCardActivityResponse
-
π Description
-
-
Creates a gift card activity to manage the balance or state of a gift card. For example, create an
ACTIVATEactivity to activate a gift card with an initial balance before first use.
-
π Usage
-
-
await client.giftCards.activities.create({ idempotencyKey: "U16kfr-kA70er-q4Rsym-7U7NnY", giftCardActivity: { type: "ACTIVATE", locationId: "81FN9BNFZTKS4", giftCardId: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", activateActivityDetails: { orderId: "jJNGHm4gLI6XkFbwtiSLqK72KkAZY", lineItemUid: "eIWl7X0nMuO9Ewbh0ChIx" } } });
-
βοΈ Parameters
-
-
request:
Square.giftCards.CreateGiftCardActivityRequest
-
requestOptions:
ActivitiesClient.RequestOptions
-
-
Labor BreakTypes
client.labor.breakTypes.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a paginated list of
BreakTypeinstances for a business.
-
π Usage
-
-
const pageableResponse = await client.labor.breakTypes.list({ locationId: "location_id", limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.labor.breakTypes.list({ locationId: "location_id", limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.labor.ListBreakTypesRequest
-
requestOptions:
BreakTypesClient.RequestOptions
-
-
client.labor.breakTypes.create({ ...params }) -> Square.CreateBreakTypeResponse
-
π Description
-
-
Creates a new
BreakType.A
BreakTypeis a template for creatingBreakobjects. You must provide the following values in your request to this endpoint:location_idbreak_nameexpected_durationis_paid
You can only have three
BreakTypeinstances per location. If you attempt to add a fourthBreakTypefor a location, anINVALID_REQUEST_ERROR"Exceeded limit of 3 breaks per location." is returned.
-
π Usage
-
-
await client.labor.breakTypes.create({ idempotencyKey: "PAD3NG5KSN2GL", breakType: { locationId: "CGJN03P1D08GF", breakName: "Lunch Break", expectedDuration: "PT30M", isPaid: true } });
-
βοΈ Parameters
-
-
request:
Square.labor.CreateBreakTypeRequest
-
requestOptions:
BreakTypesClient.RequestOptions
-
-
client.labor.breakTypes.get({ ...params }) -> Square.GetBreakTypeResponse
-
π Description
-
-
Returns a single
BreakTypespecified byid.
-
π Usage
-
-
await client.labor.breakTypes.get({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.labor.GetBreakTypesRequest
-
requestOptions:
BreakTypesClient.RequestOptions
-
-
client.labor.breakTypes.update({ ...params }) -> Square.UpdateBreakTypeResponse
-
π Description
-
-
Updates an existing
BreakType.
-
π Usage
-
-
await client.labor.breakTypes.update({ id: "id", breakType: { locationId: "26M7H24AZ9N6R", breakName: "Lunch", expectedDuration: "PT50M", isPaid: true, version: 1 } });
-
βοΈ Parameters
-
-
request:
Square.labor.UpdateBreakTypeRequest
-
requestOptions:
BreakTypesClient.RequestOptions
-
-
client.labor.breakTypes.delete({ ...params }) -> Square.DeleteBreakTypeResponse
-
π Description
-
-
Deletes an existing
BreakType.A
BreakTypecan be deleted even if it is referenced from aShift.
-
π Usage
-
-
await client.labor.breakTypes.delete({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.labor.DeleteBreakTypesRequest
-
requestOptions:
BreakTypesClient.RequestOptions
-
-
Labor EmployeeWages
client.labor.employeeWages.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a paginated list of
EmployeeWageinstances for a business.
-
π Usage
-
-
const pageableResponse = await client.labor.employeeWages.list({ employeeId: "employee_id", limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.labor.employeeWages.list({ employeeId: "employee_id", limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.labor.ListEmployeeWagesRequest
-
requestOptions:
EmployeeWagesClient.RequestOptions
-
-
client.labor.employeeWages.get({ ...params }) -> Square.GetEmployeeWageResponse
-
π Description
-
-
Returns a single
EmployeeWagespecified byid.
-
π Usage
-
-
await client.labor.employeeWages.get({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.labor.GetEmployeeWagesRequest
-
requestOptions:
EmployeeWagesClient.RequestOptions
-
-
Labor Shifts
client.labor.shifts.create({ ...params }) -> Square.CreateShiftResponse
-
π Description
-
-
Creates a new
Shift.A
Shiftrepresents a complete workday for a single team member. You must provide the following values in your request to this endpoint:location_idteam_member_idstart_at
An attempt to create a new
Shiftcan result in aBAD_REQUESTerror when:- The
statusof the newShiftisOPENand the team member has another shift with anOPENstatus. - The
start_atdate is in the future. - The
start_atorend_atdate overlaps another shift for the same team member. - The
Breakinstances are set in the request and a breakstart_atis before theShift.start_at, a breakend_atis after theShift.end_at, or both.
-
π Usage
-
-
await client.labor.shifts.create({ idempotencyKey: "HIDSNG5KS478L", shift: { locationId: "PAA1RJZZKXBFG", startAt: "2019-01-25T03:11:00-05:00", endAt: "2019-01-25T13:11:00-05:00", wage: { title: "Barista", hourlyRate: { amount: BigInt("1100"), currency: "USD" }, tipEligible: true }, breaks: [{ startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", isPaid: true }], teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), currency: "USD" } } });
-
βοΈ Parameters
-
-
request:
Square.labor.CreateShiftRequest
-
requestOptions:
ShiftsClient.RequestOptions
-
-
client.labor.shifts.search({ ...params }) -> Square.SearchShiftsResponse
-
π Description
-
-
Returns a paginated list of
Shiftrecords for a business. The list to be returned can be filtered by:- Location IDs
- Team member IDs
- Shift status (
OPENorCLOSED) - Shift start
- Shift end
- Workday details
The list can be sorted by:
START_ATEND_ATCREATED_ATUPDATED_AT
-
π Usage
-
-
await client.labor.shifts.search({ query: { filter: { workday: { dateRange: { startDate: "2019-01-20", endDate: "2019-02-03" }, matchShiftsBy: "START_AT", defaultTimezone: "America/Los_Angeles" } } }, limit: 100 });
-
βοΈ Parameters
-
-
request:
Square.labor.SearchShiftsRequest
-
requestOptions:
ShiftsClient.RequestOptions
-
-
client.labor.shifts.get({ ...params }) -> Square.GetShiftResponse
-
π Description
-
-
Returns a single
Shiftspecified byid.
-
π Usage
-
-
await client.labor.shifts.get({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.labor.GetShiftsRequest
-
requestOptions:
ShiftsClient.RequestOptions
-
-
client.labor.shifts.update({ ...params }) -> Square.UpdateShiftResponse
-
π Description
-
-
Updates an existing
Shift.When adding a
Breakto aShift, any earlierBreakinstances in theShifthave theend_atproperty set to a valid RFC-3339 datetime string.When closing a
Shift, allBreakinstances in theShiftmust be complete withend_atset on eachBreak.
-
π Usage
-
-
await client.labor.shifts.update({ id: "id", shift: { locationId: "PAA1RJZZKXBFG", startAt: "2019-01-25T03:11:00-05:00", endAt: "2019-01-25T13:11:00-05:00", wage: { title: "Bartender", hourlyRate: { amount: BigInt("1500"), currency: "USD" }, tipEligible: true }, breaks: [{ id: "X7GAQYVVRRG6P", startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", isPaid: true }], version: 1, teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), currency: "USD" } } });
-
βοΈ Parameters
-
-
request:
Square.labor.UpdateShiftRequest
-
requestOptions:
ShiftsClient.RequestOptions
-
-
client.labor.shifts.delete({ ...params }) -> Square.DeleteShiftResponse
-
π Description
-
-
Deletes a
Shift.
-
π Usage
-
-
await client.labor.shifts.delete({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.labor.DeleteShiftsRequest
-
requestOptions:
ShiftsClient.RequestOptions
-
-
Labor TeamMemberWages
client.labor.teamMemberWages.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a paginated list of
TeamMemberWageinstances for a business.
-
π Usage
-
-
const pageableResponse = await client.labor.teamMemberWages.list({ teamMemberId: "team_member_id", limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.labor.teamMemberWages.list({ teamMemberId: "team_member_id", limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.labor.ListTeamMemberWagesRequest
-
requestOptions:
TeamMemberWagesClient.RequestOptions
-
-
client.labor.teamMemberWages.get({ ...params }) -> Square.GetTeamMemberWageResponse
-
π Description
-
-
Returns a single
TeamMemberWagespecified byid.
-
π Usage
-
-
await client.labor.teamMemberWages.get({ id: "id" });
-
βοΈ Parameters
-
-
request:
Square.labor.GetTeamMemberWagesRequest
-
requestOptions:
TeamMemberWagesClient.RequestOptions
-
-
Labor WorkweekConfigs
client.labor.workweekConfigs.list({ ...params }) -> core.Page
-
π Description
-
-
Returns a list of
WorkweekConfiginstances for a business.
-
π Usage
-
-
const pageableResponse = await client.labor.workweekConfigs.list({ limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.labor.workweekConfigs.list({ limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.labor.ListWorkweekConfigsRequest
-
requestOptions:
WorkweekConfigsClient.RequestOptions
-
-
client.labor.workweekConfigs.get({ ...params }) -> Square.UpdateWorkweekConfigResponse
-
π Description
-
-
Updates a
WorkweekConfig.
-
π Usage
-
-
await client.labor.workweekConfigs.get({ id: "id", workweekConfig: { startOfWeek: "MON", startOfDayLocalTime: "10:00", version: 10 } });
-
βοΈ Parameters
-
-
request:
Square.labor.UpdateWorkweekConfigRequest
-
requestOptions:
WorkweekConfigsClient.RequestOptions
-
-
Locations CustomAttributeDefinitions
client.locations.customAttributeDefinitions.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the location-related custom attribute definitions that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions that are visible to the requesting application, including those that are created by other applications and set to
VISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
const pageableResponse = await client.locations.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.locations.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.locations.ListCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.locations.customAttributeDefinitions.create({ ...params }) -> Square.CreateLocationCustomAttributeDefinitionResponse
-
π Description
-
-
Creates a location-related custom attribute definition for a Square seller account. Use this endpoint to define a custom attribute that can be associated with locations. A custom attribute definition specifies the
key,visibility,schema, and other properties for a custom attribute. After the definition is created, you can call UpsertLocationCustomAttribute or BulkUpsertLocationCustomAttributes to set the custom attribute for locations.
-
π Usage
-
-
await client.locations.customAttributeDefinitions.create({ customAttributeDefinition: { key: "bestseller", schema: { "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" }, name: "Bestseller", description: "Bestselling item at location", visibility: "VISIBILITY_READ_WRITE_VALUES" } });
-
βοΈ Parameters
-
-
request:
Square.locations.CreateLocationCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.locations.customAttributeDefinitions.get({ ...params }) -> Square.RetrieveLocationCustomAttributeDefinitionResponse
-
π Description
-
-
Retrieves a location-related custom attribute definition from a Square seller account. To retrieve a custom attribute definition created by another application, the
visibilitysetting must beVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.locations.customAttributeDefinitions.get({ key: "key", version: 1 });
-
βοΈ Parameters
-
-
request:
Square.locations.GetCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.locations.customAttributeDefinitions.update({ ...params }) -> Square.UpdateLocationCustomAttributeDefinitionResponse
-
π Description
-
-
Updates a location-related custom attribute definition for a Square seller account. Use this endpoint to update the following fields:
name,description,visibility, or theschemafor aSelectiondata type. Only the definition owner can update a custom attribute definition.
-
π Usage
-
-
await client.locations.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", visibility: "VISIBILITY_READ_ONLY" } });
-
βοΈ Parameters
-
-
request:
Square.locations.UpdateLocationCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.locations.customAttributeDefinitions.delete({ ...params }) -> Square.DeleteLocationCustomAttributeDefinitionResponse
-
π Description
-
-
Deletes a location-related custom attribute definition from a Square seller account. Deleting a custom attribute definition also deletes the corresponding custom attribute from all locations. Only the definition owner can delete a custom attribute definition.
-
π Usage
-
-
await client.locations.customAttributeDefinitions.delete({ key: "key" });
-
βοΈ Parameters
-
-
request:
Square.locations.DeleteCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
Locations CustomAttributes
client.locations.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteLocationCustomAttributesResponse
-
π Description
-
-
Deletes custom attributes for locations as a bulk operation. To delete a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.locations.customAttributes.batchDelete({ values: { "id1": { key: "bestseller" }, "id2": { key: "bestseller" }, "id3": { key: "phone-number" } } });
-
βοΈ Parameters
-
-
request:
Square.locations.BulkDeleteLocationCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.locations.customAttributes.batchUpsert({ ...params }) -> Square.BulkUpsertLocationCustomAttributesResponse
-
π Description
-
-
Creates or updates custom attributes for locations as a bulk operation. Use this endpoint to set the value of one or more custom attributes for one or more locations. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateLocationCustomAttributeDefinition endpoint. This
BulkUpsertLocationCustomAttributesendpoint accepts a map of 1 to 25 individual upsert requests and returns a map of individual upsert responses. Each upsert request has a unique ID and provides a location ID and custom attribute. Each upsert response is returned with the ID of the corresponding request. To create or update a custom attribute owned by another application, thevisibilitysetting must beVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.locations.customAttributes.batchUpsert({ values: { "id1": { locationId: "L0TBCBTB7P8RQ", customAttribute: { key: "bestseller", value: "hot cocoa" } }, "id2": { locationId: "L9XMD04V3STJX", customAttribute: { key: "bestseller", value: "berry smoothie" } }, "id3": { locationId: "L0TBCBTB7P8RQ", customAttribute: { key: "phone-number", value: "+12223334444" } } } });
-
βοΈ Parameters
-
-
request:
Square.locations.BulkUpsertLocationCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.locations.customAttributes.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the custom attributes associated with a location. You can use the
with_definitionsquery parameter to also retrieve custom attribute definitions in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set toVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
const pageableResponse = await client.locations.customAttributes.list({ locationId: "location_id", visibilityFilter: "ALL", limit: 1, cursor: "cursor", withDefinitions: true }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.locations.customAttributes.list({ locationId: "location_id", visibilityFilter: "ALL", limit: 1, cursor: "cursor", withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.locations.ListCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.locations.customAttributes.get({ ...params }) -> Square.RetrieveLocationCustomAttributeResponse
-
π Description
-
-
Retrieves a custom attribute associated with a location. You can use the
with_definitionquery parameter to also retrieve the custom attribute definition in the same call. To retrieve a custom attribute owned by another application, thevisibilitysetting must beVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.locations.customAttributes.get({ locationId: "location_id", key: "key", withDefinition: true, version: 1 });
-
βοΈ Parameters
-
-
request:
Square.locations.GetCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.locations.customAttributes.upsert({ ...params }) -> Square.UpsertLocationCustomAttributeResponse
-
π Description
-
-
Creates or updates a custom attribute for a location. Use this endpoint to set the value of a custom attribute for a specified location. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateLocationCustomAttributeDefinition endpoint. To create or update a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.locations.customAttributes.upsert({ locationId: "location_id", key: "key", customAttribute: { value: "hot cocoa" } });
-
βοΈ Parameters
-
-
request:
Square.locations.UpsertLocationCustomAttributeRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.locations.customAttributes.delete({ ...params }) -> Square.DeleteLocationCustomAttributeResponse
-
π Description
-
-
Deletes a custom attribute associated with a location. To delete a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.locations.customAttributes.delete({ locationId: "location_id", key: "key" });
-
βοΈ Parameters
-
-
request:
Square.locations.DeleteCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
Locations Transactions
client.locations.transactions.list({ ...params }) -> Square.ListTransactionsResponse
-
π Description
-
-
Lists transactions for a particular location.
Transactions include payment information from sales and exchanges and refund information from returns and exchanges.
Max results per page: 50
-
π Usage
-
-
await client.locations.transactions.list({ locationId: "location_id", beginTime: "begin_time", endTime: "end_time", sortOrder: "DESC", cursor: "cursor" });
-
βοΈ Parameters
-
-
request:
Square.locations.ListTransactionsRequest
-
requestOptions:
TransactionsClient.RequestOptions
-
-
client.locations.transactions.get({ ...params }) -> Square.GetTransactionResponse
-
π Description
-
-
Retrieves details for a single transaction.
-
π Usage
-
-
await client.locations.transactions.get({ locationId: "location_id", transactionId: "transaction_id" });
-
βοΈ Parameters
-
-
request:
Square.locations.GetTransactionsRequest
-
requestOptions:
TransactionsClient.RequestOptions
-
-
client.locations.transactions.capture({ ...params }) -> Square.CaptureTransactionResponse
-
π Description
-
-
Captures a transaction that was created with the Charge endpoint with a
delay_capturevalue oftrue.See Delayed capture transactions for more information.
-
π Usage
-
-
await client.locations.transactions.capture({ locationId: "location_id", transactionId: "transaction_id" });
-
βοΈ Parameters
-
-
request:
Square.locations.CaptureTransactionsRequest
-
requestOptions:
TransactionsClient.RequestOptions
-
-
client.locations.transactions.void({ ...params }) -> Square.VoidTransactionResponse
-
π Description
-
-
Cancels a transaction that was created with the Charge endpoint with a
delay_capturevalue oftrue.See Delayed capture transactions for more information.
-
π Usage
-
-
await client.locations.transactions.void({ locationId: "location_id", transactionId: "transaction_id" });
-
βοΈ Parameters
-
-
request:
Square.locations.VoidTransactionsRequest
-
requestOptions:
TransactionsClient.RequestOptions
-
-
Loyalty Accounts
client.loyalty.accounts.create({ ...params }) -> Square.CreateLoyaltyAccountResponse
-
π Description
-
-
Creates a loyalty account. To create a loyalty account, you must provide the
program_idand amappingwith thephone_numberof the buyer.
-
π Usage
-
-
await client.loyalty.accounts.create({ loyaltyAccount: { programId: "d619f755-2d17-41f3-990d-c04ecedd64dd", mapping: { phoneNumber: "+14155551234" } }, idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.CreateLoyaltyAccountRequest
-
requestOptions:
AccountsClient.RequestOptions
-
-
client.loyalty.accounts.search({ ...params }) -> Square.SearchLoyaltyAccountsResponse
-
π Description
-
-
Searches for loyalty accounts in a loyalty program.
You can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty
queryobject or omit it entirely.Search results are sorted by
created_atin ascending order.
-
π Usage
-
-
await client.loyalty.accounts.search({ query: { mappings: [{ phoneNumber: "+14155551234" }] }, limit: 10 });
-
βοΈ Parameters
-
-
request:
Square.loyalty.SearchLoyaltyAccountsRequest
-
requestOptions:
AccountsClient.RequestOptions
-
-
client.loyalty.accounts.get({ ...params }) -> Square.GetLoyaltyAccountResponse
-
π Description
-
-
Retrieves a loyalty account.
-
π Usage
-
-
await client.loyalty.accounts.get({ accountId: "account_id" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.GetAccountsRequest
-
requestOptions:
AccountsClient.RequestOptions
-
-
client.loyalty.accounts.accumulatePoints({ ...params }) -> Square.AccumulateLoyaltyPointsResponse
-
π Description
-
-
Adds points earned from a purchase to a loyalty account.
-
If you are using the Orders API to manage orders, provide the
order_id. Square reads the order to compute the points earned from both the base loyalty program and an associated loyalty promotion. For purchases that qualify for multiple accrual rules, Square computes points based on the accrual rule that grants the most points. For purchases that qualify for multiple promotions, Square computes points based on the most recently created promotion. A purchase must first qualify for program points to be eligible for promotion points. -
If you are not using the Orders API to manage orders, provide
pointswith the number of points to add. You must first perform a client-side computation of the points earned from the loyalty program and loyalty promotion. For spend-based and visit-based programs, you can call CalculateLoyaltyPoints to compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see Calculating promotion points.
-
-
π Usage
-
-
await client.loyalty.accounts.accumulatePoints({ accountId: "account_id", accumulatePoints: { orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" }, idempotencyKey: "58b90739-c3e8-4b11-85f7-e636d48d72cb", locationId: "P034NEENMD09F" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.AccumulateLoyaltyPointsRequest
-
requestOptions:
AccountsClient.RequestOptions
-
-
client.loyalty.accounts.adjust({ ...params }) -> Square.AdjustLoyaltyPointsResponse
-
π Description
-
-
Adds points to or subtracts points from a buyer's account.
Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call AccumulateLoyaltyPoints to add points when a buyer pays for the purchase.
-
π Usage
-
-
await client.loyalty.accounts.adjust({ accountId: "account_id", idempotencyKey: "bc29a517-3dc9-450e-aa76-fae39ee849d1", adjustPoints: { points: 10, reason: "Complimentary points" } });
-
βοΈ Parameters
-
-
request:
Square.loyalty.AdjustLoyaltyPointsRequest
-
requestOptions:
AccountsClient.RequestOptions
-
-
Loyalty Programs
client.loyalty.programs.list() -> Square.ListLoyaltyProgramsResponse
-
π Description
-
-
Returns a list of loyalty programs in the seller's account. Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see Loyalty Program Overview.
Replaced with RetrieveLoyaltyProgram when used with the keyword
main.
-
π Usage
-
-
await client.loyalty.programs.list();
-
βοΈ Parameters
-
-
requestOptions:
ProgramsClient.RequestOptions
-
-
client.loyalty.programs.get({ ...params }) -> Square.GetLoyaltyProgramResponse
-
π Description
-
-
Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword
main.Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see Loyalty Program Overview.
-
π Usage
-
-
await client.loyalty.programs.get({ programId: "program_id" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.GetProgramsRequest
-
requestOptions:
ProgramsClient.RequestOptions
-
-
client.loyalty.programs.calculate({ ...params }) -> Square.CalculateLoyaltyPointsResponse
-
π Description
-
-
Calculates the number of points a buyer can earn from a purchase. Applications might call this endpoint to display the points to the buyer.
-
If you are using the Orders API to manage orders, provide the
order_idand (optional)loyalty_account_id. Square reads the order to compute the points earned from the base loyalty program and an associated loyalty promotion. -
If you are not using the Orders API to manage orders, provide
transaction_amount_moneywith the purchase amount. Square uses this amount to calculate the points earned from the base loyalty program, but not points earned from a loyalty promotion. For spend-based and visit-based programs, thetax_modesetting of the accrual rule indicates how taxes should be treated for loyalty points accrual. If the purchase qualifies for program points, call ListLoyaltyPromotions and perform a client-side computation to calculate whether the purchase also qualifies for promotion points. For more information, see Calculating promotion points.
-
-
π Usage
-
-
await client.loyalty.programs.calculate({ programId: "program_id", orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", loyaltyAccountId: "79b807d2-d786-46a9-933b-918028d7a8c5" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.CalculateLoyaltyPointsRequest
-
requestOptions:
ProgramsClient.RequestOptions
-
-
Loyalty Rewards
client.loyalty.rewards.create({ ...params }) -> Square.CreateLoyaltyRewardResponse
-
π Description
-
-
Creates a loyalty reward. In the process, the endpoint does following:
- Uses the
reward_tier_idin the request to determine the number of points to lock for this reward. - If the request includes
order_id, it adds the reward and related discount to the order.
After a reward is created, the points are locked and not available for the buyer to redeem another reward.
- Uses the
-
π Usage
-
-
await client.loyalty.rewards.create({ reward: { loyaltyAccountId: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", rewardTierId: "e1b39225-9da5-43d1-a5db-782cdd8ad94f", orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" }, idempotencyKey: "18c2e5ea-a620-4b1f-ad60-7b167285e451" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.CreateLoyaltyRewardRequest
-
requestOptions:
RewardsClient.RequestOptions
-
-
client.loyalty.rewards.search({ ...params }) -> Square.SearchLoyaltyRewardsResponse
-
π Description
-
-
Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns results for all loyalty accounts. If you include a
queryobject,loyalty_account_idis required andstatusis optional.If you know a reward ID, use the RetrieveLoyaltyReward endpoint.
Search results are sorted by
updated_atin descending order.
-
π Usage
-
-
await client.loyalty.rewards.search({ query: { loyaltyAccountId: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" }, limit: 10 });
-
βοΈ Parameters
-
-
request:
Square.loyalty.SearchLoyaltyRewardsRequest
-
requestOptions:
RewardsClient.RequestOptions
-
-
client.loyalty.rewards.get({ ...params }) -> Square.GetLoyaltyRewardResponse
-
π Description
-
-
Retrieves a loyalty reward.
-
π Usage
-
-
await client.loyalty.rewards.get({ rewardId: "reward_id" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.GetRewardsRequest
-
requestOptions:
RewardsClient.RequestOptions
-
-
client.loyalty.rewards.delete({ ...params }) -> Square.DeleteLoyaltyRewardResponse
-
π Description
-
-
Deletes a loyalty reward by doing the following:
- Returns the loyalty points back to the loyalty account.
- If an order ID was specified when the reward was created (see CreateLoyaltyReward), it updates the order by removing the reward and related discounts.
You cannot delete a reward that has reached the terminal state (REDEEMED).
-
π Usage
-
-
await client.loyalty.rewards.delete({ rewardId: "reward_id" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.DeleteRewardsRequest
-
requestOptions:
RewardsClient.RequestOptions
-
-
client.loyalty.rewards.redeem({ ...params }) -> Square.RedeemLoyaltyRewardResponse
-
π Description
-
-
Redeems a loyalty reward.
The endpoint sets the reward to the
REDEEMEDterminal state.If you are using your own order processing system (not using the Orders API), you call this endpoint after the buyer paid for the purchase.
After the reward reaches the terminal state, it cannot be deleted. In other words, points used for the reward cannot be returned to the account.
-
π Usage
-
-
await client.loyalty.rewards.redeem({ rewardId: "reward_id", idempotencyKey: "98adc7f7-6963-473b-b29c-f3c9cdd7d994", locationId: "P034NEENMD09F" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.RedeemLoyaltyRewardRequest
-
requestOptions:
RewardsClient.RequestOptions
-
-
Loyalty Programs Promotions
client.loyalty.programs.promotions.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the loyalty promotions associated with a loyalty program. Results are sorted by the
created_atdate in descending order (newest to oldest).
-
π Usage
-
-
const pageableResponse = await client.loyalty.programs.promotions.list({ programId: "program_id", status: "ACTIVE", cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.loyalty.programs.promotions.list({ programId: "program_id", status: "ACTIVE", cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.loyalty.programs.ListPromotionsRequest
-
requestOptions:
PromotionsClient.RequestOptions
-
-
client.loyalty.programs.promotions.create({ ...params }) -> Square.CreateLoyaltyPromotionResponse
-
π Description
-
-
Creates a loyalty promotion for a loyalty program. A loyalty promotion enables buyers to earn points in addition to those earned from the base loyalty program.
This endpoint sets the loyalty promotion to the
ACTIVEorSCHEDULEDstatus, depending on theavailable_timesetting. A loyalty program can have a maximum of 10 loyalty promotions with anACTIVEorSCHEDULEDstatus.
-
π Usage
-
-
await client.loyalty.programs.promotions.create({ programId: "program_id", loyaltyPromotion: { name: "Tuesday Happy Hour Promo", incentive: { type: "POINTS_MULTIPLIER", pointsMultiplierData: { multiplier: "3.0" } }, availableTime: { timePeriods: ["BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT"] }, triggerLimit: { times: 1, interval: "DAY" }, minimumSpendAmountMoney: { amount: BigInt("2000"), currency: "USD" }, qualifyingCategoryIds: ["XTQPYLR3IIU9C44VRCB3XD12"] }, idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.programs.CreateLoyaltyPromotionRequest
-
requestOptions:
PromotionsClient.RequestOptions
-
-
client.loyalty.programs.promotions.get({ ...params }) -> Square.GetLoyaltyPromotionResponse
-
π Description
-
-
Retrieves a loyalty promotion.
-
π Usage
-
-
await client.loyalty.programs.promotions.get({ programId: "program_id", promotionId: "promotion_id" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.programs.GetPromotionsRequest
-
requestOptions:
PromotionsClient.RequestOptions
-
-
client.loyalty.programs.promotions.cancel({ ...params }) -> Square.CancelLoyaltyPromotionResponse
-
π Description
-
-
Cancels a loyalty promotion. Use this endpoint to cancel an
ACTIVEpromotion earlier than the end date, cancel anACTIVEpromotion when an end date is not specified, or cancel aSCHEDULEDpromotion. Because updating a promotion is not supported, you can also use this endpoint to cancel a promotion before you create a new one.This endpoint sets the loyalty promotion to the
CANCELEDstate
-
π Usage
-
-
await client.loyalty.programs.promotions.cancel({ programId: "program_id", promotionId: "promotion_id" });
-
βοΈ Parameters
-
-
request:
Square.loyalty.programs.CancelPromotionsRequest
-
requestOptions:
PromotionsClient.RequestOptions
-
-
Merchants CustomAttributeDefinitions
client.merchants.customAttributeDefinitions.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the merchant-related custom attribute definitions that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions that are visible to the requesting application, including those that are created by other applications and set to
VISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
const pageableResponse = await client.merchants.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor" }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.merchants.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.merchants.ListCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.merchants.customAttributeDefinitions.create({ ...params }) -> Square.CreateMerchantCustomAttributeDefinitionResponse
-
π Description
-
-
Creates a merchant-related custom attribute definition for a Square seller account. Use this endpoint to define a custom attribute that can be associated with a merchant connecting to your application. A custom attribute definition specifies the
key,visibility,schema, and other properties for a custom attribute. After the definition is created, you can call UpsertMerchantCustomAttribute or BulkUpsertMerchantCustomAttributes to set the custom attribute for a merchant.
-
π Usage
-
-
await client.merchants.customAttributeDefinitions.create({ customAttributeDefinition: { key: "alternative_seller_name", schema: { "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" }, name: "Alternative Merchant Name", description: "This is the other name this merchant goes by.", visibility: "VISIBILITY_READ_ONLY" } });
-
βοΈ Parameters
-
-
request:
Square.merchants.CreateMerchantCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.merchants.customAttributeDefinitions.get({ ...params }) -> Square.RetrieveMerchantCustomAttributeDefinitionResponse
-
π Description
-
-
Retrieves a merchant-related custom attribute definition from a Square seller account. To retrieve a custom attribute definition created by another application, the
visibilitysetting must beVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.merchants.customAttributeDefinitions.get({ key: "key", version: 1 });
-
βοΈ Parameters
-
-
request:
Square.merchants.GetCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.merchants.customAttributeDefinitions.update({ ...params }) -> Square.UpdateMerchantCustomAttributeDefinitionResponse
-
π Description
-
-
Updates a merchant-related custom attribute definition for a Square seller account. Use this endpoint to update the following fields:
name,description,visibility, or theschemafor aSelectiondata type. Only the definition owner can update a custom attribute definition.
-
π Usage
-
-
await client.merchants.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", visibility: "VISIBILITY_READ_ONLY" } });
-
βοΈ Parameters
-
-
request:
Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.merchants.customAttributeDefinitions.delete({ ...params }) -> Square.DeleteMerchantCustomAttributeDefinitionResponse
-
π Description
-
-
Deletes a merchant-related custom attribute definition from a Square seller account. Deleting a custom attribute definition also deletes the corresponding custom attribute from the merchant. Only the definition owner can delete a custom attribute definition.
-
π Usage
-
-
await client.merchants.customAttributeDefinitions.delete({ key: "key" });
-
βοΈ Parameters
-
-
request:
Square.merchants.DeleteCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
Merchants CustomAttributes
client.merchants.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteMerchantCustomAttributesResponse
-
π Description
-
-
Deletes custom attributes for a merchant as a bulk operation. To delete a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.merchants.customAttributes.batchDelete({ values: { "id1": { key: "alternative_seller_name" }, "id2": { key: "has_seen_tutorial" } } });
-
βοΈ Parameters
-
-
request:
Square.merchants.BulkDeleteMerchantCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.merchants.customAttributes.batchUpsert({ ...params }) -> Square.BulkUpsertMerchantCustomAttributesResponse
-
π Description
-
-
Creates or updates custom attributes for a merchant as a bulk operation. Use this endpoint to set the value of one or more custom attributes for a merchant. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateMerchantCustomAttributeDefinition endpoint. This
BulkUpsertMerchantCustomAttributesendpoint accepts a map of 1 to 25 individual upsert requests and returns a map of individual upsert responses. Each upsert request has a unique ID and provides a merchant ID and custom attribute. Each upsert response is returned with the ID of the corresponding request. To create or update a custom attribute owned by another application, thevisibilitysetting must beVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.merchants.customAttributes.batchUpsert({ values: { "id1": { merchantId: "DM7VKY8Q63GNP", customAttribute: { key: "alternative_seller_name", value: "Ultimate Sneaker Store" } }, "id2": { merchantId: "DM7VKY8Q63GNP", customAttribute: { key: "has_seen_tutorial", value: true } } } });
-
βοΈ Parameters
-
-
request:
Square.merchants.BulkUpsertMerchantCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.merchants.customAttributes.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the custom attributes associated with a merchant. You can use the
with_definitionsquery parameter to also retrieve custom attribute definitions in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set toVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
const pageableResponse = await client.merchants.customAttributes.list({ merchantId: "merchant_id", visibilityFilter: "ALL", limit: 1, cursor: "cursor", withDefinitions: true }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.merchants.customAttributes.list({ merchantId: "merchant_id", visibilityFilter: "ALL", limit: 1, cursor: "cursor", withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.merchants.ListCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.merchants.customAttributes.get({ ...params }) -> Square.RetrieveMerchantCustomAttributeResponse
-
π Description
-
-
Retrieves a custom attribute associated with a merchant. You can use the
with_definitionquery parameter to also retrieve the custom attribute definition in the same call. To retrieve a custom attribute owned by another application, thevisibilitysetting must beVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.merchants.customAttributes.get({ merchantId: "merchant_id", key: "key", withDefinition: true, version: 1 });
-
βοΈ Parameters
-
-
request:
Square.merchants.GetCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.merchants.customAttributes.upsert({ ...params }) -> Square.UpsertMerchantCustomAttributeResponse
-
π Description
-
-
Creates or updates a custom attribute for a merchant. Use this endpoint to set the value of a custom attribute for a specified merchant. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateMerchantCustomAttributeDefinition endpoint. To create or update a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.merchants.customAttributes.upsert({ merchantId: "merchant_id", key: "key", customAttribute: { value: "Ultimate Sneaker Store" } });
-
βοΈ Parameters
-
-
request:
Square.merchants.UpsertMerchantCustomAttributeRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.merchants.customAttributes.delete({ ...params }) -> Square.DeleteMerchantCustomAttributeResponse
-
π Description
-
-
Deletes a custom attribute associated with a merchant. To delete a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.merchants.customAttributes.delete({ merchantId: "merchant_id", key: "key" });
-
βοΈ Parameters
-
-
request:
Square.merchants.DeleteCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
Orders CustomAttributeDefinitions
client.orders.customAttributeDefinitions.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the order-related custom attribute definitions that belong to a Square seller account.
When all response pages are retrieved, the results include all custom attribute definitions that are visible to the requesting application, including those that are created by other applications and set to
VISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
const pageableResponse = await client.orders.customAttributeDefinitions.list({ visibilityFilter: "ALL", cursor: "cursor", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.orders.customAttributeDefinitions.list({ visibilityFilter: "ALL", cursor: "cursor", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.orders.ListCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.orders.customAttributeDefinitions.create({ ...params }) -> Square.CreateOrderCustomAttributeDefinitionResponse
-
π Description
-
-
Creates an order-related custom attribute definition. Use this endpoint to define a custom attribute that can be associated with orders.
After creating a custom attribute definition, you can set the custom attribute for orders in the Square seller account.
-
π Usage
-
-
await client.orders.customAttributeDefinitions.create({ customAttributeDefinition: { key: "cover-count", schema: { "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" }, name: "Cover count", description: "The number of people seated at a table", visibility: "VISIBILITY_READ_WRITE_VALUES" }, idempotencyKey: "IDEMPOTENCY_KEY" });
-
βοΈ Parameters
-
-
request:
Square.orders.CreateOrderCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.orders.customAttributeDefinitions.get({ ...params }) -> Square.RetrieveOrderCustomAttributeDefinitionResponse
-
π Description
-
-
Retrieves an order-related custom attribute definition from a Square seller account.
To retrieve a custom attribute definition created by another application, the
visibilitysetting must beVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.orders.customAttributeDefinitions.get({ key: "key", version: 1 });
-
βοΈ Parameters
-
-
request:
Square.orders.GetCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.orders.customAttributeDefinitions.update({ ...params }) -> Square.UpdateOrderCustomAttributeDefinitionResponse
-
π Description
-
-
Updates an order-related custom attribute definition for a Square seller account.
Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to
VISIBILITY_HIDDEN.
-
π Usage
-
-
await client.orders.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { key: "cover-count", visibility: "VISIBILITY_READ_ONLY", version: 1 }, idempotencyKey: "IDEMPOTENCY_KEY" });
-
βοΈ Parameters
-
-
request:
Square.orders.UpdateOrderCustomAttributeDefinitionRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
client.orders.customAttributeDefinitions.delete({ ...params }) -> Square.DeleteOrderCustomAttributeDefinitionResponse
-
π Description
-
-
Deletes an order-related custom attribute definition from a Square seller account.
Only the definition owner can delete a custom attribute definition.
-
π Usage
-
-
await client.orders.customAttributeDefinitions.delete({ key: "key" });
-
βοΈ Parameters
-
-
request:
Square.orders.DeleteCustomAttributeDefinitionsRequest
-
requestOptions:
CustomAttributeDefinitionsClient.RequestOptions
-
-
Orders CustomAttributes
client.orders.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteOrderCustomAttributesResponse
-
π Description
-
-
Deletes order custom attributes as a bulk operation.
Use this endpoint to delete one or more custom attributes from one or more orders. A custom attribute is based on a custom attribute definition in a Square seller account. (To create a custom attribute definition, use the CreateOrderCustomAttributeDefinition endpoint.)
This
BulkDeleteOrderCustomAttributesendpoint accepts a map of 1 to 25 individual delete requests and returns a map of individual delete responses. Each delete request has a unique ID and provides an order ID and custom attribute. Each delete response is returned with the ID of the corresponding request.To delete a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.orders.customAttributes.batchDelete({ values: { "cover-count": { key: "cover-count", orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" }, "table-number": { key: "table-number", orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" } } });
-
βοΈ Parameters
-
-
request:
Square.orders.BulkDeleteOrderCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.orders.customAttributes.batchUpsert({ ...params }) -> Square.BulkUpsertOrderCustomAttributesResponse
-
π Description
-
-
Creates or updates order custom attributes as a bulk operation.
Use this endpoint to delete one or more custom attributes from one or more orders. A custom attribute is based on a custom attribute definition in a Square seller account. (To create a custom attribute definition, use the CreateOrderCustomAttributeDefinition endpoint.)
This
BulkUpsertOrderCustomAttributesendpoint accepts a map of 1 to 25 individual upsert requests and returns a map of individual upsert responses. Each upsert request has a unique ID and provides an order ID and custom attribute. Each upsert response is returned with the ID of the corresponding request.To create or update a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.orders.customAttributes.batchUpsert({ values: { "cover-count": { customAttribute: { key: "cover-count", value: "6", version: 2 }, orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" }, "table-number": { customAttribute: { key: "table-number", value: "11", version: 4 }, orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" } } });
-
βοΈ Parameters
-
-
request:
Square.orders.BulkUpsertOrderCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.orders.customAttributes.list({ ...params }) -> core.Page
-
π Description
-
-
Lists the custom attributes associated with an order.
You can use the
with_definitionsquery parameter to also retrieve custom attribute definitions in the same call.When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to
VISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
const pageableResponse = await client.orders.customAttributes.list({ orderId: "order_id", visibilityFilter: "ALL", cursor: "cursor", limit: 1, withDefinitions: true }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.orders.customAttributes.list({ orderId: "order_id", visibilityFilter: "ALL", cursor: "cursor", limit: 1, withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.orders.ListCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.orders.customAttributes.get({ ...params }) -> Square.RetrieveOrderCustomAttributeResponse
-
π Description
-
-
Retrieves a custom attribute associated with an order.
You can use the
with_definitionquery parameter to also retrieve the custom attribute definition in the same call.To retrieve a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_ONLYorVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.orders.customAttributes.get({ orderId: "order_id", customAttributeKey: "custom_attribute_key", version: 1, withDefinition: true });
-
βοΈ Parameters
-
-
request:
Square.orders.GetCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.orders.customAttributes.upsert({ ...params }) -> Square.UpsertOrderCustomAttributeResponse
-
π Description
-
-
Creates or updates a custom attribute for an order.
Use this endpoint to set the value of a custom attribute for a specific order. A custom attribute is based on a custom attribute definition in a Square seller account. (To create a custom attribute definition, use the CreateOrderCustomAttributeDefinition endpoint.)
To create or update a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.orders.customAttributes.upsert({ orderId: "order_id", customAttributeKey: "custom_attribute_key", customAttribute: { key: "table-number", value: "42", version: 1 } });
-
βοΈ Parameters
-
-
request:
Square.orders.UpsertOrderCustomAttributeRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
client.orders.customAttributes.delete({ ...params }) -> Square.DeleteOrderCustomAttributeResponse
-
π Description
-
-
Deletes a custom attribute associated with a customer profile.
To delete a custom attribute owned by another application, the
visibilitysetting must beVISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set toVISIBILITY_READ_WRITE_VALUES.
-
π Usage
-
-
await client.orders.customAttributes.delete({ orderId: "order_id", customAttributeKey: "custom_attribute_key" });
-
βοΈ Parameters
-
-
request:
Square.orders.DeleteCustomAttributesRequest
-
requestOptions:
CustomAttributesClient.RequestOptions
-
-
TeamMembers WageSetting
client.teamMembers.wageSetting.get({ ...params }) -> Square.GetWageSettingResponse
-
π Description
-
-
Retrieves a
WageSettingobject for a team member specified byTeamMember.id. For more information, see Troubleshooting the Team API.Square recommends using RetrieveTeamMember or SearchTeamMembers to get this information directly from the
TeamMember.wage_settingfield.
-
π Usage
-
-
await client.teamMembers.wageSetting.get({ teamMemberId: "team_member_id" });
-
βοΈ Parameters
-
-
request:
Square.teamMembers.GetWageSettingRequest
-
requestOptions:
WageSettingClient.RequestOptions
-
-
client.teamMembers.wageSetting.update({ ...params }) -> Square.UpdateWageSettingResponse
-
π Description
-
-
Creates or updates a
WageSettingobject. The object is created if aWageSettingwith the specifiedteam_member_iddoesn't exist. Otherwise, it fully replaces theWageSettingobject for the team member. TheWageSettingis returned on a successful update. For more information, see Troubleshooting the Team API.Square recommends using CreateTeamMember or UpdateTeamMember to manage the
TeamMember.wage_settingfield directly.
-
π Usage
-
-
await client.teamMembers.wageSetting.update({ teamMemberId: "team_member_id", wageSetting: { jobAssignments: [{ jobTitle: "Manager", payType: "SALARY", annualRate: { amount: BigInt("3000000"), currency: "USD" }, weeklyHours: 40 }, { jobTitle: "Cashier", payType: "HOURLY", hourlyRate: { amount: BigInt("2000"), currency: "USD" } }], isOvertimeExempt: true } });
-
βοΈ Parameters
-
-
request:
Square.teamMembers.UpdateWageSettingRequest
-
requestOptions:
WageSettingClient.RequestOptions
-
-
Terminal Actions
client.terminal.actions.create({ ...params }) -> Square.CreateTerminalActionResponse
-
π Description
-
-
Creates a Terminal action request and sends it to the specified device.
-
π Usage
-
-
await client.terminal.actions.create({ idempotencyKey: "thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e", action: { deviceId: "{{DEVICE_ID}}", deadlineDuration: "PT5M", type: "SAVE_CARD", saveCardOptions: { customerId: "{{CUSTOMER_ID}}", referenceId: "user-id-1" } } });
-
βοΈ Parameters
-
-
request:
Square.terminal.CreateTerminalActionRequest
-
requestOptions:
ActionsClient.RequestOptions
-
-
client.terminal.actions.search({ ...params }) -> Square.SearchTerminalActionsResponse
-
π Description
-
-
Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days.
-
π Usage
-
-
await client.terminal.actions.search({ query: { filter: { createdAt: { startAt: "2022-04-01T00:00:00.000Z" } }, sort: { sortOrder: "DESC" } }, limit: 2 });
-
βοΈ Parameters
-
-
request:
Square.terminal.SearchTerminalActionsRequest
-
requestOptions:
ActionsClient.RequestOptions
-
-
client.terminal.actions.get({ ...params }) -> Square.GetTerminalActionResponse
-
π Description
-
-
Retrieves a Terminal action request by
action_id. Terminal action requests are available for 30 days.
-
π Usage
-
-
await client.terminal.actions.get({ actionId: "action_id" });
-
βοΈ Parameters
-
-
request:
Square.terminal.GetActionsRequest
-
requestOptions:
ActionsClient.RequestOptions
-
-
client.terminal.actions.cancel({ ...params }) -> Square.CancelTerminalActionResponse
-
π Description
-
-
Cancels a Terminal action request if the status of the request permits it.
-
π Usage
-
-
await client.terminal.actions.cancel({ actionId: "action_id" });
-
βοΈ Parameters
-
-
request:
Square.terminal.CancelActionsRequest
-
requestOptions:
ActionsClient.RequestOptions
-
-
Terminal Checkouts
client.terminal.checkouts.create({ ...params }) -> Square.CreateTerminalCheckoutResponse
-
π Description
-
-
Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount.
-
π Usage
-
-
await client.terminal.checkouts.create({ idempotencyKey: "28a0c3bc-7839-11ea-bc55-0242ac130003", checkout: { amountMoney: { amount: BigInt("2610"), currency: "USD" }, referenceId: "id11572", note: "A brief note", deviceOptions: { deviceId: "dbb5d83a-7838-11ea-bc55-0242ac130003" } } });
-
βοΈ Parameters
-
-
request:
Square.terminal.CreateTerminalCheckoutRequest
-
requestOptions:
CheckoutsClient.RequestOptions
-
-
client.terminal.checkouts.search({ ...params }) -> Square.SearchTerminalCheckoutsResponse
-
π Description
-
-
Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days.
-
π Usage
-
-
await client.terminal.checkouts.search({ query: { filter: { status: "COMPLETED" } }, limit: 2 });
-
βοΈ Parameters
-
-
request:
Square.terminal.SearchTerminalCheckoutsRequest
-
requestOptions:
CheckoutsClient.RequestOptions
-
-
client.terminal.checkouts.get({ ...params }) -> Square.GetTerminalCheckoutResponse
-
π Description
-
-
Retrieves a Terminal checkout request by
checkout_id. Terminal checkout requests are available for 30 days.
-
π Usage
-
-
await client.terminal.checkouts.get({ checkoutId: "checkout_id" });
-
βοΈ Parameters
-
-
request:
Square.terminal.GetCheckoutsRequest
-
requestOptions:
CheckoutsClient.RequestOptions
-
-
client.terminal.checkouts.cancel({ ...params }) -> Square.CancelTerminalCheckoutResponse
-
π Description
-
-
Cancels a Terminal checkout request if the status of the request permits it.
-
π Usage
-
-
await client.terminal.checkouts.cancel({ checkoutId: "checkout_id" });
-
βοΈ Parameters
-
-
request:
Square.terminal.CancelCheckoutsRequest
-
requestOptions:
CheckoutsClient.RequestOptions
-
-
Terminal Refunds
client.terminal.refunds.create({ ...params }) -> Square.CreateTerminalRefundResponse
-
π Description
-
-
Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see Refunds API.
-
π Usage
-
-
await client.terminal.refunds.create({ idempotencyKey: "402a640b-b26f-401f-b406-46f839590c04", refund: { paymentId: "5O5OvgkcNUhl7JBuINflcjKqUzXZY", amountMoney: { amount: BigInt("111"), currency: "CAD" }, reason: "Returning items", deviceId: "f72dfb8e-4d65-4e56-aade-ec3fb8d33291" } });
-
βοΈ Parameters
-
-
request:
Square.terminal.CreateTerminalRefundRequest
-
requestOptions:
RefundsClient.RequestOptions
-
-
client.terminal.refunds.search({ ...params }) -> Square.SearchTerminalRefundsResponse
-
π Description
-
-
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.
-
π Usage
-
-
await client.terminal.refunds.search({ query: { filter: { status: "COMPLETED" } }, limit: 1 });
-
βοΈ Parameters
-
-
request:
Square.terminal.SearchTerminalRefundsRequest
-
requestOptions:
RefundsClient.RequestOptions
-
-
client.terminal.refunds.get({ ...params }) -> Square.GetTerminalRefundResponse
-
π Description
-
-
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.
-
π Usage
-
-
await client.terminal.refunds.get({ terminalRefundId: "terminal_refund_id" });
-
βοΈ Parameters
-
-
request:
Square.terminal.GetRefundsRequest
-
requestOptions:
RefundsClient.RequestOptions
-
-
client.terminal.refunds.cancel({ ...params }) -> Square.CancelTerminalRefundResponse
-
π Description
-
-
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.
-
π Usage
-
-
await client.terminal.refunds.cancel({ terminalRefundId: "terminal_refund_id" });
-
βοΈ Parameters
-
-
request:
Square.terminal.CancelRefundsRequest
-
requestOptions:
RefundsClient.RequestOptions
-
-
Webhooks EventTypes
client.webhooks.eventTypes.list({ ...params }) -> Square.ListWebhookEventTypesResponse
-
π Description
-
-
Lists all webhook event types that can be subscribed to.
-
π Usage
-
-
await client.webhooks.eventTypes.list({ apiVersion: "api_version" });
-
βοΈ Parameters
-
-
request:
Square.webhooks.ListEventTypesRequest
-
requestOptions:
EventTypesClient.RequestOptions
-
-
Webhooks Subscriptions
client.webhooks.subscriptions.list({ ...params }) -> core.Page
-
π Description
-
-
Lists all webhook subscriptions owned by your application.
-
π Usage
-
-
const pageableResponse = await client.webhooks.subscriptions.list({ cursor: "cursor", includeDisabled: true, sortOrder: "DESC", limit: 1 }); for await (const item of pageableResponse) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.webhooks.subscriptions.list({ cursor: "cursor", includeDisabled: true, sortOrder: "DESC", limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response;
-
βοΈ Parameters
-
-
request:
Square.webhooks.ListSubscriptionsRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.webhooks.subscriptions.create({ ...params }) -> Square.CreateWebhookSubscriptionResponse
-
π Description
-
-
Creates a webhook subscription.
-
π Usage
-
-
await client.webhooks.subscriptions.create({ idempotencyKey: "63f84c6c-2200-4c99-846c-2670a1311fbf", subscription: { name: "Example Webhook Subscription", eventTypes: ["payment.created", "payment.updated"], notificationUrl: "https://example-webhook-url.com", apiVersion: "2021-12-15" } });
-
βοΈ Parameters
-
-
request:
Square.webhooks.CreateWebhookSubscriptionRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.webhooks.subscriptions.get({ ...params }) -> Square.GetWebhookSubscriptionResponse
-
π Description
-
-
Retrieves a webhook subscription identified by its ID.
-
π Usage
-
-
await client.webhooks.subscriptions.get({ subscriptionId: "subscription_id" });
-
βοΈ Parameters
-
-
request:
Square.webhooks.GetSubscriptionsRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.webhooks.subscriptions.update({ ...params }) -> Square.UpdateWebhookSubscriptionResponse
-
π Description
-
-
Updates a webhook subscription.
-
π Usage
-
-
await client.webhooks.subscriptions.update({ subscriptionId: "subscription_id", subscription: { name: "Updated Example Webhook Subscription", enabled: false } });
-
βοΈ Parameters
-
-
request:
Square.webhooks.UpdateWebhookSubscriptionRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.webhooks.subscriptions.delete({ ...params }) -> Square.DeleteWebhookSubscriptionResponse
-
π Description
-
-
Deletes a webhook subscription.
-
π Usage
-
-
await client.webhooks.subscriptions.delete({ subscriptionId: "subscription_id" });
-
βοΈ Parameters
-
-
request:
Square.webhooks.DeleteSubscriptionsRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.webhooks.subscriptions.updateSignatureKey({ ...params }) -> Square.UpdateWebhookSubscriptionSignatureKeyResponse
-
π Description
-
-
Updates a webhook subscription by replacing the existing signature key with a new one.
-
π Usage
-
-
await client.webhooks.subscriptions.updateSignatureKey({ subscriptionId: "subscription_id", idempotencyKey: "ed80ae6b-0654-473b-bbab-a39aee89a60d" });
-
βοΈ Parameters
-
-
request:
Square.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-
client.webhooks.subscriptions.test({ ...params }) -> Square.TestWebhookSubscriptionResponse
-
π Description
-
-
Tests a webhook subscription by sending a test event to the notification URL.
-
π Usage
-
-
await client.webhooks.subscriptions.test({ subscriptionId: "subscription_id", eventType: "payment.created" });
-
βοΈ Parameters
-
-
request:
Square.webhooks.TestWebhookSubscriptionRequest
-
requestOptions:
SubscriptionsClient.RequestOptions
-
-