Skip to content

Latest commit

 

History

History
340 lines (234 loc) · 10.2 KB

File metadata and controls

340 lines (234 loc) · 10.2 KB

paystack.Page

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

Method HTTP request Description
add_products POST /page/{id}/product Add Products
check_slug_availability GET /page/check_slug_availability/{slug} Check Slug Availability
create POST /page Create Page
fetch GET /page/{id} Fetch Page
list GET /page List Pages
update PUT /page/{id} Update Page

add_products

Response add_products(id, product)

Add Products

Example

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


id = 'id_example' # str | 
product = 'product_example' # list[str] | IDs of all products to add to a page

# Add Products

response = paystack.Page.add_products(id, product)
pprint(response)

Parameters

Name Type Description Notes
id str
product list[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 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]

check_slug_availability

Response check_slug_availability(slug)

Check Slug Availability

Example

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


slug = 'slug_example' # str | 

# Check Slug Availability

response = paystack.Page.check_slug_availability(slug)
pprint(response)

Parameters

Name Type Description Notes
slug 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]

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):
import paystack
from paystack.rest import ApiException
from pprint import pprint


name = 'name_example' # str | Name of page
description = 'description_example' # str | The description of the page (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)
slug = 'slug_example' # str | URL slug you would like to be associated with this page. Page will be accessible at https://paystack.com/pay/[slug] (optional)
metadata = 'metadata_example' # str | Stringified JSON object of custom data (optional)
redirect_url = 'redirect_url_example' # str | If you would like Paystack to redirect to a URL upon successful payment, specify the URL here. (optional)
custom_fields = None # list[object] | If you would like to accept custom fields, specify them here. (optional)

# Create Page

response = paystack.Page.create(name, description=description, amount=amount, slug=slug, metadata=metadata, redirect_url=redirect_url, custom_fields=custom_fields)
pprint(response)

Parameters

Name Type Description Notes
name str Name of page
description str The description of the page [optional]
amount int Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR [optional]
slug str URL slug you would like to be associated with this page. Page will be accessible at https://paystack.com/pay/[slug] [optional]
metadata str Stringified JSON object of custom data [optional]
redirect_url str If you would like Paystack to redirect to a URL upon successful payment, specify the URL here. [optional]
custom_fields list[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 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(id)

Fetch Page

Example

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


id = 'id_example' # str | 

# Fetch Page

response = paystack.Page.fetch(id)
pprint(response)

Parameters

Name Type Description Notes
id 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, _from=_from, to=to)

List Pages

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)
_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 Pages

response = paystack.Page.list(per_page=per_page, page=page, _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]
_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(id, name=name, description=description, amount=amount, active=active)

Update Page

Example

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


id = 'id_example' # str | 
name = 'name_example' # str | Name of page (optional)
description = 'description_example' # str | The description of the page (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)
active = True # bool | Set to false to deactivate page url (optional)

# Update Page

response = paystack.Page.update(id, name=name, description=description, amount=amount, active=active)
pprint(response)

Parameters

Name Type Description Notes
id str
name str Name of page [optional]
description str The description of the page [optional]
amount int Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR [optional]
active bool Set 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 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]