Skip to content

Latest commit

History

History
350 lines (238 loc) · 9.05 KB

File metadata and controls

350 lines (238 loc) · 9.05 KB

paystack.Page

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

MethodHTTP requestDescription
add_productsPOST /page/{id}/productAdd Products
check_slug_availabilityGET /page/check_slug_availability/{slug}Check Slug Availability
createPOST /pageCreate Page
fetchGET /page/{id}Fetch Page
listGET /pageList Pages
updatePUT /page/{id}Update Page

add_products

Response add_products(id, product)

Add Products

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | product='product_example'# list[str] | IDs of all products to add to a page# Add Productsresponse=paystack.Page.add_products(
id,
product,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr
productlist[str]IDs of all products to add to a page

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]

check_slug_availability

Response check_slug_availability(slug)

Check Slug Availability

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'slug='slug_example'# str | # Check Slug Availabilityresponse=paystack.Page.check_slug_availability(
slug,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
slugstr

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]

create

Response create(name, description=description, amount=amount, slug=slug, metadata=metadata, redirect_url=redirect_url, custom_fields=custom_fields)

Create Page

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 page# Create Pageresponse=paystack.Page.create(
name,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
namestrName of page
descriptionstrThe description of the page[optional]
amountintAmount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR[optional]
slugstrURL slug you would like to be associated with this page. Page will be accessible at https://paystack.com/pay/[slug][optional]
metadatastrStringified JSON object of custom data[optional]
redirect_urlstrIf you would like Paystack to redirect to a URL upon successful payment, specify the URL here.[optional]
custom_fieldslist[object]If you would like to accept custom fields, specify them here.[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(id)

Fetch Page

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | # Fetch Pageresponse=paystack.Page.fetch(
id,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr

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, _from=_from, to=to)

List Pages

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'# List Pagesresponse=paystack.Page.list(
)
pprint(response)

Parameters

NameTypeDescriptionNotes
per_pageintNumber of records to fetch per page[optional]
pageintThe section 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(id, name=name, description=description, amount=amount, active=active)

Update Page

Example

  • Bearer Authentication (bearerAuth):
importpaystackfrompprintimportpprint# Set your API key based on domain (test or live mode)paystack.api_key='sk_domain_xxxxxxxx'id='id_example'# str | # Update Pageresponse=paystack.Page.update(
id,
)
pprint(response)

Parameters

NameTypeDescriptionNotes
idstr
namestrName of page[optional]
descriptionstrThe description of the page[optional]
amountintAmount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR[optional]
activeboolSet to false to deactivate page url[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]