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

# Create bundle

> Creates a bundle (product group of type BUNDLE) for the caller's organization. Same validation rules as the admin UI. Returns 403 when bundles are not enabled for your organization.



## OpenAPI

````yaml /openapi.json post /api/v1/bundles
openapi: 3.1.0
info:
  title: Firstbase API Specification
  description: Integration endpoints for Firstbase
  version: 0.1.0
servers:
  - url: https://apipub.firstbasehq.com
    description: Production
security:
  - ApiKey: []
tags:
  - name: Bundles
    description: Manage product-group bundles
  - name: Catalog
    description: Browse SKUs, brands, and categories
  - name: Inventory
    description: Query and manage inventory items and assets
  - name: Inventory Levels
    description: Configure inventory levels by SKU and warehouse
  - name: Inventory Orders
    description: Create and manage inventory orders
  - name: ITAD
    description: IT asset disposition requests
  - name: New Joiners
    description: Track and remind new joiners
  - name: Offices
    description: Manage office locations
  - name: Orders
    description: Create and track equipment orders
  - name: Packages
    description: Manage equipment packages
  - name: People
    description: Provision and manage users
  - name: Regions
    description: Query regions
  - name: Replacements
    description: Create and manage equipment replacements
  - name: Returns
    description: Create and manage returns
  - name: Shipment
    description: Look up shipments and carriers
  - name: Shipment Notices
    description: Create and manage shipment notices
  - name: Warehouses
    description: Query warehouses
paths:
  /api/v1/bundles:
    post:
      tags:
        - Bundles
      summary: Create bundle
      description: >-
        Creates a bundle (product group of type BUNDLE) for the caller's
        organization. Same validation rules as the admin UI. Returns 403 when
        bundles are not enabled for your organization.
      operationId: createBundleV1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrUpdateBundle'
            example:
              name: Laptop Bundle
              regionId: 3a68a467-8733-4c8d-a942-16ed7ec33018
              primaryCategoryCode: COMPUTER
              components:
                - skuId: 7b21c8e0-1a2b-4c3d-9e5f-0123456789ab
                  quantity: 1
                  required: true
                  fulfillmentMode: WAREHOUSE_FIRST_THEN_PROCURE
                  warehouseCondition: NEW_FIRST
                  sortOrder: 0
        required: true
      responses:
        '201':
          description: Bundle created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bundle'
        '400':
          description: Invalid request body or validation failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '403':
          description: Endpoint not available for this organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '404':
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '409':
          description: Conflict
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/bundles' \
              -H 'Authorization: ApiKey YOUR_API_KEY' \
              -H 'Accept: application/json' \
              -H 'Content-Type: application/json' \
              -d '{
                "name": "Laptop Bundle",
                "regionId": "3a68a467-8733-4c8d-a942-16ed7ec33018",
                "primaryCategoryCode": "COMPUTER",
                "components": [
                  {
                    "skuId": "7b21c8e0-1a2b-4c3d-9e5f-0123456789ab",
                    "quantity": 1,
                    "required": true,
                    "fulfillmentMode": "WAREHOUSE_FIRST_THEN_PROCURE",
                    "warehouseCondition": "NEW_FIRST",
                    "sortOrder": 0
                  }
                ]
              }'
