> ## Documentation Index
> Fetch the complete documentation index at: https://help.vori.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a store department

> Updates a department. Stamping `deactivated_at` deactivates it and setting it back to null reactivates it; a deactivated department is retained so reporting and past orders still resolve the department they name. A department is only deactivated once it has no active products and no active sub-departments. Renaming, moving, or reactivating a department is rejected when another active department at its resulting level already has the name, ignoring case and surrounding spaces. An edit that leaves the name, parent, and active state alone is never rejected for the name, so a department that already shares one stays editable.



## OpenAPI

````yaml /api/openapi.json patch /v1/store-departments/{id}
openapi: 3.0.0
info:
  title: Vori API
  description: ''
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.vori.com
    description: production
security: []
tags: []
paths:
  /v1/store-departments/{id}:
    patch:
      tags:
        - Departments
      summary: Update a store department
      description: >-
        Updates a department. Stamping `deactivated_at` deactivates it and
        setting it back to null reactivates it; a deactivated department is
        retained so reporting and past orders still resolve the department they
        name. A department is only deactivated once it has no active products
        and no active sub-departments. Renaming, moving, or reactivating a
        department is rejected when another active department at its resulting
        level already has the name, ignoring case and surrounding spaces. An
        edit that leaves the name, parent, and active state alone is never
        rejected for the name, so a department that already shares one stays
        editable.
      operationId: updateStoreDepartment
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
            pattern: ^[0-9]+$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStoreDepartmentRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreDepartment'
        '400':
          description: ''
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InvalidParentDepartmentError'
                  - $ref: '#/components/schemas/InvalidDepartmentHierarchyError'
                  - $ref: '#/components/schemas/DepartmentHasActiveProductsError'
                  - $ref: >-
                      #/components/schemas/DepartmentHasActiveSubDepartmentsError
                  - $ref: '#/components/schemas/DuplicateDepartmentNameError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InsufficientPermissionsError'
                  - $ref: '#/components/schemas/NoBannerAssociationError'
        '404':
          description: ''
      security:
        - bearer: []
components:
  schemas:
    UpdateStoreDepartmentRequest:
      type: object
      properties:
        deactivated_at:
          type: string
          nullable: true
          description: >-
            When the department was deactivated. Null means active, so setting
            it reactivates the department.
          format: date-time
        exclude_from_sales_reporting:
          type: boolean
          description: Whether sales from this department are omitted from sales reporting.
        name:
          type: string
          description: Human-readable department name.
        parent_department_id:
          type: string
          nullable: true
          description: >-
            ID of the parent department, or null for a top-level department. A
            parent must itself be top-level: departments nest one level deep.
          pattern: ^[0-9]+$
    StoreDepartment:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the store department.
        deactivated_at:
          type: string
          nullable: true
          description: When the department was deactivated, or null when it is active.
          format: date-time
        exclude_from_sales_reporting:
          type: boolean
          description: Whether sales from this department are omitted from sales reporting.
        name:
          type: string
          description: Human-readable department name.
        parent_department_id:
          type: string
          nullable: true
          description: ID of the parent department, or null for a top-level department.
      description: >-
        A grouping of products within a store, optionally nested under a parent
        department.
      required:
        - id
        - deactivated_at
        - exclude_from_sales_reporting
        - name
        - parent_department_id
    InvalidParentDepartmentError:
      type: object
      properties:
        error_code:
          type: string
          enum:
            - invalid_parent_department
      required:
        - error_code
    InvalidDepartmentHierarchyError:
      type: object
      properties:
        error_code:
          type: string
          enum:
            - invalid_department_hierarchy
      required:
        - error_code
    DepartmentHasActiveProductsError:
      type: object
      properties:
        error_code:
          type: string
          enum:
            - department_has_active_products
      required:
        - error_code
    DepartmentHasActiveSubDepartmentsError:
      type: object
      properties:
        error_code:
          type: string
          enum:
            - department_has_active_sub_departments
      required:
        - error_code
    DuplicateDepartmentNameError:
      type: object
      properties:
        error_code:
          type: string
          enum:
            - duplicate_department_name
      required:
        - error_code
    InsufficientPermissionsError:
      type: object
      properties:
        error_code:
          type: string
          enum:
            - insufficient_permissions
        error_details:
          $ref: '#/components/schemas/InsufficientPermissionsErrorDetails'
      required:
        - error_code
        - error_details
    NoBannerAssociationError:
      type: object
      properties:
        error_code:
          type: string
          enum:
            - no_banner_association
      required:
        - error_code
    InsufficientPermissionsErrorDetails:
      type: object
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
        resource:
          allOf:
            - $ref: '#/components/schemas/Resource'
      required:
        - action
        - resource
    Action:
      type: string
      enum:
        - '*'
        - cancel
        - check_in
        - create
        - delete
        - read
        - read_credentials
        - record_events
        - refund
        - restart
        - update
        - void
    Resource:
      type: string
      enum:
        - '*'
        - accounting_integration
        - agent_chats
        - api_clients
        - asynchronous_tasks
        - banners
        - blackhawk_transactions
        - business_entities
        - capabilities
        - coupons
        - custom_quick_actions
        - datacap_transactions
        - departments
        - discounts
        - ditto_auth_tokens
        - edge_agents
        - electronic_shelf_labels
        - employees
        - feature_orientations
        - files
        - food_modifiers
        - gift_cards
        - gl_code_mappings
        - house_accounts
        - inventory
        - inventory_sessions
        - inventory_settings
        - invoices
        - item_modifiers
        - label_dimension_sets
        - label_sheet_profiles
        - label_stock_products
        - lanes
        - loyalty_bonuses
        - loyalty_campaigns
        - loyalty_rewards
        - notification_templates
        - offers
        - order_guides
        - people
        - pos_banner_configurations
        - pos_orders
        - pos_tills
        - price_tags
        - product_ranges
        - products
        - promotions
        - purchase_orders
        - receiving
        - reporting
        - revision_sessions
        - revisions
        - roles
        - shopper_tags
        - shoppers
        - store_product_inventory_counts
        - store_product_lots
        - store_product_rules
        - store_product_tag_templates
        - store_snap_incentive_program_coupons
        - store_vendor_merge_requests
        - store_vendor_product_merge_requests
        - store_vendor_products
        - store_vendors
        - stores
        - tag_printings
        - tag_template_presets
        - tag_templates
        - tax_rates
        - users
        - variable_weights
        - vendor_merge_requests
        - vendor_product_merge_requests
        - vendors
        - wallet_payments
        - wic_products
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

## Related topics

- [Retrieve a store department](/api-reference/departments/retrieve-a-store-department.md)
- [Create a store department](/api-reference/departments/create-a-store-department.md)
- [List store departments](/api-reference/departments/list-store-departments.md)
