Skip to main content

Virtual Instruments

Introduction​

Virtual Instruments provide a Virtual Bank Account linked to customer balance account.

During customer onboarding Virtual Account can be auto-assigned and linked to customer's balance. If Virtual Account is not auto-assigned, assignment can be requested later using the provided methods.

Key Features​

  • Get Virtual Account information.
  • Request assignment of new Virtual Account.
  • Track Virtual Account assignment process.

Prerequisites​

Before integrating the Virtual Instrument service, ensure you have:

  • A valid Paysafe account with appropriate permissions.
  • Set up instructions for Paysafe SDK Android or iOS.

To get started, initialize the VirtualInstrumentService instance in your app as shown below:

import com.paysafe.wallet.android.core.wallet.Wallet

val virtualInstrumentService = Wallet.getInstance().getVirtualInstrumentService()

Retrieve Virtual Instruments​

To retrieve all virtual instruments associated with a specific account, use Get Customer Accounts functionality provided by the ProfileService.

Get Supported Virtual Instrument Types​

Use getSupportedTypes method to retrieve the supported types of virtual instruments for the account represented by the VirtualInstrumentTypeList object.

val accountId = "acde070d-8c4c-4f0d-9d8a"

val supportedTypes = virtualInstrumentService.getSupportedTypes(accountId)

Get status of all Virtual Instrument Request​

Use getAllRequestStatuses method to retrieve the list of virtual instrument assignment request statuses of the account represented by the VirtualInstrumentsRequestStatusParameters object.

val virtualInstrumentsParameters = VirtualInstrumentsRequestStatusParameters(
limit = 10,
offset = 0,
accountId = "12345",
instrumentType = null // filters instruments of specific type i.e. VirtualInstrumentType.US_BANK_ACCOUNT
)

val requests = virtualInstrumentService.getAllRequestStatuses(virtualInstrumentsParameters)

Get status of Virtual Instrument assignment request​

Use getRequestStatus method to retrieve the status of a given virtual instrument assignment request.

val virtualInstrumentRequestId = "acde070d-8c4c-4f0d-9d8a"

val request = virtualInstrumentService.getRequestStatus(virtualInstrumentRequestId)

Request assignment of new Virtual Instrument​

Use requestVirtualInstrument method to request a new virtual instrument by passing the VirtualInstrumentRequest object.

val virtualInstrumentRequest = VirtualInstrumentRequest(
accountId = "12345",
instrumentType = VirtualInstrumentType.US_BANK_ACCOUNT,
)

val virtualInstrumentRequest = virtualInstrumentService.requestVirtualInstrument(virtualInstrumentRequest)