# paymentscanada/api-toolkit architecture

> Architecture diagram of the GitHub repository paymentscanada/api-toolkit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paymentscanada/api-toolkit
- Repository: https://github.com/paymentscanada/api-toolkit

## Overview

Payments Canada API Toolkit is a collection of API consumer examples and reusable API reference artifacts, rather than one deployed application. Its principal user workflow is to choose a language sample, authenticate with consumer credentials, and call FIF or CCIN endpoints; separate Postman collections and OpenAPI specifications support manual exploration and API-contract reference. The Angular sample shows the clearest end-to-end flow, including lookup and extract features. Other language samples are represented as their own implementations. Only relationships supported by the README or shown source/reference index are drawn; unsampled Postman and specification contents are not inferred.

Main entry points: [`code-samples/angular/src/app/app.module.ts`](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/app/app.module.ts) (Application module), [`code-samples/angular/src/app/access-token/access-token.service.ts`](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/app/access-token/access-token.service.ts) (OAuth token service), [`code-samples/angular/src/app/fif/services`](https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/angular/src/app/fif/services) (FIF branch and extracts), [`code-samples/angular/src/app/ccin/services`](https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/angular/src/app/ccin/services) (CCIN lookup and extracts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_angular["Angular sample"]
  node_angular_entry["Angular bootstrap<br/>[main.ts]"]
  node_angular_app["Application module<br/>[app.module.ts]"]
  node_angular_auth["OAuth token service"]
  node_angular_fif["FIF branch and extracts"]
  node_angular_ccin["CCIN lookup and extracts"]
  node_angular_ui["Search and extract views"]
  node_angular_config["API configuration<br/>[environment.ts]"]
end

subgraph group_other_samples["Other samples"]
  node_node_sample["Node.js client samples"]
  node_node_rest["Node REST client<br/>[rest-client.js]"]
  node_node_config["Node API configuration<br/>[config.js]"]
  node_java_sample["Java REST sample"]
  node_kotlin_main["Kotlin sample entry<br/>[Main.kt]"]
  node_kotlin_repo["Kotlin API repository<br/>[ApiRepository.kt]"]
end

subgraph group_collections["Postman collections"]
  node_postman_fif_ccin["FIF and CCIN collections"]
  node_postman_lynx["Lynx collection"]
  node_postman_rtr["RTR collection"]
end

subgraph group_specs["API specifications"]
  node_fif_ccin_specs["FIF and CCIN OpenAPI"]
  node_rtr_specs["RTR OpenAPI"]
end

node_developer(("API consumer"))
node_payments_api{{"Payments Canada API"}}
node_postman_user(("Postman user"))
node_portal_user(("API portal reader"))

node_angular_entry -->|"bootstraps"| node_angular_app
node_angular_app -->|"registers"| node_angular_auth
node_angular_app -->|"registers"| node_angular_fif
node_angular_app -->|"registers"| node_angular_ccin
node_angular_app -->|"declares"| node_angular_ui
node_angular_ui -->|"uses"| node_angular_fif
node_angular_ui -->|"uses"| node_angular_ccin
node_angular_fif -->|"requests token"| node_angular_auth
node_angular_ccin -->|"requests token"| node_angular_auth
node_angular_fif -->|"calls endpoints"| node_payments_api
node_angular_ccin -->|"calls endpoints"| node_payments_api
node_angular_auth -->|"requests token"| node_payments_api
node_angular_config -->|"configures"| node_angular_auth
node_developer -.->|"runs sample"| node_angular_entry
node_node_sample -->|"includes"| node_node_rest
node_node_rest -->|"reads config"| node_node_config
node_node_sample -->|"calls endpoints"| node_payments_api
node_kotlin_main -->|"uses"| node_kotlin_repo
node_kotlin_repo -->|"calls endpoints"| node_payments_api
node_java_sample -.->|"API sample"| node_payments_api
node_postman_user -->|"imports"| node_postman_fif_ccin
node_portal_user -->|"consults"| node_fif_ccin_specs
node_portal_user -->|"consults"| node_rtr_specs

click node_angular_entry "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/main.ts"
click node_angular_app "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/app/app.module.ts"
click node_angular_auth "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/app/access-token/access-token.service.ts"
click node_angular_fif "https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/angular/src/app/fif/services"
click node_angular_ccin "https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/angular/src/app/ccin/services"
click node_angular_ui "https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/angular/src/app"
click node_angular_config "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/environments/environment.ts"
click node_node_sample "https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/nodejs"
click node_node_rest "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/nodejs/rest-client.js"
click node_node_config "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/nodejs/config.js"
click node_java_sample "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/java/src/main/java/ca/payments/example/restclient/RestClientApplication.java"
click node_kotlin_main "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/kotlin/src/main/kotlin/ca/payments/api_sample/kotlin/Main.kt"
click node_kotlin_repo "https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/kotlin/src/main/kotlin/ca/payments/api_sample/kotlin/repository/ApiRepository.kt"
click node_postman_fif_ccin "https://github.com/paymentscanada/api-toolkit/tree/develop/postman-collection/FIF-and-CCIN"
click node_postman_lynx "https://github.com/paymentscanada/api-toolkit/tree/develop/postman-collection/Lynx"
click node_postman_rtr "https://github.com/paymentscanada/api-toolkit/tree/develop/postman-collection/RTR-Sandbox"
click node_fif_ccin_specs "https://github.com/paymentscanada/api-toolkit/tree/develop/swagger-oas/FIF-and-CCIN"
click node_rtr_specs "https://github.com/paymentscanada/api-toolkit/tree/develop/swagger-oas/RTR-Sandbox"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_angular_entry,node_angular_app,node_angular_auth,node_angular_fif,node_angular_ccin,node_angular_ui,node_angular_config,node_postman_user toneBlue
class node_node_sample,node_node_rest,node_node_config,node_java_sample,node_kotlin_main,node_kotlin_repo toneAmber
class node_postman_fif_ccin,node_postman_lynx,node_postman_rtr,node_developer,node_payments_api,node_portal_user toneMint
class node_fif_ccin_specs,node_rtr_specs toneRose
```

## Components

### Angular sample

- [Angular bootstrap](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/main.ts): `code-samples/angular/src/main.ts`
- [Application module](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/app/app.module.ts): `code-samples/angular/src/app/app.module.ts`
- [OAuth token service](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/app/access-token/access-token.service.ts): `code-samples/angular/src/app/access-token/access-token.service.ts`
- [FIF branch and extracts](https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/angular/src/app/fif/services): `code-samples/angular/src/app/fif/services`
- [CCIN lookup and extracts](https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/angular/src/app/ccin/services): `code-samples/angular/src/app/ccin/services`
- [Search and extract views](https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/angular/src/app): `code-samples/angular/src/app`
- [API configuration](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/angular/src/environments/environment.ts): `code-samples/angular/src/environments/environment.ts`

### Other samples

- [Node.js client samples](https://github.com/paymentscanada/api-toolkit/tree/develop/code-samples/nodejs): `code-samples/nodejs`
- [Node REST client](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/nodejs/rest-client.js): `code-samples/nodejs/rest-client.js`
- [Node API configuration](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/nodejs/config.js): `code-samples/nodejs/config.js`
- [Java REST sample](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/java/src/main/java/ca/payments/example/restclient/RestClientApplication.java): `code-samples/java/src/main/java/ca/payments/example/restclient/RestClientApplication.java`
- [Kotlin sample entry](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/kotlin/src/main/kotlin/ca/payments/api_sample/kotlin/Main.kt): `code-samples/kotlin/src/main/kotlin/ca/payments/api_sample/kotlin/Main.kt`
- [Kotlin API repository](https://github.com/paymentscanada/api-toolkit/blob/develop/code-samples/kotlin/src/main/kotlin/ca/payments/api_sample/kotlin/repository/ApiRepository.kt): `code-samples/kotlin/src/main/kotlin/ca/payments/api_sample/kotlin/repository/ApiRepository.kt`

### Postman collections

- [FIF and CCIN collections](https://github.com/paymentscanada/api-toolkit/tree/develop/postman-collection/FIF-and-CCIN): `postman-collection/FIF-and-CCIN`
- [Lynx collection](https://github.com/paymentscanada/api-toolkit/tree/develop/postman-collection/Lynx): `postman-collection/Lynx`
- [RTR collection](https://github.com/paymentscanada/api-toolkit/tree/develop/postman-collection/RTR-Sandbox): `postman-collection/RTR-Sandbox`

### API specifications

- [FIF and CCIN OpenAPI](https://github.com/paymentscanada/api-toolkit/tree/develop/swagger-oas/FIF-and-CCIN): `swagger-oas/FIF-and-CCIN`
- [RTR OpenAPI](https://github.com/paymentscanada/api-toolkit/tree/develop/swagger-oas/RTR-Sandbox): `swagger-oas/RTR-Sandbox`

### Other components

- **API consumer**
- **Payments Canada API**
- **Postman user**
- **API portal reader**

## Connections

- Angular bootstrap → Application module: bootstraps (evidence: `code-samples/angular/src/main.ts`)
- Application module → OAuth token service: registers (evidence: `code-samples/angular/src/app/app.module.ts`)
- Application module → FIF branch and extracts: registers (evidence: `code-samples/angular/src/app/app.module.ts`)
- Application module → CCIN lookup and extracts: registers (evidence: `code-samples/angular/src/app/app.module.ts`)
- Application module → Search and extract views: declares (evidence: `code-samples/angular/src/app/app.module.ts`)
- Search and extract views → FIF branch and extracts: uses (evidence: `code-samples/angular/src/app/fif/components/fif-dprn-search/fif-dprn-search.component.ts`)
- Search and extract views → CCIN lookup and extracts: uses (evidence: `code-samples/angular/src/app/ccin/components/ccin-search/ccin-search.component.ts`)
- FIF branch and extracts → OAuth token service: requests token (evidence: `code-samples/angular/src/app/fif/services/fif-branch/fif-branch.service.ts`)
- CCIN lookup and extracts → OAuth token service: requests token (evidence: `code-samples/angular/src/app/ccin/services/ccin-extracts/ccin-extracts.service.ts`)
- FIF branch and extracts → Payments Canada API: calls endpoints (evidence: `code-samples/angular/src/app/fif/services/fif-extract/fif-extract.service.ts`)
- CCIN lookup and extracts → Payments Canada API: calls endpoints (evidence: `code-samples/angular/src/app/ccin/services/ccin-lookup/ccin-lookup.service.ts`)
- OAuth token service → Payments Canada API: requests token (evidence: `code-samples/angular/src/app/access-token/access-token.service.ts`)
- API configuration → OAuth token service: configures (evidence: `code-samples/angular/src/app/access-token/access-token.service.ts`)
- API consumer → Angular bootstrap: runs sample
- Node.js client samples → Node REST client: includes (evidence: `code-samples/nodejs/index.js`)
- Node REST client → Node API configuration: reads config (evidence: `code-samples/nodejs/rest-client.js`)
- Node.js client samples → Payments Canada API: calls endpoints (evidence: `code-samples/nodejs/rest-client.js`)
- Kotlin sample entry → Kotlin API repository: uses (evidence: `code-samples/kotlin/src/main/kotlin/ca/payments/api_sample/kotlin/Main.kt`)
- Kotlin API repository → Payments Canada API: calls endpoints (evidence: `code-samples/kotlin/src/main/kotlin/ca/payments/api_sample/kotlin/repository/ApiRepository.kt`)
- Java REST sample → Payments Canada API: API sample
- Postman user → FIF and CCIN collections: imports (evidence: `README.md`)
- API portal reader → FIF and CCIN OpenAPI: consults (evidence: `README.md`)
- API portal reader → RTR OpenAPI: consults (evidence: `README.md`)
