Documentation

You can copy paste the code in your browser console to quickly test Store API.

Category

Get Categories

fetch('https://api.storerestapi.com/categories')
  .then(response => response.json())
  .then(json => console.log(json))

Get Single Category

fetch('https://api.storerestapi.com/categories/phone-and-tablets')
  .then(response => response.json())
  .then(json => console.log(json))

Add New Category

fetch('https://api.storerestapi.com/categories',
  {
    method: 'POST',
    body: JSON.stringify({
      name: 'mens-cloths',
    }),
    headers: {
      'Content-type': 'application/json; charset=UTF-8',
    },
  })
  .then(response => response.json())
  .then(json => console.log(json))

Update Category

fetch('https://api.storerestapi.com/categories/phone-and-tablets',
  {
    method: 'PUT',
    body: JSON.stringify({
      name: 'Mens Fashion',
    }),
    headers: {
      'Content-type': 'application/json; charset=UTF-8',
    },
  })
  .then(response => response.json())
  .then(json => console.log(json))

Delete Category

fetch('https://api.storerestapi.com/categories/phone-and-tablets',
  {
    method: 'DELETE',
  })
  .then(response => response.json())
  .then(json => console.log(json))