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

# Modify an existing package

> Partially update a package by slug. Modifiable scalar fields: `name`, `active`, `approvalRequired`, `automaticOrder`, `defaultOfficeId`, `deliverySetting`. When `skus` is present, each entry adds or removes a SKU by catalog `id` (set `delete: true` to unlink). Omitted existing SKUs are unchanged; omit `skus` to leave assignments unchanged. `rules` and `usedEquipmentPreferences` replace when present (REQ-025). Setting `active=false` soft-deletes the package. The response includes the full package view plus its `notes` collection. Business-rule rejections (illegal automatic order, duplicate name, archive blocked, etc.) return HTTP 409 with `source="package"` envelope.



## OpenAPI

````yaml /openapi.json patch /api/v1/packages/{slug}
openapi: 3.1.0
info:
  title: Firstbase API Specification Beta
  description: Integration endpoints for Firstbase
  version: 0.1.0
servers:
  - url: /
    description: Default
security:
  - ApiKey: []
tags:
  - name: Inventory Orders
    description: Create and manage inventory orders
  - name: Shipment Notices V1
    description: 'Query shipment notice orders (V1: package items expose `inventories` list)'
  - name: Packages
    description: ''
  - name: Categories
    description: Query available categories for asset creation
  - name: Catalog
    description: ''
  - name: New Joiners
    description: New joiner provisioning pipeline for the organization
  - name: Orders
    description: ''
  - name: People
    description: >-
      Manage the users of Firstbase for your organization. API follows the SCIM
      standard.
    externalDocs:
      url: https://scim.cloud/
  - name: People — Lifecycle
    description: Offboard and reactivate users.
  - name: Assets
    description: Manage inventory assets
  - name: Regions V1
    description: Query regions (V1)
  - name: Warehouses V1
    description: Query warehouses (V1)
  - name: Brands
    description: Query available brands for asset creation
  - name: Inventory
    description: ''
  - name: Replacements
    description: Create and manage equipment replacements
  - name: Offices
    description: Manage and query office locations for the authenticated organization
  - name: Returns
    description: Return and Replacements
paths:
  /api/v1/packages/{slug}:
    patch:
      tags:
        - Packages
      summary: Modify an existing package
      description: >-
        Partially update a package by slug. Modifiable scalar fields: `name`,
        `active`, `approvalRequired`, `automaticOrder`, `defaultOfficeId`,
        `deliverySetting`. When `skus` is present, each entry adds or removes a
        SKU by catalog `id` (set `delete: true` to unlink). Omitted existing
        SKUs are unchanged; omit `skus` to leave assignments unchanged. `rules`
        and `usedEquipmentPreferences` replace when present (REQ-025). Setting
        `active=false` soft-deletes the package. The response includes the full
        package view plus its `notes` collection. Business-rule rejections
        (illegal automatic order, duplicate name, archive blocked, etc.) return
        HTTP 409 with `source="package"` envelope.
      operationId: patchPackage
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAPIPatchPackageRequest'
        required: true
      responses:
        '200':
          description: Package updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPackageResponse'
        '400':
          description: >-
            Empty body, invalid field values, or explicit null for guarded
            scalar fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '403':
          description: Endpoint not enabled for this organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '404':
          description: Package not found for the authenticated organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '409':
          description: >-
            Package cannot be modified (illegal automatic order, duplicate name,
            archive blocked, etc.)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
