Overview
Anchors Payment API allows you to receive payments from your clients or retailers. Our payment API supports payment via bank transfers to virtual account numbers (virtual nubans). You can receive a payment by making a transfer to the virtual account number (virtual nubans) linked to your deposit account or sub-legder account.
Use the Virtual Account Number (Virtual NUBAN) Guide to create virtual account numbers for your organization
Fetch Payments
Here are some of the main endpoints you can access:
Verb | Endpoint | Description |
---|---|---|
GET | {{baseUrl}}/api/v1/payments/{paymentId} | Fetch a specific payment |
GET | {{baseUrl}}/api/v1/payments | Retrieve list of all payments |
Sample Payment Resource:
curl --request GET \
--url https://api.sandbox.getanchor.co/api/v1/payments/169900905874731-anc_py \
--header 'accept: application/json' \
--header 'x-anchor-key: <API Key>'
{
"data": {
"id": "169900905874731-anc_py",
"type": "Payment",
"attributes": {
"createdAt": "2023-11-03T10:57:39",
"amount": 1000000,
"paymentReference": "1d7e18f2-0632-4c97-8397-697fba3f6465",
"fee": 0,
"narration": "Test transaction",
"paidAt": "2023-11-03T10:57:39",
"counterParty": {
"accountNumber": "1234567890",
"accountName": "Precious Owu",
"bank": {
"name": "STANBIC IBTC BANK"
}
},
"currency": "NGN",
"type": "BankTransfer"
},
"relationships": {
"settlements": {
"data": [
{
"id": "169900906038363-anc_set",
"type": "PaymentSettlement"
}
]
},
"virtualNuban": {
"data": {
"id": "169792321695657-anc_va",
"type": "VirtualNuban"
}
},
"settlementAccount": {
"data": {
"id": "16922123768364-anc_acc",
"type": "DepositAccount"
}
}
}
}
}
Query Parameters
Use query parameters to filter and customize your API responses. For example, \?virtualNubanId=169792321695657-anc_va
to fetch payments related to the virtual account number 169792321695657-anc_va.
Other available parameters are:accountId
,virtualNubanId
, from
, to
, metadata
, query\
Sample Payload to filter by payments made to a virtualNubanId
curl --request GET \
--url 'https://api.sandbox.getanchor.co/api/v1/payments?virtualNubanId=169792321695657-anc_va' \
--header 'accept: application/json' \
--header 'x-anchor-key: <API Key>'
{
"data": [
{
"id": "169900905874731-anc_py",
"type": "Payment",
"attributes": {
"createdAt": "2023-11-03T10:57:39",
"amount": 1000000,
"paymentReference": "1d7e18f2-0632-4c97-8397-697fba3f6465",
"fee": 0,
"narration": "Test transaction",
"paidAt": "2023-11-03T10:57:39",
"counterParty": {
"accountNumber": "1234567890",
"accountName": "Precious",
"bank": {
"name": "STANBIC IBTC BANK"
}
},
"currency": "NGN",
"type": "BankTransfer"
},
"relationships": {
"settlements": {
"data": [
{
"id": "169900906038363-anc_set",
"type": "PaymentSettlement"
}
]
},
"virtualNuban": {
"data": {
"id": "169792321695657-anc_va",
"type": "VirtualNuban"
}
},
"settlementAccount": {
"data": {
"id": "16922123768364-anc_acc",
"type": "DepositAccount"
}
}
}
}
],
"meta": {
"pagination": {
"number": 0,
"size": 20,
"total": 1,
"totalPages": 1
}
}
}
Support Included
You can use the support included feature to fetch related resources for a payment with on API call.
curl --request GET \
--url 'https://api.sandbox.getanchor.co/api/v1/payments/169900905874731-anc_py?include=DepositAccount' \
--header 'accept: application/json' \
--header 'x-anchor-key: <API Key>'
{
"data": {
"id": "169900905874731-anc_py",
"type": "Payment",
"attributes": {
"createdAt": "2023-11-03T10:57:39",
"amount": 1000000,
"paymentReference": "1d7e18f2-0632-4c97-8397-697fba3f6465",
"fee": 0,
"narration": "Test transaction",
"paidAt": "2023-11-03T10:57:39",
"counterParty": {
"accountNumber": "1234567890",
"accountName": "Precious",
"bank": {
"name": "STANBIC IBTC BANK"
}
},
"currency": "NGN",
"type": "BankTransfer"
},
"relationships": {
"settlements": {
"data": [
{
"id": "169900906038363-anc_set",
"type": "PaymentSettlement"
}
]
},
"virtualNuban": {
"data": {
"id": "169792321695657-anc_va",
"type": "VirtualNuban"
}
},
"settlementAccount": {
"data": {
"id": "16922123768364-anc_acc",
"type": "DepositAccount"
}
}
}
},
"included": [
{
"id": "16922123768364-anc_acc",
"type": "DepositAccount",
"attributes": {
"createdAt": "2023-08-16T18:59:37",
"bank": {
"id": "16565854883910-anc_bk",
"name": "CORESTEP MICROFINANCE BANK",
"cbnCode": "",
"nipCode": "090365"
},
"accountName": "Great Business",
"frozen": false,
"currency": "NGN",
"accountNumber": "******3681",
"type": "FBO",
"status": "ACTIVE"
},
"relationships": {
"subAccounts": {
"data": [
{
"id": "16942634915344-anc_subacc",
"type": "SubAccount"
},
{
"id": "16974678542522-anc_subacc",
"type": "SubAccount"
}
]
},
"virtualNubans": {
"data": [
{
"id": "16977064849536-anc_va",
"type": "VirtualNuban"
},
{
"id": "169792321695657-anc_va",
"type": "VirtualNuban"
}
]
},
"customer": {
"data": {
"id": "16922123736510-anc_bus_cst",
"type": "BusinessCustomer"
}
}
}
}
]
}
Updated 3 months ago