Skip to content

Latest commit

 

History

History
301 lines (207 loc) · 7.99 KB

File metadata and controls

301 lines (207 loc) · 7.99 KB

paystack.Product

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

Method HTTP request Description
create POST /product Create Product
delete DELETE /product/{id} Delete Product
fetch GET /product/{id} Fetch Product
list GET /product List Products
update PUT /product/{id} Update product

create

Response create(name, description, price, currency, limited=limited, quantity=quantity)

Create Product

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 product
description = 'description_example' # str | The description of the product
price = 56 # int | Price should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR
currency = 'currency_example' # str | Currency in which price is set. Allowed values are: NGN, GHS, ZAR or USD

# Create Product

response = paystack.Product.create(
    name,
    description,
    price,
    currency,
)

pprint(response)

Parameters

Name Type Description Notes
name str Name of product
description str The description of the product
price int Price should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR
currency str Currency in which price is set. Allowed values are: NGN, GHS, ZAR or USD
limited bool Set to true if the product has limited stock. Leave as false if the product has unlimited stock [optional]
quantity int Number of products in stock. Use if limited is true [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
201 Resource created -
401 Unauthorized operation -
0 Server error -

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

delete

Response delete(id)

Delete Product

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 | 

# Delete Product

response = paystack.Product.delete(
    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]

fetch

Response fetch(id)

Fetch Product

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 Product

response = paystack.Product.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, active=active, _from=_from, to=to)

List 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'


# List Products

response = paystack.Product.list(
)

pprint(response)

Parameters

Name Type Description Notes
per_page int [optional]
page int [optional]
active bool [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, price=price, currency=currency, limited=limited, quantity=quantity)

Update product

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 product

response = paystack.Product.update(
    id,
)

pprint(response)

Parameters

Name Type Description Notes
id str
name str Name of product [optional]
description str The description of the product [optional]
price int Price should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR [optional]
currency str Currency in which price is set. Allowed values are: NGN, GHS, ZAR or USD [optional]
limited bool Set to true if the product has limited stock. Leave as false if the product has unlimited stock [optional]
quantity int Number of products in stock. Use if limited is true [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]