Codigos HTTP esperados
200/201 exito, 401 auth invalida, 403 modulo/tenant restringido, 422 validacion.
Busca por endpoint, modulo o verbo HTTP (ej: /reports/inventory, ventas, POST).
Actualizado con los endpoints activos de la plataforma. Total disponibles: 73.
| Contexto | Header requerido | Uso |
|---|---|---|
| Usuario cliente (Bearer) | Authorization: Bearer {token} X-Company-Id: {id} |
Apps moviles y sesiones por usuario. |
| Empresa (API Key) | X-API-Key: {api_key_empresa} | Integraciones server-to-server. |
| Base URL | https://troyansys.com/api/v1 | Todos los endpoints documentados usan este prefijo. |
200/201 exito, 401 auth invalida, 403 modulo/tenant restringido, 422 validacion.
POST /documents/invoices: crea comprobante, valida stock y ejecuta flujo SRI/email segun configuracion de empresa.
Cada modulo muestra sus metodos, payloads, ejemplos cURL/PHP/.NET y respuesta esperada.
Consulta de productos y stock por empresa con filtros de busqueda y bodega.
Base URL: https://troyansys.com/api/v1
Obtiene productos paginados con categoria.
| Campo | Tipo | Req. | Descripcion |
|---|---|---|---|
| per_page | integer | No | Cantidad por pagina (1 a 100). |
| search | string | No | Filtro por nombre o SKU. |
curl -X GET "https://troyansys.com/api/v1/products?per_page=20&search=lapiz" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Company-Id: 1"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/products?per_page=20&search=lapiz', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
'X-Company-Id' => '1'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/products?per_page=20&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);
curl -X GET "https://troyansys.com/api/v1/company/products?per_page=20&search=lapiz" \
-H "Accept: application/json" \
-H "X-API-Key: {api_key_empresa}"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/products?per_page=20&search=lapiz', [
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => '{api_key_empresa}'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/products?per_page=20&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);
{
"current_page": 1,
"data": [
{
"id": 10,
"sku": "LPZ-001",
"name": "Lapiz HB",
"sale_price": "0.4500",
"category": {
"id": 3,
"name": "Utiles"
}
}
],
"total": 1
}
Consulta detalle de un producto.
curl -X GET "https://troyansys.com/api/v1/products/10" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Company-Id: 1"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/products/10', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
'X-Company-Id' => '1'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/products/10");
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);
curl -X GET "https://troyansys.com/api/v1/company/products/10" \
-H "Accept: application/json" \
-H "X-API-Key: {api_key_empresa}"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/products/10', [
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => '{api_key_empresa}'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/products/10");
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);
{
"id": 10,
"sku": "LPZ-001",
"name": "Lapiz HB",
"description": "Producto de demostracion",
"sale_price": "0.4500"
}
Consulta stock por bodega y producto.
| Campo | Tipo | Req. | Descripcion |
|---|---|---|---|
| per_page | integer | No | Cantidad por pagina. |
| warehouse_id | integer | No | Filtro por deposito/bodega. |
| product_id | integer | No | Filtro por producto. |
curl -X GET "https://troyansys.com/api/v1/stocks?per_page=20&warehouse_id=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Company-Id: 1"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/stocks?per_page=20&warehouse_id=1', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
'X-Company-Id' => '1'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/stocks?per_page=20&warehouse_id=1");
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);
curl -X GET "https://troyansys.com/api/v1/company/stocks?per_page=20&warehouse_id=1" \
-H "Accept: application/json" \
-H "X-API-Key: {api_key_empresa}"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/stocks?per_page=20&warehouse_id=1', [
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => '{api_key_empresa}'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/stocks?per_page=20&warehouse_id=1");
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);
{
"current_page": 1,
"data": [
{
"id": 55,
"warehouse_id": 1,
"product_id": 10,
"quantity": "120.000",
"warehouse": {
"id": 1,
"name": "Bodega Principal",
"code": "BOD-001"
},
"product": {
"id": 10,
"name": "Lapiz HB",
"sku": "LPZ-001"
}
}
],
"total": 1
}
Obtiene bodegas disponibles para inventario/ventas/compras.
| Campo | Tipo | Req. | Descripcion |
|---|---|---|---|
| per_page | integer | No | Cantidad por pagina. |
| include_inactive | boolean | No | Incluye bodegas inactivas si es true. |
curl -X GET "https://troyansys.com/api/v1/warehouses?per_page=20" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Company-Id: 1"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/warehouses?per_page=20', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
'X-Company-Id' => '1'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/warehouses?per_page=20");
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);
curl -X GET "https://troyansys.com/api/v1/company/warehouses?per_page=20" \
-H "Accept: application/json" \
-H "X-API-Key: {api_key_empresa}"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/warehouses?per_page=20', [
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => '{api_key_empresa}'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/warehouses?per_page=20");
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);
{
"current_page": 1,
"data": [
{
"id": 1,
"code": "BOD-001",
"name": "Bodega Principal",
"is_active": true
}
],
"total": 1
}
Devuelve cantidad disponible por producto/variante en una bodega.
| Campo | Tipo | Req. | Descripcion |
|---|---|---|---|
| warehouse_id | integer | Si | Bodega a consultar. |
| product_id | string|integer | No | Producto o combinacion product_id|variant_id. |
| product_variant_id | integer | No | Variante del producto. |
| product_ids[] | array | No | Lista de productos. |
| variant_ids[] | array | No | Lista de variantes. |
curl -X GET "https://troyansys.com/api/v1/stocks/availability?warehouse_id=1&product_id=10%7C31" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Company-Id: 1"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/stocks/availability?warehouse_id=1&product_id=10%7C31', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
'X-Company-Id' => '1'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/stocks/availability?warehouse_id=1&product_id=10%7C31");
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);
curl -X GET "https://troyansys.com/api/v1/company/stocks/availability?warehouse_id=1&product_id=10%7C31" \
-H "Accept: application/json" \
-H "X-API-Key: {api_key_empresa}"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/stocks/availability?warehouse_id=1&product_id=10%7C31', [
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => '{api_key_empresa}'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/stocks/availability?warehouse_id=1&product_id=10%7C31");
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);
{
"data": {
"warehouse_id": 1,
"items": [
{
"product_id": 10,
"product_variant_id": 31,
"quantity": 7
}
]
}
}
Retorna compras historicas de un producto con evolucion de costos.
| Campo | Tipo | Req. | Descripcion |
|---|---|---|---|
| per_page | integer | No | Cantidad por pagina. |
| date_from | date | No | Desde YYYY-MM-DD. |
| date_to | date | No | Hasta YYYY-MM-DD. |
| supplier_id | integer | No | Filtro por proveedor. |
| warehouse_id | integer | No | Filtro por bodega. |
curl -X GET "https://troyansys.com/api/v1/products/10/purchase-history?date_from=2026-01-01&date_to=2026-03-31" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Company-Id: 1"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/products/10/purchase-history?date_from=2026-01-01&date_to=2026-03-31', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
'X-Company-Id' => '1'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/products/10/purchase-history?date_from=2026-01-01&date_to=2026-03-31");
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);
curl -X GET "https://troyansys.com/api/v1/company/products/10/purchase-history?date_from=2026-01-01&date_to=2026-03-31" \
-H "Accept: application/json" \
-H "X-API-Key: {api_key_empresa}"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/products/10/purchase-history?date_from=2026-01-01&date_to=2026-03-31', [
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => '{api_key_empresa}'
],
]);
$data = json_decode((string) $response->getBody(), true);
print_r($data);
using System.Net.Http.Headers;
using System.Text;
var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/products/10/purchase-history?date_from=2026-01-01&date_to=2026-03-31");
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);
{
"summary": {
"lines_count": 5,
"latest_cost": 3.55,
"average_cost": 3.21,
"min_cost": 2.95,
"max_cost": 3.8
},
"data": [
{
"id": 101,
"date": "2026-03-01",
"quantity": 20,
"unit_cost": 3.55,
"total_cost": 71,
"variation_percent_vs_previous": 4.41
}
]
}
Intenta con otra palabra clave o selecciona un resultado del buscador global.