# paystack.Subscription All URIs are relative to *https://api.paystack.co* Method | HTTP request | Description ------------- | ------------- | ------------- [**create**](Subscription.md#create) | **POST** /subscription | Create Subscription [**disable**](Subscription.md#disable) | **POST** /subscription/disable | Disable Subscription [**enable**](Subscription.md#enable) | **POST** /subscription/enable | Enable Subscription [**fetch**](Subscription.md#fetch) | **GET** /subscription/{code} | Fetch Subscription [**list**](Subscription.md#list) | **GET** /subscription | List Subscriptions [**manage_email**](Subscription.md#manage_email) | **POST** /subscription/{code}/manage/email | Send Update Subscription Link [**manage_link**](Subscription.md#manage_link) | **POST** /subscription/{code}/manage/link | Generate Update Subscription Link # **create** > Response create(customer, plan, authorization=authorization, start_date=start_date) Create Subscription ### Example * Bearer Authentication (bearerAuth): ```python import paystack from paystack.rest import ApiException from pprint import pprint customer = 'customer_example' # str | Customer's email address or customer code plan = 'plan_example' # str | Plan code authorization = 'authorization_example' # 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 = '2013-10-20T19:20:30+01:00' # datetime | Set the date for the first debit. (ISO 8601 format) e.g. 2017-05-16T00:30:13+01:00 (optional) # Create Subscription response = paystack.Subscription.create(customer, plan, authorization=authorization, start_date=start_date) pprint(response) ``` ### Parameters 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] ### Return type [**Response**](Response.md) ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded, application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Request successful | - | **401** | Unauthorized operation | - | **0** | Server error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **disable** > Response disable(code, token) Disable Subscription ### Example * Bearer Authentication (bearerAuth): ```python import paystack from paystack.rest import ApiException from pprint import pprint code = 'code_example' # str | Subscription code token = 'token_example' # str | Email token # Disable Subscription response = paystack.Subscription.disable(code, token) pprint(response) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code** | **str**| Subscription code | **token** | **str**| Email token | ### Return type [**Response**](Response.md) ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded, application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Request successful | - | **401** | Unauthorized operation | - | **0** | Server error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **enable** > Response enable(code, token) Enable Subscription ### Example * Bearer Authentication (bearerAuth): ```python import paystack from paystack.rest import ApiException from pprint import pprint code = 'code_example' # str | Subscription code token = 'token_example' # str | Email token # Enable Subscription response = paystack.Subscription.enable(code, token) pprint(response) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code** | **str**| Subscription code | **token** | **str**| Email token | ### Return type [**Response**](Response.md) ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded, application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Request successful | - | **401** | Unauthorized operation | - | **0** | Server error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fetch** > Response fetch(code) Fetch Subscription ### Example * Bearer Authentication (bearerAuth): ```python import paystack from paystack.rest import ApiException from pprint import pprint code = 'code_example' # str | # Fetch Subscription response = paystack.Subscription.fetch(code) pprint(response) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code** | **str**| | ### Return type [**Response**](Response.md) ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | 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]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list** > Response list(per_page=per_page, page=page, plan=plan, customer=customer, _from=_from, to=to) List Subscriptions ### Example * Bearer Authentication (bearerAuth): ```python import paystack from paystack.rest import ApiException from pprint import pprint per_page = 56 # int | Number of records to fetch per page (optional) page = 56 # int | The section to retrieve (optional) plan = 'plan_example' # str | Plan ID (optional) customer = 'customer_example' # str | Customer ID (optional) _from = '2013-10-20T19:20:30+01:00' # datetime | The start date (optional) to = '2013-10-20T19:20:30+01:00' # datetime | The end date (optional) # List Subscriptions response = paystack.Subscription.list(per_page=per_page, page=page, plan=plan, customer=customer, _from=_from, to=to) pprint(response) ``` ### Parameters 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] ### Return type [**Response**](Response.md) ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | 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]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **manage_email** > Response manage_email(code) Send Update Subscription Link ### Example * Bearer Authentication (bearerAuth): ```python import paystack from paystack.rest import ApiException from pprint import pprint code = 'code_example' # str | # Send Update Subscription Link response = paystack.Subscription.manage_email(code) pprint(response) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code** | **str**| | ### Return type [**Response**](Response.md) ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Request successful | - | **401** | Unauthorized operation | - | **0** | Server error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **manage_link** > Response manage_link(code) Generate Update Subscription Link ### Example * Bearer Authentication (bearerAuth): ```python import paystack from paystack.rest import ApiException from pprint import pprint code = 'code_example' # str | # Generate Update Subscription Link response = paystack.Subscription.manage_link(code) pprint(response) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code** | **str**| | ### Return type [**Response**](Response.md) ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Request successful | - | **401** | Unauthorized operation | - | **0** | Server error | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)