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 merchant account that has integrated with your application.

Note

Both application developer and seller 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 API-What It Does.

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/{{MERCHANT-ID}}'

The following is an example response:

{
    "merchant": [
        {
            "id": "6AH6E4EXAMPLE",
            "business_name": "My business",
            "country": "US",
            "language_code": "en-US",
            "currency": "USD",
            "status": "ACTIVE"
        }
    ]
}

If you don't know a merchant ID, you can use the ListMerchants endpoint to retrieve the merchant ID for an access token. In the request, you can specify your personal access token to get your own merchant information or specify an OAuth token to get the merchant information that granted you access.

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:

{
   "merchant":[
      {
         "id":"BS20H4A5M503E",
         "business_name":"My awesome business",
         "country":"US",
         "language_code":"en-US",
         "currency":"USD",
         "status":"ACTIVE"
      }
   ]
}