Skip to main content

Notch Pay Python SDK

The Notch Pay Python SDK provides a convenient way to integrate Notch Pay into your Python applications, including frameworks like Django, Flask, and FastAPI.

Installation

Basic Usage

Initialize the SDK

Create a Payment

Retrieve a Payment

List Payments

Create a Transfer

Check Balance

Django Integration

Installation

Settings Configuration

Add Notch Pay settings to your Django settings file:

Create a Payment View

URLs Configuration

Templates

Create the necessary templates:

Flask Integration

Installation

Basic Flask App

Templates

Create the necessary templates in a templates folder:
Create similar templates for payment_success.html, payment_failed.html, and payment_error.html as shown in the Django example.

FastAPI Integration

Installation

Basic FastAPI App

API Reference

The Python SDK provides access to all Notch Pay API endpoints:

Payments

  • notchpay.payments.create(data) - Create a payment
  • notchpay.payments.retrieve(reference) - Retrieve a payment
  • notchpay.payments.list(params) - List payments
  • notchpay.payments.cancel(reference) - Cancel a payment

Transfers

  • notchpay.transfers.create(data) - Create a transfer
  • notchpay.transfers.retrieve(reference) - Retrieve a transfer
  • notchpay.transfers.list(params) - List transfers
  • notchpay.transfers.cancel(reference) - Cancel a transfer
  • notchpay.transfers.create_bulk(data) - Create a bulk transfer

Customers

  • notchpay.customers.create(data) - Create a customer
  • notchpay.customers.retrieve(id) - Retrieve a customer
  • notchpay.customers.update(id, data) - Update a customer
  • notchpay.customers.list(params) - List customers
  • notchpay.customers.delete(id) - Delete a customer

Beneficiaries

  • notchpay.beneficiaries.create(data) - Create a beneficiary
  • notchpay.beneficiaries.retrieve(id) - Retrieve a beneficiary
  • notchpay.beneficiaries.update(id, data) - Update a beneficiary
  • notchpay.beneficiaries.list(params) - List beneficiaries
  • notchpay.beneficiaries.delete(id) - Delete a beneficiary

Balance

  • notchpay.balance.retrieve() - Check balance
  • notchpay.balance.retrieve_currency(currency) - Check balance for a specific currency
  • notchpay.balance.history(params) - List balance history

Webhooks

  • notchpay.webhooks.create(data) - Create a webhook
  • notchpay.webhooks.retrieve(id) - Retrieve a webhook
  • notchpay.webhooks.update(id, data) - Update a webhook
  • notchpay.webhooks.list(params) - List webhooks
  • notchpay.webhooks.delete(id) - Delete a webhook

Error Handling

The SDK raises exceptions that you can catch and handle:

Async Support

The SDK also provides async support for use with async frameworks like FastAPI:

API Reference

Complete API documentation

JavaScript SDK

Integrate with JavaScript applications

PHP SDK

Integrate with PHP applications