📃Responses format

When interacting with the Moneroo APIs, it is essential to understand the format of the responses you will receive. This will help you properly interpret the responses and handle them appropriately in your application.


Response Structure

Responses from the Moneroo API are returned in the JSON format and follow a consistent structure. Here's an example of a typical response:

{
  "message": "Transaction initialized successfully.",
  "data": {},
  "errors" : null
}

Each part of this response carries specific information:

  • message

This is a string field that provides a human-readable message about the result of the operation. If the API call is success, this message usually gives a confirmation about what has been achieved. If fail, this message usually provides information about what went wrong.

  • data

This is an object that contains any data returned by the operation. The exact structure of this object will depend on the specific API endpoint you are interacting with, and what information it is designed to return. For example, a payment-related API might return information about the payment in this field. If there's no data to return, this field will be an empty object ({}).

Please refer to the specific API endpoint documentation to understand the structure and content of the data field for each endpoint.

  • errors

When interacting with the Moneroo APIs, you may encounter an errors key in the response body, especially in cases where the operation fails to execute as expected. This key is an array of error objects, each providing detailed context about specific issues encountered during the operation. These objects contain information such as the type of error, a detailed error message, and sometimes, a hint or steps to resolve the issue.

Understanding this response format is crucial to making the most of the Moneroo APIs, as it will allow you to handle both successful operations and errors in a robust and user-friendly way.

Last updated