API Reference
The TreasuryHub API is organized around REST. All requests accept and return JSON.
Available resources
Section titled “Available resources”| Resource | Base path | Description |
|---|---|---|
| Financial Events | /api/h2h/ingestion/financial-events | Ingest and manage H2H financial events |
Request conventions
Section titled “Request conventions”All POST, PUT, and PATCH requests must include the header:
Content-Type: application/jsonFor POST requests that create resources, include an Idempotency-Key to safely retry without creating duplicates:
Idempotency-Key: a8098c1a-f86e-11da-bd1a-00112444be1eThe base URL for all API requests:
https://api.gateway.treasuryhub.aiResponse format
Section titled “Response format”Collection responses include a data array and a meta pagination object:
{ "data": [...], "meta": { "total": 100, "page": 1, "per_page": 20, "total_pages": 5 }}Error format
Section titled “Error format”{ "error": { "code": "resource_not_found", "message": "The requested account does not exist." }}Validation errors include a fields object:
{ "error": { "code": "validation_failed", "message": "The request contains invalid parameters.", "fields": { "currency": ["is not a valid ISO 4217 code"], "amount": ["must be greater than 0"] } }}Rate limiting
Section titled “Rate limiting”Rate limiting enforcement and response headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) will be added in a future version of the product.
La API de TreasuryHub está organizada en torno a REST. Todas las solicitudes aceptan y devuelven JSON.
Recursos disponibles
Section titled “Recursos disponibles”| Recurso | Ruta base | Descripción |
|---|---|---|
| Financial Events | /api/h2h/ingestion/financial-events | Ingesta y gestión de eventos financieros H2H |
Convenciones de solicitud
Section titled “Convenciones de solicitud”Todas las solicitudes POST, PUT y PATCH deben incluir el encabezado:
Content-Type: application/jsonPara solicitudes POST que crean recursos, incluye un Idempotency-Key para reintentar de forma segura sin crear duplicados:
Idempotency-Key: a8098c1a-f86e-11da-bd1a-00112444be1eLa URL base para todas las solicitudes a la API:
https://api.gateway.treasuryhub.aiFormato de respuesta
Section titled “Formato de respuesta”Las respuestas de colección incluyen un array data y un objeto de paginación meta:
{ "data": [...], "meta": { "total": 100, "page": 1, "per_page": 20, "total_pages": 5 }}Formato de errores
Section titled “Formato de errores”{ "error": { "code": "resource_not_found", "message": "La cuenta solicitada no existe." }}Los errores de validación incluyen un objeto fields:
{ "error": { "code": "validation_failed", "message": "La solicitud contiene parámetros inválidos.", "fields": { "currency": ["no es un código ISO 4217 válido"], "amount": ["debe ser mayor que 0"] } }}Límites de tasa
Section titled “Límites de tasa”El control de límites de tasa y los encabezados de respuesta (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) se agregarán en una versión futura del producto.