Skip to content

ImagLend — API Reference

Base URL

https://api.reimaginetech.io/api/v1

Todos los endpoints requieren autenticacion JWT excepto los marcados como publicos.

Headers Estandar

Request Headers

HeaderObligatorioDescripcion
AuthorizationSi (excepto publicos)Bearer {JWT}
Content-TypeSi (en body)application/json o application/merge-patch+json
Idempotency-KeySi (en POST)UUID v4 generado por cliente
If-MatchSi (en PATCH/PUT)ETag del recurso
X-Access-TokenSi (wizard publico)Token de acceso del wizard

Response Headers

HeaderDescripcion
ETagVersion del recurso
X-Request-IdID de trazabilidad
X-Idempotent-Replayedtrue si es respuesta cacheada

Productos de Credito

Listar productos

GET /credit-products

Query params: page, page_size, sort, category, is_active

Response 200:

json
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "code": "microcredito-30d",
      "name": "Microcredito 30 dias",
      "category": "microcredito",
      "amount_config": {
        "min": 100000,
        "max": 750000,
        "default": 300000,
        "step": 50000,
        "currency": "COP"
      },
      "is_active": true,
      "created_at": "2026-01-15T10:00:00Z"
    }
  ],
  "metadata": {
    "request_id": "req-abc123",
    "timestamp": "2026-05-18T10:30:00Z",
    "pagination": {
      "page": 1,
      "page_size": 20,
      "total": 5,
      "total_pages": 1
    }
  }
}

Obtener producto

GET /credit-products/{id}

Response 200:

json
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "code": "microcredito-30d",
    "name": "Microcredito 30 dias",
    "description": "Credito rapido de bajo monto",
    "category": "microcredito",
    "amount_config": {
      "min": 100000,
      "max": 750000,
      "default": 300000,
      "step": 50000,
      "currency": "COP"
    },
    "term_config": {
      "min_days": 15,
      "max_days": 90,
      "options": [15, 30, 60, 90]
    },
    "rate_config": {
      "type": "fixed",
      "rate": 0.076
    },
    "fee_config": {
      "origination": 0.02,
      "platform": 0.005,
      "insurance": 0.01,
      "tax": 0.19
    },
    "requirements": {
      "min_age": 18,
      "max_age": 70,
      "documents": ["cc", "selfie"],
      "validations": ["identity_verification"]
    },
    "validation_flow_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "signature_required": true,
    "signature_type": "electronic",
    "is_active": true,
    "requires_approval": true,
    "row_version": 3,
    "created_at": "2026-01-15T10:00:00Z",
    "updated_at": "2026-03-20T14:30:00Z"
  },
  "metadata": {
    "request_id": "req-def456",
    "timestamp": "2026-05-18T10:30:00Z"
  }
}

Response Header: ETag: "3"

Crear producto (con maker-checker)

POST /credit-products
Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7

Request Body:

json
{
  "code": "consumo-180d",
  "name": "Credito Consumo 180 dias",
  "description": "Credito personal a 6 meses",
  "category": "consumo",
  "amount_config": {
    "min": 1000000,
    "max": 10000000,
    "default": 3000000,
    "step": 500000,
    "currency": "COP"
  },
  "term_config": {
    "min_days": 90,
    "max_days": 180,
    "options": [90, 120, 150, 180]
  },
  "rate_config": {
    "type": "fixed",
    "rate": 0.022
  },
  "fee_config": {
    "origination": 0.015,
    "platform": 0.005,
    "insurance": 0.008,
    "tax": 0.19
  },
  "requirements": {
    "min_age": 21,
    "max_age": 65,
    "documents": ["cc", "selfie", "income_proof"],
    "validations": ["identity_verification", "bureau_check"]
  },
  "validation_flow_id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "signature_required": true,
  "signature_type": "digital"
}

Response 202 (requires_approval = true):

json
{
  "data": {
    "change_request_id": "cr-550e8400-e29b-41d4-a716-446655440099",
    "status": "pending",
    "action": "create",
    "entity_type": "credit_product",
    "requested_by": "user-uuid",
    "created_at": "2026-05-18T10:30:00Z"
  },
  "metadata": {
    "request_id": "req-ghi789",
    "timestamp": "2026-05-18T10:30:00Z"
  }
}

Actualizar producto (PATCH con maker-checker)

PATCH /credit-products/{id}
Content-Type: application/merge-patch+json
If-Match: "3"

Request Body:

json
{
  "rate_config": {
    "rate": 0.082
  },
  "fee_config": {
    "origination": 0.025
  }
}

