Beginner API Proxy to trasform to xsml with added changes

How to create a proxy that takes this request:

Request:
{
“products”: [
{
“id”: 1,
“name”: “product1”,
“price”: 50
},
{
“id”: 2,
“name”: “product2”,
“price”: 30
}
]
}

and responds with this

Response:



1
product1
50


2
product2
30


80

1 Like

Hello @Badriyalaharb ,
You can create an API proxy using Apigee or similar tools. In the proxy, use a JavaScript or Python policy to transform the incoming JSON to XML, calculate the totalPrice, and build the final XML response manually before returning it.

2 Likes

have you looked here ?