Skip to Content
v1.5Official documentation for the LX CloudPos API · stable in production
v1.5 (current)Data modelFacturaCompraApiLineaDto

FacturaCompraApiLineaDto

Detail line of a purchase invoice. Unlike sales, the catalog behind it is producto_factura_compra — separate from the inventory catalog used by POST /facturas.

Fields

FieldTypeRequiredDescription
idProductonumberOne of the two pathsID in the purchase-invoice catalog. Not the sales inventory catalog.
descripcionstringIf there’s no idProductoDescription of the line. Creates the item in the purchase catalog.
codigoCabysstringIf there’s no idProducto13-digit CAByS code. See CAByS codes.
unidadMedidastringOptionalHacienda unit of measure. Default "Unid".
cantidadnumberYesQuantity greater than 0.
precioUnitarionumberOptionalPrice in the document’s currency. If the line comes by idProducto and it’s omitted, uses the one from the purchase catalog.
numeroVinstringOptionalVIN number, for lines that require it.
numeroRegistrostringOptionalHealth-registry number or equivalent.
codigoPresentacionstringOptionalProduct presentation code.
interface FacturaCompraApiLineaDto { /** ID of the product in the purchase-invoice catalog (producto_factura_compra). NOT the sales inventory catalog. Alternative: descripcion + codigoCabys. */ idProducto?: number | null; /** Required if you don't send idProducto. Creates the line in the purchase catalog. */ descripcion?: string | null; /** Required if you don't send idProducto. 13-digit CAByS code. */ codigoCabys?: string | null; /** Hacienda unit of measure. Default "Unid". */ unidadMedida?: string | null; /** REQUIRED. Quantity > 0. */ cantidad: number; /** Unit price in the document's currency. If it comes by idProducto and is omitted, uses the one from the purchase catalog. */ precioUnitario?: number | null; numeroVin?: string | null; numeroRegistro?: string | null; codigoPresentacion?: string | null; }

Rules

  • Each line goes by one of two paths: idProducto or descripcion + codigoCabys.
  • When sending descripcion + codigoCabys without idProducto, the line is created in producto_factura_compra. Before creating it, it’s looked up by exact name, so invoicing the same supply every month doesn’t fill the catalog with duplicates.
  • The line doesn’t support VAT, discount, or tax exemption: it has no such fields, because the purchase invoice is 0% exempt rate.

Examples

Line from the purchase catalog

{ "idProducto": 8, "cantidad": 100 }

Ad-hoc line (gets created)

{ "descripcion": "Café en fruta", "codigoCabys": "8511200000100", "unidadMedida": "Kg", "cantidad": 250, "precioUnitario": 450.00 }