Cart Information API 関数概要

オペレーション 概要
ListCustomers 検索条件に基づいて顧客アカウントリストを取得します。
ListCustomersByNextToken 顧客アカウントリストの次の情報があれば取得します。
GetCustomersForCustomerId CustomerId の値に該当する情報を取得します。
GetServiceStatus Customers API の動作状況を取得します。

Cart Information API 関数利用例

private void btnListCustomers_Click(object sender, RoutedEventArgs e)
{
    string SellerId = CommonValue.strMerchantId;
    string MarketplaceId = CommonValue.strMarketplaceId;
    string AccessKeyId = CommonValue.strAccessKeyId;
    string SecretKeyId = CommonValue.strSecretKeyId;
    string ApplicationVersion = CommonValue.strApplicationVersion;
    string ApplicationName = CommonValue.strApplicationName;
    string MWSAuthToken = CommonValue.strMWSAuthToken;
    string strbuff = string.Empty;
 
    MWSCustomerServiceConfig config = new MWSCustomerServiceConfig();
    config.ServiceURL = CommonValue.strServiceURL;
 
    MWSCustomerServiceClient client = new MWSCustomerServiceClient(
                                                    CommonValue.strAccessKeyId,
                                                    CommonValue.strSecretKeyId,
                                                    CommonValue.strApplicationName,
                                                    CommonValue.strApplicationVersion,
                                                    config);
 
    ListCustomersRequest request = new ListCustomersRequest();
    request.SellerId = SellerId;
    request.MWSAuthToken = MWSAuthToken;
    request.MarketplaceId = MarketplaceId;
    ListCustomersResponse response = client.ListCustomers(request);
    if (response.IsSetListCustomersResult())
    {
        List<Customer> customerList = response.ListCustomersResult.CustomerList;
        foreach (Customer customer in customerList)
        {
            strbuff += "顧客ID:" + customer.CustomerId + System.Environment.NewLine;
        }
    }
    txtListCustomers.Text = strbuff;
}

private void btnListCustomersByNextToken_Click(object sender, RoutedEventArgs e)
{
    string SellerId = CommonValue.strMerchantId;
    string MarketplaceId = CommonValue.strMarketplaceId;
    string AccessKeyId = CommonValue.strAccessKeyId;
    string SecretKeyId = CommonValue.strSecretKeyId;
    string ApplicationVersion = CommonValue.strApplicationVersion;
    string ApplicationName = CommonValue.strApplicationName;
    string MWSAuthToken = CommonValue.strMWSAuthToken;
    string strbuff = string.Empty;
 
    MWSCustomerServiceConfig config = new MWSCustomerServiceConfig();
    config.ServiceURL = CommonValue.strServiceURL;
 
    MWSCustomerServiceClient client = new MWSCustomerServiceClient(
                                                    CommonValue.strAccessKeyId,
                                                    CommonValue.strSecretKeyId,
                                                    CommonValue.strApplicationName,
                                                    CommonValue.strApplicationVersion,
                                                    config);
    ListCustomersRequest request = new ListCustomersRequest();
    request.SellerId = SellerId;
    request.MWSAuthToken = MWSAuthToken;
    request.MarketplaceId = MarketplaceId;
    ListCustomersResponse response = client.ListCustomers(request);
    if (response.IsSetListCustomersResult())
    {
        if (response.ListCustomersResult.NextToken != null)
        {
            ListCustomersByNextTokenRequest request1 = new ListCustomersByNextTokenRequest();
            request1.SellerId = SellerId;
            request1.MWSAuthToken = MWSAuthToken;
            request1.NextToken = response.ListCustomersResult.NextToken;
 
            ListCustomersByNextTokenResponse response1 = client.ListCustomersByNextToken(request1);
            if (response1.IsSetListCustomersByNextTokenResult())
            {
                List<Customer> customerList = response1.ListCustomersByNextTokenResult.CustomerList;
                foreach (Customer customer in customerList)
                {
                    strbuff += "顧客ID:" + customer.CustomerId + System.Environment.NewLine;
                }
 
            }
        }
    }
    txtListCustomersByNextToken.Text = strbuff;
}

private void btnGetCustomersForCustomerId_Click(object sender, RoutedEventArgs e)
{
    string SellerId = CommonValue.strMerchantId;
    string MarketplaceId = CommonValue.strMarketplaceId;
    string AccessKeyId = CommonValue.strAccessKeyId;
    string SecretKeyId = CommonValue.strSecretKeyId;
    string ApplicationVersion = CommonValue.strApplicationVersion;
    string ApplicationName = CommonValue.strApplicationName;
    string MWSAuthToken = CommonValue.strMWSAuthToken;
    string strbuff = string.Empty;
 
    MWSCustomerServiceConfig config = new MWSCustomerServiceConfig();
    config.ServiceURL = CommonValue.strServiceURL;
 
    MWSCustomerServiceClient client = new MWSCustomerServiceClient(
                                                    CommonValue.strAccessKeyId,
                                                    CommonValue.strSecretKeyId,
                                                    CommonValue.strApplicationName,
                                                    CommonValue.strApplicationVersion,
                                                    config);
 
    GetCustomersForCustomerIdRequest request = new GetCustomersForCustomerIdRequest();
    request.SellerId = SellerId;
    request.MarketplaceId = MarketplaceId;
    request.MWSAuthToken = MWSAuthToken;
 
    List<string> customerIdList = new List<string>();
    customerIdList.Add("CustomerId");
    request.CustomerIdList = customerIdList;
 
    GetCustomersForCustomerIdResponse response = client.GetCustomersForCustomerId(request);
    if (response.IsSetGetCustomersForCustomerIdResult())
    {
        List<Customer> customerList = response.GetCustomersForCustomerIdResult.CustomerList;
        foreach (Customer customer in customerList)
        {
            strbuff += "顧客ID:" + customer.CustomerId + System.Environment.NewLine;
        }
    }
    txtGetCustomersForCustomerId.Text = strbuff;
 
}

private void btnGetServiceStatus_Click(object sender, RoutedEventArgs e)
{
    string SellerId = CommonValue.strMerchantId;
    string MarketplaceId = CommonValue.strMarketplaceId;
    string AccessKeyId = CommonValue.strAccessKeyId;
    string SecretKeyId = CommonValue.strSecretKeyId;
    string ApplicationVersion = CommonValue.strApplicationVersion;
    string ApplicationName = CommonValue.strApplicationName;
    string MWSAuthToken = CommonValue.strMWSAuthToken;
    string strbuff = string.Empty;
 
    MWSCustomerServiceConfig config = new MWSCustomerServiceConfig();
    config.ServiceURL = CommonValue.strServiceURL;
 
    MWSCustomerServiceClient client = new MWSCustomerServiceClient(
                                                    CommonValue.strAccessKeyId,
                                                    CommonValue.strSecretKeyId,
                                                    CommonValue.strApplicationName,
                                                    CommonValue.strApplicationVersion,
                                                    config);
    GetServiceStatusRequest request = new GetServiceStatusRequest();
    request.SellerId = SellerId;
    request.MWSAuthToken = MWSAuthToken;
 
    GetServiceStatusResponse response = client.GetServiceStatus(request);
    if (response.IsSetGetServiceStatusResult())
    {
        strbuff = "ステータス状況:" + response.GetServiceStatusResult.Status;
    }
    txtGetServiceStatus.Text = strbuff;
}