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

# Finalize case

> Finalizes the fraud case identified by `{id}`. This action is allowed only if
every transaction in the case has `customerDecision = RISK` or `NO_RISK`.

Once finalized:
  - All transactions become immutable.
  - Case status is set to `CLOSED`.
  - An optional comment can be stored on the case
  - `resolutionStatus` is derived for the case:
      - `NO_RISK` if all transactions are `NO_RISK`
      - `RISK` if at least one transaction is `RISK`



## OpenAPI

````yaml fraud-case post /v1/{id}/finalize
openapi: 3.0.3
info:
  description: API for fraud case updates and retrieval
  version: '1'
  title: Fraud Case API
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: >-
      https://integration-api-cat2.{{environment}}.ext.{{realm}}.cia.enfuce.com/fraud-case
  - url: https://integration-api-cat2.live.ext.prod.cia.enfuce.com/fraud-case
    description: Live environment
security: []
tags:
  - name: Get Fraud Case
    description: Endpoints for fetching fraud case information
  - name: Update Fraud Case
    description: Endpoints for updating transactions on a fraud case.
paths:
  /v1/{id}/finalize:
    post:
      tags:
        - Update Fraud Case
      summary: Finalize case
      description: >-
        Finalizes the fraud case identified by `{id}`. This action is allowed
        only if

        every transaction in the case has `customerDecision = RISK` or
        `NO_RISK`.


        Once finalized:
          - All transactions become immutable.
          - Case status is set to `CLOSED`.
          - An optional comment can be stored on the case
          - `resolutionStatus` is derived for the case:
              - `NO_RISK` if all transactions are `NO_RISK`
              - `RISK` if at least one transaction is `RISK`
      operationId: finalizeCase
      parameters:
        - $ref: '#/components/parameters/AuditUserParam'
        - $ref: '#/components/parameters/FraudCaseIdParam'
      requestBody:
        $ref: '#/components/requestBodies/FinalizeCaseRequestBody'
      responses:
        '200':
          description: Case finalized successfully — returns updated case
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FraudCaseResponse'
        '401':
          $ref: '#/components/responses/FraudCaseError401'
        '403':
          $ref: '#/components/responses/FraudCaseError403'
        '404':
          $ref: '#/components/responses/FraudCaseError404'
        '409':
          $ref: '#/components/responses/FraudCaseError409'
        '422':
          $ref: '#/components/responses/FraudCaseError422'
        '500':
          $ref: '#/components/responses/FraudCaseError500'
