Payments & Charges

Charge API

Charge API https://paystack.com/docs/api/charge/

class djpaystack.api.charge.ChargeAPI(client)[source]

Bases: BaseAPI

Paystack Charge API

The Charge API allows you to configure payment channel of your choice when initiating a payment. It exposes the core components powering the Paystack checkout, supporting cards, bank accounts, USSD, mobile money, bank transfers, EFT, QR codes, and more.

create(email: str, amount: int, bank: Dict[str, Any] | None = None, authorization_code: str | None = None, pin: str | None = None, metadata: Dict | None = None, reference: str | None = None, ussd: Dict[str, Any] | None = None, mobile_money: Dict[str, Any] | None = None, bank_transfer: Dict[str, Any] | None = None, eft: Dict[str, Any] | None = None, qr: Dict[str, Any] | None = None, device_id: str | None = None, **kwargs) Dict[str, Any][source]

Create a charge.

Parameters:
  • email – Customer’s email address

  • amount – Amount in the subunit of the supported currency

  • bank – Bank account object with ‘code’ and ‘account_number’

  • authorization_code – Authorization code for recurring charges

  • pin – Customer’s PIN (for card charges)

  • metadata – Additional charge metadata

  • reference – Unique transaction reference

  • ussd – USSD object with ‘type’ (e.g. ‘737’ for GTBank)

  • mobile_money – Mobile money object with ‘phone’ and ‘provider’

  • bank_transfer – Bank transfer object with optional ‘account_expires_at’ (Pay with Transfer / Pesalink)

  • eft – EFT object with ‘provider’ (e.g. ‘ozow’ for South Africa)

  • qr – QR code object with ‘provider’ (e.g. ‘scan-to-pay’ for South Africa)

  • device_id – Device ID for terminal charges

Returns:

Charge response with status indicating next step

submit_pin(pin: str, reference: str) Dict[str, Any][source]

Submit PIN

submit_otp(otp: str, reference: str) Dict[str, Any][source]

Submit OTP

submit_phone(phone: str, reference: str) Dict[str, Any][source]

Submit phone

submit_birthday(birthday: str, reference: str) Dict[str, Any][source]

Submit birthday

submit_address(address: str, reference: str, city: str, state: str, zipcode: str) Dict[str, Any][source]

Submit address

check_pending_charge(reference: str) Dict[str, Any][source]

Check pending charge

Supports card, bank, USSD, mobile money, bank transfer, EFT (South Africa), and QR code channels:

from djpaystack import PaystackClient
client = PaystackClient()

# Bank transfer (Pay with Transfer)
client.charge.create(
    email='customer@example.com',
    amount=50000,
    bank_transfer={'account_expires_at': '2025-12-31T23:59:59'},
)

# QR code (scan-to-pay)
client.charge.create(
    email='customer@example.com',
    amount=50000,
    qr={'provider': 'visa'},
)

# EFT (South Africa / Ozow)
client.charge.create(
    email='customer@example.com',
    amount=50000,
    eft={'provider': 'ozow'},
)

# Submit PIN / OTP / Phone / Birthday / Address
client.charge.submit_pin(reference=..., pin=...)
client.charge.submit_otp(reference=..., otp=...)
client.charge.submit_phone(reference=..., phone=...)
client.charge.submit_birthday(reference=..., birthday=...)
client.charge.submit_address(reference=..., address=..., city=..., state=..., zipcode=...)

# Check pending charge
client.charge.check_pending(reference=...)

Payment Requests API

class djpaystack.api.payment_requests.PaymentRequestAPI(client)[source]

Bases: BaseAPI

Payment Requests API

create(customer: str, amount: int, due_date: str | None = None, description: str | None = None, line_items: List | None = None, tax: List | None = None, currency: str | None = None, send_notification: bool | None = None, draft: bool | None = None, has_invoice: bool | None = None, invoice_number: int | None = None, split_code: str | None = None) Dict[str, Any][source]

Create payment request

list(per_page: int = 50, page: int | None = None, customer: int | None = None, status: str | None = None, currency: str | None = None, include_archive: bool | None = None, from_date: str | None = None, to_date: str | None = None) Dict[str, Any][source]

List payment requests

fetch(id_or_code: str) Dict[str, Any][source]

Fetch payment request

verify(code: str) Dict[str, Any][source]

Verify payment request

send_notification(code: str) Dict[str, Any][source]

Send notification for payment request

total() Dict[str, Any][source]

Get payment request totals

finalize(code: str) Dict[str, Any][source]

Finalize payment request

update(id_or_code: str, customer: str | None = None, amount: int | None = None, currency: str | None = None, due_date: str | None = None, description: str | None = None, line_items: List | None = None, tax: List | None = None, send_notification: bool | None = None, draft: bool | None = None) Dict[str, Any][source]

Update payment request

archive(code: str) Dict[str, Any][source]

Archive payment request

client.payment_requests.create(customer=..., amount=..., description=...)
client.payment_requests.list()
client.payment_requests.fetch(id_or_code=...)
client.payment_requests.send_notification(id_or_code=...)
client.payment_requests.verify(code=...)

Pages API

client.pages.create(name=..., amount=..., description=...)
client.pages.list()
client.pages.fetch(id_or_slug=...)
client.pages.update(id_or_slug=..., name=...)
client.pages.check_slug_availability(slug=...)