@bates-solutions/squareup API Reference - v3.2.0
    Preparing search index...

    Class LocationsService

    Locations service for reading a merchant's Square locations.

    // Derive the merchant's currency instead of configuring it
    const [location] = await square.locations.list();
    const currency = location?.currency; // e.g. 'CAD'
    Index
    • Get a single location by ID.

      Parameters

      • locationId: string

        Location ID

      Returns Promise<Location>

      The location

      If Square returns an errors body (e.g. missing MERCHANT_PROFILE_READ scope)

      const location = await square.locations.get('LXXX');
      console.log(location.currency); // 'CAD'
    • List all locations for the merchant.

      The Square Locations API is not paginated — every location is returned.

      Returns Promise<Location[]>

      Array of locations

      If Square returns an errors body — e.g. the access token lacks the MERCHANT_PROFILE_READ scope (code is INSUFFICIENT_SCOPES). An empty array always means the merchant genuinely has no locations.

      const locations = await square.locations.list();