Skip to content

Authentication

All requests to the TreasuryHub API are authenticated using two HTTP headers: X-Client-Id and X-Access-Token. This is a machine-to-machine (H2H) integration. There is no OAuth flow, no Bearer token, and no end-user authentication layer.

EnvironmentBase URLToken expirationCredential management
Productionhttps://api.gateway.treasuryhub.aiDefined by client in PortalTreasuryHub Portal
Sandboxhttps://sandbox.api.gateway.treasuryhub.aiNever expireProvided by TreasuryHub

Tokens from one environment do not work in the other.

Every request — including GET — must include all three headers:

X-Client-Id: {{tenant_id}}
X-Access-Token: {{api_key}}
Content-Type: application/json

X-Client-Id identifies the tenant. Client and Tenant refer to the same concept throughout this API.

PrefixEnvironment
th_live_Production
th_test_Sandbox

Examples:

  • Production: th_live_xxxxxxxxxxxx
  • Sandbox: th_test_xxxxxxxxxxxx
  1. Request manual creation of a Client and credentials — there is no automated provisioning in sandbox.
  2. Provide a fixed IP address — the sandbox enforces an IP allowlist at tenant level.
  3. Your X-Access-Token does not expire in sandbox.
  1. Log in to the TreasuryHub Portal.
  2. Create a client (tenant) and generate credentials.
  3. Configure token expiration and allowed IP ranges.
  4. Token expiration is defined by the client; a token from another environment will not work.
Terminal window
curl -X POST https://sandbox.api.gateway.treasuryhub.ai/api/h2h/ingestion/financial-events \
-H "X-Client-Id: {{tenant_id}}" \
-H "X-Access-Token: th_test_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"externalId":"ext-001","type":"INTERNAL_PAYIN","countryCode":"MX","currencyCode":"MXN","amount":1500.00,"status":"PENDING","originalStatus":"CREATED","payload":{}}'

The default limit is 1000 requests per minute per tenant. When the limit is exceeded, the API returns 429. Tenants can request a higher limit via the TreasuryHub Portal.

  • Never expose X-Client-Id or X-Access-Token in client-side code or public repositories.
  • Store credentials in environment variables or a secrets manager such as Azure Key Vault.
  • Configure a fixed IP allowlist for all environments.
  • Rotate tokens immediately upon any suspected compromise.
  • Do not share tokens across environments.

Todas las solicitudes a la API de TreasuryHub se autentican mediante dos encabezados HTTP: X-Client-Id y X-Access-Token. Esta es una integración máquina a máquina (H2H). No existe flujo OAuth, ni Bearer token, ni capa de autenticación de usuarios finales.

EntornoURL baseExpiración del tokenGestión de credenciales
Producciónhttps://api.gateway.treasuryhub.aiDefinida por el cliente en el PortalTreasuryHub Portal
Sandboxhttps://sandbox.api.gateway.treasuryhub.aiNo expiranProvista por TreasuryHub

Los tokens de un entorno no funcionan en el otro.

Toda solicitud — incluyendo GET — debe incluir los tres encabezados:

X-Client-Id: {{tenant_id}}
X-Access-Token: {{api_key}}
Content-Type: application/json

X-Client-Id identifica al tenant. Client y Tenant se refieren al mismo concepto en esta API.

PrefijoEntorno
th_live_Producción
th_test_Sandbox

Ejemplos:

  • Producción: th_live_xxxxxxxxxxxx
  • Sandbox: th_test_xxxxxxxxxxxx
  1. Solicitar la creación manual de un Client y sus credenciales — no existe aprovisionamiento automatizado en sandbox.
  2. Proporcionar una dirección IP fija — el sandbox aplica una lista de IPs permitidas a nivel de tenant.
  3. El X-Access-Token no expira en sandbox.
  1. Iniciar sesión en el TreasuryHub Portal.
  2. Crear un client (tenant) y generar las credenciales.
  3. Configurar la expiración del token y los rangos de IP permitidos.
  4. La expiración del token la define el cliente; un token de otro entorno no funcionará.
Terminal window
curl -X POST https://sandbox.api.gateway.treasuryhub.ai/api/h2h/ingestion/financial-events \
-H "X-Client-Id: {{tenant_id}}" \
-H "X-Access-Token: th_test_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"externalId":"ext-001","type":"INTERNAL_PAYIN","countryCode":"MX","currencyCode":"MXN","amount":1500.00,"status":"PENDING","originalStatus":"CREATED","payload":{}}'

El límite predeterminado es de 1000 solicitudes por minuto por tenant. Cuando se supera el límite, la API devuelve 429. Los tenants pueden solicitar un límite más alto a través del TreasuryHub Portal.

  • Nunca expongas X-Client-Id ni X-Access-Token en código del lado del cliente ni en repositorios públicos.
  • Almacena las credenciales en variables de entorno o en un gestor de secretos como Azure Key Vault.
  • Configura una lista de IPs fijas permitidas para todos los entornos.
  • Rota los tokens de inmediato ante cualquier sospecha de compromiso.
  • No compartas tokens entre entornos.