Dynamic Virtual Account - v2
This module contains APIs that allow you generate a pool of Virtual Accounts that can be assigned on a transaction basis. This means that you can set a timer for expiry, a transaction ref, determine the amount to be collected. Please note that all accounts created will now bear the merchant's business name and no longer SQUAD CHECKOUT as it used to be. The format will now be SQUAD_MERCHANT BUSINESS NAME. (Also note that this doesn't affect already created accounts in the pool). After creating the pool of accounts, the system automatically assigns accounts from your pool on a transaction basis. It has various webhook notifications for mismatch, expired and successful transaction as we as a re-query endpoint to see all transactions that have been queued for refunds, and those that have been refunded.
Please note that to create dynamic virtual accounts for your pools, your KYC account needs to be a GTB account number and is mapped to the BVN provided.
Process Flow
All accounts must be profiled before you can use this service as it is a restricted service for selected business. Kindly send a mail to help@squadco.com or growth@habaripay.com requesting permission to use this service.
Each merchant is assigned a separate pool of accounts and as such they are expected to create their accounts based on their use case and expected transaction volume.
To initiate a transaction, the merchant is to call the generate Dynamic virtual account endpoint and an account from your own pool will be made available for transaction and will be tied to the amount and duration you set.
Webhook notification is fired for 3 events: success, expired and mismatch.
There is a re-query that shows all payment attempts for a single transaction reference. It returns an array which contains the payment attempts and you can see the various status of either success, expired or mismatch where applicable.
API KEYS (Test Environment)
Create an account on our sandbox environment: sandbox.squadco.com
Share the merchant ID with the Technical Account Managers for Profiling.
Retrieve Authorization keys from the bottom of the Get Started Page.
Authorization Any request made without the authorization key (secret key) will fail with a 401
(Unauthorized)
response code.
The authorization key is sent via the request header as Bearer Token Authorization
If using other services such as payment gateway, do not use the same transaction reference
Example: Authorization: Bearer sandbox_sk_94f2b798466408ef4d19e848ee1a4d1a3e93f104046f
Create Dynamic VA Accounts
This allows you to create and assign dynamic virtual accounts to your pool. Only one account is generated per request.
This allows you to create and assign dynamic virtual accounts to your pool
POST
https://sandbox-api-d.squadco.com/virtual-account/create-dynamic-virtual-account
Where instant settlement is required, please pass the beneficiary_account parameter along with a GTBank account to the request body. Note: Only a GTBank should be used.
Sample:
Where a customized business name is required, please pass the name as "first_name" and "last_name" to the request body. Note: Only permitted merchants can use this feature.
Sample:
Initiate Dynamic Virtual Account Transaction
This API allows you to generate a Dynamic Virtual Account to be assigned to a customer. This is used to initiate a transaction.
POST
https://sandbox-api-d.squadco.com/virtual-account/initiate-dynamic-virtual-account
Request Body
Sample Request
Get Transactions
This API allows you re-query a transaction to see its status. It returns an array of all transaction attempts made including those that returned as a mismatch, those that expired and the successful transaction. Ultimately all expired and mismatched transactions will eventually be refunded.
This API allows you retrieve transactions to see their status.
GET
https://sandbox-api-d.squadco.com/virtual-account/get-dynamic-virtual-account-transactions/:transaction_reference
This API allows you re-query a transaction to see its status. It returns an array of all transaction attempts made including those that returned as a mismatch, those that expired and the successful transaction. Ultimately all expired and mismatched transactions will eventually be refunded.
Path Parameters
Edit Amount/Duration
This API allows you to edit the amount/duration of a dynamic transaction that has already been initiated. It takes the transction reference, the amount and duration.
Sample Request
This API allows you to edit the amount/duration of a dynamic transaction
PATCH
https://sandbox-api-d.squadco.com/virtual-account/update-dynamic-virtual-account-time-and-amount
Request Body
Simulate Payment Endpoint
This API allows you push test transactions. Please note that this APi is to be used only on the sandbox environment.
This is to be used only on the sandbox environment to do test transactions.
POST
https://sandbox-api-d.squadco.com/virtual-account/simulate/payment
Request Body
DVA REFUNDS
As earlier highlighted in this documentation, customers are expected to pay the exact amount specified for each initiated Dynamic Virtual Account within the specified time. Where a customer fails in any of these (mismatched or expired) the default flow is that the customer is automatically refunded.
However, for use cases where merchants require the mismatched or expired funds to be settled to them and they take on the responsibility of refunding the customers this can now be done:
Expired or mismatched DVA transactions will be processed to one of the following:
Merchant's Dashboard
Merchant's GTBank settlement account
Sub- merchant's wallet
PROCESS FLOW
A merchant must send a written request via mail for any of the profiling options. The mail should contain
Merchant ID
Where the mismatched/expired transactions should be settled (Merchant Dashboard, GTBank Settlement account or Sub-Merchant Wallet). The mail should be sent to the Key account manager with growth@squadco.com in copy of the mail.
If the request is approved, the merchant will be profiled internally and Informed
WEBHOOKS
Webhook Notification is sent for 3 different events/ status
Success: first transfer/transaction that is equal to the expected/specified amount and within the set duration.
Mismatch: A transfer that happens within the specified duration but expected amount is not equal to the transfered amount.
Expired: Transaction that happens after the set duration or after a successful transaction has been recorded, it doesn't matter if the transferred amount is equivalent to the expected amount.
To set your webhook, kindly visit your squad dashboard and go to the merchant setting page you will see a field labelled webhook URL. Only accounts with a valid webhook URL will receive notification.
Sample Webhook Notification (Success)
Sample Webhook Notification (Expired)
Sample Webhook Notification (Mismatch)
HASH SIGNATURE VALIDATION
Every webhook request comes with a hash signature on the request header. You are expected as a form of security to create a hash and compare to the hash sent via the header. The hash is a sha512 hash of some parameters in the payload using your squad secret/private key.
The signature in the header has the key: x-squad-encrypted-body The parameters to be hashed are seen below:
Webhook Payload to be hashed
Webhook Error Log
This contains all missed webhook notifications that we didn't get a 200 response for. The aim of this is to mitigate against missed webhooks.
Sample Error Log Response for DVA
Go Live
To go live, simply:
1. Change the base URL of your endpoints from sandbox-api-d.squadco.com to api-d.squadco.com
2. Sign up on our Live Environment
3. Sign the integration sign-off document after completing the UAT
4. Complete your KYC on the Live Environment
5. Use the secret key provided on the dashboard to replace the test keys from the sandbox environment to authenticate your live transactions.
Last updated