### Create Paystack Charge (Python) Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Charge.md This example shows how to initiate a new charge using the `paystack.Charge.create` method. While the example shows no parameters, this method accepts various optional arguments like email, amount, authorization_code, etc., as detailed in the API documentation. Ensure your Paystack API key is set. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Create Charge response = paystack.Charge.create( ) pprint(response) ``` -------------------------------- ### Listing Paystack Pages - Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Page.md Shows how to list Paystack pages using the Python library. The example demonstrates a basic list call without optional parameters. Requires setting the API key. ```python 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) ``` -------------------------------- ### Installing Paystack Python SDK via pip Source: https://github.com/paystackoss/paystack-python/blob/main/README.md Installs the Paystack Python client library using the pip package manager. The second command shows how to install with root permissions if necessary. Requires Python 2.7 or 3.4+. ```shell pip install paystack-sdk ``` ```shell sudo pip install ``` -------------------------------- ### Fetch Transfer Recipient using Paystack Python SDK (Setup) Source: https://github.com/paystackoss/paystack-python/blob/main/docs/TransferRecipient.md This Python code snippet shows the initial setup for fetching a single transfer recipient using the Paystack Python SDK, including setting the API key. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' ``` -------------------------------- ### Setup for Verifying Payment Request - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/PaymentRequest.md This snippet shows the initial setup for verifying a payment request using the Paystack Python library, including importing necessary modules and setting the API key. It also declares a variable for the payment request ID. ```python 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 | ``` -------------------------------- ### List Customers - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Customer.md This example demonstrates how to retrieve a list of customers from your Paystack integration using the Python library. It requires setting your API key before making the call. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Customers response = paystack.Customer.list( ) pprint(response) ``` -------------------------------- ### Submit OTP - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Charge.md Provides an example of submitting a customer's One-Time Password (OTP) to complete a Paystack charge using the Python library. This includes API key setup and requires the transaction reference. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' otp = 'otp_example' # str | Customer's OTP reference = 'reference_example' # str | The reference of the ongoing transaction # Submit OTP response = paystack.Charge.submit_otp( otp, reference, ) pprint(response) ``` -------------------------------- ### Submit Phone - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Charge.md Illustrates how to submit a customer's phone number to complete a Paystack charge using the Python library. This example includes API key setup and requires the transaction reference. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' phone = 'phone_example' # str | Customer's mobile number reference = 'reference_example' # str | The reference of the ongoing transaction # Submit Phone response = paystack.Charge.submit_phone( phone, reference, ) pprint(response) ``` -------------------------------- ### Getting Dispute Upload URL with Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Dispute.md This example demonstrates how to retrieve an upload URL for a dispute using the Paystack Python library. It shows how to set the API key, specify the dispute ID, and call the `Dispute.upload_url` method. ```python 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 | Dispute ID # Get Upload URL response = paystack.Dispute.upload_url( id, ) pprint(response) ``` -------------------------------- ### Exporting Transactions with Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transaction.md Demonstrates how to use the `paystack.Transaction.download()` method to export transactions. It shows setting the API key and calling the method. Optional parameters for filtering by date range or pagination are available but not shown in this basic example. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Export Transactions response = paystack.Transaction.download( ) pprint(response) ``` -------------------------------- ### Fetch Bulk Charge Batch - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/BulkCharge.md This example shows how to retrieve details for a specific bulk charge batch using its code via the Paystack Python library. It initializes the API key, calls the fetch method with the batch code, and prints the result. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | Batch code # Fetch Bulk Charge Batch response = paystack.BulkCharge.fetch( code, ) pprint(response) ``` -------------------------------- ### Generate Update Subscription Link using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Subscription.md Provides an example of generating a direct update link for a subscription using the Paystack Python SDK. Requires the subscription code. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | # Generate Update Subscription Link response = paystack.Subscription.manage_link( code, ) pprint(response) ``` -------------------------------- ### Retrieve Balance Ledger using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Balance.md This example shows how to retrieve entries from the balance ledger using the Paystack Python library. Optional parameters like pagination and date range can be passed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Balance Ledger response = paystack.Balance.ledger( ) pprint(response) ``` -------------------------------- ### List Dedicated Accounts in Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/DedicatedVirtualAccount.md Provides an example of listing dedicated virtual accounts using the Paystack Python library. It demonstrates how to set the API key and call the list method. The list of accounts is printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Dedicated Accounts response = paystack.DedicatedVirtualAccount.list( ) pprint(response) ``` -------------------------------- ### List Bulk Charge Batches - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/BulkCharge.md This example demonstrates how to retrieve a list of all bulk charge batches using the Paystack Python library. It sets the API key and calls the list method, printing the paginated API response. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Bulk Charge Batches response = paystack.BulkCharge.list( ) pprint(response) ``` -------------------------------- ### Submit Birthday - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Charge.md Shows how to submit the customer's birthday in YYYY-MM-DD format to complete a Paystack charge using the Python library. This example includes API key setup and requires the transaction reference. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' birthday = 'birthday_example' # str | Customer's birthday in the format YYYY-MM-DD e.g 2016-09-21 reference = 'reference_example' # str | The reference of the ongoing transaction # Submit Birthday response = paystack.Charge.submit_birthday( birthday, reference, ) pprint(response) ``` -------------------------------- ### Updating a Dispute with Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Dispute.md This example demonstrates how to update an existing dispute using the Paystack Python library. It shows how to set the API key, specify the dispute ID and refund amount, and call the `Dispute.update` method. ```python 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 | Dispute ID refund_amount = 'refund_amount_example' # str | The amount to refund, in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR # Update Dispute response = paystack.Dispute.update( id, refund_amount, ) pprint(response) ``` -------------------------------- ### Adding Evidence to a Dispute - Paystack API - Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Dispute.md This example shows how to add evidence to an existing dispute using the Paystack Python library. It requires the dispute ID and customer/service details as parameters for the `Dispute.evidence()` method. The API key must be set before making the call. ```python 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 | Dispute ID customer_email = 'customer_email_example' # str | Customer email customer_name = 'customer_name_example' # str | Customer name customer_phone = 'customer_phone_example' # str | Customer mobile number service_details = 'service_details_example' # str | Details of service offered # Add Evidence response = paystack.Dispute.evidence( id, customer_email, customer_name, customer_phone, service_details, ) pprint(response) ``` -------------------------------- ### Listing/Searching Paystack Splits Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Split.md This snippet demonstrates how to list or search transaction splits using the Paystack Python library. It requires setting the API key and calls the `Split.list()` method. Optional parameters for filtering and pagination are available but not shown in this basic example. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List/Search Splits response = paystack.Split.list( ) pprint(response) ``` -------------------------------- ### Create Paystack Payment Request Python Example Source: https://github.com/paystackoss/paystack-python/blob/main/docs/PaymentRequest.md This snippet demonstrates how to create a new payment request using the Paystack Python library. It shows how to set the API key, provide the required customer ID or code, call the `create` method, and print the response. Bearer authentication is used. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' customer = 'customer_example' # str | Customer id or code # Create Payment Request response = paystack.PaymentRequest.create( customer, ) pprint(response) ``` -------------------------------- ### Fetching Refund using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Refund.md This example shows how to retrieve the details of a specific refund using the `paystack.Refund.fetch` method in Python. It requires setting the API key and providing the refund ID. The response object contains the details of the fetched refund. ```python 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 Refund response = paystack.Refund.fetch( id, ) pprint(response) ``` -------------------------------- ### Submitting PIN for Transaction in Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Charge.md This example demonstrates how to use the `paystack.Charge.submit_pin` method to submit a customer's PIN for a transaction. It requires setting the API key and providing the transaction reference and the customer's PIN. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' pin = 'pin_example' # str | Customer's PIN reference = 'reference_example' # str | Transaction reference that requires the PIN # Submit PIN response = paystack.Charge.submit_pin( pin, reference, ) pprint(response) ``` -------------------------------- ### Getting a Transaction Event with Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transaction.md Shows how to fetch a specific transaction event using its ID via `paystack.Transaction.event()`. It includes setting the API key and passing the required transaction ID as a parameter. ```python 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 | # Get Transaction Event response = paystack.Transaction.event( id, ) pprint(response) ``` -------------------------------- ### Listing Transfer Recipients (Python) Source: https://github.com/paystackoss/paystack-python/blob/main/docs/TransferRecipient.md Shows how to list all transfer recipients. The method supports optional parameters for pagination and date filtering, but the example shows a basic call without them. Requires setting the API key. The response is printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Transfer Recipients response = paystack.TransferRecipient.list( ) pprint(response) ``` -------------------------------- ### Update Paystack Subaccount - Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Subaccount.md This Python code snippet demonstrates how to update an existing subaccount using the Paystack library. It requires setting the API key and provides an example of calling the `Subaccount.update` method with the subaccount code. The response is then printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | # Update Subaccount response = paystack.Subaccount.update( code, ) pprint(response) ``` -------------------------------- ### Archive Paystack Payment Request Python Example Source: https://github.com/paystackoss/paystack-python/blob/main/docs/PaymentRequest.md This snippet demonstrates how to archive a payment request using the Paystack Python library. It shows how to set the API key, specify the payment request ID, call the `archive` method, and print the response. Bearer authentication is used. ```python 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 | # Archive Payment Request response = paystack.PaymentRequest.archive( id, ) pprint(response) ``` -------------------------------- ### Update Customer Details - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Customer.md This example demonstrates how to modify details for an existing customer using the Paystack Python library. It requires the customer's code and allows updating fields like first name, last name, phone, and metadata. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | # Update Customer response = paystack.Customer.update( code, ) pprint(response) ``` -------------------------------- ### Update Payment Request - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/PaymentRequest.md This example shows how to update an existing payment request using its ID with the Paystack Python library. It requires setting the API key and calling the `PaymentRequest.update()` method with the request ID. ```python 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 Payment Request response = paystack.PaymentRequest.update( id, ) pprint(response) ``` -------------------------------- ### Get Transaction Totals with Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transaction.md This snippet shows how to retrieve transaction totals using the Paystack Python library. It requires setting the API key and calls the totals method without mandatory parameters, although optional parameters like pagination and date range are available. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Transaction Totals response = paystack.Transaction.totals( ) pprint(response) ``` -------------------------------- ### Updating Transfer Recipient (Python) Source: https://github.com/paystackoss/paystack-python/blob/main/docs/TransferRecipient.md Shows how to update a transfer recipient's details. Requires setting the API key and providing the recipient's code. The method supports optional parameters for updating name and email, but the example shows a basic call without them. The response is printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | Transfer recipient code # Update Transfer recipient response = paystack.TransferRecipient.transferrecipient_code_put( code, ) pprint(response) ``` -------------------------------- ### Update Payment Session Timeout using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Integration.md This snippet shows how to update the payment session timeout setting using the Paystack Python SDK. It requires setting the API key and calling the `update_payment_session_timeout` method on the `Integration` object. Note that the example shows the call without parameters, but the API definition indicates an optional `body` parameter. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Update Payment Session Timeout response = paystack.Integration.update_payment_session_timeout( ) pprint(response) ``` -------------------------------- ### Initializing Paystack Client and Creating Customer in Python Source: https://github.com/paystackoss/paystack-python/blob/main/README.md Demonstrates how to initialize the Paystack client with an API key and create a new customer using the Customer.create method. The response object is then printed using pprint. ```python import paystack from pprint import pprint paystack.api_key = 'sk_domain_xxxxx' response = paystack.Customer.create( email="larry@james.com", first_name="Larry", last_name="James" ) pprint(response) ``` -------------------------------- ### Creating Paystack Subscription (Python) Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Subscription.md Demonstrates how to create a new subscription using the Paystack Python SDK. It requires setting the API key and providing the customer identifier and plan code. The response object is then printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' customer = 'customer_example' # str | Customer's email address or customer code plan = 'plan_example' # str | Plan code # Create Subscription response = paystack.Subscription.create( customer, plan, ) pprint(response) ``` -------------------------------- ### Creating Paystack Product in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Product.md This snippet demonstrates how to create a new product using the Paystack Python library. It requires setting the API key, defining product details like name, description, price, and currency, and then calling the `paystack.Product.create` method with these parameters. The response object contains the result of the API call. ```python 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) ``` -------------------------------- ### Creating Paystack Plan in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Plan.md This snippet demonstrates how to create a new plan using the paystack-python library. It requires setting the API key and providing the plan's name, amount (in kobo/pesewas/cents), and interval. ```python 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 plan amount = 56 # int | Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR interval = 'interval_example' # str | Interval in words. Valid intervals are daily, weekly, monthly,biannually, annually # Create Plan response = paystack.Plan.create( name, amount, interval, ) pprint(response) ``` -------------------------------- ### Listing Paystack Plans in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Plan.md This snippet demonstrates how to fetch a list of all plans. It requires setting the API key and can optionally include parameters for pagination or filtering. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Plans response = paystack.Plan.list( ) pprint(response) ``` -------------------------------- ### Creating Paystack Customer in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Customer.md Demonstrates how to create a new customer using the Paystack Python library. It requires setting the API key and providing the customer's email address. The response object is then printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' email = 'email_example' # str | Customer's email address # Create Customer response = paystack.Customer.create( email, ) pprint(response) ``` -------------------------------- ### List Products - Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Product.md This snippet demonstrates how to list products using the Paystack Python SDK. It requires setting the API key and uses the `paystack.Product.list()` method. Optional parameters like pagination and date ranges can be passed. ```python 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) ``` -------------------------------- ### Initiate Bulk Transfer - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transfer.md This snippet demonstrates how to initiate a bulk transfer using the Paystack Python library. It requires setting the API key and then calling the `Transfer.bulk()` method. The response is printed using `pprint`. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Initiate Bulk Transfer response = paystack.Transfer.bulk( ) pprint(response) ``` -------------------------------- ### Get Transaction Session with Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transaction.md This snippet shows how to retrieve a specific transaction session using its ID via the Paystack Python library. It requires setting the API key and providing the transaction ID. ```python 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 | # Get Transaction Session response = paystack.Transaction.session( id, ) pprint(response) ``` -------------------------------- ### Initiate Transfer using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transfer.md This snippet demonstrates how to initiate a transfer using the Paystack Python library. It requires setting the API key and providing the source, amount, and recipient details. The response is printed to the console. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' source = 'source_example' # str | Where should we transfer from? Only balance is allowed for now amount = 'amount_example' # str | Amount to transfer in kobo if currency is NGN and pesewas if currency is GHS. recipient = 'recipient_example' # str | The transfer recipient's code # Initiate Transfer response = paystack.Transfer.initiate( source, amount, recipient, ) pprint(response) ``` -------------------------------- ### Fetch Subscription using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Subscription.md Demonstrates how to fetch a specific subscription using its code via the Paystack Python SDK. Requires setting the API key and providing the subscription code. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | # Fetch Subscription response = paystack.Subscription.fetch( code, ) pprint(response) ``` -------------------------------- ### Fetching Banks using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Verification.md Demonstrates how to call the `fetch_banks` method of the `paystack.Verification` class to retrieve a list of banks. Requires setting the API key. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Fetch Banks response = paystack.Verification.fetch_banks( ) pprint(response) ``` -------------------------------- ### Creating a Paystack Page (Python) Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Page.md Shows the basic process of creating a new Paystack page. The page name is a required parameter, while others like description, amount, and slug are optional. Requires a valid Paystack API key. ```python 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) ``` -------------------------------- ### Fetching Paystack Plan in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Plan.md This snippet shows how to retrieve details for a specific plan using its code. It requires setting the API key and providing the plan's unique code. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | # Fetch Plan response = paystack.Plan.fetch( code, ) pprint(response) ``` -------------------------------- ### Initiate Bulk Charge - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/BulkCharge.md This snippet illustrates how to initiate a new bulk charge operation using the Paystack Python library. It sets the API key and then calls the initiate method without parameters, printing the API response. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Initiate Bulk Charge response = paystack.BulkCharge.initiate() pprint(response) ``` -------------------------------- ### Fetching Settlements - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Settlement.md Demonstrates how to fetch a list of settlements using the Paystack Python library. Requires setting the API key and calling the `Settlement.fetch()` method. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Fetch Settlements response = paystack.Settlement.fetch( ) pprint(response) ``` -------------------------------- ### Exporting Disputes - Paystack API - Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Dispute.md This snippet demonstrates how to use the Paystack Python library to export dispute records. It initializes the library with an API key and then calls the `Dispute.download()` method. The response object containing the result is then printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Export Disputes response = paystack.Dispute.download( ) pprint(response) ``` -------------------------------- ### Listing Countries using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Verification.md Demonstrates how to call the `list_countries` method of the `paystack.Verification` class to retrieve a list of supported countries. Requires setting the API key. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Countries response = paystack.Verification.list_countries() pprint(response) ``` -------------------------------- ### Listing States (AVS) using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Verification.md Demonstrates how to call the `avs` method of the `paystack.Verification` class to list states for Address Verification System (AVS). Requires setting the API key. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List States (AVS) response = paystack.Verification.avs( ) pprint(response) ``` -------------------------------- ### Removing Subaccount from Paystack Split Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Split.md This example shows how to remove a subaccount from an existing transaction split using the Paystack Python SDK. It requires the split ID and optionally the subaccount code and share to remove. The API key must be set prior to the call. ```python 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 | # Remove Subaccount from split response = paystack.Split.remove_subaccount( id, ) pprint(response) ``` -------------------------------- ### Adding Products to a Paystack Page (Python) Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Page.md Demonstrates how to add one or more products to an existing Paystack page using its unique ID and a list of product IDs. Requires a valid Paystack API key. ```python 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) ``` -------------------------------- ### Resolve Card BIN using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Verification.md This snippet demonstrates how to use the Paystack Python library to resolve a card BIN. It shows how to set the API key and call the `resolve_card_bin` method from the `Verification` module with the required BIN value. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' bin = 'bin_example' # str | # Resolve Card BIN response = paystack.Verification.resolve_card_bin( bin, ) pprint(response) ``` -------------------------------- ### Verifying Transfer using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transfer.md This snippet demonstrates how to verify a transfer using the Paystack Python library. It shows how to set the API key, provide the transfer reference, call the `Transfer.verify` method, and print the response. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' reference = 'reference_example' # str | # Verify Transfer response = paystack.Transfer.verify( reference, ) pprint(response) ``` -------------------------------- ### Fetching Paystack Product in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Product.md This snippet illustrates how to retrieve details of a specific product using the Paystack Python library. It requires setting the API key and providing the unique identifier (`id`) of the product to be fetched. The `paystack.Product.fetch` method is called with the product ID. The response object contains the retrieved product details or the result of the API call. ```python 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) ``` -------------------------------- ### Creating Refund using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Refund.md This snippet demonstrates how to create a refund using the `paystack.Refund.create` method in Python. It requires setting the API key and providing the transaction reference or ID. The response object contains the details of the created refund. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' transaction = 'transaction_example' # str | Transaction reference or id # Create Refund response = paystack.Refund.create( transaction, ) pprint(response) ``` -------------------------------- ### List Subscriptions using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Subscription.md Shows how to retrieve a list of subscriptions using the Paystack Python SDK. The method supports optional parameters for filtering and pagination. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Subscriptions response = paystack.Subscription.list( ) pprint(response) ``` -------------------------------- ### Resume Bulk Charge Batch - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/BulkCharge.md This snippet demonstrates how to resume a bulk charge batch using the Paystack Python library. It requires setting the API key and providing the batch code as a parameter to the `paystack.BulkCharge.resume` method. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | Batch code # Resume Bulk Charge Batch response = paystack.BulkCharge.resume( code, ) pprint(response) ``` -------------------------------- ### Exporting Transfers using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transfer.md This snippet demonstrates how to export transfers using the Paystack Python library. It requires setting the API key and calling the `Transfer.download()` method. The response is then printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Export Transfers response = paystack.Transfer.download( ) pprint(response) ``` -------------------------------- ### Enabling Paystack Subscription (Python) Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Subscription.md Illustrates how to enable a previously disabled subscription using the Paystack Python SDK. It requires setting the API key and providing the subscription code and email token. The response object is then printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | Subscription code token = 'token_example' # str | Email token # Enable Subscription response = paystack.Subscription.enable( code, token, ) pprint(response) ``` -------------------------------- ### Validating Customer Details using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Customer.md This code snippet shows how to initialize the Paystack API key and then call the `Customer.validate` method to verify customer information. It requires providing various customer details such as name, identification type, country, BVN, bank code, and account number as parameters. The response from the API call is then printed. ```python # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | first_name = 'first_name_example' # str | Customer's first name last_name = 'last_name_example' # str | Customer's last name type = 'type_example' # str | Predefined types of identification. country = 'country_example' # str | Two-letter country code of identification issuer bvn = 'bvn_example' # str | Customer's Bank Verification Number bank_code = 'bank_code_example' # str | You can get the list of bank codes by calling the List Banks endpoint (https://api.paystack.co/bank). account_number = 'account_number_example' # str | Customer's bank account number. # Validate Customer response = paystack.Customer.validate( code, first_name, last_name, type, country, bvn, bank_code, account_number, ) pprint(response) ``` -------------------------------- ### Creating Paystack Subaccount in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Subaccount.md This snippet demonstrates how to create a new subaccount using the Paystack Python library. It requires setting the API key and providing mandatory parameters like business name, settlement bank, account number, and percentage charge. The method returns a Response object containing the result of the operation. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' business_name = 'business_name_example' # str | Name of business for subaccount settlement_bank = 'settlement_bank_example' # str | Bank code for the bank. You can get the list of Bank Codes by calling the List Banks endpoint. account_number = 'account_number_example' # str | Bank account number percentage_charge = 3.4 # float | Customer's phone number # Create Subaccount response = paystack.Subaccount.create( business_name, settlement_bank, account_number, percentage_charge, ) pprint(response) ``` -------------------------------- ### Update Plan using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Plan.md This snippet demonstrates how to update an existing plan using the Paystack Python SDK. It requires setting the API key and calling the `Plan.update` method with the plan code. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | # Update Plan response = paystack.Plan.update( code, ) pprint(response) ``` -------------------------------- ### Initialize Transaction - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transaction.md This snippet demonstrates how to initialize a new transaction using the Paystack Python library. It sets the API key and calls the `Transaction.initialize` method with required parameters like email and amount. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' email = 'email_example' # str | Customer's email address amount = 56 # int | Amount should be in kobo if currency is NGN, pesewas, if currency is GHS, and cents, if currency is ZAR # Initialize Transaction response = paystack.Transaction.initialize( email, amount, ) pprint(response) ``` -------------------------------- ### Fetching Paystack Customer Details in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Customer.md Illustrates how to retrieve details for a specific customer using the Paystack Python library. It requires setting the API key and providing the customer's code or ID. The response object containing the customer details is then printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | # Fetch Customer response = paystack.Customer.fetch( code, ) pprint(response) ``` -------------------------------- ### Fetching a Paystack Page - Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Page.md Demonstrates how to fetch a specific Paystack page using its ID with the Python library. Requires setting the API key and providing the page ID as a string. ```python 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) ``` -------------------------------- ### Submit Address - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Charge.md Demonstrates how to submit the customer's address, city, state, and zipcode to complete a Paystack charge using the Python library. This requires the transaction reference. ```python response = paystack.Charge.submit_address( address, city, state, zipcode, reference, ) pprint(response) ``` -------------------------------- ### Listing Disputes using Paystack Python API Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Dispute.md This snippet demonstrates how to list disputes using the Paystack Python library. It requires setting the API key and then calling the `list` method on the `Dispute` object. Optional parameters like pagination, status, transaction ID, and date ranges can be passed to filter the results. The response object contains the list of disputes. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Disputes response = paystack.Dispute.list( ) pprint(response) ``` -------------------------------- ### Listing Paystack Subaccounts in Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Subaccount.md This snippet demonstrates how to retrieve a list of all subaccounts. It requires setting the API key. Optional parameters like pagination (per_page, page) and date range (from, to) can be used to filter the results. The method returns a Response object containing the list of subaccounts. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Subaccounts response = paystack.Subaccount.list( ) pprint(response) ``` -------------------------------- ### Fetch Account Balance using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Balance.md This snippet demonstrates how to fetch the current account balance using the Paystack Python library. It requires setting the API key before making the call. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Fetch Balance response = paystack.Balance.fetch() pprint(response) ``` -------------------------------- ### Resolving Account Number using Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Verification.md Demonstrates how to call the `resolve_account_number` method of the `paystack.Verification` class to verify bank account details. Requires setting the API key. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # Resolve Account Number response = paystack.Verification.resolve_account_number( ) pprint(response) ``` -------------------------------- ### Update Product - Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Product.md This snippet shows how to update an existing product using the Paystack Python SDK. It requires the product ID and uses the `paystack.Product.update()` method. Various optional parameters like name, description, price, and quantity can be provided. ```python 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) ``` -------------------------------- ### Bulk Create Transfer Recipient using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/TransferRecipient.md This Python code demonstrates how to create multiple transfer recipients in bulk using the Paystack Python SDK. It requires setting the API key and providing a list of TransferRecipientCreate objects. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' batch = paystack.TransferRecipientCreate() # list[TransferRecipientCreate] | A list of transfer recipient object. Each object should contain type, name, and bank_code. Any Create Transfer Recipient param can also be passed. # Bulk Create Transfer Recipient response = paystack.TransferRecipient.bulk( batch, ) pprint(response) ``` -------------------------------- ### List Transfers using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transfer.md This snippet shows how to retrieve a list of transfers using the Paystack Python library. It requires setting the API key. Optional parameters like pagination and status can be added to the `list` method. The response is printed. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' # List Transfers response = paystack.Transfer.list( ) pprint(response) ``` -------------------------------- ### Fetch Charges in Bulk Batch - Paystack Python Source: https://github.com/paystackoss/paystack-python/blob/main/docs/BulkCharge.md This snippet demonstrates how to fetch the individual charges within a specific bulk charge batch using the Paystack Python library. It requires the batch code as a parameter and prints the API response. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' code = 'code_example' # str | Batch code # Fetch Charges in a Batch response = paystack.BulkCharge.charges( code, ) pprint(response) ``` -------------------------------- ### Verify Transaction using Paystack Python SDK Source: https://github.com/paystackoss/paystack-python/blob/main/docs/Transaction.md This snippet demonstrates how to verify a transaction using the Paystack Python library. It requires setting your API key and providing the transaction reference. The response object contains the verification details. ```python import paystack from pprint import pprint # Set your API key based on domain (test or live mode) paystack.api_key = 'sk_domain_xxxxxxxx' reference = 'reference_example' # str | The transaction reference to verify # Verify Transaction response = paystack.Transaction.verify( reference, ) pprint(response) ```