Pagination and Filtering
All group API resources have support for bulk fetches via List API resources and filtering by query params. The sections that follow explain how you can use the Pagination and Filtering.
Pagination
You can list subscriptions, list customers, and list invoices. These list API methods share a common structure
Pagination can be controlled by page_size
parameter that limits the number of resources to be returned in the response. The value ranges from 1 to 100 and defaults to 20.
List API methods returns an object with these four attributes:
count: The total existing objects.
next: The query path to go to next results.
previous: The query path to go to previous results.
results: The list with the results objects.
Filtering
In the List API resources, filtering of resources can be performed using query parameters. Please refer to the corresponding resource's documentation for the complete list of supported query parameters. The following types of query parameters are supported now:
string
enumerated string
number
date
datetime
boolean
The operators supported for a query parameter is based on the query parameter type, as explained below:
Filter operators:
Nested filtering
Filter on nested objects is supported. Use an expression like these for filter by nested objects:
/invoices/?customer__name__endswith=llc
Returns all invoices objects that customer name ends with LLC.
/subscriptions/?lines__plan__name__icontains=basic
Returns all subscriptions objects that plan name contain basic.
In the same way you can make use of filter operators on nested objects.
Last updated