Logo Blue Finalse
Console 
  Français   English


C#


  • GETTING STARTED
  • Authentication
  • Hello World
  • Pricing
  • Rate Limit
  • USE CASES
  • FPay UI Integration
  • Custom UI Integration
  • Interoperability  New
  • Payment links and QRCodes
  • Third Parties Money  New
  • Audit & Dashboard  New
  • REFERENCES
  • Attempt
  • AuthAccess
  • Deposit
  • FundRequest
  • QuasiTransfer
  • Transaction
  • Transfer
  • Wallet
Logo Blue FinalseLogo Blue Finalse
Javascript
Console 
  Français   English
  • GETTING STARTED
  • Authentication
  • Hello World
  • Pricing
  • Rate Limit
  • USE CASES
  • FPay UI Integration
  • Custom UI Integration
  • Interoperability  New
  • Payment links and QRCodes
  • Third Parties Money  New
  • Audit & Dashboard  New
  • REFERENCES
  • Attempt
  • AuthAccess
  • Deposit
  • FundRequest
  • QuasiTransfer
  • Transaction
  • Transfer
  • Wallet

Audit Reporting & Dashboard

Context  

Whether you're auditing, reporting or designing a dashboard, FPay lets you ask the system questions about all the actions that have taken place on your account. With the same simplicity, here are some of the questions you'll be able to ask FPay:

  • Which transactions over ₣ 500,000 were debited from my main account last month, sorted from largest to smallest amount ?
  • What are all my wallets whose balance is less than ₣ 1,000,000 ?
  • What transfers to OrangeMoney did I make yesterday ?
  • What was the biggest transaction to or from MtnMoney this month ?
  • What are the failed outflows for MoovMoney or OrangeMoney ?
  • What are the inflows received from MoovMoney before today, sorted from the most recent to the oldest ?
Once you've answered the above questions, we're confident you'll be able that you will be able to design or be assisted by an expert in data analysis / data visualization to create dashboards to present your data in the following way:
FPay Dashboard example

Pre Requisites  

Javascript
This SDK requires
Node >=9.5

Authentication
We assume that you have of course opened your FPay account and that you are in possession of your  token and your secretKey  obtained during the creation of the AuthAccess object as explained  on the Authentication page.

Initialization  

Important
In AuthAccess object, the value of the field named secretKey must be kept absolutely secret and used only on your servers. This implies that you should never use the value of this field as a variable or constant in the source code of a mobile application, a web application or in the source code of any application whose binary may be public and visible to all. There are many tools to access strings in the source code from a binary around here.
  • NPM
  • Yarn
npm install @finalse/sdk-node
yarn add @finalse/sdk-node
const fPay = sdk.FPayClient(sdk.Auth({token: '<token>', secretKey: '<secretKey>' }));

Implementation  

Initialisation  

const fPay = sdk.FPayClient(sdk.Auth({token: '<token>', secretKey: '<secretKey>' }));

General operation  

To list items corresponding to particular criteria, we need to start by considering the type of object that will be returned by our listing.
For example, if we want to list Wallet

  • because the objects of this type to be returned have a  foreignId field of type String and whose value may be absent, we are entitled to make the following requests:
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "foreignId isDefined"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "foreignId !isDefined"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "foreignId = '1234'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "foreignId = '1234'",
            sortBy: "foreignId"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "foreignId != '1234'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "foreignId startsWith '1234'"
        });
  • because the objects of this type Wallet to be returned have a  mainPocket field and this field has a balance field having itself an available field of type Number, we are entitled to make the following requests:
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "mainPocket.balance.available = 10000"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            sortBy: "mainPocket.balance.available:ASC"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            sortBy: "mainPocket.balance.available:DESC"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "mainPocket.balance.available  > 100000"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "mainPocket.balance.available >= 5000"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "mainPocket.balance.available != 100000"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "mainPocket.balance.available <= 100000"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "mainPocket.balance.available  < 100000"
        });
  • because the objects of this type Wallet to be returned have a  createdTime field of type DateTime (ISO 8601-compliant date and time), we are entitled to make the following requests:
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime = '2024-10-01T01:30Z'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime.iso8601 = '2024-10-01T01:30Z'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime = '2024-10-01'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime.iso8601 = '2024-10-01'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime isBefore '2024-10-01T01:30Z'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime isBefore '2024-10-01'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime.timestamp.seconds <= 19817999"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime.timestamp.milliseconds <= 19817999000"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime isAfter '2024-10-01T01:30Z'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime isAfter '2024-10-01'"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime in CurrentYear"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime in CurrentMonth"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime in Today"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            filter: "createdTime in Yesterday",
            sortBy: "createdTime:ASC"
        });
    const walletsCollectionPromise = 
        fPay.wallet.list({
            sortBy: "createdTime:DESC"
        });

Questions  

Now that we've laid the logical foundations for querying, we're going to answer the questions raised above.

Question 1

Which transactions over ₣ 500,000 were debited from my main account last month, sorted from largest to smallest amount ?

const transactionsCollectionPromise = 
    fPay.transaction.list({
        filter: "status = 'Successful'"
                + " AND amount.value >= 500_000"
                + " AND dc = 'Debit'"
                + " AND wallet.isMain = true"
                + " AND createdTime in LastMonth",
        sortBy: "amount.value:DESC"
    });

Question 2

What are all my wallets whose balance is less than ₣ 1,000,000 ?

const walletsCollectionPromise = 
    fPay.wallet.list({
        filter: "mainPocket.balance < 1_000_000"
    });

Question 3

What transfers to OrangeMoney did I make yesterday ?

const transfersCollectionPromise = 
    fPay.transfer.list({
        filter: "status = 'Successful'"
                + " AND destination.account.provider.key = 'OrangeMoney'"
                + " AND createdTime in Yesterday "
    });

Question 4

What was the biggest transaction to or from MtnMoney this month ?

const transactionsCollectionPromise = 
    fPay.transaction.list({
        filter: "status = 'Successful'"
                + " AND (source.provider.key = 'MtnMoney' OR destination.provider.key = 'MtnMoney')"
                + " AND createdTime in CurrentMonth",
        sortBy: "amount.value:DESC",
        limit: 1
    });

Question 5

What are the failed outflows for MoovMoney or OrangeMoney ?

const transactionsCollectionPromise = 
    fPay.transaction.list({
        filter: "status = 'Failure'"
                + " AND dc = 'Debit'"
                + " AND destination.provider.key in {'MoovMoney', 'OrangeMoney'}"
    });
You can also run the following query
const transactionsCollectionPromise = 
    fPay.transaction.list({
        filter: "status = 'Failure'"
                + " AND dc = 'Debit'"
                + " AND (destination.provider.key = 'MoovMoney' OR destination.provider.key = OrangeMoney)"
    });

Question 6

What are the inflows received from MoovMoney before today, sorted from the most recent to the oldest ?

const transactionsCollectionPromise = 
    fPay.transaction.list({
        filter: "status = 'Successful'"
                + " AND dc = 'Credit'"
                + " AND source.provider.key = 'MoovMoney'"
                + " AND createdTime isBefore Today",
        sortBy: "createdTime:DESC"
    });

AUDIT REPORTING & DASHBOARD
  • Context
  • Pre Requisites
  • Initialization
  • Implementation
    • Initialisation
    • General operation
    • Questions