Skip to main content
The Pro Stock Tool API is a RESTful API that allows you to manage inventory, warehouses, categories, suppliers, and parameters programmatically.

Base URL

All API requests should be made to:
https://your-domain.com/database/

HTTP Methods

The API supports standard HTTP methods:
  • GET - Retrieve resources
  • POST - Create new resources
  • PUT - Update existing resources
  • DELETE - Delete resources
  • OPTIONS - CORS preflight requests

Request Format

All POST, PUT, and DELETE requests must:
  • Use Content-Type: application/json header
  • Send data as JSON in the request body
  • Use UTF-8 encoding

Response Format

All API responses return JSON with the following structure:

Success Response

{
  "success": true,
  "data": [...],
  "message": "Operation completed successfully"
}

Error Response

{
  "success": false,
  "error": "Error message describing what went wrong"
}

Response Fields

success
boolean
required
Indicates whether the request was successful
data
array | object
Contains the requested data (for GET requests or successful CREATE operations)
message
string
Success message for POST, PUT, DELETE operations
error
string
Error message when success is false
id
integer
The ID of the newly created resource (for POST requests)

CORS Support

The API supports Cross-Origin Resource Sharing (CORS) with the following headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type

Caching

Some endpoints include cache-control headers:
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Pragma: no-cache

Common Error Messages

Error MessageDescription
Datos inválidosInvalid or malformed JSON in request body
ID inválidoInvalid or missing ID parameter
Método no permitidoHTTP method not supported for this endpoint
Error del servidor: [details]Server-side exception occurred

Available Endpoints

Warehouses

Manage warehouse locations

Categories

Manage product categories

Subcategories

Manage product subcategories

Suppliers

Manage supplier information

Parameters

Manage system parameters and statuses

Data Ordering

All GET endpoints return data ordered by id DESC (newest first) unless otherwise specified.

Build docs developers (and LLMs) love