OrderClientExtensions

class oandapyV20.endpoints.orders.OrderClientExtensions(accountID, orderID, data)

Bases: oandapyV20.endpoints.orders.Orders

Update the Client Extensions for an Order in an Account.

Warning

Do not set, modify or delete clientExtensions if your account is associated with MT4.

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

Instantiate an OrderCreate request.

Parameters:
  • accountID (string (required)) – id of the account to perform the request on.
  • orderID (string (required)) – id of the order to perform the request on.
  • data (JSON (required)) – json orderbody to send

Orderbody example:

{
  "clientExtensions": {
    "comment": "myComment",
    "id": "myID"
  }
}
>>> import oandapyV20
>>> import oandapyV20.endpoints.orders as orders
>>> client = oandapyV20.API(access_token=...)
>>> r = orders.OrderClientExtensions(accountID, orderID, data=data)
>>> client.request(r)
>>> print r.response
{
  "lastTransactionID": "2305",
  "orderClientExtensionsModifyTransaction": {
    "orderID": "2304",
    "batchID": "2305",
    "clientExtensionsModify": {
      "comment": "myComment",
      "id": "myID"
    },
    "time": "2016-10-25T15:56:43.075594239Z",
    "type": "ORDER_CLIENT_EXTENSIONS_MODIFY",
    "userID": 1435156,
    "id": "2305",
    "accountID": "101-004-1435156-001"
  },
  "relatedTransactionIDs": [
    "2305"
  ]
}