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

Wallet

Introducing  

A Wallet is a place where money is stored. We've modeled it like a wallet in real life: each wallet has “pockets” whose usefulness we'll detail later. For now, we'll consider that we have just one “main pocket”.
When you register with FPay, we automatically create a wallet for you: This is your main wallet..
You feed any wallet with your classic Deposit, Transfer, QuasiTransfer and FundRequest operations. Every time you create one of the previous items, if you don't specify anything, your main account will be used. For example, if you make a deposit without specifying the destination of the money, the money will default to your main account. Similarly, if you transfer money without specifying its source, the money will default to your main account.

Balances

To view the available balance on a wallet, access the mainPocket.balance.available field. A special feature of wallet balances is the availability of 2 additional balances: The balance of locked amounts currently entering the wallet, and the balance of amounts currently leaving the wallet. These balances can be accessed using the mainPocket.balance.lockedOut field and the mainPocket.balance.lockedIn field. These amounts are always positive. They allow you to show your customer the amounts of future transactions on his account: simply make a difference between the last 2 balances.

Volumes

You can also consult the volumes of all transactions in and out of a wallet since its creation. You'll therefore be able to see the volume of incoming money, the volume of outgoing money and the total volume, which is the sum of the 2 previous volumes in absolute value. The fields you need to access to do this are respectively
  • mainPocket.volume.input
  • mainPocket.volume.total
  • mainPocket.volume.output
A very interesting Wallet use case is explained on the use case page if you're managing money on behalf of third parties.

Operations  

create  

Create a new Wallet object and return the newly created object.
This operation takes the following parameters as input:

CreateWalletForm
name
Required
string
wallet name
description
string | undefined
Details, explanations and notes about this item to help you get organized and find your way around later.
foreignData
string | undefined
Your own data that you can attach to the object you've created. This can be JSON XML other data formats or simply Strings.
The maximum allowed length is 128 characters.
foreignId
string | undefined
ID Personalisé ou bien ID de votre système interne que vous souhaitez attacher à cet objet pour vous permettre de le récupérer plus tard.
Once created, this value cannot be modified.
This value must be unique for each type.
The maximum allowed length is 128 characters.

Here's an example of code for creating a Wallet object:

const walletPromise = 
    fPay.wallet.create({
        name: "My First Wallet",
        description: "My description",
        foreignData: "{\"myKey\": 19, \"myOtherKey\": \"myOtherValue\"}",
        foreignId: "123456789"
    });


get  

Returns an object Wallet found by an identifier.
You can use a unique ID specific to your system. To use your own ID instead of the one generated by FPay, you need to specify the foreignId field when creating the object. This will enable you to retrieve the object via the foreignId field, which must be unique for all Wallet objects.  Here are all the fields whose values can be used as identifiers for this operation:

  • id
  • foreignId
  • mars.alpha
  • man.alpha

const walletPromise = fPay.wallet.get("identifier");


list  

Returns a collection of Wallet objects, possibly filtered and/or sorted. Here are the parameters supported by this operation.

NAMETYPEDESCRIPTIONDEFAULT VALUE
filterstring | undefinedCondition to be met by any object returned in this collection
undefined
sortBystring | undefinedSpecify the field and the order (ascending or descending) by which returned objects will be sorted
createdTime:ASC
limitnumber | undefinedTotal number of results to return in this collection
50

Here are a few examples of code to execute a listing to return a collection of Wallet objects:

const walletsCollectionPromise = fPay.wallet.listAll();
const walletsCollectionPromise = 
    fPay.wallet.list({
        sortBy: "id:ASC"
    });
const walletsCollectionPromise = 
    fPay.wallet.list({
        limit: 5
    });
const walletsCollectionPromise = 
    fPay.wallet.list({
        filter: "id in {'31234', '5678', '9990'}"
    });
const walletsCollectionPromise = 
    fPay.wallet.list({
        filter: "createdTime isBefore Yesterday",
        sortBy: "foreignId:DESC"
    });
const walletsCollectionPromise = 
    fPay.wallet.list({
        filter: "id startsWith abcd",
        sortBy: "createdTime:ASC",
        limit: 25
    });


fetchPage  

When you fetch a list of Wallet, the results returned by the server can be paginated, i.e. they will be arranged on several pages. This fetchPage function allows you to navigate from page to page, iterating over all the elements. Consequently, this function returns a collection of Wallet.

Let's say you've retrieved a collection of Wallet with the following code:

const walletsCollectionPromise = fPay.wallet.listAll();

