Skip to main content

System Admin Operations

8 API calls in this section.

Create Recurring Subscription​

Billing & Subscriptions / System Admin Operations
POST/tenant-subscriptions

Creates a new recurring subscription (MONTHLY/ANNUAL). Creates Stripe Customer if needed, creates subscription with inline pricing, and finalizes the invoice immediately.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Body parameters

ParameterTypeDescription
tenant_idstring—
typestring—
amountnumber—
note_publicstring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/tenant-subscriptions" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "tenant_id": "<TENANT_UUID>",6  "type": "MONTHLY",7  "amount": 49.99,8  "note_public": "Standard Plan"9}'

Response examples

No saved response example. Use Try it to inspect a staging response.

Create Unlimited Subscription​

Billing & Subscriptions / System Admin Operations
POST/tenant-subscriptions/unlimited

Creates a one-time 'UNLIMITED' subscription. AUTOMATICALLY CANCELS any existing recurring subscription for the tenant. Generates a one-off invoice. A tenant notification email (tenant_subscription_unlimited_invoice_created) is sent after Stripe invoice finalization webhook.

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Body parameters

ParameterTypeDescription
tenant_idstring—
amountnumber—
note_publicstring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/tenant-subscriptions/unlimited" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "tenant_id": "<TENANT_UUID>",6  "amount": 500,7  "note_public": "Lifetime Access"8}'

Response examples

No saved response example. Use Try it to inspect a staging response.

List Subscriptions​

Billing & Subscriptions / System Admin Operations
GET/tenant-subscriptions

Lists all tenant subscriptions with pagination and filtering.

Query parameters

ParameterTypeDescription
pagestring

Example: 1

limitstring

Example: 10

searchOptionalstring—
statusOptionalstring

Example: ACTIVE

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/tenant-subscriptions?page=1&limit=10" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

No saved response example. Use Try it to inspect a staging response.

Get Subscription Details​

Billing & Subscriptions / System Admin Operations
GET/tenant-subscriptions/:tenantId

Gets detailed subscription info and history for a specific tenant. Response content type is always application/json. If there is an unpaid invoice, response includes data.subscription.pendingInvoice for both recurring (MONTHLY/ANNUAL) and UNLIMITED plans.

Path parameters

ParameterTypeDescription
tenantIdRequiredstring

Example: <TENANT_UUID>

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/tenant-subscriptions/${TENANTID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

No saved response example. Use Try it to inspect a staging response.

Disable Subscription​

Billing & Subscriptions / System Admin Operations
POST/tenant-subscriptions/:id/disable

Manually disables a subscription and sends a tenant admin notification email (tenant_subscription_disabled).

Path parameters

ParameterTypeDescription
idRequiredstring

Example: <SUBSCRIPTION_UUID>

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/tenant-subscriptions/${ID}/disable" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

No saved response example. Use Try it to inspect a staging response.

Reactivate Subscription​

Billing & Subscriptions / System Admin Operations
POST/tenant-subscriptions/:id/reactivate

Reactivates a manually disabled subscription and sends a tenant admin notification email (tenant_subscription_activated).

Path parameters

ParameterTypeDescription
idRequiredstring

Example: <SUBSCRIPTION_UUID>

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/tenant-subscriptions/${ID}/reactivate" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

No saved response example. Use Try it to inspect a staging response.

Update Subscription (Price/Plan)​

Billing & Subscriptions / System Admin Operations
PATCH/tenant-subscriptions/:id

Updates subscription details.

Parameters

  • price_amount: New price (optional)

  • type: 'MONTHLY' or 'ANNUAL' (optional)

  • effective_from: Controls how the change is applied to Stripe (optional, defaults to immediate_no_prorate).

    • immediate_prorated: Updates immediately, Stripe calculates the difference and sends an invoice.

    • immediate_no_prorate: Updates immediately, ignores price difference (no invoice).

    • end_of_period: Updates at the end of the current billing cycle (Schedule). Note: Currently simplified to immediate_no_prorate in code until full Schedule support is added.

When plan/amount changes, a tenant admin notification email (tenant_subscription_plan_changed) is emitted.

Path parameters

ParameterTypeDescription
idRequiredstring

Example: <SUBSCRIPTION_UUID>

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Body parameters

ParameterTypeDescription
price_amountnumber—
typestring—
effective_fromstring—
note_publicstring—
note_internalstring—
Staging
Request
curl
1curl --globoff --request PATCH "https://staging-api.ondi.io/functions/v1/tenant-subscriptions/${ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "price_amount": 150,6  "type": "ANNUAL",7  "effective_from": "immediate_prorated",8  "note_public": "Plan Upgrade",9  "note_internal": "Admin update"10}'

Response examples

No saved response example. Use Try it to inspect a staging response.

Trigger Nightly Sweep (Manual)​

Billing & Subscriptions / System Admin Operations
POST/tenant-subscription-sweep

Manually triggers the subscription status sweep.

Notes

  • If system setting tenant_subscription.enabled=false, the sweep is skipped (no recompute, no emails).

  • When enabled, sweep emits lifecycle and reminder emails (tenant_subscription_warning, tenant_subscription_suspended, tenant_subscription_resumed, tenant_subscription_activated, tenant_subscription_due_reminder, tenant_subscription_suspension_notice).

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/tenant-subscription-sweep" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

No saved response example. Use Try it to inspect a staging response.