Sellers API(Ver.316922798)
出品者情報取得に関するAPI
Sellers API 関数一覧
オペレーション | 概要 |
---|---|
ListMarketplaceParticipations | 出品者が出品可能なマーケットプレイス一覧を取得します。 |
ListMarketplaceParticipationsByNextToken | マーケットプレイス一覧が多い場合次の一覧を取得します。 |
GetServiceStatus | 出品者ステータス取得 |
Sellers API 関数利用例
private void btnListMarketplaceParticipations_Click(object sender, RoutedEventArgs e) { string SellerId = CommonValue.strMerchantId; string AccessKeyId = CommonValue.strAccessKeyId; string SecretKeyId = CommonValue.strSecretKeyId; string ApplicationVersion = CommonValue.strApplicationVersion; string ApplicationName = CommonValue.strApplicationName; string MWSAuthToken = CommonValue.strMWSAuthToken; string strbuff = string.Empty; MarketplaceWebServiceSellersConfig config = new MarketplaceWebServiceSellersConfig(); config.ServiceURL = CommonValue.strServiceURL; MarketplaceWebServiceSellersClient client = new MarketplaceWebServiceSellersClient( ApplicationName, ApplicationVersion, AccessKeyId, SecretKeyId, config); ListMarketplaceParticipationsRequest request = new ListMarketplaceParticipationsRequest(); request.SellerId = SellerId; request.MWSAuthToken = MWSAuthToken; ListMarketplaceParticipationsResponse response = client.ListMarketplaceParticipations(request); if (response.IsSetListMarketplaceParticipationsResult()) { ListMarketplaceParticipationsResult listMarketplaceParticipationsResult = response.ListMarketplaceParticipationsResult; if (listMarketplaceParticipationsResult.IsSetListParticipations()) { ListParticipations listParticipations = listMarketplaceParticipationsResult.ListParticipations; List<Participation> participationList = listParticipations.Participation; foreach (Participation participation in participationList) { strbuff += "マーケットプレイスID:" + participation.MarketplaceId + System.Environment.NewLine; } } txtListMarketplaceParticipations.Text = strbuff; } }
private void btnListMarketplaceParticipationsByNextToken_Click(object sender, RoutedEventArgs e) { string SellerId = CommonValue.strMerchantId; string AccessKeyId = CommonValue.strAccessKeyId; string SecretKeyId = CommonValue.strSecretKeyId; string ApplicationVersion = CommonValue.strApplicationVersion; string ApplicationName = CommonValue.strApplicationName; string MWSAuthToken = CommonValue.strMWSAuthToken; string strbuff = string.Empty; MarketplaceWebServiceSellersConfig config = new MarketplaceWebServiceSellersConfig(); config.ServiceURL = CommonValue.strServiceURL; MarketplaceWebServiceSellersClient client = new MarketplaceWebServiceSellersClient( ApplicationName, ApplicationVersion, AccessKeyId, SecretKeyId, config); ListMarketplaceParticipationsRequest request = new ListMarketplaceParticipationsRequest(); request.SellerId = SellerId; request.MWSAuthToken = MWSAuthToken; ListMarketplaceParticipationsResponse response = client.ListMarketplaceParticipations(request); if (response.IsSetListMarketplaceParticipationsResult()) { ListMarketplaceParticipationsResult listMarketplaceParticipationsResult = response.ListMarketplaceParticipationsResult; if (listMarketplaceParticipationsResult.IsSetListParticipations()) { if (listMarketplaceParticipationsResult.NextToken != null) { ListMarketplaceParticipationsByNextTokenRequest request1 = new ListMarketplaceParticipationsByNextTokenRequest(); request1.SellerId = SellerId; request1.NextToken = listMarketplaceParticipationsResult.NextToken; request1.MWSAuthToken = MWSAuthToken; ListMarketplaceParticipationsByNextTokenResponse response1 = client.ListMarketplaceParticipationsByNextToken(request1); if (response1.IsSetListMarketplaceParticipationsByNextTokenResult()) { ListMarketplaceParticipationsByNextTokenResult listMarketplaceParticipationsNextResult = response1.ListMarketplaceParticipationsByNextTokenResult; if (listMarketplaceParticipationsNextResult.IsSetListParticipations()) { ListParticipations listParticipations = listMarketplaceParticipationsNextResult.ListParticipations; List<Participation> participationList = listParticipations.Participation; foreach (Participation participation in participationList) { strbuff += "マーケットプレイスID:" + participation.MarketplaceId + System.Environment.NewLine; } } } } } txtListMarketplaceParticipations.Text = strbuff; } }
private void btnGetServiceStatus_Click(object sender, RoutedEventArgs e) { string SellerId = CommonValue.strMerchantId; string AccessKeyId = CommonValue.strAccessKeyId; string SecretKeyId = CommonValue.strSecretKeyId; string ApplicationVersion = CommonValue.strApplicationVersion; string ApplicationName = CommonValue.strApplicationName; string MWSAuthToken = CommonValue.strMWSAuthToken; string strbuff = string.Empty; MarketplaceWebServiceSellersConfig config = new MarketplaceWebServiceSellersConfig(); config.ServiceURL = CommonValue.strServiceURL; MarketplaceWebServiceSellersClient client = new MarketplaceWebServiceSellersClient( ApplicationName, ApplicationVersion, AccessKeyId, SecretKeyId, config); GetServiceStatusRequest request = new GetServiceStatusRequest(); request.SellerId = SellerId; request.MWSAuthToken = MWSAuthToken; GetServiceStatusResponse response = client.GetServiceStatus(request); if (response.IsSetGetServiceStatusResult()) { GetServiceStatusResult getServiceStatusResult = response.GetServiceStatusResult; strbuff = "処理状況:" + getServiceStatusResult.Status; } txtGetServiceStatus.Text = strbuff; }