System Admin Operations
8 API calls in this section.
Create Recurring Subscription
/tenant-subscriptionsCreates a new recurring subscription (MONTHLY/ANNUAL). Creates Stripe Customer if needed, creates subscription with inline pricing, and finalizes the invoice immediately.
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}'1{2 "tenant_id": "<TENANT_UUID>",3 "type": "MONTHLY",4 "amount": 49.99,5 "note_public": "Standard Plan"6}Request body fields
tenant_idExampleExample field from the request body.
typeExampleExample field from the request body.
amountExampleExample field from the request body.
note_publicExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.
Create Unlimited Subscription
/tenant-subscriptions/unlimitedCreates 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.
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}'1{2 "tenant_id": "<TENANT_UUID>",3 "amount": 500,4 "note_public": "Lifetime Access"5}Request body fields
tenant_idExampleExample field from the request body.
amountExampleExample field from the request body.
note_publicExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.
List Subscriptions
/tenant-subscriptions?page=1&limit=10Lists all tenant subscriptions with pagination and filtering.
1curl --request GET "$ONDI_BASE_URL/tenant-subscriptions?page=1&limit=10" \2 --header "Authorization: Bearer {{access_token}}"Query parameters
pageOptional1
limitOptional10
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.
Get Subscription Details
/tenant-subscriptions/:tenantIdGets 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.
1curl --request GET "$ONDI_BASE_URL/tenant-subscriptions/:tenantId" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
tenantIdRequired<TENANT_UUID>
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.
Disable Subscription
/tenant-subscriptions/:id/disableManually disables a subscription and sends a tenant admin notification email (tenant_subscription_disabled).
1curl --request POST "$ONDI_BASE_URL/tenant-subscriptions/:id/disable" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
idRequired<SUBSCRIPTION_UUID>
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.
Reactivate Subscription
/tenant-subscriptions/:id/reactivateReactivates a manually disabled subscription and sends a tenant admin notification email (tenant_subscription_activated).
1curl --request POST "$ONDI_BASE_URL/tenant-subscriptions/:id/reactivate" \2 --header "Authorization: Bearer {{access_token}}"Path parameters
idRequired<SUBSCRIPTION_UUID>
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.
Update Subscription (Price/Plan)
/tenant-subscriptions/:idUpdates 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.
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}'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<SUBSCRIPTION_UUID>
Request body fields
price_amountExampleExample field from the request body.
typeExampleExample field from the request body.
effective_fromExampleExample field from the request body.
note_publicExampleExample field from the request body.
note_internalExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.
Trigger Nightly Sweep (Manual)
/tenant-subscription-sweepManually 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).
1curl --request POST "$ONDI_BASE_URL/tenant-subscription-sweep" \2 --header "Authorization: Bearer {{access_token}}"Headers
AuthorizationOptionalBearer {{access_token}}
Responses
No response example is available for this endpoint yet.