Workspace API

Subskrypcje

Endpointy „Subskrypcje” Zanfia Workspace API — ze schematami i przykładami kodu.

2 min czytaniaOstatnia aktualizacja: 10 wrz 2026

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

GET/subscriptions/failed-payments

Authorization

bearerAuth
AuthorizationBearer <token>

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

POST/subscriptions/failed-payments/{invoiceId}/retry

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

invoiceId*string

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

GET/subscriptions/upcoming-renewals

Authorization

bearerAuth
AuthorizationBearer <token>

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

GET/subscriptions/ending

Authorization

bearerAuth
AuthorizationBearer <token>

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?

Powiązane artykuły

Coś się nie zgadza? Napisz do nas na support@zanfia.com.