components:
  parameters:
    AuditUserParam:
      name: auditUser
      in: query
      description: The audit user to log the request
      required: true
      schema:
        type: string
    FraudCaseIdParam:
      name: id
      in: path
      description: The unique identifier of the fraud case
      required: true
      schema:
        type: string
        format: uuid
  requestBodies:
    FinalizeCaseRequestBody:
      description: Request payload for finalizing a fraud case.
      required: false
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FinalizeCaseRequest'
  schemas:
    FraudCaseResponse:
      type: object
      required:
        - id
        - status
        - cardId
        - createdTime
        - lastUpdatedTime
        - transactions
      properties:
        id:
          $ref: '#/components/schemas/FraudCaseId'
        status:
          $ref: '#/components/schemas/FraudCaseStatus'
        cardId:
          $ref: '#/components/schemas/FraudCaseCardId'
        createdTime:
          $ref: '#/components/schemas/FraudCaseCreatedTime'
        lastUpdatedTime:
          $ref: '#/components/schemas/FraudCaseLastUpdatedTime'
        comment:
          $ref: '#/components/schemas/FraudCaseComment'
        resolutionStatus:
          $ref: '#/components/schemas/FraudCaseResolutionStatus'
        transactions:
          type: array
          description: List of transactions associated with this case
          items:
            $ref: '#/components/schemas/Transaction'
    FinalizeCaseRequest:
      type: object
      additionalProperties: false
      properties:
        comment:
          $ref: '#/components/schemas/FraudCaseComment'
    FraudCaseId:
      type: string
      format: uuid
      description: Unique identifier of the fraud case
      example: 123e4567-e89b-12d3-a456-426614174000
    FraudCaseStatus:
      type: string
      description: Current status of the fraud case
      enum:
        - OPEN
        - PENDING
        - CLOSED
      example: OPEN
    FraudCaseCardId:
      type: string
      format: biginteger
      description: Unique identifier of the card on the fraud case
      example: '54321'
    FraudCaseCreatedTime:
      type: string
      format: date-time
      description: Time when the fraud case was created
      example: '2025-07-01T10:00:00Z'
    FraudCaseLastUpdatedTime:
      type: string
      format: date-time
      description: Time when the fraud case was last updated
      example: '2025-07-02T14:30:00Z'
    FraudCaseComment:
      type: string
      description: Optional plain text comment on case (set via PATCH or finalize).
      maxLength: 512
      pattern: ^[^\p{Cntrl}<>]*$
      nullable: true
    FraudCaseResolutionStatus:
      type: string
      description: |
        Final case resolution derived when the case is CLOSED:
          - NO_RISK if all transactions are NO_RISK
          - RISK if at least one transaction is RISK
        Omitted for OPEN or PENDING cases.
      enum:
        - RISK
        - NO_RISK
    Transaction:
      type: object
      description: A transaction associated with the fraud case
      required:
        - transactionId
        - customerDecision
      properties:
        transactionId:
          $ref: '#/components/schemas/TransactionId'
        customerDecision:
          $ref: '#/components/schemas/TransactionCustomerDecision'
        customerComment:
          $ref: '#/components/schemas/TransactionCustomerComment'
        lastUpdatedTime:
          $ref: '#/components/schemas/TransactionLastUpdatedTime'
        reason:
          $ref: '#/components/schemas/TransactionReason'
        additionalAttributes:
          type: object
          description: >
            Optional key–value attributes. Omitted when empty. Keys and values
            may change without notice. Values may be primitives or objects.
          readOnly: true
          additionalProperties: true
    FraudCaseErrorResponse:
      allOf:
        - $ref: '#/components/schemas/errorResponse'
        - type: object
          properties:
            errorCode:
              type: string
              description: >-
                Possible fraud-case specific error codes:

                - FRAUD_CASE_NOT_FOUND

                - FRAUD_CASE_TRANSACTIONS_NOT_FOUND

                - FRAUD_CASE_INVALID_DATE_RANGE

                - FRAUD_CASE_ALREADY_CLOSED

                - FRAUD_CASE_FINALIZE_PENDING_TRANSACTIONS

                - FRAUD_CASE_DUPLICATE_TRANSACTION_IDS

                - FRAUD_CASE_TRANSACTION_DECISION_MISSING

                - FRAUD_CASE_TRANSACTION_ID_MISSING

                - FRAUD_CASE_INVALID_FILTER

                - FRAUD_CASE_REASON_NOT_ALLOWED_FOR_PENDING

                - FRAUD_CASE_REASON_REQUIRED_FOR_DECISION

                - FRAUD_CASE_REASON_MISMATCH_FOR_DECISION

                - FRAUD_CASE_INVALID_ENUM_VALUE

                - FRAUD_CASE_INVALID_DISCRIMINATOR

                - FRAUD_CASE_MALFORMED_REQUEST_BODY

                - FRAUD_CASE_UPDATE_ERROR

                - FRAUD_CASE_INVALID_DATA


                In addition to the fraud-case specific codes listed above, the
                API may also return generic error codes (e.g. for auth or
                validation failures).
    TransactionId:
      type: string
      description: Unique identifier of the transaction on the case
      minLength: 1
      example: '12345'
    TransactionCustomerDecision:
      type: string
      description: Customer’s decision on this transaction
      enum:
        - PENDING
        - NO_RISK
        - RISK
      example: PENDING
    TransactionCustomerComment:
      type: string
      nullable: true
      description: Optional plain text comment provided by the customer on this transaction
      maxLength: 512
      pattern: ^[^\p{Cntrl}<>]*$
      example: Looks good to me
    TransactionLastUpdatedTime:
      type: string
      format: date-time
      description: Time when this transaction was last updated
      example: '2025-07-02T15:00:00Z'
    TransactionReason:
      type: object
      additionalProperties: false
      nullable: true
      description: |
        Polymorphic reason associated with a non-PENDING decision.
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/TransactionReasonType'
      oneOf:
        - $ref: '#/components/schemas/TransactionRiskReason'
        - $ref: '#/components/schemas/TransactionNoRiskReason'
      discriminator:
        propertyName: type
        mapping:
          RISK:
            $ref: '#/components/schemas/TransactionRiskReason'
          NO_RISK:
            $ref: '#/components/schemas/TransactionNoRiskReason'
      example:
        type: RISK
        code: ISSUANCE_OF_A_PAYMENT_ORDER_BY_FRAUDSTER
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaining the error reason
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occurred
    TransactionReasonType:
      type: string
      description: Discriminator for the polymorphic reason object.
      enum:
        - RISK
        - NO_RISK
      example: RISK
    TransactionRiskReason:
      type: object
      description: Concrete `reason` object when `type = RISK`.
      additionalProperties: false
      required:
        - code
      properties:
        code:
          $ref: '#/components/schemas/TransactionRiskReasonCode'
    TransactionNoRiskReason:
      type: object
      description: Concrete `reason` object when `type = NO_RISK`.
      additionalProperties: false
      required:
        - code
      properties:
        code:
          $ref: '#/components/schemas/TransactionNoRiskReasonCode'
    TransactionRiskReasonCode:
      type: string
      description: Reason code to use when `customerDecision = RISK`.
      enum:
        - ISSUANCE_OF_A_PAYMENT_ORDER_BY_FRAUDSTER
        - LOST_OR_STOLEN_CARD
        - CARD_NOT_RECEIVED
        - COUNTERFEIT_CARD
        - CARD_DETAILS_THEFT
        - MODIFICATION_OF_A_PAYMENT_ORDER_BY_FRAUDSTER
        - MANIPULATION_OF_PAYER
        - UNAUTHORIZED_PAYMENT_TRANSACTION
        - OTHER
    TransactionNoRiskReasonCode:
      type: string
      description: Reason code to use when `customerDecision = NO_RISK`.
      enum:
        - GENUINE
  responses:
    FraudCaseError401:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FraudCaseErrorResponse'
    FraudCaseError403:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FraudCaseErrorResponse'
    FraudCaseError404:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FraudCaseErrorResponse'
    FraudCaseError409:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FraudCaseErrorResponse'
    FraudCaseError422:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FraudCaseErrorResponse'
    FraudCaseError500:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FraudCaseErrorResponse'

````