I am trying to build a virtual service for a REST API. The request is a JSON which has the first name, last name and an array of payments. The response is a JSON message which has the first name, last name, total amount of all payments from the request, and the array of payments (from the request) with a new tag element for each payment entry. I have attached a sample request and response.
I am trying to build a dynamic response for the meta that can handle any number of payments from the request properly (i.e. shows are the payment entries from the request with the added tag and the total amount). I have tried the scriptable data protocol to update the response but it doesn't work.
I was wondering if someone can give me a hint on how to build that dynamic response.
Thanks for your help.