All URIs are relative to https://connect.squareup.com
Method | HTTP request | Description |
---|---|---|
listMerchants | GET /v2/merchants | ListMerchants |
retrieveMerchant | GET /v2/merchants/{merchant_id} | RetrieveMerchant |
ListMerchantsResponse listMerchants(opts)
ListMerchants
Returns `Merchant` information for a given access token. If you don't know a `Merchant` ID, you can use this endpoint to retrieve the merchant ID for an access token. You can specify your personal access token to get your own merchant information or specify an OAuth token to get the information for the merchant that granted you access. If you know the merchant ID, you can also use the RetrieveMerchant endpoint to get the merchant information.
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SquareConnect.MerchantsApi();
var opts = {
'cursor': 56 // Number | The cursor generated by the previous response.
};
apiInstance.listMerchants(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
cursor | Number | The cursor generated by the previous response. | [optional] |
- Content-Type: application/json
- Accept: application/json
RetrieveMerchantResponse retrieveMerchant(merchantId)
RetrieveMerchant
Retrieve a `Merchant` object for the given `merchant_id`.
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SquareConnect.MerchantsApi();
var merchantId = "merchantId_example"; // String | The ID of the merchant to retrieve.
apiInstance.retrieveMerchant(merchantId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
merchantId | String | The ID of the merchant to retrieve. |
- Content-Type: application/json
- Accept: application/json