LogoLogo
  • GET STARTED
    • Integration Guide
    • Quick Start
  • Webhooks
    • Webhooks
      • Register a webhook
      • Webhook notification
      • Verify webhook
  • Payment APIs
    • Collect Payments
      • Virtual Accounts
        • Create a single-use virtual account
        • Create a multi-use virtual account
        • Update a virtual account
        • Delete a virtual account
        • List all virtual accounts
        • Get details of a virtual account
      • Digital Wallets
        • Create a wallet
        • List all wallets
        • Get details of a wallet
        • Transfer between wallets
        • Transfer to business
        • Sweep wallet balances
        • Get wallet balance
      • Customers
        • Create a customer
        • List all customers
        • Get customer details
      • Invoices
        • Create an invoice
        • Edit invoice
        • Resend invoice
        • List all invoices
        • Get invoice details
    • Make Payments
      • Request OTP to initiate payout
      • Get a list of registered banks
      • Get Wallet Balance
      • Verify account number
      • Initiate a payout
      • Get all transactions
      • Get details of a transaction
      • Recipients
        • Create a recipient
        • List all recipient
        • Get a recipient's details
        • Delete a recipient
        • Get recipients summary
    • Duplo Checkout
      • Checkout Redirect
        • Generate a checkout URL
      • Checkout SDK
      • Verify checkout transaction
    • Make Payments v2
      • Initiate a Payout v2
      • Resend OTP
      • Process Payout
      • Get details of a Transaction v2
Powered by GitBook
On this page
  • URI
  • Parameters
  • Sample request
  • Duplo Response

Was this helpful?

  1. Payment APIs
  2. Collect Payments
  3. Virtual Accounts

Create a multi-use virtual account

Create a multi-use virtual account to accept multiple time payment.

The multi-use account is valid for multiple time use

Depending on the partner bank you choose, we may require more information. These requirements are at the request of our partnering banks.

URI

POST

https://api.tryduplo.com/v1/virtual-accounts

Parameters

Header

Authorization string

set value to Bearer SECRET_KEY

Body Param

business_id string required

Buisness ID

first_name string required

Customer's first name

last_name string required

Customer's last name

phone_number string required

Customer's phone number

email string required

Customer's email address

bvn string

Customer's bank verification number

metadata string

Customer's specific data - Stringified JSON

is_permanent boolean required

Flags a virtual account as permanent. Should be set to true

preferred_banks array

List of Customer's preferred banks

purpose string required

Customer's purpose for creating a virtual account

amount number

Specifies the exact amount a virtual account should receive

single_use boolean required

Flag for a single use virtual account, should be set to false

Sample request

curl --location --request POST 'https://api.tryduplo.com/v1/virtual-accounts' \
--header 'Authorization: Bearer SECRET_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
   "first_name": "Pat",
   "last_name": "Daniel",
   "phone_number": "08085279945",
   "email": "patwiksingle@yopmail.com",
   "bvn": "39372746283",
   "is_permanent": true,
   "purpose": "Testing purpose",
   "preferred_banks": [
       {
           "bank_code": "111",
           "bank_name": "Wema Bank",
           "id": "wema"
       }
   ],
   "single_use": false,
   "metadata": "{'invocie': '10093743'}"
}'

var axios = require('axios');
var data = JSON.stringify({
 "first_name": "Pat",
 "last_name": "Daniel",
 "phone_number": "08012345678",
 "email": "patwiksingle@yopmail.com",
 "bvn": "39372746283",
 "is_permanent": true,
 "purpose": "Testing purpose",
 "preferred_banks": [
   {
     "bank_code": "111",
     "bank_name": "Wema Bank",
     "id": "wema"
   }
 ],
 "single_use": false,
 "metadata": '{}'
});

var config = {
 method: 'post',
 url: 'https://api.tryduplo.com/v1/virtual-accounts',
 headers: {
   'Authorization': 'Bearer SECRET_KEY',
   'Content-Type': 'application/json'
 },
 data : data
};

axios(config)
.then(function (response) {
 console.log(JSON.stringify(response.data));
})
.catch(function (error) {
 console.log(error);
});
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
 CURLOPT_URL => 'https://api.tryduplo.com/v1/virtual-accounts',
 CURLOPT_RETURNTRANSFER => true,
 CURLOPT_ENCODING => '',
 CURLOPT_MAXREDIRS => 10,
 CURLOPT_TIMEOUT => 0,
 CURLOPT_FOLLOWLOCATION => true,
 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 CURLOPT_CUSTOMREQUEST => 'POST',
 CURLOPT_POSTFIELDS =>'{
   "business_id": BUSINESS_ID,
   "first_name": "Pat",
   "last_name": "Daniel",
   "phone_number": "08085279945",
   "email": "patwiksingle@yopmail.com",
   "bvn": "39372746283",
   "is_permanent": true,
   "purpose": "Testing purpose",
   "preferred_banks": [
       {
           "bank_code": "111",
           "bank_name": "Wema Bank",
           "id": "wema"
       }
   ],
   "fallback_bank": true,
   "single_use": false,
   "amount": 3000,
   "metadata": {}
}',
 CURLOPT_HTTPHEADER => array(
   'Authorization: Bearer SECRET_KEY',
   'Content-Type: application/json'
 ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Duplo Response

{
    "data": {
        "account_ref": "act_jR8TvmZgiIHV",
        "account_number": "9190000023",
        "is_permanent": true,
        "email": "alindavdsin@gmail.com",
        "status": "active",
        "provider": {
            "bank_code": "111",
            "bank_name": "Wema Bank",
            "id": "wema",
            "credentials": {}
        },
        "created_at": "2022-02-01T18:20:19.000Z",
        "account_name": "David Daniel"
    },
    "errors": {},
    "message": "Account created successfully"
}
PreviousCreate a single-use virtual accountNextUpdate a virtual account

Last updated 5 months ago

Was this helpful?