# How to interpret vin/vout on a Bitcoin transaction?

I used nownodes api to get this response on a transaction:

``````(
[txid] => 38ac1348219f8aa9349f497bfa6f8d05f775cafbbd26354867d22ca84f15e1e1
[version] => 2
[vin] => Array
(
[0] => stdClass Object
(
[txid] => 38cff250be850140644a1abf022b22f3e59cab15c6091706c3f73218a4d72050
[vout] => 1
[sequence] => 4294967295
[n] => 0
(
[0] => 1EJtMFThodiQ1j26xy1kugFck9325C38CQ
)

[value] => 158316
)

)

[vout] => Array
(
[0] => stdClass Object
(
[value] => 7000
[n] => 0
[hex] => a9144a09be6e2917ef00e5d72bc38035db5c5a5ed8ec87
(
[0] => 38SVbkkFE8qcJuGyTJ9fY2cbGS3xknEfYr
)

)

[1] => stdClass Object
(
[value] => 146856
[n] => 1
(
[0] => 1EJtMFThodiQ1j26xy1kugFck9325C38CQ
)

)

)

[blockHash] => 000000000000000000050bfb2a645a5eb7ac882aeb1782bce37ef6a2652c383b
[blockHeight] => 743696
[confirmations] => 8
[blockTime] => 1657005608
[value] => 153856
[valueIn] => 158316
[fees] => 4460
)
``````
1. The transaction was for: 0.0001146 BTC
2. And the fee was: 0.0000446
3. Totalling: 0.0001592

However, based on teh result from Nownodes, how can I see what the transaction total was? I can easily see the fee under "Fees". But how do I calculate the actually amount that came in or went out for this transaction?

Thanks!

The amount in Satoshis that went out from the sender's wallet(s) is the sum of the `[vin][value]` amounts in that transaction.
The amount that went to recipient's wallets is the sum of the `[vout][value]` amounts
It is likely that one of the outputs was change being returned to the sender. So the total reduction to the sender's "balance" is sum of `[vin][value]` minus one of the `[vout][value]`.