# /api/v1/merchant/getAutoUwResults

## Get Auto UW Results

Returns the results of automated underwriting (autoUW) verification checks that the system has run against a merchant. Each result identifies a verification type and its outcome. Optionally, results can be filtered to return only checks that failed, making it easy to identify which areas require attention before manual review.

### Endpoint

`GET /api/v1/merchant/getAutoUwResults`

### Authentication

Basic HTTP Authentication required.
Encode `username:password` in Base64 and pass in the Authorization header:

```
Authorization: Basic {base64(username:password)}
```

### When to use

Use this endpoint after a merchant has been submitted to TSYS and the system has performed its automated pre-screening. The autoUW checks run automatically and cover areas such as MATCH list verification, OFAC screening, GIACT bank validation, Google search, WHOIS, and Clear background checks. Call this endpoint to review automated findings before escalating to a human underwriter, or to display compliance check results in an ISO dashboard.

### Query Parameters

| Parameter    | Type            | Required | Description                                                                                 |
| ------------ | --------------- | -------- | ------------------------------------------------------------------------------------------- |
| id           | integer (int32) | Yes      | Merchant profile ID to retrieve autoUW results for                                          |
| failedChecks | boolean         | No       | When `true`, returns only failed checks. When `false` or omitted, returns all check results |

### Response

**200 OK**

| Field                      | Type    | Description                                                               |
| -------------------------- | ------- | ------------------------------------------------------------------------- |
| data                       | array   | List of automated verification results                                    |
| data\[].verificationType   | string  | Name of the automated check (e.g., `"AutomatedMATCH"`, `"AutomatedOfac"`) |
| data\[].verificationResult | string  | Outcome of the check (e.g., `"Pass"`, `"Fail"`, `"Review"`)               |
| requestId                  | integer | Unique identifier for this API request                                    |
| success                    | boolean | `true` if the request completed successfully                              |
| error                      | string  | Error message if the request failed                                       |
| validationErrors           | array   | Field-level validation errors                                             |

```json
{
  "data": [
    {
      "verificationType": "AutomatedMATCH",
      "verificationResult": "Pass"
    },
    {
      "verificationType": "AutomatedOfac",
      "verificationResult": "Pass"
    },
    {
      "verificationType": "AutomatedGiact",
      "verificationResult": "Fail"
    },
    {
      "verificationType": "AutomatedGoogleSearch",
      "verificationResult": "Review"
    },
    {
      "verificationType": "AutomatedWhois",
      "verificationResult": "Pass"
    },
    {
      "verificationType": "AutomatedClear",
      "verificationResult": "Pass"
    }
  ],
  "requestId": 88621,
  "success": true,
  "error": null,
  "validationErrors": []
}
```

### Error Codes

| Code | When it happens                                  |
| ---- | ------------------------------------------------ |
| 400  | `id` is missing or not a valid integer           |
| 401  | Invalid or missing Basic Auth credentials        |
| 403  | User does not have permission for this operation |
| 404  | Merchant not found                               |
| 500  | Internal server error                            |

### Common Mistakes

* Calling this endpoint before the merchant has been submitted — autoUW checks only run after submission, so results may be empty or unavailable for draft merchants.
* Misinterpreting a `"Review"` result as a failure — a `"Review"` result means the check flagged something that requires human inspection, not that the merchant is rejected.
* Forgetting the `failedChecks=true` filter when you only want to surface actionable problems in a UI.

### Related Endpoints

* `GET /api/v1/underwriting/statuses` — get the current underwriting status for all merchants
* `GET /api/v1/underwriting/status-history` — get the full underwriting status history for a merchant
* `POST /api/v1/underwriting/pending-review` — notify the UW team after corrections have been made

### Example

```bash
curl -X GET "https://hq.staging.netevia.dev/api/v1/merchant/getAutoUwResults?id=48201&failedChecks=true" \
  -H "Authorization: Basic $(echo -n 'username:password' | base64)"
```

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "v1",
    "title": "Netevia HQ | API Documentation",
    "description": "Netevia HQ | API Documentation"
  },
  "paths": {
    "/api/v1/merchant/getAutoUwResults": {
      "get": {
        "tags": [
          "Underwriting"
        ],
        "operationId": "Underwriting_GetAutoUwResults",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "failedChecks",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultArray1_AutoUwResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultArray1_AutoUwResult"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultArray1_AutoUwResult"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResultArray1_AutoUwResult"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "Basic": []
    }
  ],
  "servers": [
    {
      "url": "https://hq.staging.netevia.dev"
    }
  ],
  "components": {
    "securitySchemes": {
      "Basic": {
        "type": "http",
        "description": "Basic HTTP Authentication",
        "scheme": "basic"
      }
    },
    "schemas": {
      "ValidationError": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "ApiResultArray1_AutoUwResult": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutoUwResult"
            }
          },
          "requestId": {
            "format": "int32",
            "type": "integer"
          },
          "success": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "validationErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "AutoUwResult": {
        "type": "object",
        "properties": {
          "verificationType": {
            "type": "string"
          },
          "verificationResult": {
            "type": "string"
          }
        }
      }
    }
  }
}
```