Billing API

Plan, checkout, invoices and X credit top-ups.

OperationMethod and path
Current plan and subscriptionGET /api/v1/billing/subscription
Start a plan checkoutPOST /api/v1/billing/checkout
Open the payment-details portalPOST /api/v1/billing/portal
Cancel at the end of the periodPOST /api/v1/billing/cancel
Undo a pending cancellationPOST /api/v1/billing/resume
List invoicesGET /api/v1/billing/invoices
Get an invoice with its linesGET /api/v1/billing/invoices/{id}
Billing details printed on invoicesGET /api/v1/billing/details
Update billing detailsPATCH /api/v1/billing/details
Buy X creditPOST /api/v1/billing/credits/top-up
Credit movementsGET /api/v1/billing/credits/ledger
Set the low-balance thresholdPATCH /api/v1/billing/credits/settings
GET /api/v1/billing/subscription

Current plan and subscription

billing.subscription · requires x-api-key

Example

curl -X GET "https://api.siaran.my/api/v1/billing/subscription" \
  -H "x-api-key: $SIAR_API_KEY"

Response 200

8 top-level fields
  • plan string required
    One of: FREE PRO BUSINESS ENTERPRISE
  • interval string nullable
    One of: MONTHLY YEARLY
  • status string nullable
    One of: trialing active canceled incomplete incomplete_expired past_due unpaid paused
  • provider string nullable
    One of: STRIPE CHIP MOCK
  • currentPeriodEnd string nullable date-time
  • trialEndsAt string nullable date-time
  • cancelAtPeriodEnd boolean
  • currency string
POST /api/v1/billing/checkout

Start a plan checkout

billing.checkout · requires x-api-key

Request body application/json

  • plan string required
    One of: FREE PRO BUSINESS ENTERPRISE
  • interval string required
    One of: MONTHLY YEARLY
  • provider string
    One of: STRIPE CHIP
  • coupon string nullable

Example

curl -X POST "https://api.siaran.my/api/v1/billing/checkout" \
  -H "x-api-key: $SIAR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "plan": "FREE",
    "interval": "MONTHLY"
  }'

Response 200

2 top-level fields
  • url string required
  • provider string
POST /api/v1/billing/portal

Open the payment-details portal

billing.portal · requires x-api-key

Example

curl -X POST "https://api.siaran.my/api/v1/billing/portal" \
  -H "x-api-key: $SIAR_API_KEY"

Response 200

2 top-level fields
  • url string required
  • provider string
POST /api/v1/billing/cancel

Cancel at the end of the period

billing.cancel · requires x-api-key

Example

curl -X POST "https://api.siaran.my/api/v1/billing/cancel" \
  -H "x-api-key: $SIAR_API_KEY"

Response 200

8 top-level fields
  • plan string required
    One of: FREE PRO BUSINESS ENTERPRISE
  • interval string nullable
    One of: MONTHLY YEARLY
  • status string nullable
    One of: trialing active canceled incomplete incomplete_expired past_due unpaid paused
  • provider string nullable
    One of: STRIPE CHIP MOCK
  • currentPeriodEnd string nullable date-time
  • trialEndsAt string nullable date-time
  • cancelAtPeriodEnd boolean
  • currency string
POST /api/v1/billing/resume

Undo a pending cancellation

billing.resume · requires x-api-key

Example

curl -X POST "https://api.siaran.my/api/v1/billing/resume" \
  -H "x-api-key: $SIAR_API_KEY"

Response 200

8 top-level fields
  • plan string required
    One of: FREE PRO BUSINESS ENTERPRISE
  • interval string nullable
    One of: MONTHLY YEARLY
  • status string nullable
    One of: trialing active canceled incomplete incomplete_expired past_due unpaid paused
  • provider string nullable
    One of: STRIPE CHIP MOCK
  • currentPeriodEnd string nullable date-time
  • trialEndsAt string nullable date-time
  • cancelAtPeriodEnd boolean
  • currency string
GET /api/v1/billing/invoices

List invoices

billing.invoices · requires x-api-key

Parameters

NameInTypeNotes
offset query integer
limit query integer

