Introducing
Every time there is a change in the balance of a Wallet
, a Transaction
object is created to materialize this movement of money. Whether this change in balance is due to a Transfer
, a Deposit
or any other object, a Transaction
object will be created.
Here are the most importants fields of this object :
-
amount
With an always positive value, this field represents the amount that has been added to or withdrawn from the Wallet
in question. -
dc
Abbreviation for debit or credit, this field indicates whether the previous amount has been added to or withdrawn from the Wallet
in question.
The 2 possible values for this field are "Debit"
or "Credit"
.
If the value is "Debit"
, then the amount that is always positive has been removed from the Wallet
.
If the value is "Credit"
, then the amount that is always positive has been added to the Wallet
. -
wallet
This field is an indicator of the status of the target Wallet
on which the Transaction
took place. In particular, this field will give us access to the balance before and after the Transaction
. -
status
This field indicates whether the transaction was successful or failed. The 2 possible values for this field are Successful
or Failure
.
Please note that these are not String
, but objects. For example, the Failure object has isCancelled
field, which indicates that the transaction failed because it has was cancelled. -
parent
This field indicates the parent object whose execution led to the creation of this Transaction. This parent object can therefore be a Transfer
, Deposit
, QuasiTransfer
etc. -
details
This field, if available, will access the transaction id generated by the operator if this transaction concerns an operation between FPay and the outside world (Mtn Money, Orange Money or Moov Money).
Operations
get
Returns an object Transaction
found by an identifier
.
Here are all the fields whose values can be used as identifiers for this operation:
-
id
-
details.providerTransactionId
const transactionPromise = fPay.transaction.get("identifier");
list
Returns a collection of Transaction
objects, possibly filtered and/or sorted. Here are the parameters supported by this operation.
NAME | TYPE | DESCRIPTION | DEFAULT VALUE |
---|
filter | string | undefined | Condition to be met by any object returned in this collection | undefined
|
sortBy | string | undefined | Specify the field and the order (ascending or descending) by which returned objects will be sorted | createdTime:DESC
|
limit | number | undefined | Total 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 Transaction
objects:
const transactionsCollectionPromise = fPay.transaction.listAll();
const transactionsCollectionPromise =
fPay.transaction.list({
sortBy: "id:ASC"
});
const transactionsCollectionPromise =
fPay.transaction.list({
limit: 5
});
const transactionsCollectionPromise =
fPay.transaction.list({
filter: "id in {'31234', '5678', '9990'}"
});
const transactionsCollectionPromise =
fPay.transaction.list({
filter: "createdTime isBefore Yesterday",
sortBy: "foreignId:DESC"
});
const transactionsCollectionPromise =
fPay.transaction.list({
filter: "id startsWith abcd",
sortBy: "createdTime:ASC",
limit: 25
});
fetchPage
When you fetch a list of Transaction
, 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 Transaction
.
Let's say you've retrieved a collection of Transaction
with the following code:
const transactionsCollectionPromise = fPay.transaction.listAll();
If the result is spread over several pages, to go to the next page, you should do:
transactionsCollectionPromise.then(transactionCollection => {
if(transactionCollection.hasNextPage()) {
const nextTransactionPromise = fPay.transaction.fetchPage(transactionCollection.pagination.nextPage);
}
});
update
Modify a Transaction
object and return the modified version.
Here are all the fields whose values can be used as identifiers for this operation:
-
id
-
details.providerTransactionId
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 Transaction
objects:NAME | TYPE | DESCRIPTION |
---|
description | string | undefined | Can be updated Can be Deleted |
foreignData | string | undefined | Can be updated Can be Deleted |
Here are a few examples of code to execute an update:
transactionPromise =
fPay.transaction.update({
id: "<id>",
change: {
description: "<new value>",
foreignData: "<new value>"
}
});
transactionPromise =
fPay.transaction.update({
id: "<id>",
change: {
description: "<new value>"
},
'remove': ['foreignData']
});
transactionPromise =
fPay.transaction.update({
id: "<id>",
'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.
NAME | TYPE | DESCRIPTION |
---|
amount.currency.code | string | |
amount.value | number | |
createdTime | string | |
createdTime.iso8601 | string | |
createdTime.timestamp.milliseconds | number | |
createdTime.timestamp.seconds | number | |
dc | string | |
description | string | |
destination.balanceType | string | |
destination.identifier._type | string | |
destination.identifier.value | string | |
destination.provider.country.iso3166.alpha2 | string | |
destination.provider.country.iso3166.alpha3 | string | |
destination.provider.country.name | string | |
destination.provider.key | string | |
destination.provider.name | string | |
details | string | |
details._type | string | |
details.providerTransactionId | string | |
h1 | string | |
id | string | |
parent._type | string | |
parent.foreignId | string | |
parent.id | string | |
source.balanceType | string | |
source.identifier._type | string | |
source.identifier.value | string | |
source.provider.country.iso3166.alpha2 | string | |
source.provider.country.iso3166.alpha3 | string | |
source.provider.country.name | string | |
source.provider.key | string | |
source.provider.name | string | |
status | string | |
status._type | string | |
status.isCancelled | boolean | |
wallet.after.balance | number | |
wallet.after.balance.available | number | |
wallet.after.balance.lockedIn | number | |
wallet.after.balance.lockedOut | number | |
wallet.after.volume.input | number | |
wallet.after.volume.output | number | |
wallet.after.volume.total | number | |
wallet.before.balance | number | |
wallet.before.balance.available | number | |
wallet.before.balance.lockedIn | number | |
wallet.before.balance.lockedOut | number | |
wallet.before.volume.input | number | |
wallet.before.volume.output | number | |
wallet.before.volume.total | number | |
wallet.foreignId | string | |
wallet.id | string | |
wallet.isMain | boolean | |
wallet.man.alpha | string | |
Code examples
Code examples are available on the Audit & Dashboard page
Fields
Transaction
amount
Amount
currency
AmountCurrency
code
string
The only possible value is"XOF"
unit
string
Symbol used to represent this currency. For now, the only value is "₣".
value
number
Numeric value of amount always positive or zero.
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
dc
string
Abbreviation for debit or credit, this field indicates whether the transaction amount has been added to or withdrawn from the Wallet
in question.
The 2 possible values for this field are "Debit"
or "Credit"
.
If the value is "Debit"
, then the amount that is always positive has been removed from the Wallet
.
If the value is "Credit"
, then the amount that is always positive has been added to the Wallet
.The only possible values are"Credit" "Debit"
description
string | undefined
Details, explanations and notes about this item to help you get organized and find your way around later.
destination
MoneyAccount
balanceType
string
Indicates the type of balance used.
"AvailableBalance" literally means “Available Balance”. So, if the value of this field is “AvailableBalance”, then the funds are on the "AvailableBalance" and can be used. In some cases, funds are “Locked” (either on the "LockedInBalance" or "LockedOutBalance" ) and cannot be used until they are made available on the "AvailableBalance".The only possible values are"AvailableBalance" "LockedInBalance" "LockedOutBalance"
identifier
MoneyAccountIdentifier
_type
string
Indicates the type of account on which “MoneyAccount” money is held. If it's a bank account, this field will have the value "Iban".
If it's a mobile money account, this field will have the value "MobileMoney".
If it's an FPay wallet, the value can be either "Id" or "Man", the latter meaning "Money Account Number".The only possible values are"Iban" "Id" "Man" "MobileNumber"
value
string
Indicates the type of account on which “MoneyAccount” money is held. If it's a bank account, this field will have the value "Iban".
If it's a mobile money account, this field will have the value "MobileMoney".
If it's an FPay account, the value can be either "Id" or "Man", the latter meaning "Money Account Number".
provider
MoneyAccountProvider
country
Country
iso3166
Iso3166Country
alpha2
string
ISO 3166 code with 2 characters representing the country.
Example: “CI” for Côte d'Ivoire, “BF” for Burkina Faso and “SN” for Senegal.
alpha3
string
ISO 3166 code with 3 characters representing the country.
Example: “CIV” for Côte d'Ivoire, “BFA” for Burkina Faso and “SEN” for Senegal.
name
string
Country name in either English or French, depending on the language of your FPay account. If, when you registered, you chose French as the language of your account, then the country name will be in French. in French and if you have chosen English, then this name will be in English.
key
string
Key uniquely identifying the money account provider.The only possible values are"FPay" "MoovMoney" "MtnMoney" "OrangeMoney"
name
string
Money account provider name
details
TransactionDetails
TransactionDetails.BankTransfer
BankTransfer
_type
string
The only possible value is"BankTransfer"
TransactionDetails.FPayTransfer
FPayTransfer
_type
string
The only possible value is"FPayTransfer"
TransactionDetails.MobileMoneyTransfer
MobileMoneyTransfer
_type
string
The only possible value is"MobileMoneyTransfer"
providerTransactionId
string | undefined
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.
h1
H1
Title, wording of this Transactionen
string
fr
string
id
string
Unique, unchangeable identifier made up of numbers and letters.
parent
TransactionParent
This field indicates the parent object whose execution led to the creation of this Transaction. This parent object can therefore be a Transfer, Deposit, QuasiTransfer etc.
source
MoneyAccount
balanceType
string
Indicates the type of balance used.
"AvailableBalance" literally means “Available Balance”. So, if the value of this field is “AvailableBalance”, then the funds are on the "AvailableBalance" and can be used. In some cases, funds are “Locked” (either on the "LockedInBalance" or "LockedOutBalance" ) and cannot be used until they are made available on the "AvailableBalance".The only possible values are"AvailableBalance" "LockedInBalance" "LockedOutBalance"
identifier
MoneyAccountIdentifier
_type
string
Indicates the type of account on which “MoneyAccount” money is held. If it's a bank account, this field will have the value "Iban".
If it's a mobile money account, this field will have the value "MobileMoney".
If it's an FPay wallet, the value can be either "Id" or "Man", the latter meaning "Money Account Number".The only possible values are"Iban" "Id" "Man" "MobileNumber"
value
string
Indicates the type of account on which “MoneyAccount” money is held. If it's a bank account, this field will have the value "Iban".
If it's a mobile money account, this field will have the value "MobileMoney".
If it's an FPay account, the value can be either "Id" or "Man", the latter meaning "Money Account Number".
provider
MoneyAccountProvider
country
Country
iso3166
Iso3166Country
alpha2
string
ISO 3166 code with 2 characters representing the country.
Example: “CI” for Côte d'Ivoire, “BF” for Burkina Faso and “SN” for Senegal.
alpha3
string
ISO 3166 code with 3 characters representing the country.
Example: “CIV” for Côte d'Ivoire, “BFA” for Burkina Faso and “SEN” for Senegal.
name
string
Country name in either English or French, depending on the language of your FPay account. If, when you registered, you chose French as the language of your account, then the country name will be in French. in French and if you have chosen English, then this name will be in English.
key
string
Key uniquely identifying the money account provider.The only possible values are"FPay" "MoovMoney" "MtnMoney" "OrangeMoney"
name
string
Money account provider name
status
TransactionStatus
TransactionStatus.Failure
Failure
_type
string
The only possible value is"Failure"
isCancelled
boolean
TransactionStatus.Successful
Successful
_type
string
The only possible value is"Successful"
url
string
URL on which a properly authorized GET method will return the instance of the object on which this field is defined.
wallet
TransactionWalletView
A transaction always impacts a wallet. Whether it adds money to a wallet or removes money from a wallet. This field represents a “view”, a photograph of the wallet impacted by the transaction when it occurred.after
TransactionBeforeAfter
All the following values were captured after the transaction had taken placebalance
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.
before
TransactionBeforeAfter
All the following values were captured before the transaction took placebalance
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.
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.