Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Latest commit

 

History

History
107 lines (70 loc) · 3.48 KB

MerchantsApi.md

File metadata and controls

107 lines (70 loc) · 3.48 KB

SquareConnect.MerchantsApi

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

listMerchants

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.

Example

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': SquareConnect.MerchantsApi.constructFromObject({}); // 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);
});

Parameters

Name Type Description Notes
cursor Number The cursor generated by the previous response. [optional]

Return type

ListMerchantsResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

retrieveMerchant

RetrieveMerchantResponse retrieveMerchant(merchantId)

RetrieveMerchant

Retrieve a `Merchant` object for the given `merchant_id`.

Example

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 = SquareConnect.MerchantsApi.constructFromObject({}); // String | The ID of the merchant to retrieve. If the string \"me\" is supplied as the ID, then retrieve the merchant that is currently accessible to this call.

apiInstance.retrieveMerchant(merchantId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
merchantId String The ID of the merchant to retrieve. If the string "me" is supplied as the ID, then retrieve the merchant that is currently accessible to this call.

Return type

RetrieveMerchantResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json