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

FacturaCompraApiRequestDto

Full schema of the request body of POST /api/v1/facturas-compra.

interface FacturaCompraApiRequestDto { /** REQUIRED. Tenant user the document is attributed to. Same as in sales. */ idUsuario: number; /** REQUIRED. The supplier. */ emisor: FacturaCompraApiEmisorDto; /** * Issuing point of sale. Optional; if omitted, behavior does not change * relative to v1.2. Determines which branch/terminal carries the consecutive * number and the Hacienda key. The tenant's ids are listed by GET /catalogos/puntos-venta. */ idPuntoVenta?: number | null; /** Sale-condition code. See Hacienda catalog. Default "01" (Cash). */ condicionVenta: string; /** Term in days if condicionVenta="02". */ plazoCredito?: number; /** Payment-method code. See Hacienda catalog. Default "01" (Cash). */ medioPago: string; /** ISO currency code. "CRC" or "USD". Default "CRC". */ moneda: string; /** Hacienda transaction-type code. Default "01". */ tipoTransaccion: string; /** Economic-activity code the document is issued under. If omitted, uses the tenant's main one. */ codigoActividad?: string | null; /** Recipient's economic-activity code. */ codigoActividadReceptor?: string | null; /** Free text with comments visible in the PDF and XML. */ comentario?: string | null; /** REQUIRED. At least 1 line. */ lineas: FacturaCompraApiLineaDto[]; }

Field validations

FieldRuleError if it fails
idUsuarioInteger ≥ 1, corresponding to an existing user of the tenant.400
emisorWith idEmisor or identificacion.400 — Debe indicar idEmisor o identificacion del proveedor.
idPuntoVentaOptional. If present, must be a point of sale of the tenant — listed by GET /catalogos/puntos-venta.400
condicionVenta2-character string per Hacienda catalog.400 or Hacienda validation 9015
medioPago2-character string per Hacienda catalog.400 or Hacienda validation
moneda"CRC" or "USD".—
lineasArray with at least one element.400 — Debe incluir al menos una línea.

Unlike FacturaApiRequestDto, here there is no tipo or referencias: the type is always 08 and a purchase invoice does not reference prior documents.