Esc

Gafiapay API

Generate and manage virtual accounts for your customers, receive payment notifications, and refund payments, from your own server.

Gafiapay gives each of your customers a 10-digit virtual account number. When a customer transfers money to that number, the payment is credited to your Gafiapay balance and your server receives a webhook. The API is REST over HTTPS, takes and returns JSON, and every request is signed with your secret key.

Only verified businesses can use the API. Each account is tied to a customer's name and email, and to their BVN, NIN or CAC number.

Quickstart

  1. Create and verify your business

    Sign up for a Gafiapay business account and complete KYC. Your verification status must be completed before the API accepts your requests.

  2. Get your API keys

    Generate an API key and a secret key in the dashboard. See API key setup.

  3. Sign your requests

    Send x-api-key, x-timestamp and an HMAC SHA-256 x-signature with every call. See Authentication.

  4. Generate your first account

    Call POST /account/generate with your customer's details:

    curl -X POST 'https://api.gafiapay.com/api/v1/external/account/generate' \
      -H 'Content-Type: application/json' \
      -H 'x-api-key: your_api_key' \
      -H 'x-timestamp: 1678901234567' \
      -H 'x-signature: generated_signature' \
      -d '{
        "name": "John Doe",
        "email": "john@example.com",
        "bvn": "22345678901"
      }'

Base URL

All endpoints are relative to this URL:

Base URL
https://api.gafiapay.com/api/v1/external

Endpoints

Responses

Every response is JSON with a status field. Successful calls return success and put the result in data:

JSON
{
  "status": "success",
  "data": {
    // Response data specific to the endpoint
  }
}

Failed calls return fail for a client error (4xx) or error for a server error (5xx), with a readable message. See authentication errors for the most common ones.

Best practices

  • Keep keys on your server. Never put your API or secret key in client-side code or a public repository. Store them in environment variables.
  • Check status on every response. Retry 429 and 5xx errors with backoff. Before retrying a refund, check its status so you don't refund twice.
  • Paginate lists. Use page and limit when listing accounts or refunds.
  • Verify your business first. Requests from businesses that aren't verified return 401.
Building with an AI coding agent?

Download the integration guide for AI agents. It's one Markdown file with the whole API and the rules agents most often get wrong. Give it to Claude Code, Cursor or Copilot along with the features you want.

GafiaPayGafiaPayDocs
Guide for AI agents Dashboard