AI Gateway API Documentation (0.98)

Download OpenAPI specification:

Overview

Purpose

The AI Gateway API provides document processing capabilities for GCash lending applications. It accepts document uploads, processes them through AI-powered analysis, and returns structured data extracted from documents.


Key Features

  • Batch document processing
  • Document type mapping: Bank Statement, Payslip, Electric Utility Bills, Tax Forms, Employment Certificates, etc.
  • OCR data extraction with computed financial metrics
  • Fraud detection and quality assessment scoring
  • Asynchronous callback notifications
  • Comprehensive error handling and validation

Supported Document Types

The API processes multiple document categories with customizable extraction schemas. Extracted fields can be extended beyond the standard set through fine-tuning to meet specific partner requirements.

Document Type Classification Extracted Data
BankStatement PRIMARY Account details, transactions, balances, inferred income
Payslip PRIMARY Employment details, salary breakdown, deductions
BIRForm2303 PRIMARY Tax information and compliance data
CertificateOfEmployment PRIMARY Employment status and company information
ElectricUtilityBillingStatement SUPPORTING Address, payment history
TelcoBill SUPPORTING Contact information, billing details
WaterUtilityBillingStatement SUPPORTING Address verification data

Base URLs

Endpoint URLs are shared with partners individually.

Contact Boost Capital to receive environment-specific endpoint URLs and IP addresses for network configuration.

IP Addresses

The API operates from dedicated IP ranges:

  • Ingress IP: Load balancer address for incoming API requests
  • Egress IPs: Cloud Function addresses for outgoing callbacks

Specific IP addresses are provided during integration setup for firewall whitelisting.


Authentication & Security

The security measures described below represent the baseline configuration. These are not limited and can be extended, modified, or customized individually with partners based on specific security requirements and compliance obligations.

Partners have complete flexibility to choose which authentication and encryption methods to implement.


Mutual TLS

Mutual TLS (mTLS) provides bidirectional authentication for API domains. This setup ensures both the server and client verify each other's identity before any data is exchanged.

Requirements

For successful connection and client authentication:

  • Client Certificate: client.cert file
  • Client Private Key: client.key file

These cryptographic materials are securely shared by Boost Capital. The mTLS policy is configured to reject connections from clients that do not present a valid, trusted certificate.

Implementation

  1. Obtain client.cert and client.key files from Boost Capital via secure channel
  2. Configure HTTPS client to present client certificate during TLS handshake
  3. Server validates client certificate against trusted certificate authority
  4. Secure encrypted communication channel established

Payload Encryption

End-to-end encryption of all API request and response payloads provides an additional layer of data security.

Encryption Specifications

  • Algorithm: AES-256-CBC with PKCS#7 padding
  • Key/IV Management: Encryption keys and Initialization Vectors (IVs) are securely shared by Boost Capital
  • Format: Base64-encoded encrypted JSON payload
  • Content-Type: text/plain (when encryption is enabled)

Implementation Steps

Request Encryption:

  1. Obtain the shared secret key and IV from Boost Capital via secure channel
  2. Construct JSON request payload
  3. Encrypt the JSON payload using AES-256-CBC with the provided key and IV
  4. Base64-encode the encrypted data
  5. Send the base64-encoded string as HTTP POST body with Content-Type: text/plain header

Response Decryption:

  1. Receive response body as base64-encoded string
  2. Base64-decode the response
  3. Decrypt using AES-256-CBC with the same key and IV
  4. Parse the decrypted JSON payload

Important: The request and response examples in this documentation display decrypted JSON for readability. In actual implementation with encryption enabled, payloads must be encrypted and base64-encoded as described above.


OAuth 2.0

The API supports OAuth 2.0 authentication via Google Cloud Identity-Aware Proxy (IAP). This standard ensures only trusted service accounts can obtain access tokens required for API requests.

Requirements

Boost Capital will securely share:

  • Service Account JSON file (e.g., service-account.json)
  • IAP Audience (OAuth 2.0 Client ID)

Implementation Steps

  1. Obtain Credentials: Receive service account JSON and IAP Audience from Boost Capital
  2. Generate ID Token: Use the service account credentials and IAP Audience to obtain a Google-signed ID token
  3. Authenticate Requests: Include the ID token in the Authorization header of every API request:
    Authorization: Bearer {idToken}
    

Token Management

  • ID tokens have limited validity periods and must be refreshed periodically
  • Implement token caching and automatic refresh logic
  • Handle 401 Unauthorized responses by obtaining a new token

Endpoint Reference

API endpoints for document processing and verification. The request body structures and examples shown in this documentation are displayed in decrypted JSON format for readability and ease of implementation. However, when payload encryption is enabled (see Payload Encryption section above), the actual HTTP POST body for all endpoints must be the base64-encoded, AES-256-CBC encrypted plain text string with the Content-Type:text/plain header. The same applies to response bodies - they will be returned as base64-encoded encrypted strings that must be decoded and decrypted using the same key and IV. Partners who choose not to implement payload encryption can send and receive standard JSON payloads with Content-Type:application/json.

Batch Document Upload

Submit a batch of documents for AI-powered processing. This endpoint accepts multiple documents associated with a single application submission and processes them asynchronously.

Processing Flow

  1. Submit documents with pre-signed URLs
  2. Receive immediate acknowledgment (200 OK) with processing status
  3. API processes documents asynchronously
  4. Receive detailed results via callback to your specified URL
Authorizations:
Noneoauth2
Request Body schema: application/json
required
required
object
required
object (Callback)

Responses

Callbacks

Request samples

Content type
application/json
Example
{}

Response samples

Content type
application/json
{
  • "application_id": "550e8400-e29b-41d4-a716-446655440000",
  • "submission_id": "650e8400-e29b-41d4-a716-446655440001",
  • "upload_id": "750e8400-e29b-41d4-a716-446655440002",
  • "status": "PROCESSING",
  • "timestamp": "2025-11-07T14:30:00.123Z"
}

Callback payload samples

Callback
POST: Processing completion callback
Content type
application/json
Example
{
  • "applicationId": "string",
  • "submissionId": "string",
  • "documentId": "string",
  • "documentCategory": "string",
  • "documentType": "BankStatement",
  • "ocrResult": {
    }
}

Application Status Check

Check the processing status of a previously submitted application.

This endpoint provides the current state of document processing for a given application. For detailed processing results including OCR data, fraud scores, and quality metrics, rely on the callback notifications sent to your webhook endpoint.

Use Cases

  • Query processing status before callback delivery
  • Verify completion status for tracking purposes
  • Check processing time metrics
Authorizations:
Noneoauth2
Request Body schema: application/json
required
application_id
required
string <uuid>

Application identifier from batch upload response

Responses

Request samples

Content type
application/json
{
  • "application_id": "550e8400-e29b-41d4-a716-446655440000"
}

Response samples

Content type
application/json
{
  • "application_id": "550e8400-e29b-41d4-a716-446655440000",
  • "submission_id": "650e8400-e29b-41d4-a716-446655440001",
  • "upload_id": "850e8400-e29b-41d4-a716-446655440003",
  • "status": "PROCESSING",
  • "processing_time_ms": 15420,
  • "timestamp": "2025-11-07T14:35:00.123Z"
}