This database schema and therefore the API is based on IDs and KEYS. IDs are just integers which always act as an internal and unique identifier for any record. However, as optimal as integer IDs are, they are very difficult to work with when a database schema is dynamic as with EAV and make APIs equally obtuse. Where appropriate and only so, if an ID can benefit from a readable KEY name then one will be assigned.

This overhead is minimal and all data-integrity will be maintained at the API level, so should you ever change a key-name which in effect would be the same as changing a field-name, data-integrity will be preserved.

All documentation web-pages are only partially responsive and desktop-designed.

Classes | Categories

https://vshop.vadoo.co.uk/api/category/class/get/{id}

fetch('https://vshop.vadoo.co.uk/api/category/class/get/' + _id)
    .then( response => response.json() )
    .then( class => {
        // class.name is the category `main header` 
        // or `class`, e.g. Spirits, Laptops
    })

JSON | Category Class or `Main Header` [Object]

{'id as value', 'name'} and will return null if no {id} record
https://vshop.vadoo.co.uk/api/category/class/get/{id} with a {class-id} of your choosing.

https://vshop.vadoo.co.uk/api/category/class/all

fetch('https://vshop.vadoo.co.uk/api/category/class/all')
    .then( response => response.json() )
    .then( classes => {
        // Array of all classes or `Main Headers`
    })

JSON | Category Classes Array or `Main Headers` [Object]

[ {'id as value', 'name'} ] and will return null if no records
https://vshop.vadoo.co.uk/api/category/class/all

https://vshop.vadoo.co.uk/api/category/headers/get/{id}

fetch('https://vshop.vadoo.co.uk/api/category/headers/get/' + _id)
    .then( response => response.json() )
    .then( categories => {
        // array of Categories e.g. [Whiskey, Gin] or [Acer, Lenovo]
        // useful for <select> boxes
    })

JSON | Categories Array [Object] with header {id}

[ {'category_key as value', 'name'} ] and will return null if no records
https://vshop.vadoo.co.uk/api/category/headers/get/{id} with a header {category-id} of your choosing.

https://vshop.vadoo.co.uk/api/category/headers/all

fetch('https://vshop.vadoo.co.uk/api/category/headers/all')
    .then( response => response.json() )
    .then( categories => {
        // array of all Categories
        // as above useful for single <select> boxes when you don't
        // use Category Headers e.g. [Arabica, Robusta, Liberica, Excelsa]
    })

JSON | Categories Array [Object]

[ {'category_key as value', 'name'} ] and will return null if no records
https://vshop.vadoo.co.uk/api/category/headers/all

https://vshop.vadoo.co.uk/api/category/megamenu

fetch('https://vshop.vadoo.co.uk/api/category/megamenu')
    .then( response => response.json() )
    .then( menu => {
        // Array `Main Headers | Classes` -> Categories
    })

JSON | `Main Headers | Classes` -> Categories Array [Object]

Useful for building a drop-down menu

https://vshop.vadoo.co.uk/api/category/megamenu