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

# Submit a form

> Submits an active form. The request body is a free-form object keyed by the form's field `name`s (as returned by `GET /forms/{slug}`); values are validated dynamically against each field's definition (required/nullable, email format, `in:` for select/radio, array for checkbox, date for date fields). Include the honeypot field `_hp_name` as an empty string — if it is filled the submission is rejected as spam. Depending on the form type the submission may also create a contact message, subscribe the customer to a marketing list, and trigger notifications.



## OpenAPI

````yaml /api-reference/openapi.json post /forms/{slug}/submit
openapi: 3.0.0
info:
  title: Marzipan API
  version: 1.0.0
servers:
  - url: https://api.marzipan.co/v1
security:
  - tenantAuth: []
tags:
  - name: Account
    description: >-
      Account management endpoints including registration, login, and user
      details
  - name: Carts
    description: Shopping cart management endpoints
  - name: Products
    description: Product catalog and search endpoints
  - name: Subscriptions
    description: Subscription management and renewal endpoints
  - name: CMS
    description: Content management system endpoints
  - name: Messaging
    description: Message and communication endpoints
  - name: Search
    description: Search functionality endpoints
  - name: Settings
    description: >-
      Storefront settings and market detection used to configure the web
      components and checkout.
  - name: Analytics
    description: Storefront visit and attribution tracking.
  - name: Rewards
    description: >-
      Loyalty and rewards programme endpoints for the authenticated customer,
      covering points balance, tier status, perks, exclusive products and
      transaction history.
  - name: Forms
    description: Render and submit dynamic storefront forms defined in the CMS.
  - name: Events
    description: >-
      Check event availability, browse occurrences and recurring dates, generate
      ticket QR codes, and manage event waitlists (join, leave, check status,
      and claim promoted spots).
paths:
  /forms/{slug}/submit:
    post:
      tags:
        - Forms
      summary: Submit a form
      description: >-
        Submits an active form. The request body is a free-form object keyed by
        the form's field `name`s (as returned by `GET /forms/{slug}`); values
        are validated dynamically against each field's definition
        (required/nullable, email format, `in:` for select/radio, array for
        checkbox, date for date fields). Include the honeypot field `_hp_name`
        as an empty string — if it is filled the submission is rejected as spam.
        Depending on the form type the submission may also create a contact
        message, subscribe the customer to a marketing list, and trigger
        notifications.
      parameters:
        - name: slug
          in: path
          required: true
          description: URL-friendly identifier of the form.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: >-
                Object keyed by the form's field names. Keys and validation
                rules are determined by the form definition.
              additionalProperties: true
              properties:
                _hp_name:
                  type: string
                  description: >-
                    Honeypot field. Must be left empty; a non-empty value causes
                    the submission to be rejected as spam.
            example:
              name: Ada Lovelace
              email: ada@example.com
              message: Do you ship internationally?
              _hp_name: ''
      responses:
        '200':
          description: The form was submitted successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                    description: The form's configured success message.
              example:
                success: true
                message: Thank you for your submission!
        '404':
          description: No active form with the given slug exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: No query results for model [Form].
        '422':
          description: The submitted data failed validation, or spam was detected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              example:
                message: The email field must be a valid email address.
                errors:
                  email:
                    - The email field must be a valid email address.
components:
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
      required:
        - message
    ValidationError:
      type: object
      properties:
        message:
          type: string
          description: Validation error message
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Field-specific validation errors
      required:
        - message
        - errors
  securitySchemes:
    tenantAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your API token.
      bearerFormat: JWT

````