Skip to content

Storefronts Resource

Introduction

The Storefronts resource provides access to storefront-related data, allowing for the management of storefront entities within the system. This resource includes support for querying, creating, updating, and deleting storefront records.

Storefronts Object

The storefronts resource includes the following fields:

Field Type Description Possible values Default
_id String Unique identifier for the storefront UUID format N/A
name String The name of the storefront Any string N/A
_links Object Links to related resources N/A N/A

See also structured fields.

Managing Storefronts Resources

GET: Retrieving a Storefront

A storefront can be fetched by its unique ID using an HTTP GET request.

Endpoint

GET https://api.openpublishing.com/resource/v3/storefronts/[ID]

Response Structure

The response is a JSON object with the Storefronts object.

POST: Creating a New Storefront (Not implemented yet)

New storefront resources can be added using an HTTP POST request. The request must include all required fields for the resource in the body.

Endpoint

POST https://api.openpublishing.com/resource/v3/storefronts

Request Body Example

{
   "name": "book-heaven"
}

PUT: Updating an Existing Storefront (not implemented yet)

Existing storefront resources can be updated using an HTTP PUT request. The request body should contain the updated fields.

Endpoint

PUT https://api.openpublishing.com/resource/v3/storefronts/[ID]

Request Body Example

{
   "name": "bookheaven"
}

DELETE: Deleting a Storefront (not implemented yet)

Storefront resources can be deleted using an HTTP DELETE request. This action permanently removes the resource.

Endpoint

DELETE https://api.openpublishing.com/resource/v3/storefronts/[ID]

Resource Queries

Querying Storefronts (GET)

Endpoint

GET https://api.openpublishing.com/resource/v3/storefronts

This endpoint supports filters and pagination for querying storefront data. Please refer to resource queries syntax to filter and refine your search results.

Response Structure

Field Type Description
_links Object Links to related resources
items Array An array of individual storefront objects

Each item in the items array represents a single storefront.

Query Parameters

Parameter Description
name Filters storefronts by name

Examples

Example 1: Querying Storefronts with Filters

GET https://api.openpublishing.com/resource/v3/storefronts?name__contains=book

Example Response

{
   "_links": {
      "first": "https://api.openpublishing.com/resource/v3/storefronts?page=1",
      "last": "https://api.openpublishing.com/resource/v3/storefronts?page=1",
      "next": null,
      "prev": null,
      "self": "https://api.openpublishing.com/resource/v3/storefronts"
   },
   "items": [
      {
         "_id": "9ee61a17-e617-11ee-a221-00505699575c",
         "_links": {
            "self": "https://api.openpublishing.com/resource/v3/storefronts/9ee61a17-e617-11ee-a221-00505699575c"
         },
         "name": "bookheaven"
      },
      {
         "_id": "9ee62266-e617-11ee-a221-00505699575c",
         "_links": {
            "self": "https://api.openpublishing.com/resource/v3/storefronts/9ee62266-e617-11ee-a221-00505699575c"
         },
         "name": "best-book-deals"
      }
   ]
}