Gafiapay Docs

Virtual Accounts

Learn how to create and manage virtual accounts using the Gafiapay API.


Generate Virtual Account

Create a new virtual account number for your customer.

Customer identifier required
You must include exactly one of bvn or nin. Do not send both. If both are provided, the API will use BVN.

Endpoint

POST /account/generate

Authentication

This endpoint requires API key authentication. Include your API key in the request headers:

json
{
  "x-api-key": "your_api_key",
  "x-signature": "generated_signature",
  "x-timestamp": "current_timestamp"
}

Request Parameters

Headers

Name Type Required Description
x-api-key string Yes Your API key
x-signature string Yes Request signature
x-timestamp string Yes Current timestamp
Content-Type string Yes application/json

Body Parameters

Name Type Required Description
name string Yes Customer's full name
email string Yes Customer's email address
bvn string Yes (or nin) Customer BVN (11 digits); sent as identityType: personal. Required unless nin is provided.
nin string Yes (or bvn) Customer NIN (11 digits); sent as identityType: personal_nin. Required unless bvn is provided. Aliases: NIN, ninNumber.

Send exactly one of bvn or nin. If both are provided, bvn takes precedence.

Request Examples

Request Example

json
{
  "name": "John Doe",
  "email": "john@example.com"
}

Request example (with customer BVN)

json
{
  "name": "John Doe",
  "email": "john@example.com",
  "bvn": "22345678901"
}

Response Example

json
{
  "status": "success",
  "data": {
    "bankName": "Virtual Bank",
    "accountNumber": "1234567890",
    "accountName": "John Doe",
    "userName": "John Doe"
  }
}

Error Responses

400 Bad Request — Missing Required Fields

json
{
  "status": "fail",
  "message": "name is required"
}

400 Bad Request — Virtual Account API Error

json
{
  "status": "fail",
  "message": "Virtual account error message from external API"
}

500 Internal Server Error

json
{
  "status": "fail",
  "error": "Internal server error details"
}

Important Notes

Account Reuse
If an account already exists for the provided email and business, the existing account will be updated with the new account number from our virtual account system.
Virtual Account System
Virtual accounts are generated through our secure API. The account numbers are 10-digit virtual account numbers provided by our system.
Identity for generation
Both permanent (POST /account/generate) and temporary (POST /account/generate/temporary) use the same identity rules: you must send exactly one of bvn or nin. Values must match Gafiapay's virtual account identity requirements.