Pagination

Navigate large result sets with offset-based pagination

The PartsSource APIs use offset-based pagination for list and search endpoints. This provides predictable result ordering and consistent navigation through large datasets.


Request Format

Include pagination parameters in the request body for POST search endpoints:

{
  "filters": {
    "email": "[email protected]"
  },
  "pagination": {
    "sortBy": "LastName",
    "sortDir": "Asc",
    "limit": 50,
    "offset": 0
  }
}

Pagination Parameters

Parameter
Type
Default
Range
Description

limit

integer

50

1-10,000

Maximum records to return

offset

integer

0

0+

Number of records to skip

sortBy

enum

varies

endpoint-specific

Field to sort by

sortDir

enum

Asc

Asc, Desc

Sort direction

circle-info

CustomerApi limits: The CustomerApi has a lower maximum limit of 500 records per page to optimize for customer-facing use cases.


Response Format

Paginated responses include metadata alongside the results:

Response Metadata

Field
Type
Description

total

integer

Total records matching the query

limit

integer

Page size used

offset

integer

Records skipped

hasMore

boolean

true if more pages exist


Example: Fetching All Pages

Code Example


Sort Fields by Endpoint

Customers / Users

Sort Field
Description

Id

Customer/Contact ID (default)

FirstName

First name alphabetically

LastName

Last name alphabetically

Email

Email address

UserName

Login username

Example:

Catalog

Sort Field
Description

PartNumber

OEM part number

Description

Product description

Manufacturer

Manufacturer name

Price

Unit price

QuantityAvailable

Stock availability

Example:


Validation & Normalization

Invalid pagination values are automatically corrected:

Input
Normalized To
Reason

limit: 50000

limit: 10000

Exceeds maximum

limit: -5

limit: 50

Below minimum (uses default)

offset: -10

offset: 0

Cannot be negative

sortDir: "invalid"

sortDir: "Asc"

Invalid value (uses default)

circle-exclamation

Performance Considerations

Large Offsets

For very large result sets, performance may degrade with high offset values:

Offset Range
Performance

0 - 10,000

Excellent

10,000 - 100,000

Good

100,000+

May be slower

Recommendations for large datasets:

  1. Use filters to reduce the result set size

  2. Use keyset pagination for sequential processing (if supported)

  3. Cache results when possible

  4. Process incrementally rather than loading all data at once

Efficient Pagination Patterns


Complete Request Example

cURL

Response


TypeScript Helper

Last updated