User does not have required agreements

Added by Dorte over 3 years ago

Hi,

When I use the nExt API Documentation to send my request I get this, I work on the same paper as always 101 on market 11

Response Body {
"message": "User does not have required agreements.",
"order_id": 898001,
"result_code": "ORDER_MISSING_AGREEMENT",
"order_state": "DELETED",
"action_state": "INS_FAIL"
}

The same order from my application :

{"identifier":"101","market_id":11,"price":90.0,"currency":"SEK","volume":10,"side":"BUY","order_type":"NORMAL","valid_until":"2015-11-01","type":"BUY"}

gives this reply

OrderReply {
order_id: 0
result_code: INPUT_ERROR
order_state: DELETED
action_state: INS_FAIL
message: Invalid input parameter.
}

Could you please see why I am blocked like this?

Thanks
Dorte


Replies (10)

RE: User does not have required agreements - Added by Björn over 3 years ago

I assume that you are trying to make an "Enter Order" request using the HTTP service...

ORDER_MISSING_AGREEMENT is, from my own experience, typically received when you try to short an instrument without having "credentials" to do so. That has to be requested through Nordnet, for example using this forum.

Regarding your own application, could you post the actual request being made using some kind of http dump? Nordnet might be able to help you with the information you provided, but no one else can.
You do send the order using HTTP form data, right? And not using the JSON object that you have included in your question?

RE: User does not have required agreements - Added by Dorte over 3 years ago

Thanks Björn, you were right about the price I tried to use, guess it had come quite off the 82 SEK that was the morning price.

I did two tests one from NN's test API clearly with the wrong value and one from my program that uses JSON, I don't use an HTTP form based interface, I only work in JSON and the request above is what I actually sent. Looking closely at my statement I now see what the problem is I have a "type" too much, somehow my @JsonIgnore seems to be ignored, but at least now I know what to look for.

RE: User does not have required agreements - Added by Björn over 3 years ago

Ah, I didn't spot the extra type=BUY. Glad you found it.

But I am surprised... You're saying that it's possible to send requests using JSON? With Content-Type=application/json?
I didn't realize it was possible. All examples I have looked at have used application/x-www-form-urlencoded instead.

RE: User does not have required agreements - Added by Dorte over 3 years ago

It is, I started developing on v1 and originally used this example https://api.test.nordnet.se/projects/api/wiki/Java_example to get started.

RE: User does not have required agreements - Added by Björn over 3 years ago

I still don't get it. What part of that Java example makes requests using JSON objects?

RE: User does not have required agreements - Added by Joachim over 3 years ago

This one will receive a json back.

String resp = baseResource.path("accounts").request(responseType).get(String.class);

RE: User does not have required agreements - Added by Björn over 3 years ago

Receiving responses in JSON is not the issue. JSON is the only supported content type for that in v2 as far as I know.
The question was about sending requests using JSON instead of standard "form data" (application/x-www-form-urlencoded).

RE: User does not have required agreements - Added by Lars over 3 years ago

Why don't you just try it? I did and it seems to work fine, much to my surprise!

RE: User does not have required agreements - Added by Joachim over 3 years ago

Just setup a SSL socket and build your json with jackson as stated in the subscribe type etc..etc.

RE: User does not have required agreements - Added by David over 2 years ago

I got the

INPUT_ERROR

error code when I tried to set valid_until to a date when the market was not open.

I saw that when trying to replicate the exact same order in the web gui, then the date I wanted to set was greyed out.

IN your example valid_until = NOV 1, 2015which was a saturday so probably that was the problem.

(1-10/10)