Garment.id
🇮🇩 Indonesian
  • 🇮🇩 Indonesian
  • 🇺🇸 English
Home
Core APITenant APISupport CenterChangelog
Home
Core APITenant APISupport CenterChangelog
Github
Instagram
|
🇮🇩 Indonesian
  • 🇮🇩 Indonesian
  • 🇺🇸 English
🇮🇩 Indonesian
  • 🇮🇩 Indonesian
  • 🇺🇸 English
  1. Home
  • Introduction
  • 01 - Project Structure
  • 02 - Context Boundaries
  • 03 - Central Auth Runtime
  • 04 - Central Billing
  • 05 - Tenant Runtime
  • 06 - FE Integration Contracts
  • 07 - Security, Middleware, and RLS
  • 08 - Events, Jobs, Listeners, Notifications, Observers
  • 09 - Testing and Quality Gates
  • 10 - Operations Runbook
  • 11 - Architecture Decisions (ADR Ringkas)
  • 12 - API Endpoint Catalog (v1)
  • 13 - Class Catalog by Context
  • 14 - Feature Development Playbook
  • 15 - Migration and Model Conventions
  • 16 - Service, Support, and Trait Contracts
  • 17 - Auth Business Scenarios and Decision Tree
  • 18 - Config Reference and Impact
  • 19 - Migration and Model Cookbook
  • 20 - Billing and Provisioning Business Flows
  • 21 - FE Error Handling Matrix
  • 22 - Incident Playbooks
  • 23 - Data Ownership Matrix
  • 24 - Documentation Governance and Changelog
  • 25 - Tenant Authorization Backend Guide
Home
Core APITenant APISupport CenterChangelog
Home
Core APITenant APISupport CenterChangelog
Github
Instagram
|
🇮🇩 Indonesian
  • 🇮🇩 Indonesian
  • 🇺🇸 English
🇮🇩 Indonesian
  • 🇮🇩 Indonesian
  • 🇺🇸 English
  1. Home

04 - Central Billing

Dokumen ini menjelaskan endpoint, flow, class, dan ownership billing pada central context.

Scope#

Route files:
routes/central/billing-public.php
routes/central/billing.php
Controllers:
app/Http/Controllers/Api/V1/Central/Billing/*
Services:
app/Services/Central/Billing/*
app/Services/Shared/Billing/*

Billing Domain Topology#

Endpoint Matrix#

A. Public Billing#

MethodPathControllerMiddlewareTujuan
GET/api/v1/central/billing/plansPlanCatalogController-Katalog plan untuk pricing publik
POST/api/v1/central/billing/webhooks/{provider}BillingWebhookControllerthrottle:auth-refreshIngest webhook provider

B. Platform Billing Admin#

Semua endpoint memakai:
auth:sanctum
ability:platform:access
MethodPathControllerTujuan
GET/api/v1/central/platform/billing/auditsAuditController@indexList audit billing
GET/api/v1/central/platform/billing/audits/{id}AuditController@showDetail audit
GET/api/v1/central/platform/billing/plansPlanController@indexList plan
PUT/api/v1/central/platform/billing/plans/{planCode}PlanController@upsertCreate/update plan
PUT/api/v1/central/platform/billing/plans/{planCode}/features/{featureKey}PlanController@upsertFeatureValueSet value fitur plan
GET/api/v1/central/platform/billing/featuresFeatureController@indexList fitur billing
PUT/api/v1/central/platform/billing/features/{featureKey}FeatureController@upsertCreate/update fitur

Webhook Processing Flow#

Class Responsibility Map#

PlanCatalogController: public plan list output.
BillingWebhookController: ingress endpoint webhook.
PaymentWebhookService: orchestration validasi, idempotensi, mutasi state.
BillingWebhookForensicService: persistence forensik webhook.
DunningNotificationService: notifikasi dunning flow.
BillingWebhookProviderRegistry: registry adapter provider.
Provider adapters:
ManualWebhookProvider
MidtransWebhookProvider
XenditWebhookProvider

Data Ownership (Central)#

Plan + plan features = central source of truth.
Subscription + invoice lifecycle = central.
Tenant feature usage + overrides = central.
Webhook events + receipts = central.
Tenant runtime hanya konsumsi entitlements dan status dari kebijakan central.
Diubah pada 2026-03-03 22:25:30
Sebelumnya
03 - Central Auth Runtime
Berikutnya
05 - Tenant Runtime
Built with