Hi Ekaterina
The 400 code can be used to signify any error. In the swagger for all APIs, including TMF641, an Error object is generated as the response payload for all HTTP non-success codes. The expectation is that you will populate significant fields in the Error structure to give the consumer detailed information as to what went wrong.
All this is for validations that you can do in your implementation synchronously and respond to POST with code 400.
If there are validations that cannot be done synchronously, then you would return 201 on POST (create successful), and when those validations fail raise an event.
The API spec itself does not prescribe which validations can be synchronous, it's up to the implementation.
We are in the process of updating TMF641 so that Service Order and Service Order Item will contain an error resource, so that errors during handling of the order can be recorded on the order structure itself and returned by GET.
@Kamal Maghsoudlou could perhaps give more information on this enhancement.
Hope it helps
------------------------------
Jonathan Goldberg
Amdocs Management Limited
Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
------------------------------