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
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
Example responses
201 Response
Responses
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
id
path
string
true
Product id
Example responses
200 Response
Responses
This operation does not require authentication
Update product
Code samples
PATCH /product/{id}
Body parameter
Parameters
id
path
string
true
Product id
Responses
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
id
path
string
true
Product id
Responses
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
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
This operation does not require authentication
Create product review
Code samples
POST /product/{id}/review
Body parameter
Parameters
id
path
string
true
Product id
Example responses
200 Response
Responses
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
prodid
path
string
true
none
reviewid
path
string
true
none
id
path
string
true
Product id
Responses
This operation does not require authentication
Delete product review
Code samples
DELETE /product/{prodid}/review/{reviewid}
Parameters
prodid
path
string
true
none
reviewid
path
string
true
none
id
path
string
true
Product id
Responses
This operation does not require authentication
Last updated