Language

Billing

Generated from LinkSnap's own code: every route in this area, what it takes and how to call it.

Method Path What it does
POST /api/v1/billing/cancel Cancel the active paid subscription at period end.
POST /api/v1/billing/checkout Create a Plugipay checkout session for the selected LinkSnap tier.
POST /api/v1/billing/downgrade /billing/webhook/storlaunch was the legacy receiver back when LinkSnap routed checkout through Storlaunch's Midtrans wrapper.
GET /api/v1/billing/history Billing history (paginated)
GET /api/v1/billing/invoices Alias for history
GET /api/v1/billing/plan Return current user's plan with all limits
GET /api/v1/billing/plans Return all 3 plans with IDR prices (public, no auth needed)
GET /api/v1/billing/subscription Return current subscription details
GET /api/v1/billing/usage Return current usage vs plan limits

Cancel the active paid subscription at period end.

POST /api/v1/billing/cancel

POST /billing/cancel — cancel the active paid subscription at period end.

Example

curl -X POST "https://linksnap.forjio.com/api/v1/billing/cancel" \
  -H "Authorization: ApiKey lsk_live_<your API key>"

Create a Plugipay checkout session for the selected LinkSnap tier.

POST /api/v1/billing/checkout

POST /billing/checkout — create a Plugipay checkout session for the selected LinkSnap tier. Mirrors Huudis's /account/billing/checkout.

Body

Field Type Required Notes
currency any no
plan any no

Example

curl -X POST "https://linksnap.forjio.com/api/v1/billing/checkout" \
  -H "Authorization: ApiKey lsk_live_<your API key>" \
  -H "Content-Type: application/json" \
  -d '{"currency":null,"plan":null}'

/billing/webhook/storlaunch was the legacy receiver back when LinkSnap routed checkout through Storlaunch's Midtrans wrapper.

POST /api/v1/billing/downgrade

/billing/webhook/storlaunch was the legacy receiver back when LinkSnap routed checkout through Storlaunch's Midtrans wrapper. Retired once /checkout moved to Plugipay direct — the replacement /billing/webhook/plugipay handler lives below. /billing/cancel — defined above via plugipayBilling. Legacy handler (billingService.cancelSubscription) retired; its DB-only state flip left the Plugipay subscription active, which meant Plugipay would keep trying to auto-renew after the user hit "cancel". POST /billing/downgrade — downgrade to a lower plan

Body

Field Type Required Notes
plan any no

Example

curl -X POST "https://linksnap.forjio.com/api/v1/billing/downgrade" \
  -H "Authorization: ApiKey lsk_live_<your API key>" \
  -H "Content-Type: application/json" \
  -d '{"plan":null}'

Billing history (paginated)

GET /api/v1/billing/history

GET /billing/history — billing history (paginated)

Query parameters

Name Type Required Notes
cursor any no
limit any no

Example

curl -X GET "https://linksnap.forjio.com/api/v1/billing/history" \
  -H "Authorization: ApiKey lsk_live_<your API key>"

Alias for history

GET /api/v1/billing/invoices

GET /billing/invoices — alias for history

Query parameters

Name Type Required Notes
cursor any no
limit any no

Example

curl -X GET "https://linksnap.forjio.com/api/v1/billing/invoices" \
  -H "Authorization: ApiKey lsk_live_<your API key>"

Return current user's plan with all limits

GET /api/v1/billing/plan

GET /billing/plan — return current user's plan with all limits

Example

curl -X GET "https://linksnap.forjio.com/api/v1/billing/plan" \
  -H "Authorization: ApiKey lsk_live_<your API key>"

Return all 3 plans with IDR prices (public, no auth needed)

GET /api/v1/billing/plans

GET /billing/plans — return all 3 plans with IDR prices (public, no auth needed)

Authentication: Public: the plan catalogue, no credential needed.

Example

curl -X GET "https://linksnap.forjio.com/api/v1/billing/plans" \
  -H "Accept: application/json"

Return current subscription details

GET /api/v1/billing/subscription

GET /billing/subscription — return current subscription details

Example

curl -X GET "https://linksnap.forjio.com/api/v1/billing/subscription" \
  -H "Authorization: ApiKey lsk_live_<your API key>"

Return current usage vs plan limits

GET /api/v1/billing/usage

GET /billing/usage — return current usage vs plan limits

Example

curl -X GET "https://linksnap.forjio.com/api/v1/billing/usage" \
  -H "Authorization: ApiKey lsk_live_<your API key>"
Language