Documentation

Bundles API

Manage reusable equipment bundles that can be applied to project rooms.

GET /api/v1/bundles

Returns a paginated list of bundles.

Query Parameters

Parameter Type Default Description
page integer 1 Page number
pageSize integer 20 Items per page (max 100)
search string null Search by name or description

Response (200 - Success)

{
    "success": true,
    "data": {
        "bundles": [
            {
                "bundleId": 1,
                "name": "Small Conference Room Package",
                "description": "Basic AV setup for 8-person room",
                "itemCount": 12,
                "createdAt": "2024-01-15T10:00:00Z",
                "updatedAt": "2024-12-25T12:00:00Z"
            }
        ],
        "pagination": { ... }
    },
    "timestamp": "2024-12-25T12:00:00Z"
}

GET /api/v1/bundles/{id}

Returns a bundle with all its items and dividers.

Response (200 - Success)

{
    "success": true,
    "data": {
        "bundle": {
            "bundleId": 1,
            "name": "Small Conference Room Package",
            "description": "Basic AV setup for 8-person room",
            "items": [
                {
                    "bundleItemId": 1,
                    "productId": 123,
                    "productMake": "Crestron",
                    "productModel": "TSW-1070",
                    "quantity": 1,
                    "laborHours": 2.0,
                    "orderIndex": 1
                }
            ],
            "dividers": [
                {
                    "bundleDividerId": 1,
                    "title": "Control System",
                    "orderIndex": 0
                }
            ],
            "createdAt": "2024-01-15T10:00:00Z",
            "updatedAt": "2024-12-25T12:00:00Z"
        }
    },
    "timestamp": "2024-12-25T12:00:00Z"
}

POST /api/v1/bundles

Creates a new bundle.

Request Body

Field Type Required Description
name string Yes Bundle name (max 200 chars)
description string No Bundle description (max 1000 chars)

PUT /api/v1/bundles/{id}

Updates a bundle's name and description.


DELETE /api/v1/bundles/{id}

Deletes a bundle and all its items.


GET /api/v1/bundles/{id}/items

Returns all items and dividers in a bundle.


POST /api/v1/bundles/{id}/items

Adds a product to a bundle.

Request Body

Field Type Required Description
productId integer Yes Product ID to add
quantity integer No Quantity (default: 1)
laborHours number No Labor hours per unit
productCostEach decimal No Override cost per unit
productMarkup decimal No Override markup percentage
orderIndex integer No Position in bundle (auto-assigned if omitted)

PUT /api/v1/bundles/{id}/items/{itemId}

Updates a bundle item's properties.


DELETE /api/v1/bundles/{id}/items/{itemId}

Removes an item from a bundle.


POST /api/v1/bundles/{id}/apply

Applies a bundle to a project room, adding all items and dividers.

Request Body

Field Type Required Description
projectId integer Yes Target project ID
roomId integer Yes Target room ID
allowDuplicates boolean No If false (default), adds quantity to existing products. If true, creates new line items.

Response (200 - Success)

{
    "success": true,
    "data": {
        "bundleId": 1,
        "bundleName": "Small Conference Room Package",
        "projectId": 100,
        "roomId": 50,
        "itemsAdded": 10,
        "itemsUpdated": 2,
        "dividersAdded": 3
    },
    "message": "Bundle 'Small Conference Room Package' applied to room",
    "timestamp": "2024-12-25T12:00:00Z"
}
Bundle Application

When applying a bundle, items are appended to the end of the room's equipment list. If a product already exists in the room, its quantity is increased (unless allowDuplicates is true).