Quickstart: Receive a Payment

Capera gives you two ways to collect NGN payments via virtual bank accounts:

TypeBest forAmountExpiry
StaticRecurring payments from a known customerAnyNever
DynamicOne-time invoice or order paymentsFixed24 hours

Both types receive payments the same way — the payer does a regular bank transfer to the virtual account number. You get a webhook when the money arrives.


Path A — Static Virtual Account

Use this when you want to give a customer a dedicated account number they can reuse.

Step 1: Create the customer

A static virtual account must be linked to a customer. Create one first.

curl -X POST https://api.withcapera.com/b2b/v1/customers \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "CUST-001",
    "firstName": "Amara",
    "lastName": "Okafor",
    "email": "[email protected]",
    "phoneNumber": "+2348012345678"
  }'

Request fields

FieldTypeRequiredDescription
referencestringYesYour unique identifier for this customer — must be unique per business
firstNamestringYesCustomer's first name
lastNamestringYesCustomer's last name
emailstringNoCustomer's email address
phoneNumberstringNoCustomer's phone number
bvnstringNoBank Verification Number
ninstringNoNational Identification Number

Response

{
  "success": true,
  "data": {
    "id": "cust_abc123",
    "reference": "CUST-001",
    "firstName": "Amara",
    "lastName": "Okafor",
    "email": "[email protected]",
    "phoneNumber": "+2348012345678",
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T10:00:00Z"
  }
}

Save the reference — you'll use it to generate and look up virtual accounts.

Step 2: Generate the virtual account

curl -X POST https://api.withcapera.com/b2b/v1/virtual-accounts/ngn \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "customerReference": "CUST-001"
  }'

Request fields

FieldTypeRequiredDescription
customerReferencestringYesThe reference you set when creating the customer
preferredBankstringNoRequest a specific bank provider. Omit to use the default.

Response

{
  "success": true,
  "data": {
    "id": "va_xyz789",
    "accountNumber": "1234567890",
    "accountName": "Amara Okafor - Your Business",
    "bankName": "Providus Bank",
    "createdAt": "2024-01-15T10:05:00Z",
    "updatedAt": "2024-01-15T10:05:00Z"
  }
}

Share the accountNumber and bankName with your customer. When they transfer any amount to that account, you will receive a customer.deposit.success webhook.


Path B — Dynamic Virtual Account

Use this when you need the payer to send an exact amount, for example to settle a specific invoice.

Generate a dynamic account

curl -X POST https://api.withcapera.com/b2b/v1/virtual-accounts/dynamic/ngn \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1500000
  }'

Request fields

FieldTypeRequiredDescription
amountintegerYesExpected payment amount in kobo. Minimum 100 (₦1).
preferredBankstringNoRequest a specific bank provider. Omit to use the default.

Amounts are in kobo. ₦1 = 100 kobo, ₦15,000 = 1,500,000 kobo.

Response

{
  "success": true,
  "data": {
    "accountNumber": "9900123456",
    "accountName": "Your Business Name",
    "bankName": "Providus Bank",
    "expiresIn": "24h0m0s",
    "fee": 50
  }
}
FieldDescription
accountNumberThe account number to share with the payer
accountNameYour business name as it appears on the account
bankNameThe bank providing the virtual account
expiresInHow long the account remains active
feeCollection fee in kobo deducted from the incoming deposit

The account accepts only the exact amount specified and expires after 24 hours. When payment arrives you will receive a deposit.success webhook.


Step 3: Handle the webhook

When a payment is received Capera sends a POST to your registered webhook URL.

Customer account deposit (customer.deposit.success)

{
  "id": "evt_ghi789",
  "event": "customer.deposit.success",
  "timestamp": "2024-01-15T12:00:00Z",
  "data": {
    "id": "dep_xyz456",
    "customerReference": "CUST-001",
    "amount": 1500000,
    "fee": 25,
    "currency": "NGN",
    "reference": "CAPERA-CUSTDEP-456",
    "senderAccountName": "John Smith",
    "senderAccountNumber": "1122334455",
    "senderBankName": "First Bank",
    "recipientAccountNumber": "1234567890",
    "recipientBankName": "Providus Bank",
    "sessionId": "000001240115...",
    "transactionId": "txn_abc789",
    "createdAt": "2024-01-15T12:00:00Z"
  }
}

Business account deposit (deposit.success) — received for dynamic accounts

{
  "id": "evt_def456",
  "event": "deposit.success",
  "timestamp": "2024-01-15T12:00:00Z",
  "data": {
    "id": "dep_xyz789",
    "amount": 1500000,
    "fee": 50,
    "currency": "NGN",
    "reference": "CAPERA-DEP-123",
    "senderAccountName": "Jane Doe",
    "senderAccountNumber": "9876543210",
    "senderBankName": "GTBank",
    "recipientAccountNumber": "9900123456",
    "recipientBankName": "Providus Bank",
    "sessionId": "000001240115...",
    "transactionId": "txn_xyz789",
    "createdAt": "2024-01-15T12:00:00Z"
  }
}

Always verify the webhook signature before processing. See Webhooks for signature verification details.


What's next


Did this page help you?