Autenticación

SmartAPI usa Bearer Token para autenticar todas las peticiones.

Obtener tu API Key

  1. Ve a admin.smartapp.com.co 
  2. Inicia sesión con tus credenciales
  3. Navega a Settings → API Keys
  4. Copia tu API Key

Usar la API Key

Incluye el token en el header Authorization de cada petición.

cURL

curl -H "Authorization: Bearer sk_live_abc123..." \
  https://emision.smartapp.com.co/api/v1/service/invoice

Python

import requests
 
headers = {"Authorization": "Bearer sk_live_abc123..."}
resp = requests.get("https://emision.smartapp.com.co/api/v1/service/invoice", headers=headers)

PHP

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://emision.smartapp.com.co/api/v1/service/invoice");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer sk_live_abc123..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Node.js

const resp = await fetch("https://emision.smartapp.com.co/api/v1/service/invoice", {
  headers: { Authorization: "Bearer sk_live_abc123..." }
});

C#

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "sk_live_abc123...");
var response = await client.GetAsync("https://emision.smartapp.com.co/api/v1/service/invoice");

Java

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://emision.smartapp.com.co/api/v1/service/invoice"))
    .header("Authorization", "Bearer sk_live_abc123...")
    .build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());

Errores de autenticación

CódigoErrorSolución
401Token inválido o expiradoVerifica tu API Key en Settings
401Tenant no habilitadoCompleta el onboarding
403Scope insuficienteRevisa los permisos de tu API Key

Rate Limits

Seguridad