### Get Clients - Example Request (JSON)
Source: https://developer.loggro.com/reference/get_clients
Example of a GET request to retrieve a paginated list of clients. This includes the base URL, endpoint, and the necessary Authorization header with a Bearer token.
```http
GET /clients?pagination=true&limit=10&page=0
Authorization: Bearer tu_token_aqui
```
--------------------------------
### Get Clients - Search by Multiple Keywords (JSON)
Source: https://developer.loggro.com/reference/get_clients
Example of a GET request to search for clients using multiple keywords. The 'filter' parameter can accept multiple words, allowing for more specific searches.
```http
GET /clients?filter=Maria Lopez&pagination=true&limit=10&page=0
Authorization: Bearer tu_token_aqui
```
--------------------------------
### Example of Creating a Single CxP Application (JSON)
Source: https://developer.loggro.com/reference/crearaplicacion
This example demonstrates the JSON payload for creating a single CxP (Cuentas por Pagar) application. It includes all the necessary fields as defined by the schema, such as control information, document details, supplier information, dates, currency, and a detailed breakdown of the application, including the applied invoice/credit note and its value.
```json
{
"control": "CTRL001",
"tipoDocumento": "FAC",
"consecutivo": "123456",
"compania": "CO",
"division": "DIVISION01",
"proveedor": "PROVEEDOR01",
"fecha": "01/01/2024",
"fechaContable": "01/01/2024",
"moneda": "USD",
"tasaCambio": 18.25,
"comentario": "Aplicación procesada correctamente",
"detallesAplicacion": [
{
"tipoConsecutivoFacturaONotaCredito": "TCAPL",
"consecutivoFacturaONotaCredito": "00012345",
"prefijo": "PRE001",
"numeroDoc": "1234567890",
"valor": 1500
}
]
}
```
--------------------------------
### Get Invoices (Python)
Source: https://developer.loggro.com/reference/facturas
This Python example uses the 'requests' library to get invoices from the API. It constructs the necessary headers, including the Bearer token, and sends a GET request. Ensure you have 'requests' installed (`pip install requests`) and replace 'YOUR_BEARER_TOKEN' with your valid JWT.
```python
import requests
token = 'YOUR_BEARER_TOKEN'
url = 'https://api.pirpos.com/invoices'
headers = {
'Authorization': f'Bearer {token}',
'Accept': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
```
--------------------------------
### Example RecepcionDetalleDocumentoDatosEntrada
Source: https://developer.loggro.com/reference/creardocumentocxc
Provides an example of the data structure for document reception, specifically for an Accounts Receivable (CxC) document.
```APIDOC
## Example Document CxC
### Description
This example illustrates the structure of a typical Accounts Receivable (CxC) document entry, including its total, consecutive number, type, class, division, client, establishment, concept, currency, and exchange rate.
### Method
GET (Illustrative Example)
### Endpoint
N/A (This is an example structure)
### Parameters
N/A
### Request Example
N/A
### Response
#### Success Response (200)
- **total** (number) - The total amount of the document. Example: 152300.5
- **consecutivo** (string) - The consecutive number of the document. Example: "FAC12345"
- **tipoConsecutivo** (string) - The type of consecutive number. Example: "FC"
- **tipoDocumento** (string) - The type of document. Example: "FAC"
- **claseDocumento** (string) - The class of the document. Example: "VENT"
- **division** (string) - The division to which the document belongs. Example: "INTERNACIONAL"
- **cliente** (string) - The client identifier. Example: "CLI001"
- **establecimientoCliente** (string) - The client's establishment identifier. Example: "000001"
- **concepto** (string) - The concept of the document. Example: "VENTA"
- **moneda** (string) - The currency of the document. Example: "COP"
- **tasaCambio** (number) - The exchange rate. Example: 1
#### Response Example
```json
{
"total": 152300.5,
"consecutivo": "FAC12345",
"tipoConsecutivo": "FC",
"tipoDocumento": "FAC",
"claseDocumento": "VENT",
"division": "INTERNACIONAL",
"cliente": "CLI001",
"establecimientoCliente": "000001",
"concepto": "VENTA",
"moneda": "COP",
"tasaCambio": 1
}
```
```
--------------------------------
### Get Invoices (Ruby)
Source: https://developer.loggro.com/reference/facturas
This Ruby example illustrates how to retrieve invoices using the 'httparty' gem. Make sure to install 'httparty' (`gem install httparty`) and insert your Bearer token into the `Authorization` header. The code sends a GET request to the Invoices API.
```ruby
require 'httparty'
token = 'YOUR_BEARER_TOKEN'
response = HTTParty.get('https://api.pirpos.com/invoices',
headers: {
'Authorization' => "Bearer #{token}",
'Accept' => 'application/json'
}
)
puts response.body
```
--------------------------------
### Curl Example: Get Electronic Invoicing Report
Source: https://developer.loggro.com/reference/get_reports-reportsalesinvoices
Example of using cURL to get a report on electronic invoices, specifically filtering by electronic status code '00'. This is useful for accounting purposes.
```curl
curl -X GET "http://localhost:8000/reports/reportSalesInvoices?type=FacturaElectronica&statusFE=00&dateInit=2025-08-01T00:00:00.000Z&dateEnd=2025-08-06T23:59:59.999Z" \
-H "Authorization: Bearer tu_token_aqui"
```
--------------------------------
### Consultar Información de Documento (XML Example)
Source: https://developer.loggro.com/reference/consultarinformaciondocumentoelectronico
This snippet shows an example XML request to consult document information. It includes parameters such as the issuer ID, prefix, document number, and document type. The response schema defines various fields related to the document's status, operation success, and notification details.
```xml
12345
DS
001
FAVE
```
--------------------------------
### POST /consultarInformacionBasicaListaDocumentosElectronicos
Source: https://developer.loggro.com/reference/consultarinformacionbasicalistadocumentoselectronicos
Este servicio SOAP permite consultar de forma masiva información básica sobre documentos electrónicos emitidos. Está diseñado para proporcionar una vista general del estado, sin incluir su contenido completo. Requiere el ID del facturador electrónico y una lista de documentos a consultar (prefijo, número y tipo).
```APIDOC
## POST /consultarInformacionBasicaListaDocumentosElectronicos
### Description
Consulta masivamente información básica sobre documentos electrónicos emitidos, como facturas, notas crédito o notas débito. Proporciona una vista general del estado, fecha de aprobación, código QR (Base64) y CUFE/CUDE.
### Method
POST
### Endpoint
{urlServicio}/consultarInformacionBasicaListaDocumentosElectronicos
### Parameters
#### Query Parameters
- **urlServicio** (string) - Required - La URL base para consumir los servicios, recibida vía correo electrónico.
#### Request Body
- **idFacturadorElectronico** (string) - Required - El ID del facturador electrónico propietario del documento.
- **documentos** (array) - Required - Lista de documentos a consultar.
- **prefijo** (string) - Optional - Prefijo del documento (si aplica).
- **numeroDocumento** (string) - Required - Número del documento.
- **tipoDocumento** (string) - Required - Tipo de documento (factura, nota_credito, nota_debito).
### Request Example
```json
{
"idFacturadorElectronico": "12345",
"documentos": [
{
"prefijo": "FC",
"numeroDocumento": "1000",
"tipoDocumento": "factura"
},
{
"numeroDocumento": "2000",
"tipoDocumento": "nota_credito"
}
]
}
```
### Response
#### Success Response (200)
- **estadoDocumento** (string) - El estado del documento.
- **fechaAprobacionDian** (string) - La fecha de aprobación por la DIAN.
- **codigoQRBase64** (string) - El código QR del documento codificado en Base64.
- **cufeCude** (string) - El CUFE o CUDE del documento.
#### Response Example
```json
{
"resultado": [
{
"prefijo": "FC",
"numeroDocumento": "1000",
"tipoDocumento": "factura",
"estadoDocumento": "APROBADO",
"fechaAprobacionDian": "2023-10-27T10:00:00Z",
"codigoQRBase64": "iVBORw0KGgoAAAANSUhEUgAA...",
"cufeCude": "CUFE1234567890"
}
]
}
```
```
--------------------------------
### Query Historical Salaries - GET Request Example
Source: https://developer.loggro.com/reference/gethistoricosalarios
This example demonstrates how to make a GET request to the `/reporte/historicoSalarios` endpoint to retrieve historical salary data. It includes query parameters for date range, limit, and sorting.
```http
GET /apik/loggro-nomina/reporte/historicoSalarios?start=2023-01-01&limit=10&sort=nombre HTTP/1.1
Host: api.loggro.com
Authorization: Bearer
```
--------------------------------
### Multiple Vouchers Example (JSON)
Source: https://developer.loggro.com/reference/crearcomprobante
This JSON structure demonstrates an array containing multiple financial vouchers. Each voucher includes its own set of financial and accounting details, allowing for the representation of batch transactions or a series of related financial events.
```json
[
{
"idComprobante": 1234567890,
"fuente": "VENTAS",
"lote": 1001,
"ano": 2025,
"periodo": 3,
"fechaContabilizacion": "15/03/2025",
"fechaTransaccion": "14/03/2025",
"detallesContabilidad": [
{
"operacion": "1",
"cuenta": "11050501",
"centro": "Centro1",
"concepto": "Concepto1",
"tercero": "Tercero1",
"documento": "Doc123",
"prefijo": "Prefijo1",
"fechaVencimiento": "15/03/2025",
"valorMonedaLocal": 1500000,
"monedaExtranjera": "USD",
"valorMonedaExtranjera": 300000,
"tasaCambio": 5,
"valorbaseReteIva": 1800000,
"diasDiferir": 45,
"fechaInicioDiferido": "15/03/2025",
"tipoMoneda": "L",
"cantidad": 50,
"comentario": "Venta de productos",
"proyecto": "ProyectoX",
"conceptoContaAdicional": "Venta"
},
{
"operacion": "2",
"cuenta": "22050501",
"centro": "Centro2",
"concepto": "Concepto2",
"tercero": "Tercero2",
"documento": "Doc124",
"prefijo": "Prefijo2",
"fechaVencimiento": "15/03/2025",
"valorMonedaLocal": 1500000,
"monedaExtranjera": "USD",
"valorMonedaExtranjera": 300000,
"tasaCambio": 5,
"valorbaseReteIva": 1800000,
"diasDiferir": 45,
"fechaInicioDiferido": "15/03/2025",
"tipoMoneda": "L",
"cantidad": 50,
"comentario": "Venta de productos",
"proyecto": "ProyectoX",
"conceptoContaAdicional": "Venta"
}
]
}
]
```
--------------------------------
### Consultar Pedido by Control ID - API GET Request Example
Source: https://developer.loggro.com/reference/consultarpedidocontrol
Example of a GET request to consult order information using the 'control' field. The API validates the user session and returns order details if found. The response includes identification, success status, and data.
```http
GET https://api.loggro.com/apik/loggro-enterprise/pedidoControl/{idPedido} HTTP/1.1
Host: api.loggro.com
Accept: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
```
--------------------------------
### User Login Request Example (JSON)
Source: https://developer.loggro.com/reference/post_login
This snippet demonstrates the JSON payload structure for authenticating a user via the /login endpoint. It requires the user's email and password.
```json
{
"email": "usuario@ejemplo.com",
"password": "password123"
}
```
--------------------------------
### Get Invoices (Node.js)
Source: https://developer.loggro.com/reference/facturas
This code snippet shows how to fetch invoices using Node.js. It utilizes the 'axios' library to make a GET request to the Invoices API. Ensure you have 'axios' installed (`npm install axios`) and replace 'YOUR_BEARER_TOKEN' with your actual JWT.
```javascript
const axios = require('axios');
const token = 'YOUR_BEARER_TOKEN';
axios.get('https://api.pirpos.com/invoices', {
headers: {
'Authorization': `Bearer ${token}`,
'Accept': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
```
--------------------------------
### Get All Invoices (First Page) - cURL Example
Source: https://developer.loggro.com/reference/get_invoices
Example cURL command to retrieve the first page of invoices, with pagination enabled and a limit of 10 items. Requires an authorization token.
```bash
curl -X GET "http://localhost:8000/invoices?pagination=true&limit=10&page=0" \
-H "Authorization: Bearer tu_token_aqui"
```
--------------------------------
### Loggro API: Product Sales Report with Combos
Source: https://developer.loggro.com/reference/get_reports-reportsalesbyproduct
Example of how to request a product sales report that includes products which are part of bundled combos. Useful for analyzing combo performance. Requires a valid authorization token.
```curl
curl -X GET "http://localhost:8000/reports/reportSalesByProduct?dateInitISO=2025-08-06T00:00:00.000Z&dateEndISO=2025-08-06T23:59:59.999Z&showProductCombo=true" \
-H "Authorization: Bearer tu_token_aqui"
```
--------------------------------
### GET Request to Fetch All Categories
Source: https://developer.loggro.com/reference/get_categories
This example demonstrates how to make a GET request to the /categories endpoint to retrieve all active categories. Ensure you include the 'Authorization' header with your Bearer Token. No specific input parameters are required for this request.
```http
GET /categories
Host: your-api-domain.com
Authorization: Bearer YOUR_TOKEN_HERE
```
--------------------------------
### Example of Creating Multiple CxP Applications (JSON)
Source: https://developer.loggro.com/reference/crearaplicacion
This example shows how to structure a JSON payload for creating multiple CxP applications in a single request. The payload is an array, where each element represents a complete CxP application object, adhering to the defined schema. This allows for efficient batch processing of multiple applications.
```json
[
{
"control": "CTRL001",
"tipoDocumento": "FAC",
"consecutivo": "123456",
"compania": "CO",
"division": "DIVISION01",
"proveedor": "PROVEEDOR01",
"fecha": "01/01/2024",
"fechaContable": "01/01/2024",
"moneda": "USD",
"tasaCambio": 18.25,
"comentario": "Aplicación procesada correctamente",
"detallesAplicacion": [
{
"tipoConsecutivoFacturaONotaCredito": "TCAPL",
"consecutivoFacturaONotaCredito": "00012345",
"prefijo": "PRE001",
"numeroDoc": "1234567890",
"valor": 1500
}
]
},
{
"control": "CTRL002",
"tipoDocumento": "FAC",
"consecutivo": "654321",
"compania": "CO",
"division": "DIVISION01",
"proveedor": "PROVEEDOR01",
"fecha": "01/01/2024",
"fechaContable": "01/01/2024",
"moneda": "USD",
"tasaCambio": 18.25,
"comentario": "Segunda aplicación procesada",
"detallesAplicacion": [
{
"tipoConsecutivoFacturaONotaCredito": "TCAPL",
"consecutivoFacturaONotaCredito": "00012346",
"prefijo": "PRE001",
"numeroDoc": "1234567891",
"valor": 2000
}
]
}
]
```
--------------------------------
### Curl Example: Get Daily Sales Report
Source: https://developer.loggro.com/reference/get_reports-reportsalesinvoices
Example using cURL to fetch daily sales and paid invoices. Requires an authorization token. This endpoint supports filtering by date range and status.
```curl
curl -X GET "http://localhost:8000/reports/reportSalesInvoices?dateInit=2025-08-06T00:00:00.000Z&dateEnd=2025-08-06T23:59:59.999Z&status=Pagada" \
-H "Authorization: Bearer tu_token_aqui"
```
--------------------------------
### POST /websites/developer_loggro_reference/clientes
Source: https://developer.loggro.com/reference/crearcliente
Allows the registration of one or multiple customers. Each request can contain multiple records, and each will be validated individually before processing. The service returns a list of results indicating whether each customer was created successfully or encountered errors.
```APIDOC
## POST /websites/developer_loggro_reference/clientes
### Description
Allows the registration of one or multiple customers. Each request can contain multiple records, and each will be validated individually before processing. The service returns a list of results indicating whether each customer was created successfully or encountered errors.
### Method
POST
### Endpoint
/websites/developer_loggro_reference/clientes
### Parameters
#### Request Body
- **clientes** (array) - Required - A list of customer objects to be created.
- **cliente** (object) - Required - Represents a single customer.
- **nombre** (string) - Required - The name of the customer.
- **email** (string) - Required - The email address of the customer.
- **telefono** (string) - Optional - The phone number of the customer.
### Request Example
```json
{
"clientes": [
{
"nombre": "Juan Perez",
"email": "juan.perez@example.com",
"telefono": "1234567890"
},
{
"nombre": "Maria Garcia",
"email": "maria.garcia@example.com"
}
]
}
```
### Response
#### Success Response (200)
- **resultados** (array) - A list of results for each customer processed.
- **identificador** (string) - The unique identifier of the customer if created successfully.
- **estado** (string) - The status of the operation (e.g., 'creado', 'error').
- **mensaje** (string) - A message describing the result or error.
#### Response Example
```json
{
"resultados": [
{
"identificador": "cust_abc123",
"estado": "creado",
"mensaje": "Cliente registrado exitosamente."
},
{
"estado": "error",
"mensaje": "El campo email es obligatorio."
}
]
}
```
```
--------------------------------
### Get Home Delivery Invoices - cURL Example
Source: https://developer.loggro.com/reference/get_invoices
Example cURL request to fetch only invoices that include home delivery, optionally filtering by a specific delivery provider like 'RAPPI'. Requires authentication.
```bash
curl -X GET "http://localhost:8000/invoices?onlyDelivery=true&deliveryProvider=RAPPI" \
-H "Authorization: Bearer tu_token_aqui"
```
--------------------------------
### Successful Third-Party Creation Response (JSON)
Source: https://developer.loggro.com/reference/creardocumentocxp
This JSON example illustrates a successful response when multiple third parties are created. It includes the identification, a success message, and a boolean indicating the operation's success for each third party.
```json
[
{
"identificacion": "EA-200325101245",
"mensaje": "El documento FAVE-12 fue enviado correctamente para su creación, Control: EA-200325101245",
"operacionExitosa": true
}
]
```
--------------------------------
### Loggro API: Multi-Business Consolidated Product Report
Source: https://developer.loggro.com/reference/get_reports-reportsalesbyproduct
Example demonstrating how users with multiple businesses can obtain a consolidated product sales report. This requires appropriate authentication and potentially specific parameters not detailed here.
```curl
curl -X GET "http://localhost:8000/reports/reportSalesByProduct?dateInitISO=2025-08-01T00:00:00.000Z&dateEndISO=2025-08-06T23:59:59.999Z" \
-H "Authorization: Bearer tu_token_aqui"
```
--------------------------------
### Loggro API cURL GET Request Example
Source: https://developer.loggro.com/reference/vinculados
This snippet demonstrates how to make a GET request to the Loggro API to retrieve employee information. It specifies the URL, the HTTP method, and the 'accept' header for JSON responses.
```shell
curl --request GET \
--url https://api.loggro.com/apik/loggro-nomina/vinculados/integracion/empleado/CC/idEmpleado \
--header 'accept: application/json'
```
--------------------------------
### Curl Example: Get Delivery Sales Report
Source: https://developer.loggro.com/reference/get_reports-reportsalesinvoices
This cURL example shows how to filter sales reports to include only delivery orders within the last week. It also demonstrates setting a limit for the number of results.
```curl
curl -X GET "http://localhost:8000/reports/reportSalesInvoices?onlyDelivery=true&dateInit=2025-07-30T00:00:00.000Z&dateEnd=2025-08-06T23:59:59.999Z&limit=200" \
-H "Authorization: Bearer tu_token_aqui"
```
--------------------------------
### Ejemplo de solicitud Ruby para obtener productos
Source: https://developer.loggro.com/reference/productos
Ejemplo de cómo realizar una solicitud GET para obtener todos los productos usando Ruby con la librería 'net/http'. Requiere un token de autenticación Bearer.
```ruby
require 'net/http'
require 'uri'
require 'json'
def get_all_products(token)
uri = URI.parse('https://api.pirpos.com/products')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri)
request['Authorization'] = "Bearer #{token}"
request['Accept'] = 'application/json'
response = http.request(request)
if response.code.to_i >= 400
raise "HTTP error: #{response.code} - #{response.body}"
end
JSON.parse(response.body)
end
# Ejemplo de uso:
# user_token = 'YOUR_BEARER_TOKEN'
# begin
# products = get_all_products(user_token)
# puts products
# rescue => e
# puts "Error: #{e.message}"
# end
```