public Result <List <MerchantCategory> > GetMerchantCategories(string name)
        {
            RestRequest request = new RestRequest(GET_CATEGORIES_URL, Method.GET);

            request.AddParameter("name", name);
            var responseContent = Execute(request);
            MerchantCategoryListResponse      categoryList = JsonConvert.DeserializeObject <MerchantCategoryListResponse>(responseContent);
            Result <List <MerchantCategory> > result       = new Result <List <MerchantCategory> >(categoryList);

            return(result);
        }
        public Result <List <MerchantCategory> > BatchCreateMerchantCategory(List <MerchantCategoryCreateRequest> merchantCategoryBatchCreateRequest, bool skipExist)
        {
            List <string> validationErrs = ValidateBatchCreate(merchantCategoryBatchCreateRequest);

            if (validationErrs.Count > 0)
            {
                return(new Result <List <MerchantCategory> >(validationErrs));
            }
            RestRequest request = new RestRequest(BATCH_CREATE_CATEGORY_URL, Method.POST);

            request.AddParameter("skipExist", skipExist, ParameterType.QueryString);

            var merchantCategoryJson = JsonConvert.SerializeObject(merchantCategoryBatchCreateRequest);

            request.AddParameter(Constants.CONTENT_TYPE_JSON, merchantCategoryJson, ParameterType.RequestBody);
            var responseContent = Execute(request);
            MerchantCategoryListResponse      categoryList = JsonConvert.DeserializeObject <MerchantCategoryListResponse>(responseContent);
            Result <List <MerchantCategory> > result       = new Result <List <MerchantCategory> >(categoryList);

            return(result);
        }