What is your goal?
I need to parse a webhook from the WayForPay payment gateway and send the data to Zoho CRM. The goal is to extract the customer’s email, order reference, and a list of products (name, price, count) to create a Deal and update a Contact in Zoho.
What is the problem & what have you tried?
The problem is that WayForPay sends the callback as a raw JSON string inside an array, and the products field is further nested as a string-key within an object.
Example of the raw data I receive:
[{"{"merchantAccount":"...","products":{"{\"name\":\"Product\",\"price\":1,\"count\":1}":""},"email":"user@example.com"}}"]
I have tried using the JSON > Parse JSON module, but it only parses the first level. I am stuck with “double-escaped” strings for the product details. I do not have access to the Premium “Make Code” module, so I need a solution using standard modules or formulas (like map(), get(), parseJSON(), or replace()).
Error messages or input/output bundles
Input Bundle from Webhook:
Code:
[
{
“data”: “[{“merchantAccount":“notion_site”,“orderReference”:“SHC-FBDLT2”,“merchantSignature”:“a1bc326c2d564cf7f3e8457246a”,“amount”:1,“currency”:“UAH”,“authCode”:“962356”,“email”:“dariavereshchaeva@gmail.com”,“phone”:“380954500000”,“createdDate”:1772192167,“processingDate”:1772192208,“cardPan”:“34****3456”,“cardType”:“MasterCard”,“issuerBankCountry”:“Ukraine”,“issuerBankName”:“JSC CB PRIVATBANK”,“recToken”:”“,“transactionStatus”:“Approved”,“reason”:“Ok”,“reasonCode”:1100,“fee”:0.02,“paymentSystem”:“applePay”,“acquirerBankName”:“WayForPay”,“cardProduct”:”“,“clientName”:null,“products”:{”{“name”:”\u0428\u0430\u0431\u043b\u043e\u043d",“price”:1,“count”:1}“:”“}}]”
}
]
The specific issue:
The products field looks like this:
“products”:{“{“name”:”\u0428\u0430\u0431\u043b\u043e\u043d",“price”:1,“count”:1}“:”"}
I need to extract the name, price, and count from that key.
