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

# Use this when the user wants to add a product to an existing storefront.



## OpenAPI

````yaml /openapi.json post /v1/storefronts/{storefrontId}/products
openapi: 3.1.0
info:
  title: Marea Alcalina API
  version: 1.0.0
servers:
  - url: https://api.mareaalcalina.com
security: []
paths:
  /v1/storefronts/{storefrontId}/products:
    post:
      summary: Use this when the user wants to add a product to an existing storefront.
      operationId: createProduct
      parameters:
        - schema:
            type: string
          required: true
          name: storefrontId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductManifest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductsCreateResponse'
        '400':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '409':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '410':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '413':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '500':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '503':
          description: §9.6 error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    ProductManifest:
      type: object
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 200
        description:
          type:
            - string
            - 'null'
        price:
          type: number
          minimum: 0
        salePrice:
          type:
            - number
            - 'null'
          minimum: 0
        category:
          type:
            - string
            - 'null'
        subcategory:
          type:
            - string
            - 'null'
        imageUrl:
          type:
            - string
            - 'null'
          format: uri
        thumbnailUrl:
          type:
            - string
            - 'null'
          format: uri
        sku:
          type:
            - string
            - 'null'
        slug:
          type:
            - string
            - 'null'
        position:
          type:
            - integer
            - 'null'
        cartProduct:
          type:
            - boolean
            - 'null'
        hide:
          type:
            - boolean
            - 'null'
        stock:
          type:
            - integer
            - 'null'
          minimum: 0
        tags:
          type:
            - array
            - 'null'
          items:
            type: string
        extraProductsCategory:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ExtraProductsCategory'
      required:
        - title
        - price
      description: >-
        Agent-facing product input shape. Mutability rule §6.18.1.1: every field
        PATCHable post-create.
    ProductsCreateResponse:
      type: object
      properties:
        product:
          $ref: '#/components/schemas/ProductDto'
      required:
        - product
    ApiErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
      description: §9.6 uniform error envelope. Every non-2xx response uses this shape.
    ExtraProductsCategory:
      type: object
      properties:
        title:
          type: string
        obligatory:
          type: boolean
        multipleOption:
          type: boolean
        maxOptions:
          type: integer
        minOptions:
          type: integer
        extraProducts:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ExtraProductOption'
      required:
        - title
        - obligatory
        - multipleOption
        - maxOptions
        - minOptions
    ProductDto:
      type: object
      properties:
        id:
          type: string
          pattern: ^prd_
          example: prd_abc123
        title:
          type: string
        description:
          type:
            - string
            - 'null'
        price:
          type: number
        salePrice:
          type:
            - number
            - 'null'
        category:
          type:
            - string
            - 'null'
        subcategory:
          type:
            - string
            - 'null'
        imageUrl:
          type:
            - string
            - 'null'
        thumbnailUrl:
          type:
            - string
            - 'null'
        sku:
          type:
            - string
            - 'null'
        slug:
          type:
            - string
            - 'null'
        position:
          type:
            - integer
            - 'null'
        cartProduct:
          type:
            - boolean
            - 'null'
        hide:
          type:
            - boolean
            - 'null'
        stock:
          type:
            - integer
            - 'null'
        tags:
          type:
            - array
            - 'null'
          items:
            type: string
        extraProductsCategory:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ExtraProductsCategory'
        imageProcessingPending:
          type:
            - boolean
            - 'null'
        createdAt:
          type:
            - string
            - 'null'
        updatedAt:
          type:
            - string
            - 'null'
      required:
        - id
        - title
        - description
        - price
        - salePrice
        - category
        - subcategory
        - imageUrl
        - thumbnailUrl
        - sku
        - slug
        - position
        - cartProduct
        - hide
        - stock
        - tags
        - extraProductsCategory
        - imageProcessingPending
        - createdAt
        - updatedAt
    ApiErrorBody:
      type: object
      properties:
        type:
          type: string
          enum:
            - rate_limited
            - invalid_request
            - auth
            - not_found
            - plan_limit
            - internal
            - conflict
            - idempotency_conflict
            - service_unavailable
            - tos_not_accepted
          description: High-level error category. Agents branch on this.
          example: auth
        code:
          type: string
          description: Stable machine-readable code.
          example: missing_authorization
        message:
          type: string
          description: Human-readable, localized via Accept-Language.
        doc:
          type: string
          description: Link to the error reference in the docs.
          example: https://docs.mareaalcalina.com/concepts/errors
        param:
          type:
            - string
            - 'null'
        requestId:
          type: string
          example: req_30a9358b-70bd-44f3-aa5d-8983b558ad84
        recoverable:
          type: boolean
        retryAfterMs:
          type:
            - integer
            - 'null'
        nextActions:
          type: array
          items:
            $ref: '#/components/schemas/ApiNextAction'
        upgrade:
          $ref: '#/components/schemas/ApiErrorUpgrade'
        requiredScopes:
          type: array
          items:
            type: string
        heldScopes:
          type: array
          items:
            type: string
      required:
        - type
        - code
        - message
        - doc
        - param
        - requestId
        - recoverable
        - retryAfterMs
        - nextActions
        - upgrade
    ExtraProductOption:
      type: object
      properties:
        title:
          type: string
        price:
          type: number
          minimum: 0
        available:
          type: boolean
        stock:
          type:
            - integer
            - 'null'
      required:
        - title
        - price
        - available
    ApiNextAction:
      type: object
      properties:
        label:
          type: string
          example: Validate the JSON before retrying.
        method:
          type:
            - string
            - 'null'
          example: null
        url:
          type:
            - string
            - 'null'
          example: null
      required:
        - label
        - method
        - url
      description: A concrete action the agent can offer the user.
    ApiErrorUpgrade:
      type:
        - object
        - 'null'
      properties:
        currentPlan:
          type: string
          example: free
        requiredPlan:
          type: string
          example: pro
        upgradeUrl:
          type: string
          example: >-
            https://mareaalcalina.com/menus/profile?changePlan=basic&frequency=monthly&planSource=api
        previewUrl:
          type: string
          description: Optional preview link the agent can surface.
      required:
        - currentPlan
        - requiredPlan
        - upgradeUrl
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: mk_dev_* | mk_user_*

````