Overview
The Quivo API provides mechanisms for handling large result sets through pagination and for ensuring safe retries through idempotency. Understanding these features enables you to build reliable integrations that handle data efficiently and prevent duplicate operations.For detailed endpoint-specific information about pagination parameters and idempotency support, see the API Reference endpoints documentation.
Pagination
Pagination allows you to retrieve large datasets in manageable chunks. The Quivo API supports two pagination mechanisms: offset-based pagination and cursor-based pagination.Pagination Parameters
The following query parameters control pagination for endpoints that support it:| Parameter | Type | Description |
|---|---|---|
page | integer | The page number to retrieve when using offset-based pagination. Ignored if searchAfter is provided. |
searchAfter | string or array | Used for cursor-based pagination. Pass the sort key value from the last item of the previous page to retrieve the next set of results. When sort has multiple fields, use a JSON array with values for each field. Overrides page. |
pageSize | integer | The maximum number of items to return per page. Used for both offset and cursor-based pagination. Default is 25. The maximum allowed value is 1000. |
sort | string | Optional sorting criteria for the results. Format is typically field:direction (for example, created:desc). |
Offset-Based Pagination
Offset-based pagination uses page numbers to navigate through results. Use thepage parameter to specify which page to retrieve.
Example:
Cursor-Based Pagination
Cursor-based pagination uses a cursor value from the last item of the previous page to retrieve the next set of results. This method is more efficient for large datasets and prevents issues with data changing between page requests. To use cursor-based pagination:- Include a
sortparameter in your initial request to ensure consistent ordering - Use the
searchAfterparameter with thesortkey value from the last item of the previous page - The
pageparameter is ignored whensearchAfteris provided
When
sort has multiple fields, pass searchAfter as a JSON array with values corresponding to each sort field. For example, if sorting by ID and date, use ["123", "2023-10-01T12:00:00Z"].Cursor-based pagination (
searchAfter) overrides offset-based pagination (page). If you provide both parameters, only searchAfter is used.Response Structure
Paginated responses are returned as arrays. The API doesn’t include pagination metadata in the response body. Response format:- Responses are arrays of items (for example,
ArticleGetSummary[],OrderSummary[]) - No pagination metadata fields like
total,has_more,next_cursor, orpageare included - The response body is directly the array of items
The actual fields and structure depend on the endpoint and resource type. See the OpenAPI specification for the exact schema of each endpoint’s response.
- Check if the response contains fewer items than the requested
pageSize - Make a request for the next page and check if it returns any results
Finding Pagination Support
Not all endpoints support pagination. To determine if an endpoint supports pagination, see the detailed endpoint documentation in the API Reference sectionIdempotency
Idempotency ensures that making the same request multiple times produces the same result as making it once. This is important for handling network errors, retries, and preventing duplicate operations.Idempotency Support
Currently, only one endpoint supports idempotency:POST /shipments/book- Books a shipment
How Idempotency Works
The/shipments/book endpoint uses a requestId parameter to ensure idempotency:
- Include a unique
requestIdin your request - If you make the same request with the same
requestIdmultiple times, the endpoint will not create a duplicate shipment - Instead, it returns the existing shipment that was created with that
requestId
If you make the same request with the same
requestId again, you’ll receive the existing shipment instead of creating a new one. This prevents duplicate shipments from being created due to network retries or other issues.Other Endpoints
For other endpoints, idempotency is not currently supported. To determine if an endpoint supports idempotency, see the detailed endpoint documentation in the API Reference section.Where to go next
Now that you understand pagination and idempotency concepts, continue with these guides:HTTP Response Codes
Understand API response codes, including errors that may occur during pagination.
Authentication
Learn about authentication required for API requests.