Finances API(Ver.312120327)
販売した商品の支払情報取得に関するAPI
Finances 関数概要
Finances 関数一覧
オペレーション | 概要 |
---|---|
ListFinancialEventGroups | 支払発生イベントをグループ単位で取得します。 |
ListFinancialEventGroupsByNextToken | 支払発生イベントの次のグループが存在する場合に取得します。 |
ListFinancialEvents | 注文番号・グループ番号を元に詳細な支払イベント情報を取得します。 |
ListFinancialEventsByNextToken | 支払イベントの次の情報が存在する場合に取得します。 |
GetServiceStatus | 動作状況を取得します。 |
Finances 関数利用例
private void btnListFinancialEventGroups_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; MWSFinancesServiceConfig config = new MWSFinancesServiceConfig(); config.ServiceURL = CommonValue.strServiceURL; MWSFinancesServiceClient client = new MWSFinancesServiceClient( AccessKeyId, SecretKeyId, ApplicationName, ApplicationVersion, config); ListFinancialEventGroupsRequest request = new ListFinancialEventGroupsRequest(); request.SellerId = SellerId; request.MWSAuthToken = MWSAuthToken; request.FinancialEventGroupStartedAfter = DateTime.Parse("2015-09-01T20:40:01Z"); ListFinancialEventGroupsResponse response = client.ListFinancialEventGroups(request); if (response.IsSetListFinancialEventGroupsResult()) { ListFinancialEventGroupsResult result = response.ListFinancialEventGroupsResult; if (result.IsSetFinancialEventGroupList()) { List<FinancialEventGroup> lstfinancialeventgroup = result.FinancialEventGroupList; foreach ( FinancialEventGroup financialeventgroup in lstfinancialeventgroup) { strbuff += financialeventgroup.OriginalTotal.CurrencyAmount.ToString() + Environment.NewLine; strbuff += financialeventgroup.OriginalTotal.CurrencyCode.ToString() + Environment.NewLine; strbuff += financialeventgroup.ProcessingStatus.ToString() + Environment.NewLine; } MessageBox.Show(strbuff); } } }
private void ListFinancialEventGroupsByNextToken_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; MWSFinancesServiceConfig config = new MWSFinancesServiceConfig(); config.ServiceURL = CommonValue.strServiceURL; MWSFinancesServiceClient client = new MWSFinancesServiceClient( AccessKeyId, SecretKeyId, ApplicationName, ApplicationVersion, config); ListFinancialEventGroupsRequest request = new ListFinancialEventGroupsRequest(); request.SellerId = SellerId; request.MWSAuthToken = MWSAuthToken; request.FinancialEventGroupStartedAfter = DateTime.Parse("2015-07-01T20:40:01Z"); ListFinancialEventGroupsResponse response = client.ListFinancialEventGroups(request); if (response.IsSetListFinancialEventGroupsResult()) { ListFinancialEventGroupsResult result = response.ListFinancialEventGroupsResult; if (result.IsSetFinancialEventGroupList()) { if (result.IsSetNextToken()) { ListFinancialEventGroupsByNextTokenRequest request1 = new ListFinancialEventGroupsByNextTokenRequest(); request1.SellerId = SellerId; request1.MWSAuthToken = MWSAuthToken; request1.NextToken = result.NextToken; ListFinancialEventGroupsByNextTokenResponse response1 = client.ListFinancialEventGroupsByNextToken(request1); if (response1.IsSetListFinancialEventGroupsByNextTokenResult()) { ListFinancialEventGroupsByNextTokenResult result1 = response1.ListFinancialEventGroupsByNextTokenResult; List<FinancialEventGroup> lstfinancialeventgroup = result.FinancialEventGroupList; foreach (FinancialEventGroup financialeventgroup in lstfinancialeventgroup) { strbuff += financialeventgroup.OriginalTotal.CurrencyAmount.ToString() + Environment.NewLine; strbuff += financialeventgroup.OriginalTotal.CurrencyCode.ToString() + Environment.NewLine; strbuff += financialeventgroup.ProcessingStatus.ToString() + Environment.NewLine; } MessageBox.Show(strbuff); } } } } }
private void btnListFinancialEvents_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; MWSFinancesServiceConfig config = new MWSFinancesServiceConfig(); config.ServiceURL = CommonValue.strServiceURL; MWSFinancesServiceClient client = new MWSFinancesServiceClient( AccessKeyId, SecretKeyId, ApplicationName, ApplicationVersion, config); ListFinancialEventsRequest request = new ListFinancialEventsRequest(); request.SellerId = SellerId; request.MWSAuthToken = MWSAuthToken; request.PostedAfter = DateTime.Parse("2015-09-01T00:00:00Z"); ListFinancialEventsResponse response = client.ListFinancialEvents(request); if( response.IsSetListFinancialEventsResult()) { ListFinancialEventsResult result = response.ListFinancialEventsResult; if (result.IsSetFinancialEvents()) { FinancialEvents financialevents = result.FinancialEvents; if( financialevents.IsSetServiceFeeEventList()) { strbuff = "サービス料金:" + financialevents.ServiceFeeEventList[0].FeeList[0].FeeAmount.CurrencyAmount.ToString(); } } MessageBox.Show(strbuff); } }
private void btnListFinancialEventsByNextToken_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; MWSFinancesServiceConfig config = new MWSFinancesServiceConfig(); config.ServiceURL = CommonValue.strServiceURL; MWSFinancesServiceClient client = new MWSFinancesServiceClient( AccessKeyId, SecretKeyId, ApplicationName, ApplicationVersion, config); ListFinancialEventsRequest request = new ListFinancialEventsRequest(); request.SellerId = SellerId; request.MWSAuthToken = MWSAuthToken; request.PostedAfter = DateTime.Parse("2015-09-01T00:00:00Z"); ListFinancialEventsResponse response = client.ListFinancialEvents(request); if( response.IsSetListFinancialEventsResult()) { ListFinancialEventsResult result = response.ListFinancialEventsResult; if (result.IsSetNextToken()) { ListFinancialEventsByNextTokenRequest request1 = new ListFinancialEventsByNextTokenRequest(); request1.SellerId = SellerId; request1.MWSAuthToken = MWSAuthToken; request1.NextToken = result.NextToken; ListFinancialEventsByNextTokenResponse response1 = client.ListFinancialEventsByNextToken(request1); if ( response1.IsSetListFinancialEventsByNextTokenResult()) { ListFinancialEventsByNextTokenResult result1 = response1.ListFinancialEventsByNextTokenResult; if( result1.IsSetFinancialEvents()) { FinancialEvents financialevents = result1.FinancialEvents; if (financialevents.IsSetServiceFeeEventList()) { strbuff = "サービス料金:" + financialevents.ServiceFeeEventList[0].FeeList[0].FeeAmount.CurrencyAmount.ToString(); } MessageBox.Show(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; MWSFinancesServiceConfig config = new MWSFinancesServiceConfig(); config.ServiceURL = CommonValue.strServiceURL; MWSFinancesServiceClient client = new MWSFinancesServiceClient( AccessKeyId, SecretKeyId, ApplicationName, ApplicationVersion, config); GetServiceStatusRequest request = new GetServiceStatusRequest(); request.SellerId = SellerId; request.MWSAuthToken = MWSAuthToken; GetServiceStatusResponse response = client.GetServiceStatus(request); if (response.IsSetGetServiceStatusResult()) { strbuff = "正常終了:" + response.GetServiceStatusResult.Status; } else { strbuff = "異常終了:" + response.GetServiceStatusResult.Status; } MessageBox.Show(strbuff); }