Response 202 (cambio pendiente de aprobacion):

json
{
  "data": {
    "change_request_id": "cr-uuid",
    "status": "pending",
    "action": "update",
    "entity_type": "credit_product",
    "entity_id": "550e8400-e29b-41d4-a716-446655440001",
    "payload_before": {
      "rate_config": { "rate": 0.076 },
      "fee_config": { "origination": 0.02 }
    },
    "payload_after": {
      "rate_config": { "rate": 0.082 },
      "fee_config": { "origination": 0.025 }
    }
  },
  "metadata": {
    "request_id": "req-jkl012",
    "timestamp": "2026-05-18T10:30:00Z"
  }
}

Activar/Desactivar producto

POST /credit-products/{id}/activate
POST /credit-products/{id}/deactivate
Idempotency-Key: {uuid}

Response 200:

json
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "is_active": true,
    "updated_at": "2026-05-18T10:30:00Z"
  },
  "metadata": {
    "request_id": "req-mno345",
    "timestamp": "2026-05-18T10:30:00Z"
  }
}

Solicitudes de Credito (Applications)

Crear solicitud (autenticado - manual/API)

POST /applications
Authorization: Bearer {jwt}
Idempotency-Key: {uuid}

Request Body:

json
{
  "product_id": "550e8400-e29b-41d4-a716-446655440001",
  "subject_data": {
    "document_type": "cc",
    "document_number": "1234567890",
    "first_name": "Juan",
    "last_name": "Perez",
    "email": "juan@example.com",
    "phone": "+573001234567",
    "birth_date": "1990-05-15"
  },
  "financial_data": {
    "economic_activity": "employed",
    "monthly_income": 3500000,
    "monthly_expenses": 2000000,
    "requested_amount": 500000,
    "requested_term_days": 30,
    "purpose": "gastos_personales"
  },
  "origin": {
    "type": "manual",
    "channel": "admin_panel"
  }
}

Response 201:

json
{
  "data": {
    "id": "app-uuid-001",
    "status": "submitted",
    "product_id": "550e8400-e29b-41d4-a716-446655440001",
    "flow_execution_id": "exec-uuid-001",
    "created_at": "2026-05-18T10:30:00Z",
    "expires_at": "2026-05-21T10:30:00Z"
  },
  "metadata": {
    "request_id": "req-pqr678",
    "timestamp": "2026-05-18T10:30:00Z"
  }
}

Listar solicitudes

GET /applications?status=submitted&page=1&page_size=20
Authorization: Bearer {jwt}

Response 200:

json
{
  "data": [
    {
      "id": "app-uuid-001",
      "product_id": "550e8400-e29b-41d4-a716-446655440001",
      "status": "submitted",
      "subject_data": {
        "first_name": "Juan",
        "last_name": "Perez",
        "document_number": "****7890"
      },
      "simulation_result": {
        "amount": 500000,
        "term_days": 30,
        "total_to_pay": 548500
      },
      "created_at": "2026-05-18T10:30:00Z"
    }
  ],
  "metadata": {
    "request_id": "req-stu901",
    "timestamp": "2026-05-18T10:30:00Z",
    "pagination": {
      "page": 1,
      "page_size": 20,
      "total": 42,
      "total_pages": 3
    }
  }
}

Obtener solicitud

GET /applications/{id}
Authorization: Bearer {jwt}

Response 200: Retorna la solicitud completa con todos los datos.

Decidir solicitud (aprobar/rechazar)

POST /applications/{id}/decide
Authorization: Bearer {jwt}
Idempotency-Key: {uuid}

Request Body:

json
{
  "decision": "approved",
  "notes": "Cumple todos los requisitos",
  "conditions": {
    "max_amount": 500000,
    "max_term_days": 30
  }
}

Response 200:

json
{
  "data": {
    "id": "app-uuid-001",
    "status": "approved",
    "decided_at": "2026-05-18T11:00:00Z",
    "decided_by": "operator-uuid"
  },
  "metadata": {
    "request_id": "req-vwx234",
    "timestamp": "2026-05-18T11:00:00Z"
  }
}

Creditos

Listar creditos

GET /credits?status=active&page=1&page_size=20
Authorization: Bearer {jwt}

Obtener credito

GET /credits/{id}
Authorization: Bearer {jwt}

Response 200:

