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

Files

Latest commit

cc1dea6 · Nov 20, 2019

History

History
140 lines (102 loc) · 4.16 KB

MerchantsApi.md

File metadata and controls

140 lines (102 loc) · 4.16 KB

Square.Connect.Api.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 (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

Name Type Description Notes
cursor int? 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

Name Type Description Notes
merchantId string The 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]