Guide
Billing
Subscription plans, subscribing, and the invoices generated along the way. Subscription payments are billed through PawaPay, SwiftGoma's one use of that provider outside of expense payouts. This guide covers three endpoint groups, all under https://api.swiftgoma.com/api/v1.
Plans
Plans are public and readable by anyone — by ID or by slug. Only admins can create plans, update their content, change price (a new price takes effect for new and renewing subscriptions, not retroactively), or activate/deactivate one.
Subscribing
- 1
Subscribe
POST /subscriptions creates a subscription and a PawaPay deposit request. The response includes the deposit reference to poll or await via webhook. - 2
Payment confirms
Once PawaPay confirms the deposit, the subscription becomesACTIVEand an invoice is generated automatically. - 3
Renew, upgrade, or cancel
POST /:id/upgrade moves to a different plan; POST /:id/cancel stops auto-renewal at period end; POST /:id/reactivate undoes a pending cancellation before it takes effect.
Invoices
| Endpoint | Who |
|---|---|
| GET /invoices | The signed-in seller's own invoices |
| GET /invoices/:id/download | PDF download of one invoice |
| GET /invoices/admin | Every invoice platform-wide — admin only |
Admin visibility
Admins can list every subscription platform-wide, inspect one in detail, and pull aggregate stats and revenue figures — useful for the admin dashboard.
Browse the Billing endpoints in the API Reference