score:1

Accepted answer
 var result = list.groupby(x => new { x.categorycode, x.categoryname })
                .select(x => new
                {
                    x.key.categorycode,
                    x.key.categoryname,
                    merchants = x.tolist().groupby(g => new { g.merchantid, g.mechantname })
                        .select(v => new
                        {
                            v.key.merchantid,
                            v.key.mechantname,
                            vouchers = v.select(s => new { id = s.voucherid, description = s.voucherdescription })
                                .tolist()
                        })
                });

            var json = jsonconvert.serializeobject(result);

Related Query

More Query from same tag