Master Vendor

API Documentation

Public reference untuk integrasi SSO, user sync, dan token verification.

OpenAPI JSON

Base URL

https://vendor.ilectraev.com

OAuth 2.0 Authorization Code + PKCE

Flow login browser untuk aplikasi yang ingin memakai Master Vendor sebagai pusat SSO.

GET /oauth/authorize
QueryWajibKeterangan
response_typeYaGunakan code.
client_idYaClient ID aplikasi terdaftar.
redirect_uriYaHarus persis sama dengan whitelist aplikasi.
scopeTidakContoh: openid email profile.
stateDisarankanNilai anti-CSRF dari aplikasi.
code_challengeYaPKCE S256 challenge.
code_challenge_methodTidakDefault S256.
POST /oauth/token

Kirim sebagai application/x-www-form-urlencoded.

FieldWajibKeterangan
grant_typeYaGunakan authorization_code.
client_idYaClient ID aplikasi.
client_secretYaClient secret aplikasi.
codeYaAuthorization code dari callback.
redirect_uriYaHarus sama dengan request authorize.
code_verifierYaPKCE verifier asli.
{
  "access_token": "eyJ...",
  "token_type": "Bearer",
  "expires_in": 900
}

OIDC Discovery & Token Keys

GET/.well-known/openid-configuration
GET/oauth/jwks

Gunakan JWKS untuk verifikasi JWT RS256 di aplikasi client.

User Info

GET/oauth/userinfo

Membaca user dari session Master Vendor yang sedang login.

App User Management

Endpoint server-to-server memakai Basic Auth dengan client_id sebagai username dan client_secret sebagai password.

POST/api/apps/{app_id}/users/sync
{
  "email": "[email protected]",
  "password": "temporary-password",
  "external_user_id": "supplier-1001"
}
POST/api/apps/{app_id}/users/disable
{
  "external_user_id": "supplier-1001"
}

Operational

GET/healthz
{
  "status": "ok"
}