All URIs are relative to https://api.paystack.co
| Method | HTTP request | Description |
|---|---|---|
| create | POST /subscription | Create Subscription |
| disable | POST /subscription/disable | Disable Subscription |
| enable | POST /subscription/enable | Enable Subscription |
| fetch | GET /subscription/{code} | Fetch Subscription |
| list | GET /subscription | List Subscriptions |
| manage_email | POST /subscription/{code}/manage/email | Send Update Subscription Link |
| manage_link | POST /subscription/{code}/manage/link | Generate Update Subscription Link |
Response create(customer, plan, authorization=authorization, start_date=start_date)
Create Subscription
- Bearer Authentication (bearerAuth):
import paystack
from pprint import pprint
# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'
customer = 'customer_example' # str | Customer's email address or customer code
plan = 'plan_example' # str | Plan code
# Create Subscription
response = paystack.Subscription.create(
customer,
plan,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| customer | str | Customer's email address or customer code | |
| plan | str | Plan code | |
| authorization | str | If customer has multiple authorizations, you can set the desired authorization you wish to use for this subscription here. If this is not supplied, the customer's most recent authorization would be used | [optional] |
| start_date | datetime | Set the date for the first debit. (ISO 8601 format) e.g. 2017-05-16T00:30:13+01:00 | [optional] |
- Content-Type: application/x-www-form-urlencoded, application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 0 | Server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response disable(code, token)
Disable Subscription
- Bearer Authentication (bearerAuth):
import paystack
from pprint import pprint
# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'
code = 'code_example' # str | Subscription code
token = 'token_example' # str | Email token
# Disable Subscription
response = paystack.Subscription.disable(
code,
token,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| code | str | Subscription code | |
| token | str | Email token |
- Content-Type: application/x-www-form-urlencoded, application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 0 | Server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response enable(code, token)
Enable Subscription
- Bearer Authentication (bearerAuth):
import paystack
from pprint import pprint
# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'
code = 'code_example' # str | Subscription code
token = 'token_example' # str | Email token
# Enable Subscription
response = paystack.Subscription.enable(
code,
token,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| code | str | Subscription code | |
| token | str | Email token |
- Content-Type: application/x-www-form-urlencoded, application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 0 | Server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response fetch(code)
Fetch Subscription
- Bearer Authentication (bearerAuth):
import paystack
from pprint import pprint
# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'
code = 'code_example' # str |
# Fetch Subscription
response = paystack.Subscription.fetch(
code,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| code | str |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 404 | Entity not found | - |
| 0 | Server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response list(per_page=per_page, page=page, plan=plan, customer=customer, _from=_from, to=to)
List Subscriptions
- Bearer Authentication (bearerAuth):
import paystack
from pprint import pprint
# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'
# List Subscriptions
response = paystack.Subscription.list(
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| per_page | int | Number of records to fetch per page | [optional] |
| page | int | The section to retrieve | [optional] |
| plan | str | Plan ID | [optional] |
| customer | str | Customer ID | [optional] |
| _from | datetime | The start date | [optional] |
| to | datetime | The end date | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 404 | Entity not found | - |
| 0 | Server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response manage_email(code)
Send Update Subscription Link
- Bearer Authentication (bearerAuth):
import paystack
from pprint import pprint
# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'
code = 'code_example' # str |
# Send Update Subscription Link
response = paystack.Subscription.manage_email(
code,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| code | str |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 0 | Server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Response manage_link(code)
Generate Update Subscription Link
- Bearer Authentication (bearerAuth):
import paystack
from pprint import pprint
# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'
code = 'code_example' # str |
# Generate Update Subscription Link
response = paystack.Subscription.manage_link(
code,
)
pprint(response)| Name | Type | Description | Notes |
|---|---|---|---|
| code | str |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Request successful | - |
| 401 | Unauthorized operation | - |
| 0 | Server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]