Theme

Guides

Pagination

The Liveday API uses offset-based pagination with size and from parameters.

Parameters

ParameterTypeDefaultDescription
sizeinteger100Number of results to return (max: 1000)
frominteger0Offset from the beginning of the result set

Example

Fetch the first 10 results:

curl -G "https://api.liveday.se/analytics_search/api/transactions" \
  -H "Authorization: Bearer sk_your_api_key" \
  -d "size=10" \
  -d "from=0"

Fetch the next 10:

curl -G "https://api.liveday.se/analytics_search/api/transactions" \
  -H "Authorization: Bearer sk_your_api_key" \
  -d "size=10" \
  -d "from=10"

Response

The response includes total_count so you can calculate how many pages remain:

{
  "data": {
    "total_count": 342,
    "orders": [...]
  }
}

In this example with size=10, you'd have 35 pages total (Math.ceil(342 / 10)).

Sorting

Results can be sorted using the sort and order parameters:

Sort fieldDescription
dateOrder creation date (default)
priceTotal price
customer_nameCustomer name alphabetically
OrderDescription
descDescending (default)
ascAscending
curl -G "https://api.liveday.se/analytics_search/api/transactions" \
  -H "Authorization: Bearer sk_your_api_key" \
  -d "sort=price" \
  -d "order=asc" \
  -d "size=25"

Maximum results

The API returns a maximum of 1000 results per request. If total_count exceeds your request size, paginate through results using the from parameter.

Previous
Webhooks