In this use case, the message doesn't have a current payload, and we need to create the content of the message. We can affront this use case when we have a REST service that is only triggered with the URL endpoint with the parameters, but also needs a payload to consume a backend service. Another use case can be the inverse process, in which the backend service doesn't have a response, but our service needs to reply with a message for the client that makes the request.
In both scenarios, we can use different WSO2 tools, such as PayloadFactory mediator, Enrich mediator, or Script mediator, although the most simple and easy to use is the PayloadFactory mediator.