components:
  schemas:
    CreateOrUpdateBundle:
      type: object
      description: Create or fully replace a bundle and its members
      properties:
        name:
          type: string
          description: Display name
          example: Laptop Bundle
          minLength: 1
        regionId:
          type: string
          format: uuid
          description: Region UUID the bundle is scoped to
        components:
          type: array
          description: Member SKU lines (at least one)
          items:
            $ref: '#/components/schemas/BundleComponentWrite'
          minItems: 1
        description:
          type: string
          description: >-
            Optional short description (max 120 characters). Null/omit keeps the
            stored value on update; an empty or blank string clears it.
          example: Standard laptop kit for new engineering hires
        coverSkuId:
          type: string
          format: uuid
          description: >-
            Optional cover image: SKU id of a current member whose product image
            is used as the bundle cover. Must be one of the supplied member
            SKUs. Null/omit keeps the stored value on update; once set it can be
            replaced but not removed.
          example: 7b21c8e0-1a2b-4c3d-9e5f-0123456789ab
        primaryCategoryCode:
          type: string
          description: >-
            Catalog category code this bundle sits under in a package. Valid
            codes are open-ended; list them via GET /api/v1/categories.
            Null/omit derives from members on create and keeps the stored value
            on update. Blank is rejected.
          example: COMPUTER
      required:
        - components
        - name
        - regionId
    Bundle:
      type: object
      description: Product group bundle and its members
      properties:
        id:
          type: string
          format: uuid
          description: Bundle UUID
        type:
          type: string
          enum:
            - BUNDLE
            - FALLBACK
          description: >-
            Product group type. Bundles returned by this API are always
            `BUNDLE`.
        friendlyId:
          type: string
          description: Human-friendly identifier (GRP-*)
          example: GRP-260914-TEST0001
        name:
          type: string
          description: Display name
          example: Laptop Bundle
        description:
          type: string
          description: Optional short description; null when unset
        coverSkuId:
          type: string
          format: uuid
          description: >-
            Cover image SKU id (a current member); null when unset (default
            icon)
        primaryCategoryCode:
          type: string
          description: Catalog category code this bundle sits under in a package
        region:
          $ref: '#/components/schemas/BundleRegion'
        status:
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
          description: Current status of the resource.
        components:
          type: array
          items:
            $ref: '#/components/schemas/BundleComponent'
          description: Member lines of the bundle, in `sortOrder`.
        referencedPackageCount:
          type: integer
          format: int32
          description: >-
            Distinct packages currently including this bundle. Archiving
            detaches the bundle from all of them, so this is the number of
            packages that will lose it.
          example: 0
        createdBy:
          $ref: '#/components/schemas/BundlePerson'
        updatedBy:
          $ref: '#/components/schemas/BundlePerson'
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the resource was created (ISO-8601).
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the bundle was last updated (ISO-8601).
      required:
        - components
        - createdAt
        - friendlyId
        - id
        - name
        - referencedPackageCount
        - region
        - status
        - type
        - updatedAt
    PublicApiHttpErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PublicApiError'
          description: List of error details.
      required:
        - errors
    BundleComponentWrite:
      type: object
      description: Member SKU line on a bundle write
      properties:
        skuId:
          type: string
          format: uuid
          description: Catalog SKU UUID
        quantity:
          type: integer
          format: int32
          default: 1
          description: Quantity of this SKU
          example: 1
          minimum: 1
        required:
          type: boolean
          default: true
          description: When true, an unfulfillable line blocks the whole bundle
        fulfillmentMode:
          type: string
          enum:
            - WAREHOUSE_ONLY
            - WAREHOUSE_FIRST_THEN_PROCURE
            - ALWAYS_PROCURE_NEW
          description: >-
            How this line is fulfilled: `WAREHOUSE_ONLY` (warehouse stock only),
            `WAREHOUSE_FIRST_THEN_PROCURE` (use warehouse stock, procure the
            remainder), or `ALWAYS_PROCURE_NEW` (always procure new).
        warehouseCondition:
          type: string
          description: >-
            Required unless fulfillmentMode is ALWAYS_PROCURE_NEW (defaults to
            NEW_FIRST)
          enum:
            - NEW_ONLY
            - NEW_FIRST
            - USED_FIRST
        sortOrder:
          type: integer
          format: int32
          default: 0
          description: Sort order within the bundle
          example: 0
      required:
        - fulfillmentMode
        - skuId
    BundleRegion:
      type: object
      description: Region a bundle is scoped to
      properties:
        id:
          type: string
          format: uuid
          description: Region UUID
          example: 3a68a467-8733-4c8d-a942-16ed7ec33018
        name:
          type: string
          description: Human-readable region name
          example: United States
        code:
          type: string
          description: Short region code
          example: US
      required:
        - code
        - id
        - name
    BundleComponent:
      type: object
      description: Member line of a bundle
      properties:
        id:
          type: string
          format: uuid
          description: Component UUID
        sku:
          $ref: '#/components/schemas/BundleSku'
        quantity:
          type: integer
          format: int32
          description: Quantity of this SKU in the bundle
          example: 1
        required:
          type: boolean
          description: When true, an unfulfillable line blocks the whole bundle
        fulfillmentMode:
          type: string
          enum:
            - WAREHOUSE_ONLY
            - WAREHOUSE_FIRST_THEN_PROCURE
            - ALWAYS_PROCURE_NEW
          description: >-
            How this line is fulfilled: `WAREHOUSE_ONLY` (warehouse stock only),
            `WAREHOUSE_FIRST_THEN_PROCURE` (use warehouse stock, procure the
            remainder), or `ALWAYS_PROCURE_NEW` (always procure new).
        warehouseCondition:
          type: string
          enum:
            - NEW_ONLY
            - NEW_FIRST
            - USED_FIRST
          description: >-
            Which warehouse stock to use: `NEW_ONLY`, `NEW_FIRST` (prefer new,
            then used), or `USED_FIRST` (prefer used, then new). Null when
            `fulfillmentMode` is `ALWAYS_PROCURE_NEW`.
        sortOrder:
          type: integer
          format: int32
          description: Sort order of this member within the bundle
          example: 0
      required:
        - fulfillmentMode
        - id
        - quantity
        - required
        - sku
        - sortOrder
        - warehouseCondition
    BundlePerson:
      type: object
      description: Person who created or last updated the bundle
      properties:
        id:
          type: string
          format: uuid
          description: Person UUID
          example: d7d0d906-425f-402f-bde1-39031c67c40b
        forename:
          type: string
          description: Given name
          example: Ada
        surname:
          type: string
          description: Family name
          example: Lovelace
      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
    BundleSku:
      type: object
      description: Catalog SKU referenced by a bundle member
      properties:
        id:
          type: string
          format: uuid
          description: SKU UUID
          example: 7b21c8e0-1a2b-4c3d-9e5f-0123456789ab
        vendorSku:
          type: string
          description: Vendor SKU identifier
          example: MK183LL/A
        productTitle:
          type: string
          description: Product title
          example: MacBook Pro 14
        categoryCode:
          type: string
          description: Product category code
          example: COMPUTER
      required:
        - id
        - vendorSku
  securitySchemes:
    ApiKey:
      type: apiKey
      description: Prefix the value with "ApiKey" to indicate the custom authorization type
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.