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

# Create a bundle

> Creates a new bundle (product pack) for the authenticated user



## OpenAPI

````yaml openapi.yaml post /bundle
openapi: 3.0.3
info:
  title: Lightyshare API
  description: >
    API for client access/integrations via user token.


    ## Versioning


    Inspired by Stripe's versioning strategy, we use date-based versioning to
    maintain backwards compatibility.


    ### Version Format

    API versions use the format `YYYY-MM-DD` (e.g., `2025-08-16`).


    ### How Versioning Works


    1. **Token-based versioning**: When you create an API token, it's
    automatically tied to the latest API version available at that time

    2. **Request-level override**: You can override the token's version for
    specific requests using the `lighty-version` header

    3. **Stable URLs**: API URLs remain stable - version is handled
    transparently via token or header


    ### Examples


    ```bash

    # Using token's default version (2025-08-16 in this example)

    curl -H "Authorization: Bearer lsh_live_abc123..." \
         https://lightyshare.com/api/token-secured/rental/123

    # Override with header to use a different version

    curl -H "Authorization: Bearer lsh_live_abc123..." \
         -H "lighty-version: 2025-01-15" \
         https://lightyshare.com/api/token-secured/rental/123
    ```


    The API version used is always returned in the `X-API-Version` response
    header.
  version: 0.1.0
  contact:
    name: Support Lightyshare
    url: https://support.lightyshare.com
servers:
  - url: https://lightyshare.com/api/token-secured
    description: Stable API endpoint (version handled via token/header)
security:
  - tokenAuth: []
paths:
  /bundle:
    post:
      tags:
        - Bundles
      summary: Create a bundle
      description: Creates a new bundle (product pack) for the authenticated user
      operationId: createBundle
      parameters:
        - $ref: '#/components/parameters/tokenParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BundleCreate'
      responses:
        '201':
          description: Bundle successfully created
          headers:
            X-API-Version:
              $ref: '#/components/headers/ApiVersion'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  id:
                    type: integer
                    example: 98765
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    tokenParam:
      name: token
      in: query
      required: true
      description: User authentication token
      schema:
        type: string
        example: YOUR_TOKEN
  schemas:
    BundleCreate:
      type: object
      required:
        - bundle
      properties:
        bundle:
          type: object
          required:
            - title
            - items
          properties:
            title:
              type: string
              maxLength: 255
              example: Complete LED Studio Pack
            description:
              type: string
              example: Professional kit for studio shooting
            rent:
              type: number
              format: float
              description: Optional, automatically calculated if absent
              example: 190
            items:
              type: array
              minItems: 1
              maxItems: 30
              items:
                type: object
                required:
                  - ad_id
                  - quantity
                properties:
                  ad_id:
                    type: integer
                    example: 123
                  quantity:
                    type: integer
                    minimum: 1
                    example: 2
            images:
              type: array
              maxItems: 5
              items:
                type: object
                required:
                  - src
                properties:
                  src:
                    type: string
                    format: uri
                    example: https://cdn.example.com/bundle-studio.jpg
            online:
              type: boolean
              default: true
            archived:
              type: boolean
              default: false
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: sku
              code:
                type: string
                example: REQUIRED
              message:
                type: string
                example: SKU is required for unit stock
  headers:
    ApiVersion:
      description: API version in YYYY-MM-DD format
      schema:
        type: string
        example: '2025-08-16'
  responses:
    BadRequest:
      description: Invalid request
      headers:
        X-API-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid token
      headers:
        X-API-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Invalid or missing token
    Forbidden:
      description: Access denied
      headers:
        X-API-Version:
          $ref: '#/components/headers/ApiVersion'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Access denied to this resource
    TooManyRequests:
      description: Too many requests
      headers:
        X-API-Version:
          $ref: '#/components/headers/ApiVersion'
        Retry-After:
          description: Number of seconds before retry is allowed
          schema:
            type: integer
            example: 60
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Request limit exceeded
  securitySchemes:
    tokenAuth:
      type: http
      scheme: bearer
      bearerFormat: token
      description: >
        Use your API token in the Authorization header with Bearer scheme.

        Alternative: You can also pass the token as a query parameter
        `?token=your_token` for backward compatibility.

````