Filter in and out transaction

Hello, in the API what field can be used to determine incoming and outgoing transactions? It sounds like it should be simple but i cannot find a way to easily do :thinking:. Any ideas? Thanks

You can simply use the amount world. If it is a positive number it’s a deposit, negative it’s a withdrawal

Hi @PeteMcD, I ran under that assumption until finding that payments made through third party services like Paypal are shown as positive numbers, so is not a reliable way to gauge in/out flow.

I “think” i have found a solution, by checking if the transaction.originator field is true or false.

if (transaction.originator === true)
    // treat as OUT transaction (this has worked so far..)
else
    // positive or negative amount determines IN / OUT transaction

I would imagine this indicates a refund.