Redis Product Catalogue Service

Download OpenAPI specification:Download

A simple REST API providing a way to manage and browse products

Auth

To be implemented

Errors

All errors are returned in the following format:

{
    "title": "Error title",
    "description": "Error description",
}

Pagination

Paginated data is returned in the following format

{
    "data": [],
    "current_page": 1,
    "per_page": 20,
}

You can move through pages by adding the page=X parameter in the query (described in more details in the "Get Products" endpoint).

NOTE: Work not complete

Products

Create Product

Request Body schema: application/json
name
required
string

The product name

description
string

The product description

vendor
string

The product vendor

price
number

The product price (in the specified currency)

currency
string

Currency

main_category_id
integer

A valid category id

Responses

201

Ok

422

Validation errors

post /products

Staging

http://ec2-3-122-233-203.eu-central-1.compute.amazonaws.com/api/products

Request samples

application/json
Copy
Expand all Collapse all
{
  • "name": "Rocinante",
  • "description": "The Rocinante (Roci) is a Corvette-class frigate with multiple roles, such as torpedo bomber and boarding party insertion. Originally commissioned as the MCRN Tachi, the ship was stationed onboard the MCRN Battleship Donnager.",
  • "vendor": "MCRN",
  • "price": 3500000.5,
  • "currency": "CNY",
  • "main_category_id": 1
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 77,
  • "name": "Rocinante",
  • "description": "The Rocinante (Roci) is a Corvette-class frigate with multiple roles, such as torpedo bomber and boarding party insertion. Originally commissioned as the MCRN Tachi, the ship was stationed onboard the MCRN Battleship Donnager.",
  • "vendor": "MCRN",
  • "currency": "CNY",
  • "main_category":
    {
    },
  • "images": null
}

Get Products

query Parameters
main_category_id
int
Example: 1

Filter products by category

page
int
Default: 1
Example: 3

Page number

search
string
Example: "Enterprise"

Search string (prefix searching only)

Responses

200

Ok

get /products

Staging

http://ec2-3-122-233-203.eu-central-1.compute.amazonaws.com/api/products

Response samples

application/json
Copy
Expand all Collapse all
{
  • "current_page": 1,
  • "per_page": 20,
  • "data":
    [
    ]
}

Update Product

Request Body schema: application/json
name
required
string

The product name

description
string

The product description

vendor
string

The product vendor

price
number

The product price (in the specified currency)

currency
string

Currency

main_category_id
integer

A valid category id

Responses

200

Ok

404

Not found

422

Validation errors

put /products/{id}

Staging

http://ec2-3-122-233-203.eu-central-1.compute.amazonaws.com/api/products/{id}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "name": "Rocinante",
  • "description": "The Rocinante (Roci) is a Corvette-class frigate with multiple roles, such as torpedo bomber and boarding party insertion. Originally commissioned as the MCRN Tachi, the ship was stationed onboard the MCRN Battleship Donnager.",
  • "vendor": "MCRN",
  • "price": 3500000.5,
  • "currency": "CNY",
  • "main_category_id": 1
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 77,
  • "name": "Rocinante",
  • "description": "The Rocinante (Roci) is a Corvette-class frigate with multiple roles, such as torpedo bomber and boarding party insertion. Originally commissioned as the MCRN Tachi, the ship was stationed onboard the MCRN Battleship Donnager.",
  • "vendor": "MCRN",
  • "price": 3500000.5,
  • "currency": "CNY",
  • "main_category":
    {
    },
  • "images":
    []
}

Get Product

path Parameters
id
required
int
Example: 1

Product id

Responses

200

Ok

get /products/{id}

Staging

http://ec2-3-122-233-203.eu-central-1.compute.amazonaws.com/api/products/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 77,
  • "name": "Rocinante",
  • "description": "The Rocinante (Roci) is a Corvette-class frigate with multiple roles, such as torpedo bomber and boarding party insertion. Originally commissioned as the MCRN Tachi, the ship was stationed onboard the MCRN Battleship Donnager.",
  • "vendor": "MCRN",
  • "price": 3500000.5,
  • "currency": "CNY",
  • "main_category":
    {
    },
  • "images":
    []
}

Delete Product

Responses

204

Ok

404

Not found

delete /products/{id}

Staging

http://ec2-3-122-233-203.eu-central-1.compute.amazonaws.com/api/products/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "title": "Not found",
  • "message": "That resource doesn't exist in our database"
}

Images

Create Image

Request Body schema: image/*
string <binary>

Responses

201

Ok

post /products/{id}/images

Staging

http://ec2-3-122-233-203.eu-central-1.compute.amazonaws.com/api/products/{id}/images

Response samples

application/json
Copy
Expand all Collapse all

Get Image

path Parameters
id
required
int
Example: 1

Image id

Responses

200

Ok

404

Not found

get /images/{id}

Staging

http://ec2-3-122-233-203.eu-central-1.compute.amazonaws.com/api/images/{id}

Response samples

application/json
Copy
Expand all Collapse all

Delete Image

Responses

204

Ok

404

Not found

delete /images/{id}

Staging

http://ec2-3-122-233-203.eu-central-1.compute.amazonaws.com/api/images/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "title": "Not found",
  • "message": "That resource doesn't exist in our database"
}