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.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/tenant-subscriptions" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --data '{5  "tenant_id": "<TENANT_UUID>",6  "type": "MONTHLY",7  "amount": 49.99,8  "note_public": "Standard Plan"9}'
Request body
json
1{2  "tenant_id": "<TENANT_UUID>",3  "type": "MONTHLY",4  "amount": 49.99,5  "note_public": "Standard Plan"6}

Request body fields

tenant_idExample
string

Example field from the request body.

typeExample
string

Example field from the request body.

amountExample
number

Example field from the request body.

note_publicExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

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.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/tenant-subscriptions/unlimited" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --data '{5  "tenant_id": "<TENANT_UUID>",6  "amount": 500,7  "note_public": "Lifetime Access"8}'
Request body
json
1{2  "tenant_id": "<TENANT_UUID>",3  "amount": 500,4  "note_public": "Lifetime Access"5}

Request body fields

tenant_idExample
string

Example field from the request body.

amountExample
number

Example field from the request body.

note_publicExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

List Subscriptions

Billing & Subscriptions / System Admin Operations
GET/tenant-subscriptions?page=1&limit=10

Lists all tenant subscriptions with pagination and filtering.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/tenant-subscriptions?page=1&limit=10" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

pageOptional
query string

1

limitOptional
query string

10

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

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.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/tenant-subscriptions/:tenantId" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

tenantIdRequired
path string

<TENANT_UUID>

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

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).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/tenant-subscriptions/:id/disable" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

idRequired
path string

<SUBSCRIPTION_UUID>

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

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).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/tenant-subscriptions/:id/reactivate" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

idRequired
path string

<SUBSCRIPTION_UUID>

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

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.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PATCH "$ONDI_BASE_URL/tenant-subscriptions/:id" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --data '{5  "price_amount": 150,6  "type": "ANNUAL",7  "effective_from": "immediate_prorated",8  "note_public": "Plan Upgrade",9  "note_internal": "Admin update"10}'
Request body
json
1{2  "price_amount": 150,3  "type": "ANNUAL",4  "effective_from": "immediate_prorated",5  "note_public": "Plan Upgrade",6  "note_internal": "Admin update"7}

Path parameters

idRequired
path string

<SUBSCRIPTION_UUID>

Request body fields

price_amountExample
number

Example field from the request body.

typeExample
string

Example field from the request body.

effective_fromExample
string

Example field from the request body.

note_publicExample
string

Example field from the request body.

note_internalExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.

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).

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/tenant-subscription-sweep" \2  --header "Authorization: Bearer {{access_token}}"

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

No response example is available for this endpoint yet.