If the result is spread over several pages, to go to the next page, you should do:

walletsCollectionPromise.then(walletCollection => {
    if(walletCollection.hasNextPage()) {
        const nextWalletPromise = fPay.wallet.fetchPage(walletCollection.pagination.nextPage);
    }
});


update  

Modify a Wallet object and return the modified version.
 Here are all the fields whose values can be used as identifiers for this operation:

  • id
  • foreignId
  • mars.alpha
  • man.alpha
Modifying an object means modifying its modifiable fields. Modifiable fields can be either updated or deleted. Here's the list of modifiable fields for all Wallet objects:

NAMETYPEDESCRIPTION
descriptionstring | undefinedCan be updated   Can be Deleted
foreignDatastring | undefinedCan be updated   Can be Deleted
namestringCan be updated

Here are a few examples of code to execute an update:

walletPromise = 
    fPay.wallet.update({
         id: "<id | foreignId>",
         change: {
            description: "<new value>",
            foreignData: "<new value>",
            name: "<new value>"
         }
    });
walletPromise = 
    fPay.wallet.update({
         id: "<id | foreignId>",
         change: {
            description: "<new value>"
         },
         'remove': ['foreignData']
    });
walletPromise = 
    fPay.wallet.update({
         id: "<id | foreignId>",
         'remove': ['description', 'foreignData']
    });

List Filter & Sort  

Fields  

When you retrieve a list, here are the fields you can use for filtering and sorting. as well as sorting.

NAMETYPEDESCRIPTION
createdTimestring
createdTime.iso8601string
createdTime.timestamp.millisecondsnumber
createdTime.timestamp.secondsnumber
creatorstring
creator._typestring
creator.accountIdstring
creator.authAccessIdstring
creator.personIdstring
descriptionstring
foreignIdstring
idstring
isMainboolean
mainPocket.balancenumber
mainPocket.balance.availablenumber
mainPocket.balance.lockedInnumber
mainPocket.balance.lockedOutnumber
mainPocket.volume.inputnumber
mainPocket.volume.outputnumber
mainPocket.volume.totalnumber
man.alphastring
mars.alphastring
namestring

Code examples  

Code examples are available on the Audit & Dashboard page

Fields  

Wallet
createdTime
UTCDateTime
Date and time at which this object was created. Value always stored in UTC (Universal Time), this field contains a representation of this instant in ISO 8601 format, as well as a representation of this same instant in timestamp seconds and milliseconds.
iso8601
string
Date and time in ISO 8601 format
timestamp
Timestamp
milliseconds
number
Date and time in timestamp milli seconds
seconds
Double
Date and time in timestamp seconds
creator
Creator
Creator.Api
Api
_type
string
The only possible value is"Api"  
accountId
string
authAccessId
string

Creator.Ui
Ui
_type
string
The only possible value is"Ui"  
accountId
string
personId
string

description
string | undefined
Details, explanations and notes about this item to help you get organized and find your way around later.
foreignData
string | undefined
Your own data that you can attach to the object you've created. This can be JSON XML other data formats or simply Strings.
The maximum allowed length is 128 characters.
foreignId
string | undefined
ID Personalisé ou bien ID de votre système interne que vous souhaitez attacher à cet objet pour vous permettre de le récupérer plus tard.
Once created, this value cannot be modified.
This value must be unique for each type.
The maximum allowed length is 128 characters.
id
string
Unique, unchangeable identifier made up of numbers and letters.
isMain
boolean
Indicates whether this is the main wallet.
When you register with FPay, we create a wallet for you, which is the main wallet, the first to be created.
mainPocket
Pocket
balance
Balance
available
number
Balance available for use
lockedIn
number
Locked balance, which represents the sum of all future cash inflows to this wallet.
lockedOut
number
Locked balance representing the sum of all future cash outflows from this wallet.
volume
Volume
input
number
This inflow volume represents the sum of all money received on this wallet.
output
number
This output volume represents the sum of all outflows from this wallet.
total
number
This total volume represents the sum of all incoming and outgoing to and from this wallet.
man
Man
alpha
string
Man value (Money Account Number), unique value for each wallet created on FPay.
mars
Mars
alpha
string
name
string
wallet name
url
string
URL on which a properly authorized GET method will return the instance of the object on which this field is defined.

WALLET
  • Introducing
  • Oprations
    • Create
    • Get
    • List
    • FetchPage
    • Update
  • List Filter & Sort
    • Fields
    • Code example
  • Object Fields