factus-js iconfactus-js
Facturas

Crear y validar factura

Crear y validar una factura electrónica de venta con Factus API v2.

Firma del método

create(
  input: CreateBillInput,
  options?: RequestOptions,
): Promise<CreateBillResponse>

Endpoint Factus

POST /v2/bills/validate

Fuente oficial: Crear y validar

Campos principales

Prop

Type

Ejemplo

import {
  CustomerTributeCode,
  IdentityDocumentCode,
  OperationTypeCode,
  OrganizationTypeCode,
  PaymentFormCode,
  PaymentMethodCode,
  ProductStandardCode,
} from "factus-js";

const response = await factus.bills.create({
  numbering_range_id: 8,
  reference_code: "FACT-2026-0001",
  operation_type: OperationTypeCode.Standard,
  observation: "Observaciones de la factura",
  payment_details: [
    {
      payment_form: PaymentFormCode.CreditPayment,
      payment_method_code: PaymentMethodCode.Cash,
      amount: "50000.00",
      due_date: "2026-12-31",
    },
  ],
  billing_period: {
    start_date: "2026-01-01",
    end_date: "2026-01-31",
  },
  customer: {
    identification: "123456789",
    names: "Alan Turing",
    address: "Calle 1 # 2-68",
    email: "alanturing@enigmasas.com",
    phone: "1234567890",
    legal_organization_code: OrganizationTypeCode.NaturalPerson,
    tribute_code: CustomerTributeCode.NotApplicable,
    identification_document_code: IdentityDocumentCode.CitizenshipCard,
    municipality_code: "11001",
  },
  items: [
    {
      code_reference: "PROD-001",
      name: "Producto ejemplo",
      quantity: "2.00",
      discount_rate: "0.00",
      price: "50000.00",
      unit_measure_code: "94",
      standard_code: ProductStandardCode.TaxpayerAdoption,
      taxes: [{ code: "01", rate: "19.00" }],
    },
  ],
});

console.log(response.data.number);

Respuesta

Prop

Type

En esta página