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 Authorization header for this endpoint must have the following format:

Authorization: Client APPLICATION_SECRET

Replace APPLICATION_SECRET with 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_code or refresh_token grant type.

When grant_type is authorization_code:

  • With the code flow, provide code, client_id, and client_secret.
  • With the PKCE flow, provide code, client_id, and code_verifier.

When grant_type is refresh_token:

  • With the code flow, provide refresh_token, client_id, and client_secret. The response returns the same refresh token provided in the request.
  • With the PKCE flow, provide refresh_token and client_id. The response returns a new refresh token.

You can use the scopes parameter to limit the set of permissions authorized by the access token. You can use the short_lived parameter 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.

πŸ”Œ 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 Authorization header you provide to this endpoint must have the following format:

Authorization: Bearer ACCESS_TOKEN

where ACCESS_TOKEN is a valid production authorization credential.

If the access token is expired or not a valid access token, the endpoint returns an UNAUTHORIZED error.

πŸ”Œ 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-association on 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_READ for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for 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_id
  • Booking.start_at
  • Booking.AppointmentSegment.team_member_id
  • Booking.AppointmentSegment.service_variation_id
  • Booking.AppointmentSegment.service_variation_version

To call this endpoint with buyer-level permissions, set APPOINTMENTS_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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_READ for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for 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_READ for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for 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_READ for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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.

BatchDeleteCatalogObjects succeeds 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 429 error 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 429 error 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 BatchUpsertCatalogObjects endpoint.

πŸ”Œ 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 types parameter 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_objects attribute value to true.

