Connect v1 Migration

Migrate from Connect v1 Locations API

The information below will help you migrate from the Connect v1 Locations API to the correct Square API counterparts. For general guidance on the differences between Connect v1 and Square APIs, see the Connect v1 Migration guide.

Catalog API
Inventory API
cURL (Command Line)

What you need to know
Permalink Get a link to this section

The Connect v1Locations API let developers read business details for a Square account but business information still had to be managed through Square Dashboard or Square Point of Sale. The Square API replacement, also named Locations API, supports reading and writing of business information for Square accounts.

Important dates
Permalink Get a link to this section

  • Deprecation: 2019-11-20

  • Retirement: 2020-11-18

Get help
Permalink Get a link to this section

If you need help migrating to Square API or need more time to complete your migration, please contact Developer Support, join our Slack, or reach out to your Square Account Manager..

General behavioral differences
Permalink Get a link to this section

  • Information is location-based — Square APIs differentiate between account-level information and location-level information. Account-level information includes the business name, merchant ID, and preferred language. All other information is specific to a given location and can be updated without changing the details associated with other locations. If you are integrating with /v1/me for one of these fields from V1Merchant, then it will be important to use /v2/locations and to select a specific location to use, instead. A common heuristic is to select the Location that has the earliest created_at date and is active.

  • Expanded information set — The Square Locations API provides a broader set of information than the v1 Locations API, including business hours, logo URL, status, and social media accounts for each location. See the Locations object entry in the Square Technical Reference for more information.

  • Locations are writeable — The v1Locations API is a read-only API. Square Locations API supports reading, creating, and updating Location information.

Endpoint mapping
Permalink Get a link to this section

Code relying on the following endpoints must be updated to avoid breaking when the v1 Locations API reaches retirement:

v1Locations Locations Notes
ListLocations ListLocations Returns all locations associated with the Square account.

Location ID is the primary identifier for Location objects and is referenced by other Square APIs.
RetrieveBusiness ListLocations, ListMerchants, ListEmployees RetrieveBusiness may map to ListLocations, ListMerchants, or ListEmployees depending on the field being migrated from. If multiple fields are used, calls to more than one of these endpoints may be required. You should choose an entity from each list as follows:
  1. ListMerchants: There will be a single merchant in the list.
  2. ListLocations: Choose the location with the oldest created_at that is active.
  3. ListEmployees: Choose the employee with `is_owner` equal to true.

Field Mapping
Permalink Get a link to this section

With 2 exceptions, all fields in V1Merchant objects are also available in Square API Location objects. As a result, most code will only need to update the endpoint reference and field names to work properly.

V1Merchant field Location field Notes
account_capabilities capabilities, if migrating from v1/me/locations. See Note. Value and type unchanged.

If you are migrating from v1/me (RetrieveBusiness) then this field is removed.
account_type REMOVED This described a legacy account state.
business_address address Value and type unchanged.
business_name REMOVED Use name.
business_phone phone_number Value and type unchanged.
business_type mcc The Square Locations API includes the business type but with a different encoding. Instead of the Square-curated enum from V1Merchant.business_type, the mcc field uses the industry-standard MCC code.

If you are migrating from v1/me (RetrieveBusiness) then you should call Locations.ListLocations and choose the location with the oldest created_at value that is active.
country_code country Value and type unchanged.
currency_code currency Value and type unchanged.
email See Notes> You can get the email from the owner employee by calling the Employees.ListEmployees endpoint and filtering the resulting by is_owner=true.
language_code language_code Value and type unchanged.
location_details.nickname name V1MerchantLocationDetails fields are now listed directly in the Location object.

Location.name must be unique across all locations associated with a given Square account.
market_url website_url V1Merchant.market_url is a link to a form of online store that is under sunset and is not represented in the Square Locations API. If you want any web presence for the merchant, then you can use the Location.website_url field. References to the new Square online store are currently not supported.
name business_name Value and type unchanged. The business_name field in the Locations API consolidates the V1Merchant.name and V1Merchant.business_name fields.

If you are migrating from v1/me (RetrieveBusiness) then you should get business_name from Merchants.ListMerchants.
shipping_address REMOVED Use address.

In the V2 Locations API, there is a consolidated address rather than a separate V1Merchant.shipping_address and V1Merchant.business_address.

To read location information with Locations API, call ListLocations and search for the right location:

# Assumes AUTHZ_TOKEN is set to a valid access token for the Square account
curl                                        \
  -X GET                                    \
  -H "Authorization: Bearer ${AUTHZ_TOKEN}" \
  -H "Content-Type: application/json"       \
  https://connect.squareupsandbox.com/v2/locations | json_pp

or call RetrieveLocation with a known location ID (${LOCATION_ID}):

# Assumes AUTHZ_TOKEN is set to a valid access token for the Square account
# and LOCATION_ID is set to a valid location ID for the Square account
curl                                        \
  -X GET                                    \
  -H "Authorization: Bearer ${AUTHZ_TOKEN}" \
  -H "Content-Type: application/json"       \
  https://connect.squareupsandbox.com/v2/locations/${LOCATION_ID} | json_pp

Did you know?

Location objects include a merchant_id field, a unique identifier for the associated Square account. Developers that only care about merchant ID may choose to use the Merchants API instead of Locations API to reduce the bandwidth requirements of their app. See the Merchants API guide for more information.

Common migration pitfalls
Permalink Get a link to this section

  • Location IDs matter now — In the Square Locations API, even though location names must be unique, valid IDs are required to search and update location information. Developers building integrations with other systems must preserve Square-assigned location IDs in the third party system to ensure information is synced correctly.