How to get the commerce category item details using API?

It’s possible that we can get the item details through the API using this method. With this approach, we can fetch all item details and manually specify the commerce category ID in the API link.

categoryresponse: function () {

           try {

            var APIresponse = ‘https://testing.elevateoralcare.com/api/items?commercecategoryid=114&fieldset=details’;

            var response = nlapiRequestURL(APIresponse, null,{ ‘Accept’: ‘application/json’ }, ‘GET’);

              if (response.getCode() === 200) {

                 return JSON.parse(response.body);

              } else {

                 console.error(‘Error: Unexpected response code’, response.getCode());

              }

           } catch (e) {

              console.error(‘err@recaptchfunctionsuitescript’, e);

           }

        }

Leave a comment

Your email address will not be published. Required fields are marked *