Product

Authentication

  • HTTP Authentication, scheme: bearer

Product

Get list of products

Code samples

const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', 'https://fakestoreapi.ru/product');
xhr.setRequestHeader('Accept', 'application/json');

xhr.send(data);

GET /product

Parameters

| Name | In | Type | Required | Description | | ------- | ----- | ------ | -------- | ------------------------------------ | ------ | | l | query | number | false | Items limit on page ( from 1 to 50 ) | | p | query | number | false | Items page ( min 1 ) | | n | query | string | false | Product name | | orderBy | query | string | false | Sort by ( name, price, discount ) | | sort | query | string | false | Sort method ( ASC | DESC ) | | pfrom | query | number | false | Product price from ( min 0 ) | | pto | query | number | false | Product price to ( min 1 ) | | cn | query | string | false | Product category name | | cid | query | string | false | Product category id |

Example responses

200 Response

Responses

Status
Meaning
Description
Schema

200

Products recived

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

This operation does not require authentication

Create product

Code samples

POST /product

Body parameter

Parameters

Name
In
Type
Required
Description

body

body

true

none

Example responses

201 Response

Responses

Status
Meaning
Description
Schema

201

Product created

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

To perform this operation, you must be authenticated by means of one of the following methods: bearer

Get product by id

Code samples

GET /product/{id}

Parameters

Name
In
Type
Required
Description

id

path

string

true

Product id

Example responses

200 Response

Responses

Status
Meaning
Description
Schema

200

Product recived

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

This operation does not require authentication

Update product

Code samples

PATCH /product/{id}

Body parameter

Parameters

Name
In
Type
Required
Description

id

path

string

true

Product id

body

body

true

none

Responses

Status
Meaning
Description
Schema

200

Product updated

None

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

To perform this operation, you must be authenticated by means of one of the following methods: bearer

Remove product

Code samples

DELETE /product/{id}

Parameters

Name
In
Type
Required
Description

id

path

string

true

Product id

Responses

Status
Meaning
Description
Schema

200

Product removed

None

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

To perform this operation, you must be authenticated by means of one of the following methods: bearer

Get reviews by product id

Code samples

GET /product/{id}/review

Parameters

Name
In
Type
Required
Description

l

query

number

false

Items limit on page ( from 1 to 50 )

p

query

number

false

Items page ( min 1 )

id

path

string

true

Product id

Example responses

200 Response

Responses

Status
Meaning
Description
Schema

200

Reviews recived

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

This operation does not require authentication

Create product review

Code samples

POST /product/{id}/review

Body parameter

Parameters

Name
In
Type
Required
Description

id

path

string

true

Product id

body

body

true

none

Example responses

200 Response

Responses

Status
Meaning
Description
Schema

200

Product review created

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

This operation does not require authentication

Update product review

Code samples

PATCH /product/{prodid}/review/{reviewid}

Body parameter

Parameters

Name
In
Type
Required
Description

prodid

path

string

true

none

reviewid

path

string

true

none

id

path

string

true

Product id

body

body

true

none

Responses

Status
Meaning
Description
Schema

200

Product review updated

None

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

This operation does not require authentication

Delete product review

Code samples

DELETE /product/{prodid}/review/{reviewid}

Parameters

Name
In
Type
Required
Description

prodid

path

string

true

none

reviewid

path

string

true

none

id

path

string

true

Product id

Responses

Status
Meaning
Description
Schema

200

Product review deleted

None

5XX

Unknown

Server error

None

4XX

Unknown

Check response message

None

This operation does not require authentication

Last updated