components:
  schemas:
    PublicAPIPatchPackageRequest:
      type: object
      description: Partial update payload for a package (FBS-3321)
      properties:
        name:
          $ref: '#/components/schemas/JsonNullableString'
          description: Package name
        active:
          $ref: '#/components/schemas/JsonNullableBoolean'
          description: >-
            Set to false to soft-delete the package. Must be a boolean if
            present; null is invalid.
        approvalRequired:
          $ref: '#/components/schemas/JsonNullableBoolean'
          description: Whether package orders require approval
        requireJustification:
          $ref: '#/components/schemas/JsonNullableBoolean'
          description: Whether order items in this package require justification
        automaticOrder:
          $ref: '#/components/schemas/JsonNullableBoolean'
          description: Whether orders for this package are placed automatically
        defaultOfficeId:
          $ref: '#/components/schemas/JsonNullableUUID'
          description: >-
            Default office UUID for OFFICE/FLEXIBLE delivery; cleared on PERSON
            delivery
        deliverySetting:
          $ref: '#/components/schemas/JsonNullablePackageDeliverySetting'
          description: Package delivery setting (PERSON, OFFICE, FLEXIBLE)
        skus:
          type: array
          description: >-
            SKU changes for the package. `null` (omitted) means no change. When
            present, each entry adds (`id` only) or removes (`id` + `delete:
            true`) a SKU. Existing SKUs not mentioned are unchanged. At least
            one entry is required when present.
          items:
            $ref: '#/components/schemas/PublicAPIPatchPackageSkuRequest'
        rules:
          type: array
          description: >-
            Package rules. `null` (omitted) means no change. A present list
            replaces the package's rules (upsert/additive semantics, REQ-025).
          items:
            $ref: '#/components/schemas/PublicAPIPatchPackageRuleRequest'
        usedEquipmentPreferences:
          type: array
          description: >-
            Used-equipment preferences. `null` (omitted) means no change. A
            present list replaces the package's preferences (upsert/additive
            semantics, REQ-025).
          items:
            $ref: '#/components/schemas/PublicAPIPatchUsedEquipmentPrefRequest'
        isRequireJustificationValidWhenPresent:
          type: boolean
        isAutomaticOrderValidWhenPresent:
          type: boolean
        isDefaultOfficeIdValidWhenPresent:
          type: boolean
        isDeliverySettingValidWhenPresent:
          type: boolean
        isApprovalRequiredValidWhenPresent:
          type: boolean
        isAtLeastOneModifiableField:
          type: boolean
        isNameValidWhenPresent:
          type: boolean
        isActiveValidWhenPresent:
          type: boolean
      required:
        - active
        - approvalRequired
        - automaticOrder
        - defaultOfficeId
        - deliverySetting
        - isActiveValidWhenPresent
        - isApprovalRequiredValidWhenPresent
        - isAtLeastOneModifiableField
        - isAutomaticOrderValidWhenPresent
        - isDefaultOfficeIdValidWhenPresent
        - isDeliverySettingValidWhenPresent
        - isNameValidWhenPresent
        - isRequireJustificationValidWhenPresent
        - name
        - requireJustification
    GetPackageResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        automaticOrder:
          type: boolean
        approvalRequired:
          type: boolean
        requireJustification:
          type: boolean
        slug:
          type: string
        active:
          type: boolean
        skuIds:
          type: array
          items:
            type: string
            format: uuid
        assignedTo:
          $ref: '#/components/schemas/PackageAssignedToResponse'
        notes:
          type: array
          items:
            $ref: '#/components/schemas/PackageNoteResponse'
      required:
        - active
        - approvalRequired
        - automaticOrder
        - id
        - name
        - notes
        - requireJustification
        - slug
    PublicApiHttpErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PublicApiError'
      required:
        - errors
    JsonNullableString:
      type: object
      properties:
        present:
          type: boolean
    JsonNullableBoolean:
      type: object
      properties:
        present:
          type: boolean
    JsonNullableUUID:
      type: object
      properties:
        present:
          type: boolean
    JsonNullablePackageDeliverySetting:
      type: object
      properties:
        present:
          type: boolean
    PublicAPIPatchPackageSkuRequest:
      type: object
      description: SKU change for package PATCH
      properties:
        id:
          type: string
          format: uuid
          description: SKU UUID (catalog id)
        delete:
          type: boolean
          description: >-
            When true, delete/unlink this SKU from the package. Defaults to
            false. The legacy key `remove` is accepted as a deprecated alias for
            `delete`.
      required:
        - id
    PublicAPIPatchPackageRuleRequest:
      type: object
      description: Package rule entry for PATCH (mirrors UpdatePackageRuleDTO field names)
      properties:
        categoryCode:
          $ref: '#/components/schemas/JsonNullableString'
          description: Category code (e.g. LAPTOP)
        optional:
          $ref: '#/components/schemas/JsonNullableBoolean'
          description: Whether the rule is optional
        quantity:
          $ref: '#/components/schemas/JsonNullableInteger'
          description: Quantity for the rule
      required:
        - categoryCode
        - optional
        - quantity
    PublicAPIPatchUsedEquipmentPrefRequest:
      type: object
      description: Used-equipment preference entry for PATCH
      properties:
        categoryCode:
          type: string
          description: Category code identifying which preference to update (e.g. LAPTOP)
          minLength: 1
        preference:
          type: string
          description: Used-equipment preference value
          enum:
            - NEW_FIRST
            - NEW_ONLY
            - USED_FIRST
            - USED_ONLY
      required:
        - categoryCode
        - preference
    PackageAssignedToResponse:
      type: object
      properties:
        people:
          type: array
          items:
            type: string
            format: uuid
    PackageNoteResponse:
      type: object
      description: Package note details
      properties:
        id:
          type: string
          format: uuid
          description: Package note unique identifier
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        note:
          type: string
          description: Note text
          example: Remember to include the welcome letter
        active:
          type: boolean
          description: Whether the note is active
          example: true
      required:
        - id
    PublicApiError:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable description of the error
          example: Invalid request
        source:
          type: string
          description: >-
            Entity or field path that caused the error (for example order,
            shipmentNotice, or person:email)
          example: request
      required:
        - detail
        - source
    JsonNullableInteger:
      type: object
      properties:
        present:
          type: boolean
  securitySchemes:
    ApiKey:
      type: apiKey
      description: Prefix the value with "ApiKey" to indicate the custom authorization type
      name: Authorization
      in: header

````