Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 2.45 KB

merchants.md

File metadata and controls

92 lines (63 loc) · 2.45 KB

Merchants

MerchantsApi merchantsApi = client.getMerchantsApi();

Class Name

MerchantsApi

Methods

List Merchants

Provides details about the merchant associated with a given access token.

The access token used to connect your application to a Square seller is associated with a single merchant. That means that ListMerchants returns a list with a single Merchant object. 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 your application access.

If you know the merchant ID, you can also use the RetrieveMerchant endpoint to retrieve the merchant information.

CompletableFuture<ListMerchantsResponse> listMerchantsAsync(
    final Integer cursor)

Parameters

Parameter Type Tags Description
cursor Integer Query, Optional The cursor generated by the previous response.

Response Type

ListMerchantsResponse

Example Usage

merchantsApi.listMerchantsAsync(null).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Retrieve Merchant

Retrieves the Merchant object for the given merchant_id.

CompletableFuture<RetrieveMerchantResponse> retrieveMerchantAsync(
    final String merchantId)

Parameters

Parameter Type Tags Description
merchantId String Template, Required 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.

Response Type

RetrieveMerchantResponse

Example Usage

String merchantId = "merchant_id0";

merchantsApi.retrieveMerchantAsync(merchantId).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});