from oandapyV20 import API
from oandapyV20.exceptions import V20Error
import oandapyV20.endpoints.trades as trades

# OANDAのデモ口座へのAPI接続
api = API(access_token=access_token, environment="practice")
r = trades.TradeClose(accountID=accountID, tradeID=9, data=5000)
api.request(r)
print(r.response)

決済したいため以上のコードを実行したところ、

Traceback (most recent call last):
  File "oanda.py", line 51, in <module>
    api.request(r)
  File "/Users/.pyenv/versions/3.6.1/lib/python3.6/site-packages/oandapyV20/oandapyV20.py", line 306, in request
    request_args, headers=headers)
  File "/Users/.pyenv/versions/3.6.1/lib/python3.6/site-packages/oandapyV20/oandapyV20.py", line 243, in __request
    response.content.decode('utf-8'))
oandapyV20.exceptions.V20Error: {"errorMessage":"Invalid JSON body, must be an object"}

以上のようなエラーがでました。
原因はどのように考えられますか。

よろしくお願い致します。