Facturas

Obtener la última factura del negocio

Retorna la última factura registrada del negocio actual.

Autenticación requerida: Este endpoint requiere autenticación Bearer Token. Usar el campo tokenCurrent obtenido del servicio de login (/login) en el header: Authorization: Bearer {tokenCurrent}

Útil para verificar el último número de factura generado o continuar una secuencia de facturación.

get/invoices/currentBusiness/last

Request

  • Base URL
    https://api.pirpos.com
  • URL
    https://api.pirpos.com/invoices/currentBusiness/last
  • Auth
    HTTP bearer

Response

Última factura obtenida exitosamente

_idstring

ID único de la factura

businessIdstring

ID del negocio al que pertenece la factura

numberstring

Número de la factura

invoicePrefixstring

Prefijo de la factura

seqnumber

Número secuencial de la factura

totalnumber

Total de la factura

totalPaidnumber

Total pagado

status'Pendiente' | 'Pagada' | 'Anulada'

Estado de la factura

type'Normal' | 'FacturaElectronica'

Tipo de factura

deliveryCostnumber

Costo de entrega

createdOnstring date-time

Fecha de creación

modifiedOnstring date-time

Fecha de última modificación

Example response

{
  "_id": "507f1f77bcf86cd799439011",
  "businessId": "507f1f77bcf86cd799439012",
  "business": {
    "name": "Restaurante El Buen Sabor",
    "nit": "123456789-1",
    "address": "Calle 123 #45-67"
  },
  "number": "FAC-001",
  "invoicePrefix": "FAC",
  "seq": 1,
  "products": [
    {
      "name": "Hamburguesa Clásica",
      "quantity": 2,
      "price": 15000
    }
  ],
  "total": 35000,
  "totalPaid": 35000,
  "status": "Pagada",
  "type": "Normal",
  "table": {
    "name": "Mesa 5"
  },
  "client": {
    "name": "Juan Pérez",
    "phone": "+57 300 123 4567"
  },
  "cashier": {
    "name": "María González"
  },
  "paid": {
    "paymentMethodValue": {
      "paymentMethod": "Efectivo"
    }
  },
  "eInvoice": {
    "DIAN": {
      "dianState": "00"
    }
  },
  "externalIntegration": {
    "siigo": {
      "statusCode": 200
    },
    "loggro": {
      "statusCode": 200
    }
  },
  "createdOn": "2025-08-05T10:30:00.000Z",
  "modifiedOn": "2025-08-05T10:30:00.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.