Skip to main content

Overview

The Waste API (Mermas) manages production waste records associated with batches. It tracks different types of waste that occur during the dairy production process.

Base URL

/mermas
Authentication Required: Varies by endpoint (see individual endpoints)

Get Waste Types

curl -X GET https://api.tambo360.com/mermas/tipos
Retrieves the available waste types that can be registered in the system. Authentication Required: No

Response

data
array
Array of waste type strings:
  • Natural: Natural waste occurring during production processes
  • Tecnica: Technical waste due to equipment or process issues
  • Administrativa: Administrative waste from handling or documentation errors
  • Danio: Waste from damaged products
[
  "Natural",
  "Tecnica",
  "Administrativa",
  "Danio"
]

Create Waste Record

curl -X POST https://api.tambo360.com/mermas \
  -H "Content-Type: application/json" \
  -d '{
    "idLote": "b2c3d4e5-6789-01ab-cdef-234567890abc",
    "tipo": "Natural",
    "cantidad": 20,
    "observacion": "Pérdida durante el transporte"
  }'
Registers a new waste record for a production batch.

Request Body

idLote
string
required
UUID of the batch this waste is associated with
tipo
string
required
Type of waste. Must be one of:
  • “Natural”
  • “Tecnica”
  • “Administrativa”
  • “Danio”
cantidad
number
required
Amount of waste (in the same unit as the batch)
observacion
string
Additional notes or observations about the waste

Response

idMerma
string
UUID of the created waste record
idLote
string
UUID of the associated batch
tipo
string
Waste type
cantidad
number
Waste amount
observacion
string
Observations (may be null)
fechaCreacion
string
Timestamp of waste record creation (ISO 8601)
{
  "idMerma": "d3e1c8e4-12a3-4bcd-9e0d-123456789abc",
  "idLote": "b2c3d4e5-6789-01ab-cdef-234567890abc",
  "tipo": "Natural",
  "cantidad": 20,
  "observacion": "Pérdida durante el transporte",
  "fechaCreacion": "2026-03-08T15:45:00.000Z"
}

List All Waste Records

curl -X GET https://api.tambo360.com/mermas
Retrieves all waste records in the system.

Response

data
array
Array of waste record objects:
idMerma
string
Waste record UUID
tipo
string
Waste type
observacion
string
Observations (nullable)
cantidad
number
Waste amount
fechaCreacion
string
Creation timestamp
idLote
string
Associated batch UUID
[
  {
    "idMerma": "d3e1c8e4-12a3-4bcd-9e0d-123456789abc",
    "tipo": "Natural",
    "observacion": "Pérdida durante el transporte",
    "cantidad": 20,
    "fechaCreacion": "2026-03-08T15:45:00.000Z",
    "idLote": "b2c3d4e5-6789-01ab-cdef-234567890abc"
  },
  {
    "idMerma": "e4f2d9f5-23b4-5cde-0e1d-234567890bcd",
    "tipo": "Tecnica",
    "observacion": "Error en proceso de producción",
    "cantidad": 15,
    "fechaCreacion": "2026-03-07T10:30:00.000Z",
    "idLote": "c3d4e5f6-789a-12bc-def0-34567890abcd"
  }
]

Get Waste Record by ID

curl -X GET https://api.tambo360.com/mermas/d3e1c8e4-12a3-4bcd-9e0d-123456789abc
Retrieves a specific waste record by its ID.

Path Parameters

id
string
required
UUID of the waste record

Response

{
  "idMerma": "d3e1c8e4-12a3-4bcd-9e0d-123456789abc",
  "tipo": "Natural",
  "observacion": "Pérdida durante el transporte",
  "cantidad": 20,
  "fechaCreacion": "2026-03-08T15:45:00.000Z",
  "idLote": "b2c3d4e5-6789-01ab-cdef-234567890abc"
}

Update Waste Record

curl -X PUT https://api.tambo360.com/mermas/d3e1c8e4-12a3-4bcd-9e0d-123456789abc \
  -H "Content-Type: application/json" \
  -d '{
    "tipo": "Tecnica",
    "cantidad": 25,
    "observacion": "Error en proceso de producción"
  }'
Updates an existing waste record.

Path Parameters

id
string
required
UUID of the waste record to update

Request Body

All fields are optional. Only include fields you want to update.
tipo
string
New waste type (must be a valid type)
cantidad
number
New waste amount
observacion
string
Updated observations

Response

{
  "idMerma": "d3e1c8e4-12a3-4bcd-9e0d-123456789abc",
  "tipo": "Tecnica",
  "observacion": "Error en proceso de producción",
  "cantidad": 25,
  "fechaCreacion": "2026-03-08T15:45:00.000Z",
  "idLote": "b2c3d4e5-6789-01ab-cdef-234567890abc"
}

Delete Waste Record

curl -X DELETE https://api.tambo360.com/mermas/d3e1c8e4-12a3-4bcd-9e0d-123456789abc
Deletes a waste record from the system.

Path Parameters

id
string
required
UUID of the waste record to delete

Response

{
  "message": "Merma eliminada correctamente"
}

Waste Types Reference

Natural

Waste that occurs naturally during production processes, such as evaporation, settling, or natural spoilage.

Tecnica

Waste caused by technical issues, equipment malfunction, or process errors during production.

Administrativa

Waste resulting from administrative errors, mishandling, incorrect documentation, or storage issues.

Danio

Waste from physically damaged products that cannot be sold or used.

Error Responses

400 Bad Request

  • Invalid waste type
  • Invalid quantity (must be positive)
  • Validation errors

404 Not Found

  • Waste record does not exist
  • Associated batch does not exist

500 Internal Server Error

  • Unexpected server error

Build docs developers (and LLMs) love