Virtual Account
This implementation contains endpoints to create a virtual account with First Bank of Nigeria to ensure end users can make payments into the created account.
Please note that all endpoints are protected and require merchants to obtain an api-key which is to be passed as SHA-256 encoded string in the request header and a tag (merchantCode) field as a request param of the request being sent.
Making a GET request to the endpoint
https://testcollections.spaybusiness.com/api/v1/fbn/vaccount
With the following details as request params, all virtual accounts that has been created will be fetched
s/n | Property | Data Type | Example | Description |
---|---|---|---|---|
1 | merchantCode | string | “TST_jaakdjfkadjfk” | This will be gotten once user has successfully signed up on https://spaybusiness.com |
2 | offset | int | 1 | Starting point of the record to be pulled, often encouraged to support pagination |
3 | limit | int | 20 | Needed to reduce the amount of data being pulled at a time |
4 | tag | string | “TST_jaakdjfkadjfk” | This is the same as merchant code |
Sample Response body with the status code of 200
{
"content": [
{ "merchantCode": "TST_jaakdjfkadjfk",
"reservationId": 10109,
"accountName": "Jerrry",
"virtualAccountName": "Spay Business Solutions LTD/Jerry",
"virtualAccountNumber": "9100005726",
"currency": "NGN",
"batchId": "591920230721124528",
"expiryDate": "2023-07-22T02:17:39.364Z",
"phone": "08099387462",
"email": "[email protected]",
"accountState": "PENDING",
"durationLimit": 2,
"status": "CREATED",
"charge": 2.390,
"accountType": "Dynamic",
"customerId": "086a7f80-5ee4-4938-b728-d92fb0136a29",
"callbackUrl": "https://callingback.com",
"createdOn": "2023-07-22T02:17:39.364Z"
}
],
"count": 1,
"total": 1,
"last": true
}
Making a POST request to the endpoint
https://testcollections.spaybusiness.com/api/v1/fbn/vaccount
With the following details as JSON BODY, a virtual account with First bank of Nigeria will be created.
s/n | Property | Data type | Example | Description |
---|---|---|---|---|
1 | accountName | string | "Jerry" | This could be customer's name or merchant’s name |
2 | merchantCode | string | “TST_jaakdjfkadjfk” | This will be gotten once user has successfully signed up on https://spaybusiness.com |
3 | durationType | string | DAY or HOUR | To state when the virtual account created will expire. These are the two types of duration type available for now |
4 | accountType | int | 1 or 2 | Static account = 1 and Dynamic account is 2. These are the two types of account type available for now |
5 | expiryLimit | int | 1 to 5 | States how long it will take the virtual account to expire. Saying durationType: DAY and expiryLimit: 2. This means account created will expire in two days |
6 | string | [email protected] | Customer email | |
7 | callbackUrl | string | https://callingback.com | This is a dedicated url to be called when customer successfully made payment |
Sample Response body with the status code of 200
{
"merchantCode": "TST_jaakdjfkadjfk",
"reservationId": 10003,
"accountName": "Jerry",
"virtualAccountName": "SPay Business Solutions Ltd/Jerry",
"virtualAccountNumber": "9100005721",
"currency": "NGN",
"batchId": "591920230720024529",
"expiryDate": "2023-07-26T00:00:00",
"phone": "08088492993",
"email": "[email protected]",
"accountState": "PENDING",
"durationLimit": 5,
"status": "CREATED",
"charge": 3.2300,
"accountType": "Dynamic",
"customerId": "086a7f80-5ee4-4938-b728-d92qw0136a50",
"callbackUrl": "https://callingback.com",
"createdOn": "2023-07-21T12:46:43.053237"
}
Making a GET request to the endpoint
https://testcollections.spaybusiness.com/api/v1/fbn/vaccount/{reservationId}
Hitting this endpoint with merchantCode as query params and reservationId as path variable, this will fetch a previously created virtual account with First bank of Nigeria.
s/n | Property | Data type | Description | Example |
---|---|---|---|---|
1 | reservationId | string | This is the id gotten from the create virtual account leg | 10767 |
2 | merchantCode | string | “TST_jaakdjfkadj fk” | This will be gotten once user has successfully signed up on https://spaybusiness.com |
3 | tag | string | “TST_jaakdjfkadj fk” | This is the same as merchant code |
Sample Response body with the status code of 200
{
"merchantCode": "TST_jaakdjfkadjfk",
"reservationId": 10109,
"accountName": "Jerrry",
"virtualAccountName": "Spay Business Solutions LTD/Jerry",
"virtualAccountNumber": "9100005726",
"currency": "NGN",
"batchId": "591920230721124528",
"expiryDate": "2023-07-22T02:17:39.364Z",
"phone": "08099387462",
"email": "[email protected]",
"accountState": "PENDING",
"durationLimit": 2,
"status": "CREATED",
"charge": 2.390,
"accountType": "Dynamic",
"customerId": "086a7f80-5ee4-4938-b728-d92fb0136a29",
"callbackUrl": "https://callingback.com",
"createdOn": "2023-07-22T02:17:39.364Z"
}
Updated over 1 year ago