Categories API - Venddor API

Categories Endpoints

The Categories API allows you to manage product categories in the Venddor platform. This documentation outlines the available endpoints and their supported HTTP methods.

Base URL: https://www.venddor.com.br/api

Available Endpoints

GET POST /categories

This endpoint allows you to retrieve all categories or create a new category.

Supported Methods

Method Description Usage
GET Retrieve all categories Use pagination parameters to limit results. See Pagination section for details.
POST Create a new category Requires a JSON body with category details.
Create Example
List Response
{
  "category": "Electronics",
  "description": "All electronic devices and accessories",
  "parent_id": 0,
  "status": "A",
  "meta_title": "Electronics - Best Deals",
  "meta_description": "Shop the latest in electronics and tech gadgets",
  "position": 10
}
{
  "categories": [
    {
      "category_id": 16,
      "category": "Electronics",
      "description": "All electronic devices and accessories",
      "parent_id": 0,
      "status": "A",
      "position": 10,
      "product_count": 156
    },
    {
      "category_id": 18,
      "category": "Home & Kitchen",
      "description": "Products for your home and kitchen",
      "parent_id": 0,
      "status": "A",
      "position": 20,
      "product_count": 203
    }
  ],
  "params": {
    "page": 1,
    "items_per_page": 10,
    "total_items": 42
  }
}
GET PUT DELETE /categories/:id

This endpoint allows you to work with a specific category identified by its ID.

Path Parameters

Parameter Type Description
id* integer The unique identifier of the category

Supported Methods

Method Description Usage
GET Retrieve a specific category Returns detailed information about the specified category
PUT Update a category Requires a JSON body with fields to update
DELETE Delete a category Permanently removes the category from the system
Important: When deleting a category, all products assigned to it must be reassigned to another category or they will become orphaned. Consider updating products before deleting a category.
GET /categories/:id/products

This endpoint allows you to retrieve all products assigned to a specific category.

Path Parameters

Parameter Type Description
id* integer The unique identifier of the category
Tip: You can use pagination and filtering parameters to narrow down the results. For example, ?status=A&page=2&items_per_page=20 will return active products on page 2 with 20 items per page.
GET /categories/:id/products/:id

This endpoint allows you to retrieve details about a specific product within a specific category.

Path Parameters

Parameter Type Description
category_id* integer The unique identifier of the category
product_id* integer The unique identifier of the product
Note: This endpoint will return a 404 error if the product exists but is not assigned to the specified category.

Category Status Codes

Status Code Description
A Active - Category is visible and active
H Hidden - Category exists but is not visible to customers
D Disabled - Category is temporarily disabled