getCommerceSubscriptionItemListWithHttpInfo method
List all subscription items
Returns a list of all subscription items for the instance. The subscription items are returned sorted by creation date, with the newest appearing first. This includes subscriptions for both users and organizations. Pagination is supported.
Note: This method returns the HTTP Response.
Parameters:
-
bool paginated: Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated.
-
int limit: Applies a limit to the number of results returned. Can be used for paginating the results together with
offset. -
int offset: Skip the first
offsetresults when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction withlimit. -
String status: Filter subscription items by status
-
String payerType: Filter subscription items by payer type
-
String planId: Filter subscription items by plan ID
-
bool includeFree: Whether to include free plan subscription items
-
String query: Search query to filter subscription items
Implementation
Future<http.Response> getCommerceSubscriptionItemListWithHttpInfo({
bool? paginated,
int? limit,
int? offset,
String? status,
String? payerType,
String? planId,
bool? includeFree,
String? query,
}) async {
// ignore: prefer_const_declarations
final path = r'/billing/subscription_items';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (paginated != null) {
queryParams.addAll(_queryParams('', 'paginated', paginated));
}
if (limit != null) {
queryParams.addAll(_queryParams('', 'limit', limit));
}
if (offset != null) {
queryParams.addAll(_queryParams('', 'offset', offset));
}
if (status != null) {
queryParams.addAll(_queryParams('', 'status', status));
}
if (payerType != null) {
queryParams.addAll(_queryParams('', 'payer_type', payerType));
}
if (planId != null) {
queryParams.addAll(_queryParams('', 'plan_id', planId));
}
if (includeFree != null) {
queryParams.addAll(_queryParams('', 'include_free', includeFree));
}
if (query != null) {
queryParams.addAll(_queryParams('', 'query', query));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}