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

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 pprint import pprint

# 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 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 pprint import pprint

# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'

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 pprint import pprint

# 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 Page

response = paystack.Page.create(
    name,
)

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 pprint import pprint

# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'

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 pprint import pprint

# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'


# List Pages

response = paystack.Page.list(
)

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 pprint import pprint

# Set your API key based on domain (test or live mode)
paystack.api_key = 'sk_domain_xxxxxxxx'

id = 'id_example' # str | 

# Update Page

response = paystack.Page.update(
    id,
)

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]