---
agentTools:
  projectIndex: https://uspacy.readme.io/llms.txt
---

# Edit product category

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "CRM service",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://{domain}.uspacy.ua",
      "description": "Ukrainian server"
    },
    {
      "url": "https://{domain}.uspacy.eu",
      "description": "EU server"
    },
    {
      "url": "https://{domain}.uspacy.com.br",
      "description": "Brazilian server"
    },
    {
      "url": "https://{domain}.uspacy.com",
      "description": "International server"
    }
  ],
  "tags": [
    {
      "name": "products",
      "description": "Product catalog, categories, pricing, and taxes"
    }
  ],
  "paths": {
    "/crm/v1/static/product-categories/{itemId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/itemId"
        }
      ],
      "patch": {
        "tags": [
          "products"
        ],
        "summary": "Edit product category",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategoryDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "UnauthorizedError": {
        "description": "Access token is missing or invalid"
      },
      "ValidationError": {
        "description": "Validation error response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "example": {
                    "field_name": [
                      "The field_name field is required."
                    ]
                  }
                },
                "status": {
                  "type": "boolean",
                  "example": true
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "itemId": {
        "name": "itemId",
        "in": "path",
        "description": "Item ID",
        "required": true,
        "schema": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "schemas": {
      "ProductCategory": {
        "properties": {
          "id": {
            "type": "integer",
            "example": 2
          },
          "parent_id": {
            "type": "integer",
            "example": 1
          },
          "name": {
            "type": "string",
            "example": "Main category"
          },
          "is_active": {
            "type": "boolean",
            "example": true
          },
          "created_at": {
            "type": "integer",
            "example": 12156465
          },
          "updated_at": {
            "type": "integer",
            "example": 12156465
          },
          "child_categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductCategory"
            }
          }
        }
      },
      "ProductCategoryDto": {
        "properties": {
          "parent_id": {
            "type": "integer",
            "example": 1
          },
          "name": {
            "type": "string",
            "example": "Laptops"
          },
          "is_active": {
            "type": "boolean",
            "example": true
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 105,
      "1": 145,
      "2": 108,
      "3": 28,
      "4": 165,
      "5": 162,
      "6": 20,
      "7": 148,
      "8": 43,
      "9": 242,
      "10": 235,
      "11": 56
    }
  }
}
```