Skip to content

Fetch Product Categories

Description

This endpoint retrieves a list of categories available that a client has either created or selected.

Endpoint

GET /v1/tenant-categories

Query Parameters

ParameterTypeDescription
namestringFilter categories by name

Required Headers

json
{
  "Authorization": "Bearer JWT_TOKEN",
  "X-MerchantApiKey": "MERCHANT_API_KEY",
  "Content-Type": "application/json"
}

Example API Call (Fetch or Axios)

js
fetch('{{url}}/v1/tenant-categories', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer JWT_TOKEN',
    'X-MerchantApiKey': 'MERCHANT_API_KEY',
    'Content-Type': 'application/json',
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Sample 200 Response (Success)

json
{
    "status": true,
    "message": "success",
    "data": [
        {
            "id": "679f65ad2208962713771e1d",
            "name": "Rafia",
            "slug": "rafia"
        },
        {
            "id": "679f600a8732b302e1cd088b",
            "name": "Snail",
            "slug": "snail"
        }
    ]
}

Next Steps

Build with joy