Subscriptions
Subscriptions endpoints of the Zanfia Workspace API, with schemas and code samples.
Recurring-revenue health: failed subscription charges with live Stripe dunning state (and a one-call retry on the customer's current card), customers on manual-renewal plans whose access lapses soon, and subscriptions set to cancel at period end. Read models only - the same data the dashboard's Orders views show; the retry re-charges the failed Stripe invoice on your connected account. All routes require a Authorization: Bearer header — see Authentication.
Failed subscription payments
/subscriptions/failed-paymentsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Response Body
application/json
application/json
curl -X GET "https://example.com/subscriptions/failed-payments"{ "items": [ { "orderId": "string", "invoiceId": "string", "clientEmail": "string", "customerName": "string", "productId": "string", "productName": "string", "kind": "subscription", "paymentCycle": 0, "totalInstallments": 0, "reason": "insufficient_funds", "declineCode": "string", "amountMinor": 0, "currency": "string", "attempts": 0, "lastFailedAtMs": 0, "invoiceStatus": "string", "attemptCount": 0, "nextPaymentAttempt": 0, "hostedInvoiceUrl": "string", "retriable": true } ], "stripeConnected": true}{ "error": "string", "message": "string"}Retry a failed subscription payment
/subscriptions/failed-payments/{invoiceId}/retryAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Path Parameters
Response Body
application/json
application/json
curl -X POST "https://example.com/subscriptions/failed-payments/string/retry"{ "status": "paid", "message": "string", "hostedInvoiceUrl": "string"}{ "error": "string", "message": "string"}Upcoming manual renewals
/subscriptions/upcoming-renewalsAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Response Body
application/json
application/json
curl -X GET "https://example.com/subscriptions/upcoming-renewals"{ "items": [ { "clientId": "string", "clientEmail": "string", "customerName": "string", "productId": "string", "productName": "string", "currentPeriodEnd": 0, "daysLeft": 0, "renewalLink": "string", "lastReminderAtMs": 0 } ]}{ "error": "string", "message": "string"}Subscriptions ending at period end
/subscriptions/endingAuthorization
bearerAuth API key from Dashboard → Integrations → API, MCP and CLI.
In: header
Response Body
application/json
application/json
curl -X GET "https://example.com/subscriptions/ending"{ "items": [ { "subscriptionId": "string", "clientId": "string", "clientEmail": "string", "customerName": "string", "productId": "string", "productName": "string", "amountMinor": 0, "currency": "string", "recurring": { "interval_count": 0, "trial_period_days": 0, "interval": "day", "endAccessStrategy": "cancel" }, "currentPeriodEnd": 0, "daysLeft": 0 } ]}{ "error": "string", "message": "string"}Was this article helpful?

