You can use the Square Merchants API to retrieve information about a Square seller account that is integrated with your application.
Merchants API

Merchants API Overview

The Merchants API groups individual seller locations into larger organizations, allowing them to operate as a single entity. Each merchant represents one organization or business that sells with Square and all team members of that business can coordinate on behalf of the merchant.

When a Square seller connects to your application with OAuth or a personal access token, your application receives an access token that is scoped to that merchant group. Use the Merchants API to retrieve core information about the organization connecting to your application, such as the language preferences, business name, country, and account status.

Some API tasks, such as managing orders or taking payments, are associated with a specific seller location using a location_id. Use the Locations API to access information about these locations.

Note

The application developer account and seller account are separate Square accounts. Developers cannot perform any actions, such as taking payments, on behalf of sellers before the seller has granted the application developer permissions through OAuth. For more information, see OAuth Overview.

In the Square data model, the access token (OAuth or PAT) used to connect your application to a Square seller is associated with a single merchant. Use this merchant's ID in the request URL for the RetrieveMerchant endpoint to access information about the merchant.

Retrieve Merchant
  • 1
  • 2
  • 3
  • 4
curl https://connect.squareupsandbox.com/v2/merchants/DM7VKY8Q63GNP \
  -H 'Square-Version: 2022-05-12' \
  -H 'Authorization: Bearer {{ACCESS-TOKEN}}' \
  -H 'Content-Type: application/json'

The following is an example response:

Alternatively, you can request the specific merchant associated with your account's access tokens by calling RetrieveMerchant using me in place of the merchant ID.

Retrieve Merchant
  • 1
  • 2
  • 3
  • 4
curl https://connect.squareupsandbox.com/v2/merchants/me \
  -H 'Square-Version: 2022-05-12' \
  -H 'Authorization: Bearer {{ACCESS-TOKEN}}' \
  -H 'Content-Type: application/json'

You can also retrieve the associated merchant using the ListMerchants endpoint.

List Merchants
  • 1
  • 2
  • 3
  • 4
curl https://connect.squareupsandbox.com/v2/merchants \
  -H 'Square-Version: 2022-05-12' \
  -H 'Authorization: Bearer {{ACCESS-TOKEN}}' \
  -H 'Content-Type: application/json'

Note that the response is in the form of a list, but contains only one merchant: the one associated with your application based on the given access token.

If you need more assistance, contact Developer Support or ask for help in the Developer Forums.