Skip to main content
GET
/
api
/
sales
/
:id
Get Sale by ID
curl --request GET \
  --url https://api.example.com/api/sales/:id
{
  "success": true,
  "data": {
    "id": 123,
    "fecha": "<string>",
    "montoTotal": 123,
    "estado": "<string>",
    "comprobante": "<string>",
    "costoEnvio": 123,
    "metodoEnvio": "<string>",
    "codigoSeguimiento": "<string>",
    "etiquetaUrl": "<string>",
    "direccionEnvio": "<string>",
    "ciudadEnvio": "<string>",
    "provinciaEnvio": "<string>",
    "cpEnvio": "<string>",
    "telefonoEnvio": "<string>",
    "documentoEnvio": "<string>",
    "zipnovaShipmentId": "<string>",
    "tipoEntrega": "<string>",
    "medioPago": "<string>",
    "clienteId": 123,
    "cliente": {},
    "lineasVenta": [
      {
        "id": 123,
        "productoId": 123,
        "cantidad": 123,
        "subTotal": 123,
        "customPrice": 123,
        "customDescription": "<string>",
        "producto": {}
      }
    ],
    "pagos": [
      {}
    ]
  },
  "error": "<string>"
}

Authentication

This endpoint requires authentication. Users can only access their own sales unless they have admin privileges.

Path Parameters

id
number
required
The unique identifier of the sale

Response

success
boolean
Indicates if the request was successful
data
object
The sale object with complete details
id
number
Sale ID
fecha
string
Sale creation date (ISO 8601 timestamp)
montoTotal
number
Total sale amount including shipping
estado
string
Current sale status:
  • PENDIENTE_PAGO - Pending payment
  • PENDIENTE_APROBACION - Pending approval
  • APROBADO - Approved
  • ENVIADO - Shipped
  • ENTREGADO - Delivered
  • RECHAZADO - Rejected
  • CANCELADO - Cancelled
comprobante
string
Payment receipt URL (if uploaded)
costoEnvio
number
Shipping cost
metodoEnvio
string
Shipping method (e.g., “CORREO_ARGENTINO”)
codigoSeguimiento
string
Tracking code for the shipment
etiquetaUrl
string
Shipping label URL
direccionEnvio
string
Shipping address
ciudadEnvio
string
Shipping city
provinciaEnvio
string
Shipping province
cpEnvio
string
Shipping postal code
telefonoEnvio
string
Shipping phone number
documentoEnvio
string
Recipient’s ID document (DNI)
zipnovaShipmentId
string
Zipnova shipment tracking ID
tipoEntrega
string
Delivery type: ENVIO (shipping) or RETIRO (pickup)
medioPago
string
Payment method: MERCADOPAGO, EFECTIVO, VIUMI, TRANSFERENCIA, BINANCE
clienteId
number
Customer ID
cliente
object
Customer information including user details
lineasVenta
array
Array of sale line items
id
number
Line item ID
productoId
number
Product ID
cantidad
number
Quantity purchased
subTotal
number
Line item subtotal
customPrice
number
Custom price (for manual sales)
customDescription
string
Custom description (for manual sales)
producto
object
Complete product information
pagos
array
Array of payment records associated with this sale
error
string
Error message if the request failed

Example Request

GET /api/sales/789

Example Response

{
  "success": true,
  "data": {
    "id": 789,
    "fecha": "2026-03-05T10:30:00.000Z",
    "montoTotal": 50000,
    "estado": "APROBADO",
    "comprobante": "https://storage.example.com/receipts/789.pdf",
    "costoEnvio": 5000,
    "metodoEnvio": "CORREO_ARGENTINO",
    "codigoSeguimiento": "AR123456789",
    "etiquetaUrl": "https://zipnova.com/labels/789.pdf",
    "direccionEnvio": "Av. Corrientes 1234",
    "ciudadEnvio": "Buenos Aires",
    "provinciaEnvio": "Capital Federal",
    "cpEnvio": "1414",
    "telefonoEnvio": "+5491112345678",
    "documentoEnvio": "12345678",
    "zipnovaShipmentId": "ZN789456123",
    "tipoEntrega": "ENVIO",
    "medioPago": "TRANSFERENCIA",
    "clienteId": 42,
    "cliente": {
      "id": 42,
      "userId": 100,
      "direccion": "Av. Corrientes 1234",
      "telefono": "+5491112345678",
      "user": {
        "id": 100,
        "email": "[email protected]",
        "nombre": "Juan",
        "apellido": "Pérez",
        "telefono": "+5491112345678"
      }
    },
    "lineasVenta": [
      {
        "id": 1,
        "ventaId": 789,
        "productoId": 123,
        "cantidad": 2,
        "subTotal": 30000,
        "customPrice": null,
        "customDescription": null,
        "producto": {
          "id": 123,
          "nombre": "Procesador AMD Ryzen 5",
          "descripcion": "Procesador de 6 núcleos y 12 hilos",
          "precio": 15000,
          "stock": 8,
          "foto": "https://example.com/cpu.jpg",
          "categoriaId": 1,
          "marcaId": 2
        }
      },
      {
        "id": 2,
        "ventaId": 789,
        "productoId": 456,
        "cantidad": 1,
        "subTotal": 15000,
        "customPrice": null,
        "customDescription": null,
        "producto": {
          "id": 456,
          "nombre": "Memoria RAM 8GB DDR4",
          "descripcion": "Memoria de alto rendimiento",
          "precio": 15000,
          "stock": 15,
          "foto": "https://example.com/ram.jpg",
          "categoriaId": 3,
          "marcaId": 5
        }
      }
    ],
    "pagos": []
  }
}

Error Responses

Not Found (404)

{
  "success": false,
  "error": "Not Found"
}

Unauthorized (401)

{
  "success": false,
  "error": "Unauthorized"
}

Forbidden (403)

{
  "success": false,
  "error": "Access denied"
}

Notes

  • Users can only access their own sales unless they have admin role
  • The response includes complete product details for each line item
  • Shipping information is only populated for sales with tipoEntrega set to ENVIO
  • Payment receipt (comprobante) is only available if the user has uploaded one
  • Tracking information is populated once the order has been dispatched

Build docs developers (and LLMs) love