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

# Create and submit RFQ

> Create a new RFQ in Submitted status with strict validation.
    
    **Required fields:**
    - client_id: Client requesting the quote
    - pic_id: Person in charge (staff member)
    - requested_by_id: Contact who requested this RFQ
    - requested_response_date: When client needs response
    - planned_response_date: When you plan to respond
    - note: RFQ description/notes
    - line_items: At least 1 line item required
    
    **Optional fields:**
    - ref_id: Client reference number
    - attachment_link: URL to supporting documents
    
    **Use this when:**
    - RFQ is complete and ready for processing
    - All required information is available
    - Client has been notified
    
    **Line Item Status:**
    - All line items automatically set to "Submitted"
    
    **Example:**
    ```json
    {
        "client_id": "client-uuid",
        "pic_id": "user-uuid",
        "requested_by_id": "contact-uuid",
        "requested_response_date": "2024-03-15",
        "planned_response_date": "2024-03-10",
        "note": "Urgent spring collection request",
        "line_items": [
            {
                "master_style_id": "style-uuid",
                "pic_id": "user-uuid",
                "moq": 100
            }
        ]
    }



## OpenAPI

````yaml /api/openapi-cutmake.json post /rfqs/submit
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /rfqs/submit:
    post:
      tags:
        - RFQs
      summary: Create and submit RFQ
      description: |-
        Create a new RFQ in Submitted status with strict validation.
            
            **Required fields:**
            - client_id: Client requesting the quote
            - pic_id: Person in charge (staff member)
            - requested_by_id: Contact who requested this RFQ
            - requested_response_date: When client needs response
            - planned_response_date: When you plan to respond
            - note: RFQ description/notes
            - line_items: At least 1 line item required
            
            **Optional fields:**
            - ref_id: Client reference number
            - attachment_link: URL to supporting documents
            
            **Use this when:**
            - RFQ is complete and ready for processing
            - All required information is available
            - Client has been notified
            
            **Line Item Status:**
            - All line items automatically set to "Submitted"
            
            **Example:**
            ```json
            {
                "client_id": "client-uuid",
                "pic_id": "user-uuid",
                "requested_by_id": "contact-uuid",
                "requested_response_date": "2024-03-15",
                "planned_response_date": "2024-03-10",
                "note": "Urgent spring collection request",
                "line_items": [
                    {
                        "master_style_id": "style-uuid",
                        "pic_id": "user-uuid",
                        "moq": 100
                    }
                ]
            }
      operationId: create_submitted_rfq_rfqs_submit_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RFQCreateSubmitted'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RFQCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    RFQCreateSubmitted:
      properties:
        client_id:
          type: string
          title: Client Id
          description: Client ID (required)
        pic_id:
          type: string
          title: Pic Id
          description: Person in charge (required)
        requested_by_id:
          type: string
          title: Requested By Id
          description: Contact who requested the RFQ (required)
        requested_response_date:
          type: string
          format: date
          title: Requested Response Date
          description: Response date required for submission
        planned_response_date:
          type: string
          format: date
          title: Planned Response Date
          description: Planned date required for submission
        note:
          type: string
          title: Note
          description: RFQ notes/description (required)
        ref_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Ref Id
        attachment_link:
          anyOf:
            - type: string
            - type: 'null'
          title: Attachment Link
        line_items:
          items:
            $ref: '#/components/schemas/RFQLineItemCreate'
          type: array
          minItems: 1
          title: Line Items
          description: At least one line item required for submission
      type: object
      required:
        - client_id
        - pic_id
        - requested_by_id
        - requested_response_date
        - planned_response_date
        - note
        - line_items
      title: RFQCreateSubmitted
      description: Schema for creating a submitted RFQ (strict validation)
      example:
        client_id: client-uuid-123
        line_items:
          - master_style_id: style-uuid-001
            moq: 100
            note: Red variant needed
            pic_id: user-uuid-456
          - master_style_id: style-uuid-002
            moq: 200
            note: Blue variant needed
            pic_id: user-uuid-789
        note: Urgent request for spring collection
        pic_id: user-uuid-456
        planned_response_date: '2024-02-10'
        ref_id: CLIENT-REF-001
        requested_by_id: contact-uuid-789
        requested_response_date: '2024-02-15'
    RFQCreateResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        document_id:
          type: string
          title: Document Id
        rfq_id:
          type: string
          title: Rfq Id
        status:
          type: string
          title: Status
      type: object
      required:
        - success
        - message
        - document_id
        - rfq_id
        - status
      title: RFQCreateResponse
      description: Response schema for RFQ creation
      example:
        document_id: vin_RFQ_0001
        message: RFQ created successfully
        rfq_id: uuid-123-456
        status: ' '
        success: true
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RFQLineItemCreate:
      properties:
        master_style_id:
          type: string
          title: Master Style Id
          description: Master Style ID (required)
        pic_id:
          type: string
          title: Pic Id
          description: Person in charge for this line item
        moq:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Moq
          description: Minimum Order Quantity
        sku_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku Id
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
      type: object
      required:
        - master_style_id
        - pic_id
      title: RFQLineItemCreate
      description: Schema for creating a line item within an RFQ
      example:
        master_style_id: style-uuid-123
        moq: 100
        note: Need quote for red and blue variants
        pic_id: user-uuid-456
        sku_id: sku-uuid-789
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````