AccountConfiguration

class oandapyV20.endpoints.accounts.AccountConfiguration(accountID, data)

Bases: oandapyV20.endpoints.accounts.Accounts

Set the client-configurable portions of an Account.

ENDPOINT = 'v3/accounts/{accountID}/configuration'
EXPECTED_STATUS = 200
HEADERS = {'Content-Type': 'application/json'}
METHOD = 'PATCH'
__init__(accountID, data)

Instantiate an AccountConfiguration request.

Parameters:
  • accountID (string (required)) – id of the account to perform the request on.
  • data (dict (required)) – json body to send

body example:

{
  "marginRate": "0.05"
}
>>> import oandapyV20
>>> import oandapyV20.endpoints.accounts as accounts
>>> client = oandapyV20.API(access_token=...)
>>> r = accounts.AccountConfiguration(accountID, data=data)
>>> client.request(r)
>>> print r.response
{
  "lastTransactionID": "830",
  "clientConfigureTransaction": {
    "userID": 1435156,
    "marginRate": "0.05",
    "batchID": "830",
    "time": "2016-07-12T19:48:11.657494168Z",
    "type": "CLIENT_CONFIGURE",
    "id": "830",
    "accountID": "101-004-1435156-001"
  }
}