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

# Add Bundle Item



## OpenAPI

````yaml openapi.yaml post /admin/products/{id}/bundle-items
openapi: 3.1.0
info:
  title: Headless Commerce API
  description: >
    Headless Commerce as a Service — REST API specification.


    ## Authentication

    Pass your API key as a Bearer token in every request.

    - **Secret Key** (`sk_live_*`, `sk_test_*`): Server-side. Full access to
    Admin + Storefront APIs.

    - **Publishable Key** (`pk_live_*`, `pk_test_*`): Client-side. Storefront
    API only.


    ## Customer Authentication (Storefront)

    Storefront endpoints that require customer identification
    (/storefront/customers/*, /storefront/orders/*)

    need the `X-Customer-Token` header.

    1. From your backend, call `POST /admin/customers/{id}/token` with an `sk_*`
    key to issue a token

    2. From the frontend, send requests with the `pk_*` key + `X-Customer-Token`
    header


    ## Pagination

    Uses cursor-based pagination.

    - `limit`: Page size (default 20, max 100)

    - `starting_after`: Return results after this ID

    - Response includes `has_more` and `next_cursor`


    ## Money

    All amounts are integers in the smallest currency unit (KRW=won, USD=cents).


    ## Rate Limiting

    All responses include the following headers:

    - `X-RateLimit-Limit`: Max requests per minute (by plan: Free 100, Starter
    500, Pro 2000, Enterprise 10000)

    - `X-RateLimit-Remaining`: Remaining requests in current window

    - Returns `429 Too Many Requests` when exceeded


    ## Idempotency

    Include an `Idempotency-Key` header with payment/order-related POST requests
    to receive the original response for duplicate requests with the same key.

    Recommended for: checkout, refund, and payment creation
  version: 1.0.0
  contact:
    name: Headless Commerce Support
    url: https://headlesscommerce.io
servers:
  - url: https://api.headlesscommerce.io/v1
    description: Production
  - url: https://api.headlesscommerce.io/v1
    description: Test (same URL, test API key)
security:
  - BearerAuth: []
tags:
  - name: Storefront - Products
    description: Browse products for buyers
  - name: Storefront - Cart
    description: Cart management and checkout
  - name: Storefront - Orders
    description: View orders (own orders)
  - name: Storefront - Customers
    description: Customer profile (own profile)
  - name: Storefront - Shipping
    description: View shipping methods
  - name: Admin - Products
    description: Product management
  - name: Admin - Variants
    description: Variant management
  - name: Admin - Categories
    description: Category management
  - name: Admin - Collections
    description: Collection management
  - name: Admin - Inventory
    description: Inventory management
  - name: Admin - Orders
    description: Order management
  - name: Admin - Fulfillments
    description: Fulfillment management
  - name: Admin - Customers
    description: Customer management
  - name: Admin - Discounts
    description: Discount management
  - name: Admin - Shipping Methods
    description: Shipping method management
  - name: Admin - Webhooks
    description: Webhook management
  - name: Admin - Store
    description: Store settings
  - name: Admin - Settings
    description: API keys, organization, and team management
  - name: Admin - Returns
    description: Return management
  - name: Admin - Regions
    description: Region, i18n, and currency rate management
  - name: Admin - Dashboard
    description: Dashboard statistics
  - name: Admin - Logs
    description: API log viewing
  - name: Admin - Uploads
    description: File uploads
  - name: Storefront - Returns
    description: Customer return requests and viewing
  - name: Storefront - Customer Auth
    description: Customer registration and login
  - name: Storefront - Payments
    description: Payment confirmation
  - name: OAuth
    description: OAuth 2.1 Authorization Code flow with PKCE
  - name: Auth
    description: Dashboard user password reset
  - name: Admin - CSV
    description: Bulk CSV import and export
paths:
  /admin/products/{id}/bundle-items:
    post:
      tags:
        - Admin - Products
      summary: Add Bundle Item
      parameters:
        - $ref: '#/components/parameters/ResourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - child_product_id
                - quantity
              properties:
                child_product_id:
                  type: string
                  description: Child product ID
                child_variant_id:
                  type: string
                  description: >-
                    Specific variant (optional). If omitted, uses the default
                    variant
                quantity:
                  type: integer
                  minimum: 1
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BundleItem'
components:
  parameters:
    ResourceId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Resource ID
  schemas:
    BundleItem:
      type: object
      properties:
        id:
          type: string
        bundle_product_id:
          type: string
        child_product_id:
          type: string
          description: Child product ID
        child_variant_id:
          type: string
          nullable: true
          description: Specific variant (optional)
        quantity:
          type: integer
        child_product:
          $ref: '#/components/schemas/Product'
        child_variant:
          $ref: '#/components/schemas/Variant'
    Product:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        description:
          type: string
        type:
          type: string
          enum:
            - physical
            - digital
            - service
            - bundle
        status:
          type: string
          enum:
            - draft
            - active
            - archived
        tags:
          type: array
          items:
            type: string
        attributes:
          type: object
        images:
          type: array
          items:
            $ref: '#/components/schemas/Image'
        options:
          type: array
          items:
            $ref: '#/components/schemas/Option'
        variants:
          type: array
          items:
            $ref: '#/components/schemas/Variant'
        metadata:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Variant:
      type: object
      properties:
        id:
          type: string
        product_id:
          type: string
        sku:
          type: string
        barcode:
          type: string
        price:
          $ref: '#/components/schemas/Money'
        compare_at_price:
          $ref: '#/components/schemas/Money'
        cost_price:
          $ref: '#/components/schemas/Money'
        weight:
          type: integer
          description: grams
        is_active:
          type: boolean
        option_values:
          type: array
          items:
            $ref: '#/components/schemas/OptionValue'
        images:
          type: array
          items:
            $ref: '#/components/schemas/Image'
        inventory:
          $ref: '#/components/schemas/InventoryItem'
        metadata:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Image:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        alt_text:
          type: string
        position:
          type: integer
        width:
          type: integer
        height:
          type: integer
    Option:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        position:
          type: integer
        values:
          type: array
          items:
            $ref: '#/components/schemas/OptionValue'
    Money:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: integer
          description: Smallest currency unit (KRW=won, USD=cents)
        currency:
          type: string
          minLength: 3
          maxLength: 3
    OptionValue:
      type: object
      properties:
        id:
          type: string
        value:
          type: string
        position:
          type: integer
    InventoryItem:
      type: object
      properties:
        id:
          type: string
        variant_id:
          type: string
        track_inventory:
          type: boolean
        allow_backorder:
          type: boolean
        safety_stock:
          type: integer
        on_hand:
          type: integer
        reserved:
          type: integer
        available:
          type: integer
        metadata:
          type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API Key. Example: sk_live_xxxxx or pk_live_xxxxx'

````