To ensure proper handling of expenses within your financial solution, it's essential to utilise the SAVE_TRANSACTION webhook effectively.
When working with transactions related to expenses, it's vital to use a common identifier to link multiple transactions associated with a single expense.
To achieve this, ensure that the orderId field within the SAVE_TRANSACTION webhook contains the same unique value for all related transactions, such as reserve transactions, accepted transactions, and others.
Doing so will help prevent situations where a merchant adds expense details (category, attachments, comments, notes, invoice information, etc.) to a reserved transaction, only to have that data lost when the reserved transaction is substituted by an accepted transaction.
When an integration receives from the banking provider a webhook to register a transaction that for Toqio represents a corePaymentType=PAYMENT_TYPE_CARD_RESERVE we expect to receive also an orderId to identify which reserved transactions will match with final card transactions. orderId can be a string with any value that an integration prefers to assign. This transaction will be saved on our side.
Once the integration receives from the banking provider a webhook to register a transaction that for Toqio represents a corePaymentType=PAYMENT_TYPE_CARD we will check if we have a transaction with the same orderId. If so, we will change the status of the reserved transaction from PENDING to ACCEPTED and we will copy and add to the final transaction the next values: description, concept, comments, files, category, purposeCode, invoices, invoiceAddedDate.