posting an order via REST

Hello devs;

I am trying to create an order to be used in this issue with this

url http://localhost:8081/openmrs-standalone/ws/rest/v1/order

JSON body content with valid UUIDs: https://pastebin.com/R7RP69Gh

but am getting this error https://pastebin.com/KuqzzXQi

I have followed the solution proposed by @darius in this thread but no break through, still getting the same error .

kindly requesting for your help

@mogoodrich @ruhanga @mozzy @mksd

cc.@mozzy ,@ruhanga

@gcliff, have you tried this on demo server?

You may also want to validate the JSON content you are posting. The logs show you might have posted JSON content with "type" : "orderorder" where as the JSON snippet you shared indicates "type" : "testorder"

demo server sims to be abit down but am going to try it out

yes @ruhanga but i still get this error with this JSON content

@gcliff, also ensure the orderType attribute is not an array, but rather a single uuid, probably the one the matches the Test-Order order type as per your use case.

I’m not sure whether you need this attribute at all though. Most probably not.

i tried that before n separated the the uuids of the order types but still got the same feedback

order type is required in order to create an Order according to the swagger specs

Could you share a snippet of what you attempted and the feedback you got?

https://pastebin.com/9SsqVYya am required to create an encounter first coz its missing in order for the test, gonna work on it :slightly_smiling_face:

Thanks @ruhanga

@batbrain7 & @ayesh,

Ideally, our REST documentation at rest.openmrs.org should be answering questions like you see above. :slight_smile:

4 Likes

Yes.I think we have already covered order type in docs @burke

1 Like

Iam very eager to see the User experience from this new Documentation.

Try it out and share your feedback here.

We have a start, but I’d be curious if the current documentation is helpful to those who need it. For example, I don’t believe the example we have for posting an order works.

@batbrain7

I think the creation of resources which we show case should work in examples.Will it be possible to double check

thanks :smiley: