Skip to main content

Product Kardex

The Product Kardex API allows you to track all inventory movements for finished products. It records transactions such as production entries (ESI - Entrada Standard Input), sales, returns, and other product movements.

Endpoints

POST /api/pos/kardexprod

Create a new product kardex transaction.
prd_codigo
string
required
Product code
trn_cod
string
required
Transaction code (e.g., ‘ESI’ for standard input, ‘VEN’ for sale)
krd_prd_cantidad
number
required
Transaction quantity (must be positive number)
est_cod
string
Standard recipe code (required when trn_cod is ‘ESI’)
krd_prd_obs
string
Observation or notes for the transaction

Response

krd_prd_codigo
string
Generated kardex record ID
message
string
Success message
cURL
curl -X POST "http://localhost:3000/api/pos/kardexprod" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prd_codigo": "PRD001",
    "trn_cod": "ESI",
    "krd_prd_cantidad": 10,
    "est_cod": "EST001",
    "krd_prd_obs": "Production batch #123"
  }'
{
  "krd_prd_codigo": "KP001",
  "message": "Kardex de producto creado exitosamente"
}

GET /api/pos/kardexprod

Get all product kardex transactions with pagination.
page
number
Page number for pagination (default: 1)

Response

page
number
Current page number
limit
number
Number of items per page
count
number
Total count of kardex records
data
array
Array of kardex transaction objects
cURL
curl -X GET "http://localhost:3000/api/pos/kardexprod?page=1" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "page": 1,
  "limit": 20,
  "count": 250,
  "data": [
    {
      "krd_prd_codigo": "KP001",
      "prd_codigo": "PRD001",
      "prd_nombre": "Pizza Margherita",
      "trn_cod": "ESI",
      "trn_descripcion": "Entrada Standard Input",
      "krd_prd_cantidad": 10,
      "krd_prd_fecha": "2024-03-15T10:30:00.000Z",
      "krd_prd_obs": "Production batch #123",
      "est_cod": "EST001",
      "saldo": 60
    },
    {
      "krd_prd_codigo": "KP002",
      "prd_codigo": "PRD001",
      "prd_nombre": "Pizza Margherita",
      "trn_cod": "VEN",
      "trn_descripcion": "Venta",
      "krd_prd_cantidad": 2,
      "krd_prd_fecha": "2024-03-15T14:20:00.000Z",
      "krd_prd_obs": "Order #4567",
      "est_cod": null,
      "saldo": 58
    }
  ]
}

GET /api/pos/kardexprod/product/:prd_codigo

Get kardex transactions for a specific product.
prd_codigo
string
required
Product code
page
number
Page number for pagination (default: 1)

Response

page
number
Current page number
limit
number
Number of items per page
count
number
Total count of kardex records for this product
data
array
Array of kardex transaction objects for the product
cURL
curl -X GET "http://localhost:3000/api/pos/kardexprod/product/PRD001?page=1" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "page": 1,
  "limit": 20,
  "count": 48,
  "data": [
    {
      "krd_prd_codigo": "KP001",
      "prd_codigo": "PRD001",
      "prd_nombre": "Pizza Margherita",
      "trn_cod": "ESI",
      "trn_descripcion": "Entrada Standard Input",
      "krd_prd_cantidad": 10,
      "krd_prd_fecha": "2024-03-15T10:30:00.000Z",
      "krd_prd_obs": "Production batch #123",
      "est_cod": "EST001",
      "saldo": 60
    }
  ]
}

DELETE /api/pos/kardexprod/:id

Delete a kardex transaction by ID.
id
string
required
Kardex record ID to delete

Response

message
string
Success message
cURL
curl -X DELETE "http://localhost:3000/api/pos/kardexprod/KP001" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "message": "Registro eliminado correctamente"
}

Transaction Types

Common transaction codes used in the Product Kardex:
  • ESI: Entrada Standard Input - Production entry based on a standard recipe
  • VEN: Venta - Sale transaction
  • DEV: Devolución - Return transaction
  • AJU: Ajuste - Inventory adjustment
When using transaction type ‘ESI’, the est_cod field is mandatory to indicate which standard recipe was used for production.

Build docs developers (and LLMs) love