# Create and Assign Dedicated Virtual Accounts

> How to create a customer-linked dedicated virtual account on Paystack.

## Set up webhook handling first

1. Configure your webhook URL before creating live Dedicated Virtual Accounts (DVAs).
2. Listen for `charge.success` so inbound transfers to the account can be recorded as completed payments.
3. Also prepare to receive account-assignment events such as `dedicatedaccount.assign.success`, `dedicatedaccount.assign.failed`, and, where required, customer identification events.

Here's a sample `charge.success` authorization object for a payment into a DVA:

<localized-snippet src="payments/channels/dva-webhook-charge-success">



</localized-snippet>

## Create or update the customer

1. Create the customer record with `email`, `first_name`, `last_name`, and `phone`.
2. If the customer already exists, make sure those fields are present before you assign the account.
3. Update the customer first if any of those identity details are missing.

## Validate the customer where compliance requires it

1. Check whether your business category requires identity validation.
2. Collect customer consent before using personal data for DVA assignment.

<localized-value page-key="payments/channels/dedicated-virtual-accounts" path="validation_note">



</localized-value>

There are two ways to assign a DVA to a customer: a multi-step flow where you control each stage yourself, or a single-step flow where Paystack creates the customer, runs any required validation, and assigns the DVA in one request.

## Create the DVA (multi-step)

Call the DVA creation endpoint with the customer's code and preferred provider:

<localized-snippet src="payments/channels/dva-create-request">



</localized-snippet>

<localized-snippet src="payments/channels/dva-create-response">



</localized-snippet>

<localized-value page-key="payments/channels/dedicated-virtual-accounts" path="test_mode_note">



</localized-value>

<callout title="Supported providers" type="info">

Use the Fetch Providers endpoint to confirm the providers currently available on your account before setting `preferred_bank`.

</callout>

## Assign a DVA in one step (single-step)

### Required compliance

If your business category requires identity validation, include the customer's bank account and identification details in the same request:

<localized-snippet src="payments/channels/dva-assign-request-required">



</localized-snippet>

<localized-snippet src="payments/channels/dva-assign-response">



</localized-snippet>

This triggers a customer identification step before the account is assigned. You'll receive a `customeridentification.success` or `customeridentification.failed` event first:

<localized-snippet src="payments/channels/dva-customer-identification-events">



</localized-snippet>

### Optional compliance

If your business category doesn't require identity validation, pass only the customer's details and preferred provider:

<localized-snippet src="payments/channels/dva-assign-request-optional">



</localized-snippet>

<localized-snippet src="payments/channels/dva-assign-response">



</localized-snippet>

## Wait for assignment events

1. Treat the response as the start of an asynchronous process.
2. Wait for the relevant success event before marking the DVA as active in your system.
3. Handle failure events by keeping the customer record unassigned and surfacing the reason internally.

<localized-snippet src="payments/channels/dva-assignment-events">



</localized-snippet>

## Store the assigned account details

1. Save the DVA information against the customer record after assignment succeeds.
2. Use the returned account details as the customer's reusable transfer destination.
3. Expect future transfers into that account to be attributed automatically to the same customer.

You can also retrieve a customer's DVA later by calling Fetch Customer and reading the `dedicated_account` object from the response:

<localized-snippet src="payments/channels/dva-customer-response">



</localized-snippet>

## Requery only when necessary

1. Requery the DVA when a customer says they transferred but your system has not yet received the transaction.
2. Wait at least 10 minutes between requery attempts for the same account.

<localized-snippet src="payments/channels/dva-requery-request">



</localized-snippet>

<localized-snippet src="payments/channels/dva-requery-response">



</localized-snippet>

<callout title="Rate limit" type="warning">

You can only requery a DVA once every 10 minutes. Requests within that window are not processed.

</callout>
