How to connect to the Braintree API from creator?

How to connect to the Braintree API from creator?

I'm attempting to connect to the Braintree API from deluge and I'm having some problems. I'm trying to use Braintree's graphql to do this. 
I'm able to set up a basic query but I'm having trouble using variables. 
  1. headerMap = Map();
  2. headerMap.put("Authorization","Basic //my authorization id");
  3. headerMap.put("Braintree-Version","2022-02-13");
  4. headerMap.put("Content-Type", "application/json");
  5. parameterMap = Map();
  6. parameterMap.put("query","query Search($input: CustomerSearchInput!) { search { customers(input: $input) { pageInfo { hasNextPage startCursor endCursor }, edges { node { id } } } } }");
  7. valueMap = Map();
  8. valueMap.put("is","0394827483");
  9. IdMap = Map();
  10. IdMap.put("id",valueMap);
  11. inputMap = Map();
  12. inputMap.put("input",IdMap);
  13. parameterMap.put("Variables",inputMap);
  14. test = invokeurl
  15. [
  16. url :"https://payments.braintree-api.com/graphql"
  17. type :POST
  18. parameters:parameterMap
  19. headers:headerMap
  20. ];
This produces a JSON object that looks like this.
  1. {
  2. "query": "query Search($input: CustomerSearchInput!) { 
  3. search { 
  4.   customers(input: $input) { 
  5.     pageInfo { 
  6.       hasNextPage 
  7.       startCursor 
  8.       endCursor 
  9.     }, 
  10.     edges { 
  11.       node { 
  12.         id 
  13.         } 
  14.       } 
  15.     } 
  16.   } 
  17. }",
  18.   "variables": {
  19.     "input": {
  20.       "id": {
  21.         "is": "7492836219"
  22.       }
  23.     }
  24.   }
  25. }
For some reason, I keep getting back an error that says 

{"extensions":{"requestId":"422e0d97-ee7d-4cb5-806b-a619db924d30"},"data":null,"errors":[{"message":"Unable to process JSON","extensions":{"errorClass":"VALIDATION","errorType":"developer_error"}}]}

Does anyone know why?