Subscriptions & Plans API
Plans
- class djpaystack.api.plans.PlanAPI(client)[source]
Bases:
BaseAPIPlans API
- create(name: str, amount: int, interval: str, description: str | None = None, currency: str | None = None, invoice_limit: int | None = None, send_invoices: bool | None = None, send_sms: bool | None = None) Dict[str, Any][source]
Create plan
- list(per_page: int = 50, page: int | None = None, status: str | None = None, interval: str | None = None, amount: int | None = None) Dict[str, Any][source]
List plans
- update(id_or_code: str, name: str | None = None, amount: int | None = None, interval: str | None = None, description: str | None = None, currency: str | None = None, invoice_limit: int | None = None, send_invoices: bool | None = None, send_sms: bool | None = None) Dict[str, Any][source]
Update plan
Subscriptions
- class djpaystack.api.subscriptions.SubscriptionAPI(client)[source]
Bases:
BaseAPISubscriptions API
- create(customer: str, plan: str, authorization: str | None = None, start_date: str | None = None) Dict[str, Any][source]
Create subscription
Quick Reference
from djpaystack import PaystackClient
client = PaystackClient()
# Plans
client.plans.create(name=..., amount=..., interval=...)
client.plans.list()
client.plans.fetch(id_or_code=...)
client.plans.update(id_or_code=..., name=..., amount=...)
# Subscriptions
client.subscriptions.create(customer=..., plan=..., authorization=...)
client.subscriptions.list()
client.subscriptions.fetch(id_or_code=...)
client.subscriptions.enable(code=..., token=...)
client.subscriptions.disable(code=..., token=...)
client.subscriptions.generate_update_link(code=...)