Example

curl -X GET "https://api.siaran.my/api/v1/billing/invoices" \
  -H "x-api-key: $SIAR_API_KEY"

Response 200

2 top-level fields
  • items object[] required
    14 fields
    • id string required
    • number string required
    • description string
    • amountCents integer required
    • currency string
    • status string
    • provider string
    • pdfUrl string nullable
    • hostedUrl string nullable
    • periodStart string nullable date-time
    • periodEnd string nullable date-time
    • paidAt string nullable date-time
    • paymentMethod string nullable
    • createdAt string date-time
  • total integer required
GET /api/v1/billing/invoices/{id}

Get an invoice with its lines

billing.invoice · requires x-api-key

Parameters

NameInTypeNotes
id required path string

Example

curl -X GET "https://api.siaran.my/api/v1/billing/invoices/ID" \
  -H "x-api-key: $SIAR_API_KEY"

Response 200

21 top-level fields
  • id string required
  • number string required
  • description string
  • amountCents integer required
  • currency string
  • status string
  • provider string
  • pdfUrl string nullable
  • hostedUrl string nullable
  • periodStart string nullable date-time
  • periodEnd string nullable date-time
  • paidAt string nullable date-time
  • paymentMethod string nullable
  • createdAt string date-time
  • lines object[]
    6 fields
    • description string required
    • quantity integer
    • unitAmountCents integer
    • amountCents integer required
    • periodStart string nullable date-time
    • periodEnd string nullable date-time
  • subtotalCents integer
  • totalCents integer
  • amountPaidCents integer
  • amountDueCents integer
  • billTo object nullable
    4 fields
    • name string nullable
    • email string nullable
    • address string nullable
    • taxId string nullable
  • issuer map<string, any>
GET /api/v1/billing/details

Billing details printed on invoices

billing.details · requires x-api-key

Example

curl -X GET "https://api.siaran.my/api/v1/billing/details" \
  -H "x-api-key: $SIAR_API_KEY"

Response 200

4 top-level fields
  • name string nullable
  • email string nullable
  • address string nullable
  • taxId string nullable
PATCH /api/v1/billing/details

Update billing details

billing.updateDetails · requires x-api-key

Request body application/json

  • name string nullable max length 200
  • email string nullable emailmax length 254
  • address string nullable max length 600
  • taxId string nullable max length 60

Example

curl -X PATCH "https://api.siaran.my/api/v1/billing/details" \
  -H "x-api-key: $SIAR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "Example",
    "email": "[email protected]",
    "address": "string"
  }'

Response 200

4 top-level fields
  • name string nullable
  • email string nullable
  • address string nullable
  • taxId string nullable
POST /api/v1/billing/credits/top-up

Buy X credit

billing.topUp · requires x-api-key

Request body application/json

  • amountUsd integer required ≥ 5≤ 5000
  • provider string
    One of: STRIPE CHIP

Example

curl -X POST "https://api.siaran.my/api/v1/billing/credits/top-up" \
  -H "x-api-key: $SIAR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "amountUsd": 5
  }'

Response 200

2 top-level fields
  • url string required
  • provider string
GET /api/v1/billing/credits/ledger

Credit movements

billing.ledger · requires x-api-key

Parameters

NameInTypeNotes
offset query integer
limit query integer

Example

curl -X GET "https://api.siaran.my/api/v1/billing/credits/ledger" \
  -H "x-api-key: $SIAR_API_KEY"

Response 200

2 top-level fields
  • items object[] required
    7 fields
    • id string required
    • deltaMicroUsd integer required
    • reason string required
    • action string nullable
    • refType string nullable
    • refId string nullable
    • createdAt string date-time
  • total integer required
PATCH /api/v1/billing/credits/settings

Set the low-balance threshold

billing.creditSettings · requires x-api-key

Request body application/json

  • lowBalanceThresholdMicroUsd integer required

Example

curl -X PATCH "https://api.siaran.my/api/v1/billing/credits/settings" \
  -H "x-api-key: $SIAR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "lowBalanceThresholdMicroUsd": 1
  }'

Response 200

A map<string, any>.