To add new custom messages, click on Add New button in the top right corner. The following form appears:
The name of the message.
The message that you want to display on the storefront.
How to add a message to the API response?
The messages can be added to the API response using hooks or in custom commands handler. Both the hooks and custom command provide a response object that has a method called addMessage. It takes 3 arguments which are message name, level and the parameters.
msgname: The message added to the admin panel.
level: There are 3 levels that are supported as of now which are error, warning and success. This changes how the message would be shown to the user.
params (Optional): If you want to send some custom data with the message, then you can send in this.