Subskrypcje
Endpointy „Subskrypcje” Zanfia Workspace API — ze schematami i przykładami kodu.
Kondycja przychodu cyklicznego: nieudane płatności subskrypcji z aktualnym stanem windykacji Stripe (i ponowieniem jednym wywołaniem na bieżącej karcie klienta), klienci na planach z odnowieniem ręcznym, którym wkrótce wygasa dostęp, oraz subskrypcje z anulowaniem na koniec okresu. Tylko odczyt - te same dane, które pokazują widoki Zamówień w panelu; ponowienie obciąża nieopłaconą fakturę Stripe na Twoim połączonym koncie. Wszystkie endpointy wymagają nagłówka Authorization: Bearer — zobacz Uwierzytelnianie.
Nieudane płatności subskrypcji
/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"}Ponów nieudaną płatność subskrypcji
/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"}Nadchodzące odnowienia ręczne
/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"}Subskrypcje kończące się z końcem okresu
/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"}Czy ten artykuł był pomocny?