json
{
  "data": {
    "id": "credit-uuid-001",
    "application_id": "app-uuid-001",
    "product_id": "550e8400-e29b-41d4-a716-446655440001",
    "status": "active",
    "amount": 500000,
    "currency": "COP",
    "term_days": 30,
    "interest_rate": 0.076,
    "fee_breakdown": {
      "origination": 10000,
      "platform": 2500,
      "insurance": 5000,
      "tax": 7220
    },
    "total_to_pay": 548500,
    "origin": {
      "type": "flow",
      "channel": "digital"
    },
    "disbursed_at": "2026-05-18T12:00:00Z",
    "amortization_schedule": [
      {
        "installment_number": 1,
        "principal": 500000,
        "interest": 23780,
        "fees": 17500,
        "tax": 7220,
        "total": 548500,
        "balance_after": 0,
        "due_date": "2026-06-17",
        "status": "pending"
      }
    ]
  },
  "metadata": {
    "request_id": "req-yza567",
    "timestamp": "2026-05-18T12:30:00Z"
  }
}

Desembolsar credito

POST /credits/{id}/disburse
Authorization: Bearer {jwt}
Idempotency-Key: {uuid}

Request Body:

json
{
  "method": "bank_transfer",
  "account_number": "1234567890",
  "bank_code": "007",
  "account_type": "savings"
}

Response 200:

json
{
  "data": {
    "id": "credit-uuid-001",
    "status": "disbursed",
    "disbursement": {
      "id": "disb-uuid-001",
      "amount": 500000,
      "method": "bank_transfer",
      "reference": "TXN-2026051812345",
      "status": "completed",
      "disbursed_at": "2026-05-18T12:00:00Z"
    }
  },
  "metadata": {
    "request_id": "req-bcd890",
    "timestamp": "2026-05-18T12:00:00Z"
  }
}

Pagos

Registrar pago

POST /credits/{credit_id}/payments
Authorization: Bearer {jwt}
Idempotency-Key: {uuid}

Request Body:

json
{
  "amount": 548500,
  "payment_type": "installment",
  "reference": "PAY-2026061700001",
  "installment_number": 1,
  "payment_date": "2026-06-17T10:00:00Z"
}

Response 201:

json
{
  "data": {
    "id": "pay-uuid-001",
    "credit_id": "credit-uuid-001",
    "amount": 548500,
    "payment_type": "installment",
    "reference": "PAY-2026061700001",
    "status": "confirmed",
    "installment_number": 1,
    "payment_date": "2026-06-17T10:00:00Z",
    "created_at": "2026-06-17T10:00:00Z"
  },
  "metadata": {
    "request_id": "req-efg123",
    "timestamp": "2026-06-17T10:00:00Z"
  }
}

Listar pagos de un credito

GET /credits/{credit_id}/payments?page=1&page_size=20
Authorization: Bearer {jwt}

Simulador (Publico)

Obtener configuracion del simulador

GET /public/products/{product_code}/simulator-config

No requiere autenticacion.

Response 200:

json
{
  "data": {
    "product_code": "microcredito-30d",
    "product_name": "Microcredito 30 dias",
    "amount": {
      "min": 100000,
      "max": 750000,
      "default": 300000,
      "step": 50000,
      "currency": "COP"
    },
    "term": {
      "min_days": 15,
      "max_days": 90,
      "options": [15, 30, 60, 90]
    },
    "rates": {
      "interest_rate": 0.076,
      "fees": {
        "items": [
          { "code": "origination", "label": "Originacion", "type": "percentage", "value": 0.02, "taxable": false },
          { "code": "platform", "label": "Plataforma", "type": "percentage", "value": 0.005, "taxable": false },
          { "code": "insurance", "label": "Seguro", "type": "percentage", "value": 0.01, "taxable": false }
        ],
        "tax_rate": 0.19,
        "tax_applies_to": "interest"
      }
    }
  },
  "metadata": {
    "request_id": "req-hij456",
    "timestamp": "2026-05-18T10:30:00Z"
  }
}

Endpoints Publicos del Wizard

Crear solicitud (wizard)

POST /public/applications
Idempotency-Key: {uuid}

Request Body:

json
{
  "product_code": "microcredito-30d",
  "cuenta": {
    "email": "juan@example.com",
    "phone": "+573001234567",
    "accepts_terms": true,
    "accepts_privacy": true
  },
  "identidad": {
    "document_type": "cc",
    "document_number": "1234567890",
    "expedition_date": "2015-03-20",
    "expedition_place": "Bogota"
  },
  "simulation": {
    "amount": 300000,
    "term_days": 30
  }
}

Response 201:

