Skip to content

Latest commit

 

History

History
251 lines (179 loc) · 9.53 KB

File metadata and controls

251 lines (179 loc) · 9.53 KB

paystack.Plan

All URIs are relative to https://api.paystack.co

Method HTTP request Description
create POST /plan Create Plan
fetch GET /plan/{code} Fetch Plan
list GET /plan List Plans
update PUT /plan/{code} Update Plan

create

Response create(name, amount, interval, description=description, send_invoices=send_invoices, send_sms=send_sms, currency=currency, invoice_limit=invoice_limit)

Create Plan

Example

  • Bearer Authentication (bearerAuth):
import paystack
from paystack.rest import ApiException
from pprint import pprint


name = 'name_example' # str | Name of plan
amount = 56 # int | Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR
interval = 'interval_example' # str | Interval in words. Valid intervals are daily, weekly, monthly,biannually, annually
description = True # bool | A description for this plan (optional)
send_invoices = True # bool | Set to false if you don't want invoices to be sent to your customers (optional)
send_sms = True # bool | Set to false if you don't want text messages to be sent to your customers (optional)
currency = 'currency_example' # str | Currency in which amount is set. Allowed values are NGN, GHS, ZAR or USD (optional)
invoice_limit = 56 # int | Number of invoices to raise during subscription to this plan.  Can be overridden by specifying an invoice_limit while subscribing. (optional)

# Create Plan

response = paystack.Plan.create(name, amount, interval, description=description, send_invoices=send_invoices, send_sms=send_sms, currency=currency, invoice_limit=invoice_limit)
pprint(response)

Parameters

Name Type Description Notes
name str Name of plan
amount int Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR
interval str Interval in words. Valid intervals are daily, weekly, monthly,biannually, annually
description bool A description for this plan [optional]
send_invoices bool Set to false if you don't want invoices to be sent to your customers [optional]
send_sms bool Set to false if you don't want text messages to be sent to your customers [optional]
currency str Currency in which amount is set. Allowed values are NGN, GHS, ZAR or USD [optional]
invoice_limit int Number of invoices to raise during subscription to this plan. Can be overridden by specifying an invoice_limit while subscribing. [optional]

Return type

Response

Authorization

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] [Back to Model list] [Back to README]

fetch

Response fetch(code)

Fetch Plan

Example

  • Bearer Authentication (bearerAuth):
import paystack
from paystack.rest import ApiException
from pprint import pprint


code = 'code_example' # str | 

# Fetch Plan

response = paystack.Plan.fetch(code)
pprint(response)

Parameters

Name Type Description Notes
code str

Return type

Response

Authorization

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] [Back to Model list] [Back to README]

list

Response list(per_page=per_page, page=page, interval=interval, amount=amount, _from=_from, to=to)

List Plans

Example

  • Bearer Authentication (bearerAuth):
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)
interval = 'interval_example' # str | Specify interval of the plan (optional)
amount = 56 # int | The amount on the plans to retrieve (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 Plans

response = paystack.Plan.list(per_page=per_page, page=page, interval=interval, amount=amount, _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]
interval str Specify interval of the plan [optional]
amount int The amount on the plans to retrieve [optional]
_from datetime The start date [optional]
to datetime The end date [optional]

Return type

Response

Authorization

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] [Back to Model list] [Back to README]

update

Response update(code, name=name, amount=amount, interval=interval, description=description, send_invoices=send_invoices, send_sms=send_sms, currency=currency, invoice_limit=invoice_limit)

Update Plan

Example

  • Bearer Authentication (bearerAuth):
import paystack
from paystack.rest import ApiException
from pprint import pprint


code = 'code_example' # str | 
name = 'name_example' # str | Name of plan (optional)
amount = 56 # int | Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR (optional)
interval = 'interval_example' # str | Interval in words. Valid intervals are daily, weekly, monthly,biannually, annually (optional)
description = True # bool | A description for this plan (optional)
send_invoices = True # bool | Set to false if you don't want invoices to be sent to your customers (optional)
send_sms = True # bool | Set to false if you don't want text messages to be sent to your customers (optional)
currency = 'currency_example' # str | Currency in which amount is set. Allowed values are NGN, GHS, ZAR or USD (optional)
invoice_limit = 56 # int | Number of invoices to raise during subscription to this plan.  Can be overridden by specifying an invoice_limit while subscribing. (optional)

# Update Plan

response = paystack.Plan.update(code, name=name, amount=amount, interval=interval, description=description, send_invoices=send_invoices, send_sms=send_sms, currency=currency, invoice_limit=invoice_limit)
pprint(response)

Parameters

Name Type Description Notes
code str
name str Name of plan [optional]
amount int Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR [optional]
interval str Interval in words. Valid intervals are daily, weekly, monthly,biannually, annually [optional]
description bool A description for this plan [optional]
send_invoices bool Set to false if you don't want invoices to be sent to your customers [optional]
send_sms bool Set to false if you don't want text messages to be sent to your customers [optional]
currency str Currency in which amount is set. Allowed values are NGN, GHS, ZAR or USD [optional]
invoice_limit int Number of invoices to raise during subscription to this plan. Can be overridden by specifying an invoice_limit while subscribing. [optional]

Return type

Response

Authorization

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 -
404 Entity not found -
0 Server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]