FacturaCompraApiEmisorDto
Identifies the supplier — who fiscally appears as the issuer of the document, even though its generation and submission to Hacienda are done by the integrator.
interface FacturaCompraApiEmisorDto {
/** ID of an existing supplier in the tenant's catalog. If provided,
the other fields are ignored. */
idEmisor?: number | null;
/** Supplier's ID number (cédula). Alternative to idEmisor: it's looked up in
the tenant and, if it doesn't exist, is created with the fields below. */
identificacion?: string | null;
/** ID type. See Hacienda catalog. Required if creating
by identificacion. */
tipoIdentificacion?: string | null;
/** Name. Required if creating by identificacion. */
nombre?: string | null;
/** Last name (individual). */
apellidos?: string | null;
/** Trade name, if applicable. */
nombreComercial?: string | null;
/** Supplier's email. */
correo?: string | null;
/** Phone number with country code. */
telefono?: string | null;
/** Supplier's economic-activity code. Only used when creating: it goes into
the XML's CodigoActividadEmisor. On an existing supplier it isn't changed
through here — it's edited from the POS. */
codigoActividadEmisor?: string | null;
}Fields
| Field | Type | Required | Description |
|---|---|---|---|
idEmisor | number | One of the two | ID of the existing supplier in the tenant’s catalog. If present, the other fields are ignored. |
identificacion | string | One of the two | Supplier’s ID number. It’s looked up in the tenant and, if it doesn’t exist, is created. |
tipoIdentificacion | string | If creating | ID type per Hacienda catalog. |
nombre | string | If creating | Supplier’s name. |
apellidos | string | Optional | Last name, when it’s an individual. |
nombreComercial | string | Optional | Trade name, if applicable. |
correo | string | Optional | Supplier’s email. |
telefono | string | Optional | Phone number with country code. |
codigoActividadEmisor | string | Optional | Supplier’s economic activity. Only used when creating. |
Usage modes
Mode A — Existing supplier (recommended)
{ "idEmisor": 15 }Same as cliente.idCliente for sales (see FacturaApiClienteDto): looks up by ID in the tenant’s catalog. If it doesn’t exist, 400.
Mode B — By ID number, with automatic creation
{
"identificacion": "1-0234-0567",
"tipoIdentificacion": "01",
"nombre": "Juan",
"apellidos": "Pérez Solano",
"correo": "juan.perez@correo.cr",
"telefono": "88001122",
"codigoActividadEmisor": "011101"
}- If a supplier with that ID number already exists in the tenant, it’s reused — it isn’t duplicated, nor are its data updated.
- If it doesn’t exist, it’s created.
tipoIdentificacionandnombrebecome required; without them,400. - The phone number and email are validated and normalized the same way as in the POS. An invalid format is
400. - Hacienda validates the supplier’s ID number independently. The creation succeeding in LX CloudPos doesn’t guarantee Hacienda will recognize it: if the ID number doesn’t exist in its registry, the document ends up rejected.