Create or Update Category

This REST API is used to create or update product categories in Uniware. Categories are required to well organize the products and apply a common tax class to all items in a category.

Tip

It is recommended to check out Notes for the reader. You might find this helpful as it contains Guidelines for using API references and Terminologies used here.

Basic Information

NAME DETAILS
Endpoint: /services/rest/v1/product/category/addOrEdit
Request Type: POST
Level: Tenant
Scheme: HTTPS
Header (Content-Type): application/json
Header (Authorization): bearer {access-token}, Eg.: bearer b30f3aea-7978-49bb-9ea7-33eddfc80afa

Pre-requisite

Before using this API, it is required that following item is defined in Uniware:

  • GST Tax Type Code (gstTaxTypeCode).

Request Payload

{
   "category": {
      "code": "string",
      "name": "string",
      "taxTypeCode": "string",
      "itemDetailFieldsText": "string",
      "hsnCode": "string",
      "gstTaxTypeCode": "string",
      "grnExpiryTolerance": 0,
      "dispatchExpiryTolerance": 0,
      "returnExpiryTolerance": 0,
      "expirable": true,
      "shelfLife": 0
   }
}

Request Payload Details

LEVEL PARAMETER TYPE DESCRIPTION MANDATORY NOTES
1 category object Category details - -
1.1 code string Category code (unique) Yes Max. chars: 45
1.2 name string Category name Yes Max. chars: 200
1.3 taxTypeCode string Non-GST tax code as defined in Uniware (was used in pre-GST era) No -
1.4 itemDetailFieldsText string Details of item No -
1.5 hsnCode string 6 digit uniform code that classifies products worldwide No -
1.6 gstTaxTypeCode string GST tax code as defined in Uniware Yes -
1.7 grnExpiryTolerance integer Expiry tolerance No -
1.8 dispatchExpiryTolerance integer - No -
1.9 returnExpiryTolerance integer - No -
1.10 expirable boolean true/false (true if expirable) No -
1.11 shelfLife integer Duration for which item remains in good condition while storing No -

Response Payload

{
   "successful": true,
   "message": "string",
   "errors": [
      {
         "code": 0,
         "fieldName": "string",
         "description": "string",
         "message": "string",
         "errorParams": {
            "additionalProp1": {},
            "additionalProp2": {},
            "additionalProp3": {}
         }
      }
   ],
   "warnings": [
      {
         "code": 0,
         "message": "string",
         "description": "string"
      }
   ]
}

Response Payload Details

LEVEL PARAMETER TYPE DESCRIPTION NOTES
1 successful true Request success status -
2 message string Response message -
3 errors list List of errors (if any) -
3.1 code number Error code -
3.2 fieldName string Field with error -
3.3 description string Warning description -
3.4 message string Error message -
3.5 errorParams object Parameters with error -
3.5.1 additionalProp1 object Parameter 1 with error -
3.5.2 additionalProp2 object Parameter 2 with error -
3.5.3 additionalProp3 object Parameter 3 with error -
4 warnings list List of warnings (if any) -
4.1 code number Warning code -
4.2 message string Warning message -
4.3 description string Warning description -

Error Codes

Refer Response Codes section to know about specific errors codes.

Unicommerce Website

Copyright © 2024 Unicommerce eSolutions Pvt. Ltd.