Skip to content

Dedicated Virtual Accounts ​

Dedicated Virtual Account operations.

Use it as client.dedicated_virtual_accounts. Every method takes keyword arguments, returns a PaystackSdk::Response, and raises a PaystackSdk::Error if a parameter is invalid before anything is sent. An unsuccessful result from Paystack (a 400 or 404) comes back as a Response with success? false.

Methods ​

list ​

ruby
dedicated_virtual_accounts.list(
  active: nil,
  customer: nil,
  currency: nil,
  provider_slug: nil,
  bank_id: nil,
  per_page: nil,
  page: nil
)

List Dedicated Accounts.

List dedicated virtual accounts available on your integration.

ParameterTypeRequiredDescription
activeBooleanStatus of the dedicated virtual account
customerIntegerThe customer's ID
currencyStringThe currency of the dedicated virtual account One of: NGN, GHS.
provider_slugStringThe bank's slug in lowercase, without spaces
bank_idStringThe bank's ID
per_pageIntegerThe number of records to fetch per request
pageIntegerThe offset to retrieve data from

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#list

create ​

ruby
dedicated_virtual_accounts.create(customer:, preferred_bank: nil, subaccount: nil, split_code: nil)

Create Dedicated Account.

Create a dedicated virtual account for an existing customer

ParameterTypeRequiredDescription
customerStringyesThe code for the previously created customer
preferred_bankStringThe bank slug for preferred bank.
subaccountStringSubaccount code of the account you want to split the transaction with
split_codeStringSplit code consisting of the lists of accounts you want to split the transaction with

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#create

assign ​

ruby
dedicated_virtual_accounts.assign(
  email:,
  first_name:,
  last_name:,
  phone:,
  preferred_bank:,
  country:,
  account_number: nil,
  bvn: nil,
  bank_code: nil,
  subaccount: nil,
  split_code: nil
)

Assign Dedicated Account.

With this endpoint, you can create a customer, validate the customer, and assign a DVA to the customer.

ParameterTypeRequiredDescription
emailStringyesCustomer's email address
first_nameStringyesCustomer's first name
last_nameStringyesCustomer's last name
phoneStringyesCustomer's phone name
preferred_bankStringyesThe bank slug for preferred bank.
countryStringyesThe two letter code country One of: NG, GH.
account_numberStringCustomer's account number
bvnStringCustomer's Bank Verification Number
bank_codeStringCustomer's bank code
subaccountStringSubaccount code of the account you want to split the transaction with
split_codeStringSplit code consisting of the lists of accounts you want to split the transaction with

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#assign

fetch ​

ruby
dedicated_virtual_accounts.fetch(dedicated_account_id:)

Fetch Dedicated Account.

Get details of a dedicated virtual account on your integration.

ParameterTypeRequiredDescription
dedicated_account_idStringyesID of dedicated virtual account

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#fetch

deactivate ​

ruby
dedicated_virtual_accounts.deactivate(dedicated_account_id:)

Deactivate Dedicated Account.

Deactivate a dedicated virtual account on your integration.

ParameterTypeRequiredDescription
dedicated_account_idStringyesID of dedicated virtual account

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#deactivate

requery ​

ruby
dedicated_virtual_accounts.requery(account_number: nil, provider_slug: nil, date: nil)

Requery Dedicated Account.

Requery Dedicated Virtual Account for new transactions

ParameterTypeRequiredDescription
account_numberStringVirtual account number to requery
provider_slugStringThe bank's slug in lowercase, without spaces.
dateStringThe day the transfer was made

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#requery

add_split ​

ruby
dedicated_virtual_accounts.add_split(account_number:, subaccount: nil, split_code: nil)

Split Dedicated Account Transaction.

Split a dedicated virtual account transaction with one or more accounts

ParameterTypeRequiredDescription
account_numberStringyesValid Dedicated virtual account
subaccountStringSubaccount code of the account you want to split the transaction with
split_codeStringSplit code consisting of the lists of accounts you want to split the transaction with

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#add-split

remove_split ​

ruby
dedicated_virtual_accounts.remove_split(account_number:)

Remove Split from Dedicated Account.

If you've previously set up split payment for transactions on a dedicated virtual account, you can remove it with this endpoint

ParameterTypeRequiredDescription
account_numberStringyesValid Dedicated virtual account

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#remove-split

fetch_bank_providers ​

ruby
dedicated_virtual_accounts.fetch_bank_providers

Fetch Bank Providers.

Get available bank providers for a dedicated virtual account

Paystack docs: https://paystack.com/docs/api/dedicated-virtual-account/#providers

Unofficial community SDK. Not affiliated with or endorsed by Paystack. · MIT License · rubygems.org/gems/paystack_sdk