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

# Create Form Endpoint

> The Create Form endpoint allows users to create a new form for transaction processing. Forms are used to add extra fields to store data while adding data to a resource. Different form types are available to specify the resources for the form. Field configurations can be added to customize the form's behavior. The request should include details such as form ID, fields, field configuration, form type, and ownership information. The response provides the created form's details, including form ID, associated products, fields, field configuration, update and creation timestamps, form type, and ownership information. This form can be used in transaction-related activities within the Connect system.



## OpenAPI

````yaml post /forms/forms/
openapi: 3.0.1
info:
  title: Trace Connect API
  version: v1
servers:
  - url: http://localhost:3000/connect/v1
security:
  - Bearer: []
paths:
  /forms/forms/:
    post:
      tags:
        - forms
      description: ViewSet for the Form model.
      operationId: forms_forms_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Form'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Form'
components:
  schemas:
    Form:
      required:
        - fields
        - owner
      type: object
      properties:
        id:
          type: string
        products:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/Product'
        fields:
          type: array
          items:
            $ref: '#/components/schemas/FormField'
        field_config:
          type: array
          items:
            $ref: '#/components/schemas/FormFieldConfig'
        updated_on:
          title: Updated On
          type: string
          format: date-time
          readOnly: true
        created_on:
          title: Updated On
          type: string
          format: date-time
          readOnly: true
        form_type:
          title: Form Type
          type: string
          enum:
            - TRANSACTION
            - FARMER
            - PAYMENT
            - PRODUCT
        creator:
          type: string
        updater:
          type: string
        owner:
          type: string
    Product:
      required:
        - name
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the product.
        premiums:
          title: Premiums
          type: string
          readOnly: true
          description: Premiums associated with the product.
        is_active:
          title: Is active
          type: string
          readOnly: true
          description: Indicates whether the product is currently active.
        updated_on:
          title: Updated On
          type: string
          format: date-time
          readOnly: true
          description: Date and time when the product information was last updated.
        created_on:
          title: Created On
          type: string
          format: date-time
          readOnly: true
          description: Date and time when the product was created.
        name:
          title: Product Name
          maxLength: 500
          minLength: 1
          type: string
          description: Name of the product.
        description:
          title: Product Description
          maxLength: 500
          type: string
          nullable: true
          description: Description of the product.
        image:
          title: Product Image
          type: string
          format: uri
          nullable: true
          readOnly: true
          description: URL to the image or photo of the product.
        creator:
          type: string
          description: Identifier of the user who created the product.
        updater:
          type: string
          description: Identifier of the user who last updated the product.
    FormField:
      required:
        - label
        - type
      type: object
      properties:
        id:
          type: string
        updated_on:
          title: Updated On
          type: string
          format: date-time
          readOnly: true
        created_on:
          title: Updated On
          type: string
          format: date-time
          readOnly: true
        label:
          title: Label
          maxLength: 100
          minLength: 1
          type: string
        label_en_us:
          title: Label [en-us]
          maxLength: 100
          type: string
          nullable: true
        label_en_uk:
          title: Label [en-uk]
          maxLength: 100
          type: string
          nullable: true
        label_fr:
          title: Label [fr]
          maxLength: 100
          type: string
          nullable: true
        label_nl:
          title: Label [nl]
          maxLength: 100
          type: string
          nullable: true
        label_ind:
          title: Label [ind]
          maxLength: 100
          type: string
          nullable: true
        type:
          title: Field Type
          type: string
          enum:
            - TEXT
            - INTEGER
            - FLOAT
            - RADIO
            - MULTI_SELECT
            - EMAIL
            - PHONE
            - DATE
            - BOOLEAN
            - DROPDOWN
        key:
          title: Key
          maxLength: 100
          type: string
          nullable: true
        required:
          title: Required
          type: boolean
        default_value:
          title: Default Value
          maxLength: 100
          type: string
          nullable: true
        options:
          title: Options
          type: string
          nullable: true
        creator:
          type: string
        updater:
          type: string
    FormFieldConfig:
      required:
        - key
        - label
      type: object
      properties:
        id:
          type: string
        updated_on:
          title: Updated On
          type: string
          format: date-time
          readOnly: true
        created_on:
          title: Updated On
          type: string
          format: date-time
          readOnly: true
        label:
          title: Label
          maxLength: 100
          minLength: 1
          type: string
        key:
          title: Key
          maxLength: 100
          minLength: 1
          type: string
        visibility:
          title: Visibility
          type: boolean
        required:
          title: Required
          type: boolean
        creator:
          type: string
        updater:
          type: string
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````