Dedicated Virtual Accounts Module

This wrapper class facilitates synchronous interaction with Paystack Dedicated Virtual Account API. The Dedicated Virtual Account API enables Nigerian merchants to manage unique payment accounts of their customers.

Note

Ensure Dedicated NUBAN is available for your business. Contact Paystack Support


class DedicatedVirtualAccountClientAPI(secret_key: str = None)

Paystack Customer API Reference: Dedicated Virtual Account

assign_dedicated_virtual_account(email: str, first_name: str, last_name: str, phone: str, preferred_bank: str, country: str, account_number: str | None = None, bvn: str | None = None, bank_code: str | None = None, subaccount: str | None = None, split_code: str | None = None)→ PayStackResponse

Ensure Dedicated NUBAN is available for your business. Contact Paystack Support

Parameters:
  • email (str) – The email address associated to the customer

  • first_name (str) – The first name of the customer

  • last_name (str) – The last name of the customer

  • phone (str) – The phone number associated to the customer

  • preferred_bank (str) – The preferred bank slug for the virtual account

  • country (str) – The country of the customer

  • account_number (str, optional) – The account number associated to the customer

  • bvn (str, optional) – The bvn of the customer

  • bank_code (str, optional) – The bank code associated to the customer

  • subaccount (str, optional) – Subaccount code of the account you want to split the transaction.

  • split_code (str, optional) – The split code of the account you want to split the transaction

Returns:

The response from the API.

Return type:

PayStackResponse object

create_virtual_account(customer_id_or_code: str, preferred_bank: str | None = None, subaccount: str | None = None, split_code: str | None = None, first_name: str | None = None, last_name: str | None = None, phone: str | None = None)→ PayStackResponse

Create a dedicated virtual account for existing customers. Currently, support Wema Bank and Titan Paystack.

Parameters:
  • customer_id_or_code (str) – The customer ID or code

  • preferred_bank (str, optional) – Preferred bank slug for the virtual account.

  • subaccount (str, optional) – Subaccount code of the account you want to split the transaction.

  • split_code (str, optional) – The split code of the account you want to split the transaction

  • first_name (str, optional) – The first name of the customer

  • last_name (str, optional) – The last name of the customer

  • phone (str, optional) – The phone number of the customer

Returns:

The response from the API

Return type:

PayStackResponse object

deactivate_dedicated_account(dedicated_account_id: int)→ PayStackResponse

Deactivate a dedicated virtual account

Parameters:

dedicated_account_id (int) – The id of the dedicated virtual account

Returns:

The response from the API

Return type:

PayStackResponse object

fetch_bank_providers()→ PayStackResponse

Fetch bank providers

Returns:

The response from the API

Return type:

PayStackResponse object

fetch_dedicated_account(dedicated_account_id: int)→ PayStackResponse

Get details of a dedicated virtual account

Parameters:

dedicated_account_id (int) – The id of the dedicated virtual account

Returns:

The response from the API

Return type:

PayStackResponse object

list_dedicated_account(active: bool | None = False, currency: str | None = None, provider_slug: str | None = None, bank_id: str | None = None, customer_id: str | None = None)→ PayStackResponse

List dedicated accounts

Parameters:
  • active (bool, optional) – Shows the status of the dedicated virtual account. (default: True)

  • currency (str, optional) – The currency of the dedicated virtual account

  • provider_slug (str, optional) – The preferred bank slug for the dedicated virtual account in lowercase

  • bank_id (str, optional) – The bank code for the dedicated virtual account

  • customer_id (str, optional) – The customer code for the dedicated virtual account

Returns:

The response from the API

Return type:

PayStackResponse object

remove_split_dedicated_account(account_number: str)→ PayStackResponse

Remove a split dedicated virtual account

Parameters:

account_number (str) – The account number for the dedicated virtual account

Returns:

The response from the API

Return type:

PayStackResponse object

requery_dedicated_account(account_number: str | None = None, provider_slug: str | None = None, date_transfer: date | None = None)→ PayStackResponse

Requery a dedicated virtual account for new transactions

Parameters:
  • account_number (str, optional) – Virtual account number to requery

  • provider_slug (str, optional) – Virtual account preferred bank in lowercase

  • date_transfer (date, optional) – Date of the transaction made

Returns:

The response from the API

Return type:

PayStackResponse object

Important

The preferred_bank parameter currently support Wema Bank and Titan Paystack.

The country parameter currently accepts NG only.