Each microservice's API should return the data in the same way, defined below:

Response structure

Each response should have the same structure, depending on the request and the result.

The response structures for the successful and unsuccessful request are slightly different.

Successful response
{
  "success": true,
  "meta": {},
  "data": [],
  "message": "A message to user."
}

In the response, either the 'data' or 'message' fields should be presented.

Unsuccessful response
{
  "success": false,
  "errors": [],
  "message": "An error has occured."
}