> For the complete documentation index, see [llms.txt](https://host2host.onibonje.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://host2host.onibonje.com/docs/37-partner-portal.md).

# Partner Portal Architecture

## 1. Overview

**Module:** `h2h-partner-portal` (Next.js) | **Users:** External corporate clients | **Auth:** Keycloak partner realm + MFA

Self-service for transaction status, file delivery, API documentation, and sandbox testing.

***

## 2. Architecture

```mermaid
flowchart LR
  Partner[Corporate User]
  Portal[h2h-partner-portal]
  API[h2h-admin-api / partner BFF]
  RT[h2h-runtime read APIs]
  DB[(transaction_index file_registry)]

  Partner --> Portal
  Portal --> API
  API --> DB
  API --> RT
```

**Read-heavy** — no direct Finacle access from portal.

***

## 3. Features

| Feature             | API / source                               |
| ------------------- | ------------------------------------------ |
| Transaction search  | `GET /partner/transactions?correlationId=` |
| Batch status        | `payment_batch` by batchId                 |
| Download ACK        | Signed URL via file management             |
| Download statements | Signed URL                                 |
| Upload test file    | Sandbox upload URL                         |
| API documentation   | OpenAPI per API product                    |
| API credentials     | Sandbox key management (masked)            |

***

## 4. RBAC

| Role            | Scope                       |
| --------------- | --------------------------- |
| `PARTNER_USER`  | Own `partner_id` only       |
| `PARTNER_ADMIN` | Manage users within partner |

Row-level security on all queries: `WHERE partner_id = :authenticatedPartner`.

***

## 5. OpenAPI / API Products

Per-partner generated OpenAPI from `integration_profile` + API product catalog:

* Payment POST `/v1/payments`
* Status GET `/v1/payments/{correlationId}`
* Idempotency-Key header required

Published to portal documentation tab on profile publish.

***

## 6. Sandbox vs Production

| Aspect      | Sandbox             | Production           |
| ----------- | ------------------- | -------------------- |
| Data        | Mock Finacle / test | Live Finacle         |
| Credentials | Test keys           | Production keys      |
| Portal tab  | Sandbox enabled     | Production read-only |

Environment column filter on all portal queries.

***

## 7. Related Documents

* [06 Personas and RBAC](/docs/06-personas-and-rbac.md)
* [39 API Gateway Architecture](/docs/39-api-gateway-architecture.md)
* [15 File Management System](/docs/15-file-management-system.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://host2host.onibonje.com/docs/37-partner-portal.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
