Merchants API

Merchants API Overview

Suppose you develop an application integrated with Square to process payments. Square sellers sign up to use your application. You can use this API to retrieve information about a Square seller account that has integrated with your application.

Note

The application developer account and seller account are separate Square accounts. The application developer cannot perform any actions, such as take payments, on behalf of other accounts without permissions. The sellers must grant the application developer permissions through OAuth. For more information, see OAuth Overview.

In this scenario, the application developer can use the Merchants API to retrieve seller account information, such as language, business name, country, and account status as shown in the following RetrieveMerchant request. In the request, the Authorization header provides an OAuth access token that identifies the seller whose account information is requested.

curl -X GET                                 \
-H 'Authorization: Bearer {{ACCESS-TOKEN}}' \
'https://connect.squareup.com/v2/merchants/me'

The following is an example response:

{
  "merchant": 
    {
      "id": "2RNAQEEXAMPLE",
      "business_name": "My Business",
      "country": "US",
      "language_code": "en-US",
      "currency": "USD",
      "status": "ACTIVE",
      "main_location_id": "7WQ0KXC8ZSD90"
    }
}

For API consistency, the endpoint also supports requesting a merchant with a specific ID:

curl -X GET \
-H 'Authorization: Bearer {{ACCESS-TOKEN}}' \
'https://connect.squareup.com/v2/merchants/{{MERCHANT_ID}}'

Likewise, for API consistency, you can retrieve the merchant using a ListMerchants API pattern as follows:

curl -X GET \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{ACCESS-TOKEN}}' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
'https://connect.squareup.com/v2/merchants'

The following is an example response. It includes an array with exactly one merchant in it.

{
  "merchant": [
    {
      "id": "2RNAQEEXAMPLE",
      "business_name": "My Awesome Business",
      "country": "US",
      "language_code": "en-US",
      "currency": "USD",
      "status": "ACTIVE",
      "main_location_id": "7WQ0KXC8ZSD90"
    }
  ]
}