json
{
  "data": {
    "id": "app-uuid-002",
    "access_token": "at-7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "status": "draft",
    "validation_status": "in_progress",
    "created_at": "2026-05-18T10:30:00Z",
    "expires_at": "2026-05-21T10:30:00Z"
  },
  "metadata": {
    "request_id": "req-klm789",
    "timestamp": "2026-05-18T10:30:00Z"
  }
}

Consultar estado de solicitud (wizard)

GET /public/applications/{id}/status
X-Access-Token: {access_token}

Response 200:

json
{
  "data": {
    "id": "app-uuid-002",
    "status": "draft",
    "validation_status": "passed",
    "signature_status": "pending",
    "completed_steps": ["cuenta", "identidad"],
    "current_step": "datos_personales"
  }
}

Actualizar paso del wizard

PATCH /public/applications/{id}/steps/{step_name}
X-Access-Token: {access_token}

Request Body (ejemplo datos_personales):

json
{
  "first_name": "Juan",
  "last_name": "Perez",
  "birth_date": "1990-05-15",
  "gender": "male",
  "marital_status": "single",
  "address": "Calle 100 #15-20",
  "city": "Bogota",
  "department": "Cundinamarca"
}

Response 200:

json
{
  "data": {
    "step": "datos_personales",
    "status": "completed",
    "next_step": "finanzas"
  }
}

Solicitar firma (wizard)

POST /public/applications/{id}/signature-request
X-Access-Token: {access_token}
Idempotency-Key: {uuid}

Response 200:

json
{
  "data": {
    "signature_id": "sig-uuid-001",
    "signing_url": "https://sign.reimaginetech.io/s/sig-uuid-001",
    "expires_at": "2026-05-18T11:30:00Z"
  }
}

Enviar solicitud (wizard)

POST /public/applications/{id}/submit
X-Access-Token: {access_token}
Idempotency-Key: {uuid}

Response 200:

json
{
  "data": {
    "id": "app-uuid-002",
    "status": "submitted",
    "submitted_at": "2026-05-18T10:45:00Z",
    "message": "Solicitud enviada exitosamente"
  }
}

Change Requests (Maker-Checker)

Listar cambios pendientes

GET /change-requests?status=pending
Authorization: Bearer {jwt}

Aprobar cambio

POST /change-requests/{id}/approve
Authorization: Bearer {jwt}
Idempotency-Key: {uuid}

Request Body:

json
{
  "notes": "Cambio aprobado. Tasa competitiva."
}

Rechazar cambio

POST /change-requests/{id}/reject
Authorization: Bearer {jwt}
Idempotency-Key: {uuid}

Request Body:

json
{
  "notes": "Tasa demasiado alta para el mercado actual"
}

Endpoints Internos (Service-to-Service)

Estos endpoints son consumidos por otros microservicios de la plataforma.

Obtener creditos de un sujeto (consumido por ImagID)

GET /internal/subjects/{subject_id}/credits
X-Service-Auth: {service_token}

Notificar resultado de validacion (consumido por ImagFlow via evento)

POST /internal/applications/{id}/validation-result
X-Service-Auth: {service_token}

Request Body:

json
{
  "execution_id": "exec-uuid",
  "result": "approved",
  "details": {
    "identity_score": 0.95,
    "bureau_score": 720
  }
}

Notificar firma completada (consumido por ImagSign via evento)

POST /internal/applications/{id}/signature-completed
X-Service-Auth: {service_token}

Request Body:

json
{
  "signature_id": "sig-uuid-001",
  "signed_at": "2026-05-18T10:40:00Z",
  "document_hash": "sha256:abc123..."
}

Codigos de Error

CodigoHTTPDescripcion
VALIDATION_ERROR400Datos de entrada invalidos
MISSING_IDEMPOTENCY_KEY400Falta header Idempotency-Key
INVALID_ACCESS_TOKEN401Token de wizard invalido o expirado
UNAUTHORIZED401No autenticado
FORBIDDEN403Sin permisos para la operacion
NOT_FOUND404Recurso no encontrado
APPLICATION_EXPIRED409Solicitud expirada
INVALID_STATUS_TRANSITION409Transicion de estado no permitida
CHANGE_REQUEST_EXISTS409Ya existe un cambio pendiente para esta entidad
PRECONDITION_FAILED412ETag mismatch
PRODUCT_INACTIVE422Producto no esta activo
VALIDATION_FAILED422Validacion de identidad fallo
INTERNAL_ERROR500Error interno del servidor

Reimagine Tech LLC — Documentacion Interna