Skip to content

Commit

Permalink
Remove nested parameter from Get order
Browse files Browse the repository at this point in the history
  • Loading branch information
umitanuki committed Dec 26, 2019
1 parent 6b69fdc commit 6f6f28f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ api.submit_order(
)
```

### REST.get_order_by_client_order_id(client_order_id, nested=None)
### REST.get_order_by_client_order_id(client_order_id)
Calls `GET /orders` with client_order_id and returns an `Order` entity.

### REST.get_order(order_id, nested=None)
### REST.get_order(order_id)
Calls `GET /orders/{order_id}` and returns an `Order` entity.

### REST.cancel_order(order_id)
Expand Down
8 changes: 2 additions & 6 deletions alpaca_trade_api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,21 +246,17 @@ def submit_order(self, symbol, qty, side, type, time_in_force,
resp = self.post('/orders', params)
return Order(resp)

def get_order_by_client_order_id(self, client_order_id, nested=None):
def get_order_by_client_order_id(self, client_order_id):
'''Get an order by client order id'''
params = {
'client_order_id': client_order_id,
}
if nested is not None:
params['nested'] = nested
resp = self.get('/orders:by_client_order_id', params)
return Order(resp)

def get_order(self, order_id, nested=None):
def get_order(self, order_id):
'''Get an order'''
params = {}
if nested is not None:
params['nested'] = nested
resp = self.get('/orders/{}'.format(order_id), params)
return Order(resp)

Expand Down

0 comments on commit 6f6f28f

Please sign in to comment.