Skip to main content

Links

Links are used to allow you as an API consumer to move between requests. Single entities use a self parameter with a link to that specific resource:

{
"links": {
"self": "https://useast.api.elasticpath.com/carts/1"
}
}

Listing pages use current, first, last, next, previous:

{
"links": {
"current": "https://useast.api.elasticpath.com/v2/products?page[limit]=100&page[offset]=0",
"first": "https://useast.api.elasticpath.com/v2/products?page[limit]=100&page[offset]=0",
"last": "https://useast.api.elasticpath.com/v2/products?page[limit]=100&page[offset]=600",
"prev": null,
"next": "https://useast.api.elasticpath.com/v2/products?page[limit]=100&page[offset]=100"
}
}

Sometimes, there aren’t enough entities for a project to fill multiple pages. In this situation, we return some defaults, instead of expecting you as a consumer to check for these special cases.

Property​Description
currentAlways the current page.
firstAlways the first page.
lastnull if there is only one page.
prevnull if on the first page, or a link to the first page.
nextnull if on the last page, or a link to the last page.
Ask External AI