list method
Retrieves a list of settlement reports from your Merchant Center account.
Request parameters:
merchantId
- The Merchant Center account to list settlements for.
maxResults
- The maximum number of settlements to return in the
response, used for paging. The default value is 200 returns per page, and
the maximum allowed value is 5000 returns per page.
pageToken
- The token returned by the previous request.
transferEndDate
- Obtains settlements which have transactions before
this date (inclusively), in ISO 8601 format.
transferStartDate
- Obtains settlements which have transactions after
this date (inclusively), in ISO 8601 format.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a SettlementreportsListResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<SettlementreportsListResponse> list(
core.String merchantId, {
core.int? maxResults,
core.String? pageToken,
core.String? transferEndDate,
core.String? transferStartDate,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if (transferEndDate != null) 'transferEndDate': [transferEndDate],
if (transferStartDate != null) 'transferStartDate': [transferStartDate],
if ($fields != null) 'fields': [$fields],
};
final url_ = commons.escapeVariable('$merchantId') + '/settlementreports';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return SettlementreportsListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}