Autenticacion 6 metodos Base de conocimiento 3 metodos Inventario 6 metodos Ventas 10 metodos Compras 4 metodos Contabilidad 5 metodos Reporteria 5 metodos

Reporteria

Panel y reportes operativos por modulo con KPIs y series para dashboards.

Base URL: https://troyansys.com/api/v1

GET

Dashboard de reportes

Devuelve KPI y series para graficos del panel principal.

Endpoint Bearer
https://troyansys.com/api/v1/reports/dashboard
Endpoint API Key
https://troyansys.com/api/v1/company/reports/dashboard

Ejemplos de uso

Bearer
cURL
curl -X GET "https://troyansys.com/api/v1/reports/dashboard" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Company-Id: 1"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/reports/dashboard', [
    'headers' => [
        'Accept' => 'application/json',
        'Authorization' => 'Bearer {token}',
        'X-Company-Id' => '1'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/reports/dashboard");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "{token}");
request.Headers.Add("X-Company-Id", "1");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
API Key
cURL
curl -X GET "https://troyansys.com/api/v1/company/reports/dashboard" \
  -H "Accept: application/json" \
  -H "X-API-Key: {api_key_empresa}"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/reports/dashboard', [
    'headers' => [
        'Accept' => 'application/json',
        'X-API-Key' => '{api_key_empresa}'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/reports/dashboard");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("X-API-Key", "{api_key_empresa}");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Respuesta esperada

{
    "kpis": {
        "sales_month": 2100.25,
        "collections_month": 1330,
        "purchases_month": 840.1,
        "active_products": 120,
        "stock_value": 18000,
        "draft_entries": 2,
        "available_advances": 320,
        "pending_receivables": 760.15
    },
    "charts": {
        "labels": [
            "Sep 2025",
            "Oct 2025"
        ],
        "sales": [
            1200.5,
            2100.25
        ],
        "purchases": [
            730,
            840.1
        ],
        "top_products": {
            "labels": [
                "SERV-HOSTING",
                "DOM-PRO"
            ],
            "values": [
                540.1,
                420
            ]
        }
    }
}
GET

Reporte de ventas

Obtiene ventas filtradas y resumen de totales.

Endpoint Bearer
https://troyansys.com/api/v1/reports/sales
Endpoint API Key
https://troyansys.com/api/v1/company/reports/sales

Parametros Query

Campo Tipo Req. Descripcion
per_page integer No Cantidad por pagina.
type string No invoice, sales_order, quotation.
status string No draft, issued, cancelled.
customer_id integer No Filtro por cliente.
date_from date No Desde YYYY-MM-DD.
date_to date No Hasta YYYY-MM-DD.

Ejemplos de uso

Bearer
cURL
curl -X GET "https://troyansys.com/api/v1/reports/sales?per_page=20&type=invoice&status=issued" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Company-Id: 1"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/reports/sales?per_page=20&type=invoice&status=issued', [
    'headers' => [
        'Accept' => 'application/json',
        'Authorization' => 'Bearer {token}',
        'X-Company-Id' => '1'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/reports/sales?per_page=20&type=invoice&status=issued");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "{token}");
request.Headers.Add("X-Company-Id", "1");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
API Key
cURL
curl -X GET "https://troyansys.com/api/v1/company/reports/sales?per_page=20&type=invoice&status=issued" \
  -H "Accept: application/json" \
  -H "X-API-Key: {api_key_empresa}"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/reports/sales?per_page=20&type=invoice&status=issued', [
    'headers' => [
        'Accept' => 'application/json',
        'X-API-Key' => '{api_key_empresa}'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/reports/sales?per_page=20&type=invoice&status=issued");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("X-API-Key", "{api_key_empresa}");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Respuesta esperada

{
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 20,
        "total": 2
    },
    "summary": {
        "docs": 2,
        "subtotal": 80,
        "tax": 12,
        "total": 92,
        "payment": {
            "payable_docs": 2,
            "payable_total": 92,
            "paid_total": 60,
            "pending_total": 32,
            "paid_docs": 1,
            "partial_docs": 1,
            "pending_docs": 0,
            "applied_advances": 10,
            "excess_as_advance": 2,
            "excess_as_tip": 1
        }
    },
    "data": [
        {
            "id": 120,
            "series": "001-001",
            "number": "000000120",
            "total": "46.0000",
            "paid_amount": 30,
            "pending_balance": 16,
            "payment_status": "partial"
        }
    ]
}
GET

Reporte de inventario

Consulta stock valorizado con filtros por bodega/producto/categoria.

Endpoint Bearer
https://troyansys.com/api/v1/reports/inventory
Endpoint API Key
https://troyansys.com/api/v1/company/reports/inventory

Parametros Query

Campo Tipo Req. Descripcion
per_page integer No Cantidad por pagina.
warehouse_id integer No Filtro por bodega.
product_id integer No Filtro por producto.
category_id integer No Filtro por categoria.
search string No Filtro por nombre o SKU.

Ejemplos de uso

Bearer
cURL
curl -X GET "https://troyansys.com/api/v1/reports/inventory?warehouse_id=1&search=lapiz" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Company-Id: 1"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/reports/inventory?warehouse_id=1&search=lapiz', [
    'headers' => [
        'Accept' => 'application/json',
        'Authorization' => 'Bearer {token}',
        'X-Company-Id' => '1'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/reports/inventory?warehouse_id=1&search=lapiz");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "{token}");
request.Headers.Add("X-Company-Id", "1");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
API Key
cURL
curl -X GET "https://troyansys.com/api/v1/company/reports/inventory?warehouse_id=1&search=lapiz" \
  -H "Accept: application/json" \
  -H "X-API-Key: {api_key_empresa}"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/reports/inventory?warehouse_id=1&search=lapiz', [
    'headers' => [
        'Accept' => 'application/json',
        'X-API-Key' => '{api_key_empresa}'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/reports/inventory?warehouse_id=1&search=lapiz");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("X-API-Key", "{api_key_empresa}");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Respuesta esperada

{
    "summary": {
        "total_qty": 280.5,
        "total_value": 1240.1,
        "low_stock_items": 8,
        "zero_stock_items": 3
    },
    "data": [
        {
            "id": 55,
            "warehouse_id": 1,
            "product_id": 10,
            "quantity": "120.000",
            "stock_alert_code": "ok",
            "stock_alert_label": "Normal"
        }
    ]
}
GET

Reporte de compras

Obtiene compras filtradas y resumen de totales.

Endpoint Bearer
https://troyansys.com/api/v1/reports/purchases
Endpoint API Key
https://troyansys.com/api/v1/company/reports/purchases

Parametros Query

Campo Tipo Req. Descripcion
per_page integer No Cantidad por pagina.
type string No purchase_order o supplier_invoice.
status string No draft, issued o cancelled.
supplier_id integer No Filtro por proveedor.
date_from date No Desde YYYY-MM-DD.
date_to date No Hasta YYYY-MM-DD.

Ejemplos de uso

Bearer
cURL
curl -X GET "https://troyansys.com/api/v1/reports/purchases?per_page=20&type=supplier_invoice" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Company-Id: 1"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/reports/purchases?per_page=20&type=supplier_invoice', [
    'headers' => [
        'Accept' => 'application/json',
        'Authorization' => 'Bearer {token}',
        'X-Company-Id' => '1'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/reports/purchases?per_page=20&type=supplier_invoice");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "{token}");
request.Headers.Add("X-Company-Id", "1");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
API Key
cURL
curl -X GET "https://troyansys.com/api/v1/company/reports/purchases?per_page=20&type=supplier_invoice" \
  -H "Accept: application/json" \
  -H "X-API-Key: {api_key_empresa}"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/reports/purchases?per_page=20&type=supplier_invoice', [
    'headers' => [
        'Accept' => 'application/json',
        'X-API-Key' => '{api_key_empresa}'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/reports/purchases?per_page=20&type=supplier_invoice");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("X-API-Key", "{api_key_empresa}");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Respuesta esperada

{
    "summary": {
        "docs": 3,
        "subtotal": 900,
        "tax": 108,
        "total": 1008
    },
    "data": [
        {
            "id": 33,
            "series": "001-001",
            "number": "000000041",
            "total": "550.1200"
        }
    ]
}
GET

Reporte contable

Obtiene asientos contables y resumen debito/credito.

Endpoint Bearer
https://troyansys.com/api/v1/reports/accounting
Endpoint API Key
https://troyansys.com/api/v1/company/reports/accounting

Parametros Query

Campo Tipo Req. Descripcion
per_page integer No Cantidad por pagina.
status string No draft o posted.
date_from date No Desde YYYY-MM-DD.
date_to date No Hasta YYYY-MM-DD.

Ejemplos de uso

Bearer
cURL
curl -X GET "https://troyansys.com/api/v1/reports/accounting?status=posted&date_from=2026-02-01&date_to=2026-02-29" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Company-Id: 1"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/reports/accounting?status=posted&date_from=2026-02-01&date_to=2026-02-29', [
    'headers' => [
        'Accept' => 'application/json',
        'Authorization' => 'Bearer {token}',
        'X-Company-Id' => '1'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/reports/accounting?status=posted&date_from=2026-02-01&date_to=2026-02-29");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "{token}");
request.Headers.Add("X-Company-Id", "1");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
API Key
cURL
curl -X GET "https://troyansys.com/api/v1/company/reports/accounting?status=posted&date_from=2026-02-01&date_to=2026-02-29" \
  -H "Accept: application/json" \
  -H "X-API-Key: {api_key_empresa}"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/reports/accounting?status=posted&date_from=2026-02-01&date_to=2026-02-29', [
    'headers' => [
        'Accept' => 'application/json',
        'X-API-Key' => '{api_key_empresa}'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/reports/accounting?status=posted&date_from=2026-02-01&date_to=2026-02-29");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("X-API-Key", "{api_key_empresa}");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Respuesta esperada

{
    "summary": {
        "entries": 14,
        "debit_total": 10220.5,
        "credit_total": 10220.5
    },
    "data": [
        {
            "id": 20,
            "entry_date": "2026-02-22",
            "status": "posted"
        }
    ]
}