Skip to content

Latest commit

History

History
249 lines (173 loc) · 7.58 KB

File metadata and controls

249 lines (173 loc) · 7.58 KB

paystack.Plan

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

MethodHTTP requestDescription
createPOST /planCreate Plan
fetchGET /plan/{code}Fetch Plan
listGET /planList Plans
updatePUT /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):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'name='name_example'# str | Name of planamount=56# int | Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZARinterval='interval_example'# str | Interval in words. Valid intervals are daily, weekly, monthly,biannually, annually# Create Planresponse=paystack.Plan.create(
name,
amount,
interval,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
namestrName of plan
amountintAmount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR
intervalstrInterval in words. Valid intervals are daily, weekly, monthly,biannually, annually
descriptionboolA description for this plan[optional]
send_invoicesboolSet to false if you don't want invoices to be sent to your customers[optional]
send_smsboolSet to false if you don't want text messages to be sent to your customers[optional]
currencystrCurrency in which amount is set. Allowed values are NGN, GHS, ZAR or USD[optional]
invoice_limitintNumber 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 codeDescriptionResponse headers
200Request successful-
401Unauthorized operation-
0Server 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):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'code='code_example'# str | # Fetch Planresponse=paystack.Plan.fetch(
code,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
codestr

Return type

Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request successful-
401Unauthorized operation-
404Entity not found-
0Server 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):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'# List Plansresponse=paystack.Plan.list(
)
pprint(response)

Parameters

NameTypeDescriptionNotes
per_pageintNumber of records to fetch per page[optional]
pageintThe section to retrieve[optional]
intervalstrSpecify interval of the plan[optional]
amountintThe amount on the plans to retrieve[optional]
_fromdatetimeThe start date[optional]
todatetimeThe end date[optional]

Return type

Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Request successful-
401Unauthorized operation-
404Entity not found-
0Server 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):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'code='code_example'# str | # Update Planresponse=paystack.Plan.update(
code,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
codestr
namestrName of plan[optional]
amountintAmount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR[optional]
intervalstrInterval in words. Valid intervals are daily, weekly, monthly,biannually, annually[optional]
descriptionboolA description for this plan[optional]
send_invoicesboolSet to false if you don't want invoices to be sent to your customers[optional]
send_smsboolSet to false if you don't want text messages to be sent to your customers[optional]
currencystrCurrency in which amount is set. Allowed values are NGN, GHS, ZAR or USD[optional]
invoice_limitintNumber 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 codeDescriptionResponse headers
200Request successful-
401Unauthorized operation-
404Entity not found-
0Server error-

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