Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addOrder always returns internal_order_id "0" #41

Open
nklarer-core opened this issue Feb 13, 2019 · 3 comments
Open

addOrder always returns internal_order_id "0" #41

nklarer-core opened this issue Feb 13, 2019 · 3 comments

Comments

@nklarer-core
Copy link

nklarer-core commented Feb 13, 2019

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?

@ByronAP
Copy link

ByronAP commented Feb 14, 2019

I have not, but I will look into it in a few

@nklarer-core
Copy link
Author

Thanks.

Yesterday, I tried the call on the mock server. It worked correctly and returned an ID.

Then, I tried to use the wrapper in your Coinigy repo. That returned the same response in the original post.

My account was upgraded manually. Could this be a permissions issue?

@robborden
Copy link
Contributor

Nathan,

It could be a bug with returning the order id through the API after placing an order on the specific exchange you're using. I have determined which exchange that is and I will investigate. However, I noticed that the account you're using doesn't have Trading activated for the account on this page: https://www.coinigy.com/user/api. Can you please activate this for your account and give it another try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants