Skip to content

addOrder always returns internal_order_id "0" #41

@nklarer-core

Description

@nklarer-core

I have written a function that passes a set of values to a dictionary and posts to the addOrder endpoint. However, I always receive the following response from the endpoint:

b'{"data":{"internal_order_id":"0"},"notifications":[]}'

Function

`
def makeOrder(self, auth_id, exch_id, mkt_id, order_type_id, price_type_id, limit_price, order_quantity):

headers = {
  'Content-Type': 'application/json',
  'X-API-KEY': self.APIKEY,
  'X-API-SECRET': self.APISECRET,
}

values = {
  "auth_id": int(auth_id),
  "exch_id": int(exch_id),
  "mkt_id": int(mkt_id),
  "order_type_id": int(order_type_id),
  "price_type_id": int(price_type_id),
  "limit_price": int(limit_price),
  "order_quantity": float(order_quantity),
}


print(values)
request = requests.post('https://api.coinigy.com/api/v1/addOrder', json=values, headers=headers)
logging.debug(request.content)
print(request.content)

return request.json()['data']['internal_order_id']`

Here is a sample dictionary:

{'mkt_id': 3341, 'limit_price': 3603.78, 'order_quantity': 0.001, 'auth_id': 396720, 'price_type_id': 3, 'order_type_id': 2, 'exch_id': 70}

Has anyone encountered this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions