Square.Connect.Api.MerchantsApi

November 20, 2019 ยท View on GitHub

All URIs are relative to https://connect.squareup.com

MethodHTTP requestDescription
ListMerchantsGET /v2/merchantsListMerchants
RetrieveMerchantGET /v2/merchants/{merchant_id}RetrieveMerchant

ListMerchants

ListMerchantsResponse ListMerchants (int? cursor = null)

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

using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;

namespace Example
{
    public class ListMerchantsExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new MerchantsApi();
            var cursor = 56;  // int? | The cursor generated by the previous response. (optional) 

            try
            {
                // ListMerchants
                ListMerchantsResponse result = apiInstance.ListMerchants(cursor);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling MerchantsApi.ListMerchants: " + e.Message );
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
cursorint?The cursor generated by the previous response.[optional]

Return type

ListMerchantsResponse

Authorization

oauth2

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetrieveMerchant

RetrieveMerchantResponse RetrieveMerchant (string merchantId)

RetrieveMerchant

Retrieve a Merchant object for the given merchant_id.

Example

using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;

namespace Example
{
    public class RetrieveMerchantExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new MerchantsApi();
            var merchantId = merchantId_example;  // string | The ID of the merchant to retrieve.

            try
            {
                // RetrieveMerchant
                RetrieveMerchantResponse result = apiInstance.RetrieveMerchant(merchantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling MerchantsApi.RetrieveMerchant: " + e.Message );
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
merchantIdstringThe ID of the merchant to retrieve.

Return type

RetrieveMerchantResponse

Authorization

oauth2

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]