Documentation

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

Category

Get Categories

fetch('STORE_CLIENT_API_BASE_URL/categories')
  .then(response => response.json())
  .then(json => console.log(json))

Get Single Category

fetch('STORE_CLIENT_API_BASE_URL/categories/mens-cloths')
  .then(response => response.json())
  .then(json => console.log(json))

Add New Category

fetch('STORE_CLIENT_API_BASE_URL/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('STORE_CLIENT_API_BASE_URL/categories/mens-cloths',
  {
    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('STORE_CLIENT_API_BASE_URL/categories/mens-cloths',
  {
    method: 'DELETE',
  })
  .then(response => response.json())
  .then(json => console.log(json))