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 (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.
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 );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
cursor | int? | The cursor generated by the previous response. | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RetrieveMerchantResponse RetrieveMerchant (string merchantId)
RetrieveMerchant
Retrieve a Merchant
object for the given merchant_id
.
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 );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
merchantId | string | The ID of the merchant to retrieve. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]