# decoderid/gojek-api-php-native architecture

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

- Interactive diagram: https://gitdiagram.com/decoderid/gojek-api-php-native
- Repository: https://github.com/decoderid/gojek-api-php-native

## Overview

This is a native PHP client for Gojek’s unofficial API. A caller creates the client, requests login, verifies an OTP, and may complete GoPay PIN 2FA before using account, transaction, transfer, and QR-payment operations; the library returns API responses to that caller. The main implementation centralizes endpoint calls and HTTP transport in one class, with endpoint and device settings in constants. README capabilities are included even where their method implementations were not excerpted; those links are documented rather than independently verified in source.

Main entry points: [`src/GojekApi.php`](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php) (HTTP transport), [`Example.php`](https://github.com/decoderid/gojek-api-php-native/blob/main/Example.php) (Usage example), [`src/Constant.php`](https://github.com/decoderid/gojek-api-php-native/blob/main/src/Constant.php) (API settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication"]
  node_auth["Login and OTP<br/>[GojekApi.php]"]
  node_mfa["PIN 2FA<br/>[GojekApi.php]"]
  node_session["Session controls<br/>[GojekApi.php]"]
  node_pinupdate["PIN update<br/>[GojekApi.php]"]
end

subgraph group_account["Account data"]
  node_profile["Profile and balance<br/>[GojekApi.php]"]
  node_history["Transaction history<br/>[GojekApi.php]"]
end

subgraph group_payments["Payments"]
  node_banks["Bank directory<br/>[GojekApi.php]"]
  node_banktransfer["Bank transfer<br/>[GojekApi.php]"]
  node_p2p["GoPay transfer<br/>[GojekApi.php]"]
  node_qrvalidate["QR validation<br/>[GojekApi.php]"]
  node_qrpay["QR payment<br/>[GojekApi.php]"]
end

subgraph group_runtime["Client runtime"]
  node_example["Usage example<br/>[Example.php]"]
  node_transport["HTTP transport<br/>[GojekApi.php]"]
  node_settings["API settings<br/>[Constant.php]"]
end

node_caller(("API caller"))
node_gojek{{"Gojek services"}}

node_caller -->|"runs"| node_example
node_example -->|"starts login"| node_auth
node_example -->|"verifies challenge"| node_mfa
node_auth -->|"sends requests"| node_transport
node_mfa -->|"sends requests"| node_transport
node_session -->|"sends requests"| node_transport
node_profile -.->|"sends requests"| node_transport
node_history -->|"sends requests"| node_transport
node_banks -->|"sends requests"| node_transport
node_banktransfer -->|"sends requests"| node_transport
node_banktransfer -->|"validates bank"| node_banks
node_p2p -->|"sends requests"| node_transport
node_p2p -.->|"validates recipient"| node_qrvalidate
node_qrvalidate -->|"sends requests"| node_transport
node_qrpay -->|"sends requests"| node_transport
node_qrpay -->|"uses validation"| node_qrvalidate
node_pinupdate -->|"sends requests"| node_transport
node_transport -->|"HTTP calls"| node_gojek
node_settings -->|"configures headers"| node_transport

click node_example "https://github.com/decoderid/gojek-api-php-native/blob/main/Example.php"
click node_auth "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_mfa "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_session "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_profile "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_history "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_banks "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_banktransfer "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_p2p "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_qrvalidate "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_qrpay "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_pinupdate "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_transport "https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php"
click node_settings "https://github.com/decoderid/gojek-api-php-native/blob/main/src/Constant.php"

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_auth,node_mfa,node_session,node_pinupdate toneBlue
class node_profile,node_history toneAmber
class node_banks,node_banktransfer,node_p2p,node_qrvalidate,node_qrpay,node_caller toneMint
class node_example,node_transport,node_settings toneRose
class node_gojek toneIndigo
```

## Components

### Authentication

- [Login and OTP](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [PIN 2FA](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [Session controls](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [PIN update](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`

### Account data

- [Profile and balance](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [Transaction history](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`

### Payments

- [Bank directory](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [Bank transfer](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [GoPay transfer](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [QR validation](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [QR payment](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`

### Client runtime

- [Usage example](https://github.com/decoderid/gojek-api-php-native/blob/main/Example.php): `Example.php`
- [HTTP transport](https://github.com/decoderid/gojek-api-php-native/blob/main/src/GojekApi.php): `src/GojekApi.php`
- [API settings](https://github.com/decoderid/gojek-api-php-native/blob/main/src/Constant.php): `src/Constant.php`

### Other components

- **API caller**
- **Gojek services**

## Connections

- API caller → Usage example: runs (evidence: `README.md`)
- Usage example → Login and OTP: starts login (evidence: `Example.php`)
- Usage example → PIN 2FA: verifies challenge (evidence: `Example.php`)
- Login and OTP → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- PIN 2FA → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- Session controls → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- Profile and balance → HTTP transport: sends requests (evidence: `README.md`)
- Transaction history → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- Bank directory → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- Bank transfer → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- Bank transfer → Bank directory: validates bank (evidence: `src/GojekApi.php`)
- GoPay transfer → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- GoPay transfer → QR validation: validates recipient (evidence: `src/GojekApi.php`)
- QR validation → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- QR payment → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- QR payment → QR validation: uses validation (evidence: `src/GojekApi.php`)
- PIN update → HTTP transport: sends requests (evidence: `src/GojekApi.php`)
- HTTP transport → Gojek services: HTTP calls (evidence: `src/GojekApi.php`)
- API settings → HTTP transport: configures headers (evidence: `src/GojekApi.php`)
