How can I identify account-to-account transactions?
Unfortunately, there is no clear way to identify this type of transactions.
TrueLayer does not return the name of the counterparty for account-to-account transfers in the transaction model of the Data API and we have no guarantees that it will be returned in the meta-object either.
That piece of information may or may not be returned by the bank; when it is, we'll do our best to return it in the counter_party_preferred_name field of the meta object of the Transaction model.
As a workaround, it is advised to use the 'transaction_category' field to recognise account-to-account transactions as it should have the value 'TRANSFER'.
Check out all the transaction values in this section of our Documentation.
When that is the case, you can try and return the 'counter_party_preferred_name' from the meta-object, if present, otherwise the description should fulfil this purpose.
Why account-to-account transactions do not return a merchant_name?
This kind of transaction can't return this field as they are performed by a private account to another private account, therefore there is no merchant involved.