TransactionUsages
The TransactionUsage entity represents the use of the amount, or part of the amount, of a Transaction or a CreditNote to partially or fully settle the accounting situation of a Document.
Data Format
Common fields
The TransactionUsage object includes all common-fields.
Specific fields
You can find the detailed format for output in the reference.
-
type
: The type of the TransactionUsage:TRANSACTION
: A Transaction was used to settle the accounting situation of a Document.CREDIT_NOTE
: A CreditNote was used to settle the accounting situation of a Document.
-
customerId
: The id of the associated Customer. -
invoiceId
: The id of the Invoice the TransactionUsage is linked to. -
transaction
: (only if type isTRANSACTION
) The source Transaction. -
creditNoteId
: (only if type isCREDIT_NOTE
) The id of the source CreditNote. -
amount
: The amount used of the Transaction for the Document.
Transaction and TransactionUsage
It's important not to confuse Transaction and TransactionUsage. The Transaction solely represents the actual financial flow (such as a bank transfer, a card payment, a check, etc.) while the TransactionUsage refers to how this financial flow is applied to settle the customer's account status.
Example
Lets say that Customer X
has two invoices to pay:
- Invoice
F202404-102
for 300€ - Invoice
F202404-113
for 700€
He settles these two invoices with a single bank transfer of 1000€. This would result in:
- 1
Transaction
with anamount = 1000
. - 1
TransactionUsage
of 300€ linked toF202404-102
. - 1
TransactionUsage
of 700€ linked toF202404-113
.
We can retrieve the details of this transaction :
curl -L -X POST 'https://api.infast.fr/api/v2/transactions/665989215878ad5050f421cc' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer [access_token]'
{
"data": {
"id": "665989215878ad5050f421cc",
"customerId": "66598912d075d5afd39603e9",
"amount": 1000,
"usedAmount": 1000,
"refundedAmount": 0,
"date": "2024-04-29T19:56:04.311Z",
"method": "TRANSFER",
"details": {
"additionalInformations": "VIR Intia SAS FAC 102 ET 113"
},
"usages": [
{
"id": "63e3c82675de4f6978054579",
"customerId": "66598912d075d5afd39603e9",
"date": "2024-04-29T19:56:04.311Z",
"documentId": "6659898ab2b723fe46007c1e", // this is F202404-102
"amount": 300
},
{
"id": "665989ad7c67d7e710e7a752",
"customerId": "66598912d075d5afd39603e9",
"date": "2024-04-29T19:56:04.311Z",
"documentId": "665989b9a27c09b67be74f0d", // this is F202404-113
"amount": 700
}
]
}
}