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.
Acceso por usuario cliente (Bearer) y por empresa (API Key), incluyendo contexto multiempresa.
Base URL: https://troyansys.com/api/v1
Genera token Bearer para consumir la API con usuario cliente.
| Campo | Tipo | Req. | Descripcion |
|---|---|---|---|
| string(email) | Si | Correo del usuario cliente. | |
| password | string | Si | Contrasena del usuario cliente. |
| device_name | string | No | Nombre del dispositivo cliente. |
curl -X POST "https://troyansys.com/api/v1/auth/login" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"email": "demo@empresa.ec",
"password": "Demo12345",
"device_name": "mobile-app"
}'
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://troyansys.com/api/v1/auth/login', [
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json'
],
'json' => array (
'email' => 'demo@empresa.ec',
'password' => 'Demo12345',
'device_name' => 'mobile-app',
),
]);
$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.Post, "https://troyansys.com/api/v1/auth/login");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var json = "{\"email\":\"demo@empresa.ec\",\"password\":\"Demo12345\",\"device_name\":\"mobile-app\"}";
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
{
"token": "{token}",
"token_type": "Bearer",
"expires_at": "2026-02-28T18:15:00-05:00",
"user": {
"id": 5,
"name": "Usuario Cliente Demo",
"email": "demo@empresa.ec",
"active_company_id": 1,
"active_modules": [
{
"id": 1,
"code": "inventory",
"name": "Inventario"
},
{
"id": 2,
"code": "sales",
"name": "Ventas"
},
{
"id": 3,
"code": "purchases",
"name": "Compras"
},
{
"id": 4,
"code": "accounting",
"name": "Contabilidad"
},
{
"id": 5,
"code": "reports",
"name": "Reporteria"
}
]
}
}
Webhook publico para notificaciones de pago exitoso/fallido de Payphone en suscripciones.
| Campo | Tipo | Req. | Descripcion |
|---|---|---|---|
| transactionStatus | string | No | Estado de la transaccion enviado por Payphone. |
| reference | string | No | Referencia del intento de cobro o suscripcion. |
| amount | numeric | No | Monto reportado por Payphone. |
curl -X POST "https://troyansys.com/api/v1/payphone/subscription/webhook" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"transactionStatus": "Approved",
"reference": "SUB-PLAN-PREMIUM-20260317-001",
"amount": 99.9
}'
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://troyansys.com/api/v1/payphone/subscription/webhook', [
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json'
],
'json' => array (
'transactionStatus' => 'Approved',
'reference' => 'SUB-PLAN-PREMIUM-20260317-001',
'amount' => 99.9,
),
]);
$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.Post, "https://troyansys.com/api/v1/payphone/subscription/webhook");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var json = "{\"transactionStatus\":\"Approved\",\"reference\":\"SUB-PLAN-PREMIUM-20260317-001\",\"amount\":99.9}";
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
{
"message": "Webhook procesado"
}
Devuelve usuario autenticado, empresas y modulos activos.
curl -X GET "https://troyansys.com/api/v1/auth/me" \
-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/auth/me', [
'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/auth/me");
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);
{
"id": 5,
"name": "Usuario Cliente Demo",
"email": "demo@empresa.ec",
"company": {
"id": 1,
"name": "Empresa Demo EC"
},
"active_company_id": 1
}
Invalida token Bearer actual.
curl -X POST "https://troyansys.com/api/v1/auth/logout" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Company-Id: 1"
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://troyansys.com/api/v1/auth/logout', [
'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.Post, "https://troyansys.com/api/v1/auth/logout");
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);
{
"message": "Sesion API cerrada."
}
Devuelve datos de empresa y modulos activos usando API key.
curl -X GET "https://troyansys.com/api/v1/company/me" \
-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/me', [
'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/me");
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);
{
"company": {
"id": 1,
"name": "Empresa Demo EC",
"trade_name": "Empresa Demo",
"ruc": "0999999999001"
},
"active_modules": [
{
"id": 1,
"code": "inventory",
"name": "Inventario"
},
{
"id": 2,
"code": "sales",
"name": "Ventas"
}
]
}
Obtiene planes activos, modulos incluidos y plan actual de la empresa activa.
curl -X GET "https://troyansys.com/api/v1/subscription/plans" \
-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/subscription/plans', [
'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/subscription/plans");
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/subscription/plans" \
-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/subscription/plans', [
'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/subscription/plans");
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": [
{
"id": 1,
"name": "Plan Basico",
"code": "plan-basico",
"billing_frequency": "monthly",
"amount": 39.9,
"currency_code": "USD",
"module_codes": [
"sales",
"inventory"
],
"feature_flags": {
"inventory_advanced": false
}
}
],
"meta": {
"current_plan_id": 1,
"current_plan_code": "plan-basico"
}
}
Intenta con otra palabra clave o selecciona un resultado del buscador global.