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.

Endpoint

POST /account/generate

Authentication

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

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

Request Parameters

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

Request Example

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

Response Example

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

Error Responses

400 Bad Request - Missing Required Fields

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

400 Bad Request - Virtual Account API Error

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

500 Internal Server Error

{
  "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.

📋 Business Requirements

Your business must have a valid license number in the compliance section to generate virtual accounts. This is required for account creation.