transaction to JSON