In the merge_vars array, define "groupings" which points to an array. This 'groupings' array will then consist of individual arrays that point to a particular grouping of groups. Ex. if you have a grouping of groups titled "gas type" with group options "diesel", "unleaded", etc. this level of the array points to "gas type".
THEN, you define a "groups" array inside of this array to denote membership into the actual subgroups ("diesel", "unleaded").
Here's a code example from the list subscribe MailChimp API 2.0 documentation:
"merge_vars": {
"groupings": [
{
"id": 42,
"name": "example name",
"groups": [
"..."
]
}
]
lists/subscribe: http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php
My personal suggestion: create groups in the web app if you haven't already. Then, use the lists/interest-groupings method to see how the interest groups are formatted and returned to you. This gives you a sense of how to structure it in your own code.
lists/interest-groupings: http://apidocs.mailchimp.com/api/2.0/lists/interest-groupings.php