Skip to main content

Overview

The Collections API handles money coming in to your platform — the opposite of Payments, which handles money going out. When a customer wants to pay you, you use the Collections API to:
  1. Create a collection reference (a payment link or account number) for the customer.
  2. The customer sends money to that reference from any bank in Nigeria.
  3. The platform credits your virtual account and fires a webhook to notify you instantly.
  4. You query the Collections API to reconcile and confirm the credit.
Collections work over the NIP network, so funds arrive in near real-time.

Base URL

EnvironmentBase URL
Sandboxhttps://sandbox.api.unionbank.ng
Productionhttps://api.unionbank.ng

Authentication

Authorization: ApiKey <your-api-key>

How Collections Work

Your platform                  Customer                   NIP Network
     │                             │                            │
     │──POST /collections/intent──▶│                            │
     │◀──collection_reference──────│                            │
     │                             │                            │
     │                             │──Bank transfer────────────▶│
     │                             │                            │──Credits virtual account
     │◀──Webhook notification──────────────────────────────────│
     │                             │                            │
     │──GET /collections/{id}──────────────────────────────────▶│
     │◀──Confirmed credit──────────────────────────────────────│

Endpoints

Create Collection Intent

POST /v1/collections/intent Generate a unique payment reference for a customer to send you money. You can set an exact expected amount (for invoices) or leave it open (for top-ups). What you send:
FieldTypeRequiredDescription
destination_account_idstringYesThe virtual account that should receive the funds
expected_amountintegerNoExpected amount in kobo. If set, only this exact amount is accepted
currencystringYesAlways NGN
descriptionstringNoWhat this payment is for — shown in the webhook and statement
expires_atstringNoISO 8601 datetime after which this intent expires. Default: never
customer_refstringNoYour internal reference for the customer (e.g., order ID)
metadataobjectNoAny key-value pairs for your own records
What you get back:
FieldDescription
collection_idUnique ID for this collection intent
collection_referenceA unique string the customer includes in their transfer narration
destination_account_numberThe NUBAN to send money to
destination_bank_nameAlways Union Bank of Nigeria
destination_bank_codeUnion Bank’s CBN bank code
expected_amountAmount in kobo (if specified)
statuspending — waiting for payment
expires_atExpiry datetime or null
Example request:
{
  "destination_account_id": "acct_9d7e1c",
  "expected_amount": 150000,
  "currency": "NGN",
  "description": "Payment for Order #ORD-20240115-042",
  "customer_ref": "ORD-20240115-042"
}
Example response:
{
  "collection_id": "col_7b3f1a",
  "collection_reference": "UBN-COL-7B3F1A",
  "destination_account_number": "0123456789",
  "destination_bank_name": "Union Bank of Nigeria",
  "destination_bank_code": "032",
  "expected_amount": 150000,
  "currency": "NGN",
  "status": "pending",
  "expires_at": null,
  "created_at": "2024-01-15T11:00:00+01:00"
}
Show the customer the destination_account_number, destination_bank_code, and collection_reference. Instruct them to include the reference in the transfer narration so the payment is automatically matched to their order.

Get Collection Status

GET /v1/collections/{collection_id} Check whether a payment has been received for a specific collection intent. Status values:
StatusMeaning
pendingAwaiting payment from customer
partially_paidCustomer sent less than the expected amount
paidFull payment received — virtual account credited
overpaidCustomer sent more than expected
expiredIntent expired before payment arrived
cancelledManually cancelled via the API
What you get back:
FieldDescription
collection_idIntent identifier
statusCurrent status (see above)
expected_amountAmount expected in kobo
amount_receivedAmount actually credited in kobo
payment_referenceNIP session reference for the inbound transfer
paid_atISO 8601 timestamp when the credit was received

List Collections

GET /v1/collections Returns all collection intents for your business, with filtering options. Query parameters:
ParameterTypeDefaultDescription
statusstringallFilter by status
destination_account_idstringReturn only collections for this account
fromstringStart date YYYY-MM-DD
tostringEnd date YYYY-MM-DD
pageinteger1Page number
per_pageinteger20Max 100

Cancel Collection Intent

DELETE /v1/collections/{collection_id} Cancel an outstanding collection intent. Once cancelled, any payment arriving with this reference will be rejected and returned to the sender.

Webhooks for Collections

The fastest way to know a payment arrived is via a webhook. When a collection intent is paid, the platform immediately sends a collection.paid event to your webhook URL. Webhook payload example:
{
  "event": "collection.paid",
  "data": {
    "collection_id": "col_7b3f1a",
    "amount_received": 150000,
    "currency": "NGN",
    "payment_reference": "NIP20240115XXXXXX",
    "customer_ref": "ORD-20240115-042",
    "paid_at": "2024-01-15T11:03:47+01:00"
  }
}
See the Webhooks product guide for how to set up your webhook endpoint and verify the signature.

Simulating Payments in Sandbox

In the sandbox environment, incoming payments do not arrive automatically. Use the simulation endpoint to trigger a test credit: POST /v1/collections/{collection_id}/simulate-payment What you send:
FieldTypeRequiredDescription
amountintegerYesAmount to simulate in kobo
sender_namestringNoName of the simulated sender
sender_accountstringNoSimulated sender account number
This triggers the full webhook flow as if a real payment arrived — useful for testing your webhook handler end-to-end.

Error Codes

HTTP StatusError CodeMeaning
400VALIDATION_ERRORMissing or invalid fields
404COLLECTION_NOT_FOUNDNo collection intent with this ID
409COLLECTION_ALREADY_PAIDPayment already received for this intent
410COLLECTION_EXPIREDIntent has expired — create a new one
429RATE_LIMIT_EXCEEDEDToo many requests

Full API Reference

Open API Playground

Try Collections endpoints live in the browser