A community supported Dotnet SDK that enables developers to build fintech products securely and seamlessy leveraging Fincra's API.
- To get started with this SDK, create an account on Fincra or a sandbox account if you haven't already.
- You can then retrieve your API keys from your sandbox dashboard or account dashboard..
Using Nuget
,
Install-Package com.Fincra.SDK.Dotnet
using Fincra.SDK;
Instantiate the Fincra class
string fincraSecretKey = GetEnvironmentVariable("FINCRA_SECRET_KEY");
bool IfSandbox = sandbox ? true : false;
FincraApi fincra = new FincraApi(fincraSecretKey, IfSandbox);
Note:
-
The sandbox field is optional, if you don't specify it, it will default to true, else if false, it will be using the production(live) API. For example:
-
For more information about the services exposed by the SDK, please refer to the documentation.
-
Be sure to keep your API Credentials securely in environment variables.
The following services are available with this SDK
1. Business
- Create a beneficiary
- Fetch a beneficiary
- List beneficiaries
- Update a beneficiary
- Delete a beneficiary
3. Chargebacks
4. Collections
- Pay With Transfer
- List Collection for a main Virtual Account
- List Collection for Additional Virtual Accounts
- Fetch a collection for an additional virtual account
5. Conversions
6. Payouts
- Wallet to wallet transfer
- Create a Payout
- Upload a payout(transaction) document
- Fetch a payout by reference
- Fetch a payout by Customer Reference
- List Banks
- List Payouts
7. Quotes
8. Verification
- Create a virtual account
- List merchant virtual accounts
- List virtual account requests
- Fetch a virtual account by currency
- Fetch a single virtual account
- List Sub-account Virtual Accounts
- Deactivate a Virtual Account
10. Wallets
A business represents the merchant or any entity making use of this SDK.
This method lets you retrieves the unique Identifier of your business and other information such as your email etc.
The unique identifier(businessId) allows your business to access other services.
var business = fincra.Business.getBusinessId();
The beneficiary’s service allows the business to create beneficiaries that can receive payments.
NOTE: Beneficiaries and recipients are used interchangeably in this documentation.
This method is used for creating a Beneficiary.
var request = new BeneficiaryRequest { ... };
var createBen = fincra.Beneficiary.CreateBeneficiary(BusinessId, request);
- More details about the parameters for the above method here
This method provides the ability to retrieve a list of beneficiaries attached to a business.
var listBen = fincra.Beneficiary.ListBeneficiaries(BusinessId, Page, PerPage);
This method is used for retrieving a single beneficiary attached to a business.
var fetchBen = fincra.Beneficiary.FetchBeneficiary(BusinessId, BeneficiaryID);
Parameters | Data type | Required | Description |
---|---|---|---|
BusinessId |
string | true | The business unique identifier. |
BeneficiaryId |
string | true | The id of the beneficiary |
This method is used for updating a Beneficiary.
var request = new BeneficiaryRequest { ... };
var updateBen = fincra.Beneficiary.UpdateBeneficiary(BusinessId, BeneficiaryID, request);
- More details about the parameters for the above method here
This method is used for deleting a beneficiary.
var deleteBen = fincra.Beneficiary.DeleteBeneficiary(BusinessId, BeneficiaryID);
Parameters | Data type | Required | Description |
---|---|---|---|
BusinessId |
string` | true | The business unique identifier. |
BeneficiaryId |
string | true | The id of the beneficiary. |
The chargeback service.
This method lets you list all the chargebacks incurred on your account.
var listCharge = fincra.Chargebacks.ListChargeBacks(BusinessId);
Parameters | Data type | Required | Description |
---|---|---|---|
BusinessId |
string | true | The business unique identifier. |
This method lets you accept a chargeback
var acceptCharge = fincra.Chargebacks.AcceptChargeBack(BusinessId, ChargeBackId);
Parameters | Data type | Required | Description |
---|---|---|---|
BusinessId |
string | true | The business unique identifier. |
ChargeBackId |
string | true | The id of the specific chargeback. |
This method lets you reject a chargeback
var request = new ChargeBackRequest { ... };
var rejectCharge = fincra.Chargebacks.RejectChargeBack(BusinessId, ChargeBackId, request);
Parameters | Data type | Required | Description |
---|---|---|---|
BusinessId |
string |
true |
the business unique identifier . |
ChargeBackId |
string |
true |
the current page |
BusinessRejectReason |
string |
true |
the reason for the chargeback |
The Collections service enables you to perform actions such as viewing all deposits that come into your account etc.
This method lets you create a temporary virtual account that can be used to receive payments over a period of time
var request = new PayWithTransferRequest { ... };
var payWithTransfer = fincra.Collection.PayWithTransfer(request);
Parameters | Data type | Required | Description |
---|---|---|---|
ExpiresAt |
string | true | The expiry of the virtual account in minutes. |
Name |
string | false | The name that should be on the account. |
MerchantReference |
string | false | The unique identifier of the transaction on your system . |
This service can be used to view both a single or multiple collections of a main virtual account
var request = new PayWithTransferRequest { ... };
var listCollection = fincra.Collection.ListCollectionMain(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Business |
string | true | The business unique identifier. |
Reference |
string | false | The reference of the transaction. |
Page |
string | false | The current page. |
PerPage |
string | false | The number of collections to be viewed per page. |
This method is used for getting all collections of an additional virtual account for a business
var request = new CollectionParams { ... };
var listAdditional = fincra.Collection.ListCollectionAdditional(CollectionParams request);
Parameters | Data type | Required | Description |
---|---|---|---|
Business |
string | true | The business unique identifier. |
Status |
array | true | The status of the collection e.g ["processing", "failed", "successful]. |
SourceCurrency |
string | true | The currency the payments was sent in. |
DestinationCurrency |
string | true | The currency the recipient receives. |
SubAccount |
string | true | The ID of the subAccount. |
Page |
string | false | Specify exactly what page you want to retrieve. |
PerPage |
string | false | How many records you want to retrieve per page. |
DateFrom |
string | true | The start date. This must be in ISO 8601 date format(YYYY-MM-DD). |
DateTo |
string | true | The end date.This must be in ISO 8601 date format(YYYY-MM-DD). |
This method is used for retrieving a single collection of an additional virtual account by a reference
var fetchCollection = fincra.Collection.FetchCollectionAddition(BusinessId, Reference);
Parameters | Data type | Required | Description |
---|---|---|---|
Reference |
string | true | The unique reference of the collection. |
Business |
string | false | The business unique identifier. |
The Conversions service provides methods that can be used to initiate conversion between two different currencies and also fetch conversions previously generated.
This method can convert one currency to another provided that it's a supported conversion currency e.g NGN to USD.
var request = new CreateConversionRequest { ... };
var createConvert = fincra.Conversion.CreateConversion(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Business |
string | true | The business unique identifier. |
QuoteReference |
string | true | This is the reference generated for the quote. |
This method fetches a specific conversion performed by a parent Business or sub account.
var fetchConvert = fincra.Conversion.FetchConversion(ConversionId);
Parameters | Data type | Required | Description |
---|---|---|---|
ConversionId |
string | true | The id of a specific conversion. |
This method provides a list of all conversions performed by a business.
var listBusinessConversions = fincra.Conversion.GetBusinessConversions(BusinessId);
Parameters | Data type | Required | Description |
---|---|---|---|
BusinessId |
string | true | The business unique identifier. |
The payout service can be used to initiate payouts to supported payment destinations.
This method lets you make payouts to bank accounts and mobile money wallets
var request = new CreatePayoutRequest { ... };
var createPayout = fincra.Payouts.CreatePayout(request);
- More details about the parameters for the above method here
This method lets you transfer funds from your wallet to the wallet of another user on our platform
var request = new WalletTransferRequest { ... };
var walletToWallet = fincra.Payouts.WalletToWalletTransfer(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Amount |
string | true | The value that is to be transferred from the source currency wallet. |
Business |
string | true | The business unique identifier. |
CustomerReference |
string | true | The reference of the transaction. |
Description |
string | true | The purpose of payment. |
BeneficiaryWalletNumber |
string | true | This is the unique wallet number of the beneficiary you want to make payment to. |
This method lets a business view all her payouts and that of her subaccounts
var request = new ListPayoutParams { ... };
var allPayout = fincra.Payouts.ListPayouts(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Business |
string | true | The business unique identifier. |
Status |
array | true | The status of the collection e.g ["processing", "failed", "successful]. |
SourceCurrency |
string | true | The currency the payments was sent in. |
DestinationCurrency |
string | true | The currency the recipient receives. |
SubAccount |
string | true | The ID of the subAccount. |
Page |
string | false | Specify exactly what page you want to retrieve. |
PerPage |
string | false | How many records you want to retrieve per page. |
DateFrom |
string | true | The start date. This must be in ISO 8601 date format(YYYY-MM-DD). |
DateTo |
string | true | The end date.This must be in ISO 8601 date format(YYYY-MM-DD). |
This method lets you process a payout that requires the upload of a document.
var request = new UploadTransactionDocumentRequest { ... };
var uploadPayout = fincra.Payouts.UploadTransactionDocument(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Name |
string | true | The name of the document. |
Type |
string | true | The type of document required to complete the transaction. After the payout has been initiated, this can be obtained from the response object of the payout response. |
Reference |
string | true | This is the unique reference generated for the payout. |
File |
string | true | The document required encoded to a base64 format. |
This method lets you retrieve and view a specific payout.
var fetchPayout = fincra.Payouts.FetchPayout(Reference);
This method lets you retrieve and view a specific payout by the customer reference
var fetchCustomer = fincra.Payouts.FetchCustomerPayout(string CustomerReference);
Parameters | Data type | Required | Description |
---|---|---|---|
CustomerReference |
string | true | The transaction's unique identifier on your system. |
This method lets you view a list of banks and mobile money wallet providers, together with their details such as code, swiftCode, and Bic.
var banks = fincra.Payouts.ListBanks();
The Quotes service provides a method that allows you to generate quotes for Real-time transactions occurring on your integration.
This method is used for generating a quote.
var request = new CreateQuoteRequest { ... };
var newQuote = fincra.Quote.CreateQuote(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Action |
string | true | This value can only be "send" for conversions and disbursement. |
Amount |
string | true | The amount you want to send or convert. |
BeneficiaryType |
string | true | The beneficiary type e.g individual or corporate. This is necessary in order to generate quotes for all African currencies. |
Business |
string | true | This is the ID of the business. |
DestinationCurrency |
string | true | The currency in which the recipient will be receiving funds. |
FeeBearer |
string | true | The bearer of the fees. it is usually one of conversion or business. |
PaymentDestination |
string | true | The payment destination. it is one of bank_accounts, fliqpay_wallet, mobile_money_wallet. |
PaymentScheme |
string | true | This is the valid payment scheme for the destination currency you want to generate a quote for. This is only required when the transaction type is disbursement and not conversion. |
SourceCurrency |
string | true | The currency which is used to fund a currency conversion or payout. |
TransactionType |
string | true | The transaction type. It is usually one of conversion or disbursement. |
This service lets you make kyc verification, payment verification, and account verification.
This method lets you verify a bank account.
var request = new VerifyBankAccountRequest { ... };
var verifyBank = fincra.Verify.VerifyBankAccount(request);
Parameters | Data type | Required | Description |
---|---|---|---|
AccountNumber |
string | true | The account number of the bank. |
BankCode |
string | true | The bank Code. This is required for NUBAN accounts. |
Type |
string | false | The type of the account. It is either iban(international bank accounts) nuban(Nigerian bank accounts). |
Iban |
string | false | The international bank account number. it is required when type is iban. |
This method lets you verify the status of the transaction on the checkout API
var request = new VerifyPayment { ... };
var verifyPay = fincra.Verify.VerifyPayment(xBusinessId, Reference);
This method lets you verify a bank verification number(BVN)
var request = new ResolveBvn { ... };
var verifyBvn = fincra.Verify.ResolveBvn(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Bvn |
string | true | The bank verification number . Must be 11 digits. |
Business |
string | true | The unique identifier or business ID of the parent business or it's sub account. |
The Virtual account service allows the merchant to create and maintain a foreign currency account also known as the virtual account, which can be used to perform international transactions. Multiple virtual accounts can be requested for the same currency by a merchant.
This method lets you create a singlevirtual account.
var request = new CreateVirtualAccountRequest { ... };
var createVirtual = fincra.VirtualAccount.CreateVirtualAccount(request);
- More details about the parameters for the above method here
This method fetches all virtual accounts belonging to a merchant
var request = new VirtualAccountParams { ... };
var listMerchant = fincra.VirtualAccount.ListMerchantVirtual(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Currency |
string | true | The virtual account currency.it is usually one of EUR, GPB or NGN. |
BusinessName |
string | true | Specify the name of the business or subaccount you want to retrieve. |
IssuedDate |
string | false | The date the virtual account was issued . It must be in ISO 8601 date format e.g 2020-07-10 15:00:00.000, which represents the 10th of July 2020 at 3 p.m. |
RequestedDate |
string | false | The date the virtual account was requested . It must be in ISO 8601 date format e.g 2020-07-10 15:00:00.000, which represents the 10th of July 2020 at 3 p.m. |
AccountNumber |
string | false | The account number of the virtual account. |
Status |
string | false | The status of the virtual account. It can be one of the following: approved, pending, or declined. |
This method is used for getting all virtual account requests belonging to a merchant
var virtualAccountRequests =
fincra.VirtualAccount.ListVirtualAccountRequests();
This method is used for retrieving a virtual account that is belongs to a merchant by currency
var fetchVirtualAccount =
fincra.VirtualAccount.FetchVirtualAccountByCurrency(Currency);
Parameters | Data type | Required | Description |
---|---|---|---|
Currency |
string | true | The virtual account currency.it is usually one of EUR, GPB or NGN. |
This method is used for retrieving a virtual account attached to a merchant.
var fetchSingle = fincra.VirtualAccount.FetchSingleVirtualAccount(VirtualAccountId);
Parameters | Data type | Required | Description |
---|---|---|---|
VirtualAccountId |
string | true | The ID of the virtual account. |
This method allows you to get a list of virtual accounts that belongs to a subaccount.
var request = new VirtualAccountParams { ... };
var listSubVirtualAcct = fincra.VirtualAccount.ListSubVirtualAccounts(request);
Parameters | Data type | Required | Description |
---|---|---|---|
BusinessId |
string | true | The ID of the parent business. |
SubAccountId |
string | true | The ID of the subaccount. |
Page |
string | false | The page number. |
PerPage |
string | false | The number of records per page. |
This method lets you de-activate a Naira(NGN) virtual account
var deactivated = fincra.VirtualAccount.DeactivateVirtualAccount(VirtualAccountId);
Parameters | Data type | Required | Description |
---|---|---|---|
VirtualAccountId |
string | true | The ID of the virtual account. |
The wallet service consists of services that provide information such as account balances, wallet number of a wallet, or wallets for a business. With the wallet service, You can manage the account balance for your business and that of your subaccounts.
This method lists all wallets belonging to a business.
var request = new WalletParams { ... };
var wallets = fincra.Wallet.ListWallet(request);
Parameters | Data type | Required | Description |
---|---|---|---|
BusinessId |
string | true | The ID of the business. |
This method retreives the wallet logs of a merchant's wallet.
var request = new WalletLogParams { ... };
var walletLogs = fincra.Wallet.ListWalletLogs(request);
Parameters | Data type | Required | Description |
---|---|---|---|
Business |
string | true | The ID of the business. |
Amount |
string | false | The amount of the transaction. |
Action |
string | false | The action of the transaction.it is usually one of credit or debit |
Page |
string | false | The page number. |
PerPage |
string | false | The number of records per page. |