πŸ”Œ 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:

  • SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
  • SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
  • SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
  • 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:

  • SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
  • SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
  • SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
  • 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_name
  • family_name
  • company_name
  • email_address
  • phone_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_name
  • family_name
  • company_name
  • email_address
  • phone_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 SearchCustomers without any explicit query filter returns all customer profiles ordered alphabetically based on given_name and family_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_at in 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 PENDING state. To activate a gift card so that it can be redeemed for purchases, call CreateGiftCardActivity and create an ACTIVATE activity 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_at timestamp (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_at timestamp (newest first).

When updated_after is 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_ids list contain a single element of the CatalogObject ID.

Results are paginated and sorted in descending order according to their occurred_at timestamp (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 cursor that 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 cursor that 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 version field. Some restrictions apply to updating invoices. For example, you cannot change the order_id or location_id field.

πŸ”Œ 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 request part and a file part. The file part must be a readable stream that 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, or PARTIALLY_PAID state.

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, or PARTIALLY_PAID state.

πŸ”Œ 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 DRAFT state or in a terminal state: PAID, REFUNDED, CANCELED, or FAILED.

πŸ”Œ 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 status also changes from DRAFT to a status based on the invoice configuration. For example, the status changes to UNPAID if Square emails the invoice or PARTIALLY_PAID if Square charges a card on file for a portion of the invoice amount.

In addition to the required ORDERS_WRITE and INVOICES_WRITE permissions, CUSTOMERS_READ and PAYMENTS_WRITE are 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_details fields are required:

  • location_id
  • job_id
  • start_at
  • end_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_details field as is and copies it to the published_shift_details field.

The minimum start_at and maximum end_at timestamps of all shifts in a BulkPublishScheduledShifts request 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_at in 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, and end_at fields.
  • Add, change, or clear the team_member_id and notes fields. To clear these fields, set the value to null.
  • Change the is_deleted field. To delete a scheduled shift, set is_deleted to true and then publish the shift.

πŸ”Œ 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_details field as is and copies it to the published_shift_details field.

πŸ”Œ 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 Timecard represents a complete workday for a single team member. You must provide the following values in your request to this endpoint:

  • location_id
  • team_member_id
  • start_at

An attempt to create a new Timecard can result in a BAD_REQUEST error when:

  • The status of the new Timecard is OPEN and the team member has another timecard with an OPEN status.
  • The start_at date is in the future.
  • The start_at or end_at date overlaps another timecard for the same team member.
  • The Break instances are set in the request and a break start_at is before the Timecard.start_at, a break end_at is after the Timecard.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 Timecard records for a business. The list to be returned can be filtered by:

  • Location IDs
  • Team member IDs
  • Timecard status (OPEN or CLOSED)
  • Timecard start
  • Timecard end
  • Workday details

The list can be sorted by:

  • START_AT
  • END_AT
  • CREATED_AT
  • UPDATED_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 Timecard specified by id.

πŸ”Œ 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 Break to a Timecard, any earlier Break instances in the Timecard have the end_at property set to a valid RFC-3339 datetime string.

When closing a Timecard, all Break instances in the Timecard must be complete with end_at set on each Break.

πŸ”Œ 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 checkoutId to a checkout_page_url that 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_at in 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 ListMerchants returns a list with a single Merchant object. 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 Merchant object for the given merchant_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 DRAFT state, 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).

SearchOrders requests need to specify which locations to search and define a SearchOrdersQuery object that controls how to sort or filter the results. Your SearchOrdersQuery can:

Set filter criteria. Set the sort order. Determine whether to return results as complete Order objects 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_at value 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 COMPLETED or CANCELED state cannot be updated.

An UpdateOrder request requires the following:

  • The order_id in the endpoint path, identifying the order to update.
  • The latest version of 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.

πŸ”Œ 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_ids listed in the request must be equal to the order total. Orders with a total amount of 0 can be marked as paid by specifying an empty array of payment_ids in the request.

To be used with PayOrder, a payment must:

  • Reference the order by specifying the order_id when creating the payment. Any approved payments that reference the same order_id not specified in the payment_ids is canceled.
  • Be approved with delayed capture. Using a delayed capture payment with PayOrder completes the approved payment.

πŸ”Œ 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 Payment object 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 CreatePayment request is unknown (for example, after you send a CreatePayment request, 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 your CreatePayment request that you want to cancel. After canceling the payment, you can submit your CreatePayment request 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_money and tip_money using 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_READ for 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_READ for 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_READ for 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_at date.

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 head element 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_ids to 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 subscription field values. To clear a field, set its value to null.

πŸ”Œ 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 CANCEL action to cancel an active subscription. This sets the canceled_date field 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 PAUSE action 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 RESUME action 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_PLAN action 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 TeamMember object. The TeamMember object is returned on successful creates. You must provide the following values in your request to this endpoint:

  • given_name
  • family_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 TeamMember objects. The created TeamMember objects 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 TeamMember objects. The updated TeamMember objects 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 TeamMember objects for a business. The list can be filtered by location IDs, ACTIVE or INACTIVE status, 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 TeamMember object for the given TeamMember.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 TeamMember object. The TeamMember object 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, and TeamMemberWage objects that reference the job ID. Changes to tip eligibility propagate to all TeamMemberWage objects 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:

πŸ”Œ 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_READ for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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_READ for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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_READ for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for 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_READ for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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_WRITE for the OAuth scope. To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_WRITE and APPOINTMENTS_WRITE for 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 CatalogImage is unattached to any CatalogObject if the object_id is not specified.

This CreateCatalogImage endpoint 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 UpdateCatalogImage endpoint 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 429 error 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 429 error code.

πŸ”Œ Usage

await client.catalog.object.delete({
    objectId: "object_id"
});

βš™οΈ Parameters

request: Square.catalog.DeleteObjectRequest

requestOptions: ObjectClient.RequestOptions

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_link fields such as description, checkout_options, and pre_populated_data. You cannot update other fields such as the order_id, version, URL, or timestamp field.

πŸ”Œ 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_ONLY or VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 the schema for a Selection data 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 BulkUpsertCustomerCustomAttributes endpoint 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 visibility setting must be VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 name value 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_id value.

πŸ”Œ 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_id value.

πŸ”Œ 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_id value.

πŸ”Œ 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_id value and the customer group is identified by the group_id value.

πŸ”Œ 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_id value and the customer group is identified by the group_id value.

πŸ”Œ 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_id value.

πŸ”Œ 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 CreateCustomerCard are 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_definitions query 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_ONLY or VISIBILITY_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_definition query parameter to also retrieve the custom attribute definition in the same call.

To retrieve a custom attribute owned by another application, the visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 visibility setting must be VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 visibility setting must be VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 ACTIVATE activity 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 BreakType instances 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 BreakType is a template for creating Break objects. You must provide the following values in your request to this endpoint:

  • location_id
  • break_name
  • expected_duration
  • is_paid

You can only have three BreakType instances per location. If you attempt to add a fourth BreakType for a location, an INVALID_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 BreakType specified by id.

πŸ”Œ 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 BreakType can be deleted even if it is referenced from a Shift.

πŸ”Œ 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 EmployeeWage instances 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 EmployeeWage specified by id.

πŸ”Œ 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 Shift represents a complete workday for a single team member. You must provide the following values in your request to this endpoint:

  • location_id
  • team_member_id
  • start_at

An attempt to create a new Shift can result in a BAD_REQUEST error when:

  • The status of the new Shift is OPEN and the team member has another shift with an OPEN status.
  • The start_at date is in the future.
  • The start_at or end_at date overlaps another shift for the same team member.
  • The Break instances are set in the request and a break start_at is before the Shift.start_at, a break end_at is after the Shift.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 Shift records for a business. The list to be returned can be filtered by:

  • Location IDs
  • Team member IDs
  • Shift status (OPEN or CLOSED)
  • Shift start
  • Shift end
  • Workday details

The list can be sorted by:

  • START_AT
  • END_AT
  • CREATED_AT
  • UPDATED_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 Shift specified by id.

πŸ”Œ 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 Break to a Shift, any earlier Break instances in the Shift have the end_at property set to a valid RFC-3339 datetime string.

When closing a Shift, all Break instances in the Shift must be complete with end_at set on each Break.

πŸ”Œ 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 TeamMemberWage instances 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 TeamMemberWage specified by id.

πŸ”Œ 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 WorkweekConfig instances 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_ONLY or VISIBILITY_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 visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_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 the schema for a Selection data 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 visibility setting must be VISIBILITY_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 BulkUpsertLocationCustomAttributes endpoint 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, the visibility setting must be VISIBILITY_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_definitions query 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_ONLY or VISIBILITY_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_definition query parameter to also retrieve the custom attribute definition in the same call. To retrieve a custom attribute owned by another application, the visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_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 visibility setting must be VISIBILITY_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 visibility setting must be VISIBILITY_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_capture value of true.

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_capture value of true.

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_id and a mapping with the phone_number of 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 query object or omit it entirely.

Search results are sorted by created_at in 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 points with 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_id and (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_money with 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, the tax_mode setting 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_id in 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.

πŸ”Œ 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 query object, loyalty_account_id is required and status is optional.

If you know a reward ID, use the RetrieveLoyaltyReward endpoint.

Search results are sorted by updated_at in 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 REDEEMED terminal 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_at date 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 ACTIVE or SCHEDULED status, depending on the available_time setting. A loyalty program can have a maximum of 10 loyalty promotions with an ACTIVE or SCHEDULED status.

πŸ”Œ 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 ACTIVE promotion earlier than the end date, cancel an ACTIVE promotion when an end date is not specified, or cancel a SCHEDULED promotion. 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 CANCELED state

πŸ”Œ 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_ONLY or VISIBILITY_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 visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_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 the schema for a Selection data 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 visibility setting must be VISIBILITY_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 BulkUpsertMerchantCustomAttributes endpoint 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, the visibility setting must be VISIBILITY_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_definitions query 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_ONLY or VISIBILITY_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_definition query parameter to also retrieve the custom attribute definition in the same call. To retrieve a custom attribute owned by another application, the visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_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 visibility setting must be VISIBILITY_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 visibility setting must be VISIBILITY_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_ONLY or VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 BulkDeleteOrderCustomAttributes endpoint 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 visibility setting must be VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 BulkUpsertOrderCustomAttributes endpoint 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 visibility setting must be VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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_definitions query 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_ONLY or VISIBILITY_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_definition query parameter to also retrieve the custom attribute definition in the same call.

To retrieve a custom attribute owned by another application, the visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes also known as custom fields) are always set to VISIBILITY_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 visibility setting must be VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 visibility setting must be VISIBILITY_READ_WRITE_VALUES. Note that seller-defined custom attributes (also known as custom fields) are always set to VISIBILITY_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 WageSetting object for a team member specified by TeamMember.id. For more information, see Troubleshooting the Team API.

Square recommends using RetrieveTeamMember or SearchTeamMembers to get this information directly from the TeamMember.wage_setting field.

πŸ”Œ 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 WageSetting object. The object is created if a WageSetting with the specified team_member_id doesn't exist. Otherwise, it fully replaces the WageSetting object for the team member. The WageSetting is returned on a successful update. For more information, see Troubleshooting the Team API.

Square recommends using CreateTeamMember or UpdateTeamMember to manage the TeamMember.wage_setting field 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