# Storefront REST API

## Usage

This is a public API that is intended to be used on a storefront or other public client to retrieve data from Okendo.

## Basics

This API is organised around REST with resource-based CRUD operations. Parameters for GET requests should be provided in the query string whereas POST/PUT request parameters should be provided as JSON in the body. JSON is also used for responses, including errors.

## Paths

All endpoints are relative to our base URL:

```
https://api.okendo.io/v1/stores/{okendo_user_id}
```

### Substitutions Reference

Throughout these docs you will see substitutions enclosed in `{}` (eg. `{okendo_user_id}`). Replace these (including the curly brackets) with the corresponding value:

`okendo_user_id`: Your Okendo User ID. This identifies your Okendo account. You can get this information from the Okendo section in the integration settings of the Okendo app.

`product_id`: A numerical Shopify Product ID.

`group_id`: An Okendo Group ID or a numerical Shopify Collection ID.

## Authentication

No authentication is required.

## Pagination

When listing large amounts of data, not all of it can be returned in a single request. We use pagination to break data up into reasonably sized chunks. When listing a resource, the response may include a `nextUrl` property to indicate that another page of results is available:

```json
{
    "reviews": [],
    "nextUrl": "/reviews..."
}
```

Append the `nextUrl` to the base path and make a GET request to that URL to retrieve the next page of results. Repeat this process until you have all the results you need or there are no more pages of results (there will be no `nextUrl`).

## Caching

When making repeated, identical calls to this API your response may be served from a cache. When this occurs any changes to the data since the response was cached may not be included. Making the request again after a short delay will refresh the results with any new changes.

## Versioning

Versioning is done via an HTTP header containing the required version. New versions of the API are released periodically. Provide the `okendo-api-version` header with a valid value in all requests. Valid versions:

* 2025-02-01


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.okendo.io/on-site/storefront-rest-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
