This is not a full solution, only addressing the JSON data.
JSON[
^] has a very specific requirement.
As mentioned in the comments above, the desired output is not a valid format. You can check that here:
JSON Formatter & Validator[
^]
The corrected format should be:
{ "id": "27GSPMH5711G1ZO", "name": "072017", "gt": 3782969.01, "cur_gt": 3782969.01, "b2b": [ { "ctin": "27GSPMH5711G1ZO", "inv": [ { "inum": "9005", "idt": "01-07-2017", "val": 729248.16, "pos": "27", "rchrg": "N", "inv_typ": "R", "itms": [ { "num": 1, "itm_det": { "rt": 5, "txval": 10000, "camt": 500, "samt": 900 } } ] } ] } ] }
Here is a readable version:
{
"id":"27GSPMH5711G1ZO",
"name":"072017",
"gt":3782969.01,
"cur_gt":3782969.01,
"b2b":[
{
"ctin":"27GSPMH5711G1ZO",
"inv":[
{
"inum":"9005",
"idt":"01-07-2017",
"val":729248.16,
"pos":"27",
"rchrg":"N",
"inv_typ":"R",
"itms":[
{
"num":1,
"itm_det":{
"rt":5,
"txval":10000,
"camt":500,
"samt":900
}
}
]
}
]
}
]
}
Looking at the original data and the desired output, there appears to be a lot of information missing.