> ## 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.

# Close a case from the merchant review stage



## OpenAPI

````yaml https://api.prets.io/v1/openapi.json post /v1/cases/{caseId}/close
openapi: 3.1.0
info:
  title: Prets API
  version: 1.0.0
servers:
  - url: https://api.prets.app
security:
  - bearerAuth: []
paths:
  /v1/cases/{caseId}/close:
    post:
      summary: Close a case from the merchant review stage
      parameters:
        - schema:
            type: string
            pattern: ^cas_[0-9A-HJKMNP-TV-Z]{26}$
            description: Platform case id (`cas_{ULID}`)
            example: cas_01ARZ3NDEKTSV4RRFFQ69G5AV
          required: true
          description: Platform case id (`cas_{ULID}`)
          name: caseId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostCaseCloseRequest'
      responses:
        '200':
          description: Case closed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostCaseCloseResponse'
        '400':
          description: Bad request — invalid path parameters
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden
        '404':
          description: Case not found
        '409':
          description: Case cannot be closed from its current status
        '422':
          description: Validation error — invalid JSON body
        '500':
          description: Internal server error
components:
  schemas:
    PostCaseCloseRequest:
      type: object
      properties:
        message:
          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: Optional closing note posted alongside the close
      additionalProperties: false
      description: Optional closing note posted with the close
    PostCaseCloseResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Case'
      required:
        - data
      description: Case after it was closed
    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.
    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

````