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

# Create a case for a quote



## OpenAPI

````yaml https://api.prets.io/v1/openapi.json post /v1/quotes/{quoteId}/cases
openapi: 3.1.0
info:
  title: Prets API
  version: 1.0.0
servers:
  - url: https://api.prets.app
security:
  - bearerAuth: []
paths:
  /v1/quotes/{quoteId}/cases:
    post:
      summary: Create a case for a quote
      parameters:
        - schema:
            type: string
            pattern: ^qot_[0-9A-HJKMNP-TV-Z]{26}$
            description: Quote ID
            example: qot_01ARZ3NDEKTSV4RRFFQ69G5AV
          required: true
          description: Quote ID
          name: quoteId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCase'
      responses:
        '201':
          description: Case created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostCaseResponse'
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden
        '404':
          description: Quote not found
        '409':
          description: >-
            This quote already has an open merchant case. `Location` points at
            `GET /v1/cases/{caseId}` for the blocking Case.
        '500':
          description: Internal server error
components:
  schemas:
    CreateCase:
      oneOf:
        - $ref: '#/components/schemas/CreateGeneralCase'
        - $ref: '#/components/schemas/CreateMerchantFeedbackCase'
      discriminator:
        propertyName: type
        mapping:
          general:
            $ref: '#/components/schemas/CreateGeneralCase'
          merchant_feedback:
            $ref: '#/components/schemas/CreateMerchantFeedbackCase'
      description: >-
        Open a Case under a Quote. `type` is `general` or `merchant_feedback`;
        merchants cannot create `prets_feedback`. The opening message is
        required.
    PostCaseResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Case'
      required:
        - data
      description: Created support case
    CreateGeneralCase:
      type: object
      properties:
        type:
          type: string
          enum:
            - general
          description: General-support Case with no request type
          example: general
        caseId:
          type: string
          pattern: ^cas_[0-9A-HJKMNP-TV-Z]{26}$
          description: >-
            Client-generated id (`cas_{ULID}`). When provided the server uses
            this as the canonical case ID, enabling optimistic UI.
          example: cas_01K3P7YQ2WM8TZB5RC0VXNDHF4
        subject:
          type: string
          minLength: 1
          maxLength: 255
          description: >-
            Case subject (max 255 characters). When omitted, derived from the
            first line of the opening message.
          example: Customer wants a later install date
        message:
          $ref: '#/components/schemas/CreateCaseMessage'
      required:
        - type
        - message
      additionalProperties: false
      description: Open a general-support Case. The opening text is the first message.
    CreateMerchantFeedbackCase:
      type: object
      properties:
        type:
          type: string
          enum:
            - merchant_feedback
          description: Merchant-to-Prets feedback Case
          example: merchant_feedback
        requestType:
          $ref: '#/components/schemas/MerchantCreateRequestType'
        caseId:
          type: string
          pattern: ^cas_[0-9A-HJKMNP-TV-Z]{26}$
          description: >-
            Client-generated id (`cas_{ULID}`). When provided the server uses
            this as the canonical case ID, enabling optimistic UI.
          example: cas_01K3P7YQ2WM8TZB5RC0VXNDHF4
        subject:
          type: string
          minLength: 1
          maxLength: 255
          description: >-
            Case subject (max 255 characters). When omitted, derived from the
            first line of the opening message.
          example: Customer wants a later install date
        message:
          $ref: '#/components/schemas/CreateCaseMessage'
      required:
        - type
        - requestType
        - message
      additionalProperties: false
      description: >-
        Open a merchant-feedback Case with a merchant request type. The opening
        text is the first message.
    Case:
      anyOf:
        - $ref: '#/components/schemas/CaseOpenWaiting'
        - $ref: '#/components/schemas/CaseOpenIdle'
        - $ref: '#/components/schemas/CaseClosed'
      description: >-
        Quote support Case. Conversation lives on `/messages`; this resource is
        metadata and lifecycle only.
    CreateCaseMessage:
      type: object
      properties:
        messageId:
          type: string
          pattern: ^csmsg_[0-9A-HJKMNP-TV-Z]{26}$
          description: >-
            Client-generated id (`csmsg_{ULID}`). When provided the server uses
            it as the canonical message id, enabling optimistic UI.
          example: csmsg_01K3P7YQ35N9VZC6SD1WYPEJG2
        body:
          type: string
          minLength: 1
          maxLength: 32000
          description: >-
            Plain-text message body (max 32,000 characters, per Salesforce long
            text area)
          example: The customer asked to move the appointment to next week.
      required:
        - body
      additionalProperties: false
      description: >-
        Opening or reply message body. Optional client ULID for idempotent
        create.
    MerchantCreateRequestType:
      type: string
      enum:
        - Cancel Application
        - Reschedule Meeting
        - Contact Customer
        - Application Final
        - Other
      description: >-
        Merchant-to-Prets request type. Required when creating
        `merchant_feedback`.
      example: Reschedule Meeting
    CaseOpenWaiting:
      type: object
      properties:
        caseId:
          type: string
          pattern: ^cas_[0-9A-HJKMNP-TV-Z]{26}$
          description: Platform case id (`cas_{ULID}`)
          example: cas_01ARZ3NDEKTSV4RRFFQ69G5AV
        quote:
          $ref: '#/components/schemas/QuoteRef'
        type:
          type: string
          enum:
            - general
            - merchant_feedback
            - prets_feedback
          description: Merchant-facing case category
          example: merchant_feedback
        requestType:
          type: string
          enum:
            - Cancel Application
            - Reschedule Meeting
            - Contact Customer
            - Application Final
            - Other
            - Customer Unreachable
            - Quote Under Consideration
            - Customer No Show & Unreachable
            - Customer No Show & VM
            - Cancellation Offer Requested
            - Schedule Installation
            - General Question
            - Compliance/Risk
            - Documents Requested
          description: The specific request; present on feedback cases
          example: Reschedule Meeting
        subject:
          type: string
          description: Case subject
          example: Customer wants a later install date
        description:
          type: string
          description: >-
            Read-only mirror of the opening request. The conversation lives on
            `/messages`.
          example: The customer asked to move the appointment.
        stage:
          type: string
          description: >-
            Informational Salesforce stage string. Not a published enum — switch
            on `state` and `waitingOn`.
          example: Prets Action
        createdAt:
          type: string
          format: date-time
          description: When the case was created (ISO 8601)
          example: '2026-08-14T09:12:04.000Z'
        createdBy:
          type: string
          description: Name of the portal user who created the case
          example: Jane Advisor
        updatedAt:
          type: string
          format: date-time
          description: When the case was last modified (ISO 8601)
          example: '2026-08-16T11:03:22.000Z'
        state:
          type: string
          enum:
            - open
          description: The Case is still in play
          example: open
        waitingOn:
          type: string
          enum:
            - merchant
            - prets
          description: Party that must act next
          example: prets
        waitingSince:
          type: string
          format: date-time
          description: >-
            When `waitingOn` last changed. Present only when `waitingOn` is not
            `none`.
          example: '2026-08-14T09:12:04.000Z'
      required:
        - caseId
        - quote
        - type
        - subject
        - stage
        - createdAt
        - updatedAt
        - state
        - waitingOn
        - waitingSince
      additionalProperties: false
      description: Open Case whose next action sits with the merchant or Prets
    CaseOpenIdle:
      type: object
      properties:
        caseId:
          type: string
          pattern: ^cas_[0-9A-HJKMNP-TV-Z]{26}$
          description: Platform case id (`cas_{ULID}`)
          example: cas_01ARZ3NDEKTSV4RRFFQ69G5AV
        quote:
          $ref: '#/components/schemas/QuoteRef'
        type:
          type: string
          enum:
            - general
            - merchant_feedback
            - prets_feedback
          description: Merchant-facing case category
          example: merchant_feedback
        requestType:
          type: string
          enum:
            - Cancel Application
            - Reschedule Meeting
            - Contact Customer
            - Application Final
            - Other
            - Customer Unreachable
            - Quote Under Consideration
            - Customer No Show & Unreachable
            - Customer No Show & VM
            - Cancellation Offer Requested
            - Schedule Installation
            - General Question
            - Compliance/Risk
            - Documents Requested
          description: The specific request; present on feedback cases
          example: Reschedule Meeting
        subject:
          type: string
          description: Case subject
          example: Customer wants a later install date
        description:
          type: string
          description: >-
            Read-only mirror of the opening request. The conversation lives on
            `/messages`.
          example: The customer asked to move the appointment.
        stage:
          type: string
          description: >-
            Informational Salesforce stage string. Not a published enum — switch
            on `state` and `waitingOn`.
          example: Prets Action
        createdAt:
          type: string
          format: date-time
          description: When the case was created (ISO 8601)
          example: '2026-08-14T09:12:04.000Z'
        createdBy:
          type: string
          description: Name of the portal user who created the case
          example: Jane Advisor
        updatedAt:
          type: string
          format: date-time
          description: When the case was last modified (ISO 8601)
          example: '2026-08-16T11:03:22.000Z'
        state:
          type: string
          enum:
            - open
          description: The Case is still in play
          example: open
        waitingOn:
          type: string
          enum:
            - none
          description: No party is waiting — typical of New before the first handoff
          example: none
      required:
        - caseId
        - quote
        - type
        - subject
        - stage
        - createdAt
        - updatedAt
        - state
        - waitingOn
      additionalProperties: false
      description: Open Case that is not waiting on merchant or Prets
    CaseClosed:
      type: object
      properties:
        caseId:
          type: string
          pattern: ^cas_[0-9A-HJKMNP-TV-Z]{26}$
          description: Platform case id (`cas_{ULID}`)
          example: cas_01ARZ3NDEKTSV4RRFFQ69G5AV
        quote:
          $ref: '#/components/schemas/QuoteRef'
        type:
          type: string
          enum:
            - general
            - merchant_feedback
            - prets_feedback
          description: Merchant-facing case category
          example: merchant_feedback
        requestType:
          type: string
          enum:
            - Cancel Application
            - Reschedule Meeting
            - Contact Customer
            - Application Final
            - Other
            - Customer Unreachable
            - Quote Under Consideration
            - Customer No Show & Unreachable
            - Customer No Show & VM
            - Cancellation Offer Requested
            - Schedule Installation
            - General Question
            - Compliance/Risk
            - Documents Requested
          description: The specific request; present on feedback cases
          example: Reschedule Meeting
        subject:
          type: string
          description: Case subject
          example: Customer wants a later install date
        description:
          type: string
          description: >-
            Read-only mirror of the opening request. The conversation lives on
            `/messages`.
          example: The customer asked to move the appointment.
        stage:
          type: string
          description: >-
            Informational Salesforce stage string. Not a published enum — switch
            on `state` and `waitingOn`.
          example: Prets Action
        createdAt:
          type: string
          format: date-time
          description: When the case was created (ISO 8601)
          example: '2026-08-14T09:12:04.000Z'
        createdBy:
          type: string
          description: Name of the portal user who created the case
          example: Jane Advisor
        updatedAt:
          type: string
          format: date-time
          description: When the case was last modified (ISO 8601)
          example: '2026-08-16T11:03:22.000Z'
        state:
          type: string
          enum:
            - closed
          description: The Case has been closed
          example: closed
        waitingOn:
          type: string
          enum:
            - none
          description: Closed Cases always project `none` rather than dropping the field
          example: none
        closeReason:
          type: string
          enum:
            - resolved
            - dismissed
            - withdrawn
          description: Why the Case was closed, when one was given
          example: dismissed
        closedAt:
          type: string
          format: date-time
          description: When the Case was closed (ISO 8601)
          example: '2026-08-05T15:41:10.000Z'
      required:
        - caseId
        - quote
        - type
        - subject
        - stage
        - createdAt
        - updatedAt
        - state
        - waitingOn
      additionalProperties: false
      description: Closed Case. `waitingOn` is `none`; `waitingSince` is omitted.
    QuoteRef:
      type: object
      properties:
        quoteId:
          type: string
          pattern: ^qot_[0-9A-HJKMNP-TV-Z]{26}$
          description: Quote this resource is linked to
          example: qot_01ARZ3NDEKTSV4RRFFQ69G5AV
      required:
        - quoteId
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````