Ucommerce
  • Ucommerce Next Gen
    • Getting Started
      • Prerequisites
      • Licensing
      • Ucommerce Templates
      • Headless Template
      • MVC Template
    • Headless
      • Postman Collection
      • Headless API Authentication
        • Token endpoint - Authorization Header
        • Authorization Scopes
        • Refreshing the Access Token
      • Reference
        • Cart
        • Cart / Order Line Items
        • Shipment
        • Billing
        • Promotion Codes
        • Price Groups
        • Payment Methods
        • Countries
        • Shipping Methods
        • Catalogs
        • Cart Custom Properties
        • Line Item Custom Properties
        • Orders
        • Views for Cart modifying operations
      • Custom Headless APIs
      • Error Handling
      • Pagination
      • Deprecation
    • Backoffice Authentication
      • Microsoft Entra ID Example
      • Auth0 Authentication Example
    • Definitions
      • What is a Definition
    • Search and indexing
      • Configuration
      • Indexing
        • Index Definitions
        • Facets
        • Indexing Prices
        • Suggestions
        • Custom Data
      • Searching
    • Payment Providers
      • Stripe Provider Integration
      • Implementing a custom payment provider
    • Data Import
    • Miscellaneous
      • Media
      • Price Group Inheritance
      • Price Group Criteria
      • Soft Deletion Of Entities
      • Logging
      • OpenTelemetry
    • Extensions
      • Extending Pipelines
        • Order Processing Pipelines
        • Checkout Pipelines
      • Changing Service Behavior
        • Images
        • Content
      • Custom Headless APIs
      • Extend the Backoffice
        • Custom UI Components
      • Custom Editor UI
      • Custom Promotion Criteria
      • Custom Price Group Criteria
    • How-To
      • Migrate from Classic
        • Common database issues
      • Entities from code
        • Bootstrapping data on startup
        • Product Definitions & Fields
      • Discover pipelines and their tasks
      • Executing a pipeline
    • Integrations
      • Umbraco Media Delivery API
      • App Slices
        • Product Picker
  • Release Notes
  • Contact Us
Powered by GitBook
On this page
  • Example
  • Request
  • Response
  • Next Page
  • Error Handling

Was this helpful?

  1. Ucommerce Next Gen
  2. Headless

Pagination

HTTPGET endpoints have:

  • maxItems optional parameter to act as a limit for how many results should be returned.

    • The default value is 250

  • nextPagingToken in the response that can be used in subsequent requests to get the next results page.

    • As long as nextPagingToken differs from null, there are more results available.

    • When null, the last page of results has been reached.

    • To request a previous page, the client should keep track of previously requested paging tokens.

Example

Request

curl -D- -X GET <baseUrl>/api/v1/countries?maxItems=3 \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \

Response

{
    "countries": [
        {
            "cultureCode": "da-DK",
            "id": "0c53f836-9601-ec11-837b-64bc58542c92",
            "name": "Denmark"
        },
        {
            "cultureCode": "de-DE",
            "id": "1153f836-9601-ec11-837b-64bc58542c92",
            "name": "Germany"
        },
        {
            "cultureCode": "en-GB",
            "id": "0f53f836-9601-ec11-837b-64bc58542c92",
            "name": "Great Britain"
        }
    ],
    "nextPagingToken": "M3wzfGRjMDZlZGYxLTQ2MGQtNGVlZC1hMzMxLWJjNWYwMzI4NDlkNHxGYWxzZQ=="
}

Next Page

curl -D- -X GET <baseUrl>/api/v1/countries?maxItems=3&nextPagingToken=M3wzfGRjMDZlZGYxLTQ2MGQtNGVlZC1hMzMxLWJjNWYwMzI4NDlkNHxGYWxzZQ== \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \

Error Handling

Error
Description

BadRequest (400)

Paging token does not match the current query;

PreviousError HandlingNextDeprecation

Last updated 1 year ago

Was this helpful?