---
agentTools:
  projectIndex: https://financial-cloud.readme.io/llms.txt
---

# Find FCCID by reference

Looks up a customer by exact customer reference value and returns the matching FCCID if it exists.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/reference": {
      "get": {
        "operationId": "SearchController_findByReference",
        "summary": "Find FCCID by reference",
        "description": "Looks up a customer by exact customer reference value and returns the matching FCCID if it exists.",
        "parameters": [
          {
            "name": "reference",
            "required": true,
            "in": "query",
            "description": "Exact numeric customer reference to search by",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "example": 123456
            }
          }
        ],
        "responses": {
          "200": {
            "description": "FCCID matching the provided customer reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResultsDTO"
                }
              }
            }
          },
          "400": {
            "description": "`reference` query is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDTO"
                },
                "example": {
                  "statusCode": 400,
                  "message": "`reference` query is required",
                  "error": "Bad Request"
                }
              }
            }
          },
          "403": {
            "description": "User lacks the required `search` role",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDTO"
                },
                "example": {
                  "statusCode": 403,
                  "message": "lacked required roles",
                  "error": "Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "Search did not match any customers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDTO"
                },
                "example": {
                  "statusCode": 404,
                  "message": "Search did not match any customers",
                  "error": "Not Found"
                }
              }
            }
          }
        },
        "tags": [
          "Search Customer"
        ]
      }
    }
  },
  "info": {
    "title": "Search API",
    "description": "API for finding customer and account identifiers from CRM search fields.",
    "version": "0.0.14",
    "contact": {}
  },
  "servers": [
    {
      "url": "http://localhost:{port}",
      "description": "Local API endpoint",
      "variables": {
        "port": {
          "default": "8080",
          "description": "Local port"
        }
      }
    },
    {
      "url": "https://api.{systemName}.financial-cloud.co.uk/search",
      "description": "Deployed API endpoint",
      "variables": {
        "systemName": {
          "default": "your-system-name",
          "description": "Replace with your assigned system name"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "access-token": {
        "type": "apiKey",
        "in": "header",
        "name": "x-access-token",
        "description": "Access token header."
      }
    },
    "schemas": {
      "ErrorResponseDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code.",
            "example": 400
          },
          "message": {
            "type": "string",
            "description": "Error message returned to the caller.",
            "example": "reference query is required"
          },
          "error": {
            "type": "string",
            "description": "HTTP error label.",
            "example": "Bad Request"
          }
        },
        "required": [
          "statusCode",
          "message",
          "error"
        ]
      },
      "SearchResultsDTO": {
        "type": "object",
        "properties": {
          "FCCIDs": {
            "description": "Customer FCCID values matching the search criteria.",
            "example": [
              "123e4567-a890-1234-aefa-a8c9101fc2d3",
              "098e7654-a321-0987-aefa-a8c9101fc2d3"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "FCCIDs"
        ]
      }
    }
  },
  "security": [
    {
      "access-token": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 237,
      "2": 23,
      "3": 111,
      "4": 121,
      "5": 110,
      "6": 195,
      "7": 0,
      "8": 17,
      "9": 187,
      "10": 12,
      "11": 67
    }
  }
}
```