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

# Clear Bankruptcies

## Clear Bankruptcies

Use Clear Bankruptcies to identify bankruptcy flags associated with the primary owner in the configured CLEAR Risk Inform Person result.

The Workflow Builder block is **Clear Bankruptcies** (`clear_bankruptcies`), applies to an individual entity, and runs `clear_risk_inform_person_search`. The service returns the complete account-configured Risk Inform result; the dashboard then selects the bankruptcy flag group at `RiskInformPersonSearchResult.PersonEntity.Sections.Section[].SectionDetails.OtherFlags.Bankruptcy`.

## Requirements

| Application field | Requirement | Notes |
| - | - | - |
| Primary owner's first name | Required | Used by the prerequisite ID Confirm Person search. |
| Primary owner's last name | Required | Used by the prerequisite ID Confirm Person search. |
| Primary owner's city | Required | Used for address matching. |
| Primary owner's state | Required | Use a valid U.S. state code. |
| Primary owner's street and ZIP code | Optional | These fields can improve matching. ZIP code must be valid for the address country when provided. |
| Primary owner's date of birth | Optional | This field can improve matching. |
| Primary owner's SSN or ITIN and phone | Optional | These values can improve matching and must pass validation when provided. |
| ID Confirm Person result | Conditional | A successful prerequisite match is required. Lendflow runs ID Confirm Person first when no usable result is stored. |

## API flow

1. Call [Enrich Business Credit Application](/api-reference/workflow-management/enrich-business-credit-application) with the application ID in the URL.
2. Set `provider` to `clear_risk_inform_person_search`. Optionally include an underwriting `stage_id` UUID.
3. Do not include `options`; this service has no provider-specific request options.
4. Confirm `data.onqueue: true`, which means the job was queued rather than completed.
5. Poll [Get Commercial Data](/api-reference/workflow-management/get-commercial-data) with `services[]=clear_risk_inform_person_search`.

```json theme={"system"}
{
  "provider": "clear_risk_inform_person_search",
  "stage_id": "00000000-0000-4000-8000-000000000000"
}
```

| Operation | Method and route | Result |
| - | - | - |
| Queue the service | `PUT /api/applications/{application_id}/enrich` | Returns queue acceptance. |
| Retrieve status and data | `GET /api/applications/{application_id}/commercial_data?services[]=clear_risk_inform_person_search` | Returns lifecycle status, stored request, and provider response. |

## Data Orchestration availability

The **Clear Bankruptcies** block is available in Workflow Builder. The current Data Orchestration attribute catalog does not expose a bankruptcy-specific person-search outcome attribute, so do not substitute the business bankruptcy attributes for this individual block. Evaluate the stored response or another approved outcome attribute.

A stored result can satisfy the service prerequisite. If the required CLEAR entity identifier is missing, Lendflow runs the matching ID Confirm service before Risk Inform. The Risk Inform definition name and included sections are account configuration, so a block can finish successfully without the specific result area being present.

## What the service returns

| Result area | Response path | Meaning |
| - | - | - |
| Lifecycle | `data.statuses.clear.clear_risk_inform_person_search` | Latest Lendflow execution state or error message. |
| Provider status | `data.commercial_data.clear.clear_risk_inform_person_search.Status` | CLEAR's request-level status. |
| Risk Inform entity | `data.commercial_data.clear.clear_risk_inform_person_search.RiskInformPersonSearchResult` | Matched entity, section summaries, section details, and total configured score. |
| Relevant result | `data.commercial_data.clear.clear_risk_inform_person_search.RiskInformPersonSearchResult.PersonEntity.Sections.Section[].SectionDetails.OtherFlags.Bankruptcy` | The result area used for this block's job. |
| Submitted request | `data.request_data.clear.clear_risk_inform_person_search` | Stored provider request, including configured definition and permissible-purpose fields. Restrict access and logging. |

## Representative response

This sanitized response is abbreviated and contains no subject identifiers.

```json theme={"system"}
{
  "Status": {"StatusCode": "200", "SubStatusCode": "200"},
  "RiskInformPersonSearchResult": {
    "PersonEntity": {
      "Sections": {"Section": [{
        "SectionName": "Custom",
        "SectionDetails": {"OtherFlags": {"Bankruptcy": {
          "BankruptcyPersonal": {"RiskFlagName": "Bankruptcy - Personal", "RiskFlagScore": "0.00", "RiskFlagHitIndicator": "No"}
        }}}
      }]},
      "TotalScore": "12.00"
    }
  }
}
```

## Response field meanings

| Field | Type | Meaning | Possible values or units | When returned |
| - | - | - | - | - |
| `Status.StatusCode` | String | Primary CLEAR status. | Provider-defined numeric string; successful fixtures use `"200"`. | When CLEAR returns a status body. |
| `RiskInformPersonSearchResult.PersonEntity` | Object | Matched person and configured risk assessment. | One entity object in current typed frontend handling. | When CLEAR returns a match. |
| `Header.*.@attributes.sectioncount` | String | Count for a configured section. | Integer encoded as a string. | For returned section summaries. |
| `Header.*.@attributes.sectionscore` | String | Configured points accumulated by a section. | Signed decimal string; not a probability. | For scored section summaries. |
| `Sections.Section` | Array | Definition-dependent result sections. | Zero or more section objects. | When section content exists. |
| `SectionName` | String | CLEAR section label. | For example, `"Custom"`. | For each returned section. |
| `SectionScore` | String | Configured points for the section. | Signed decimal string. | For scored sections. |
| `RiskFlagName` | String | Human-readable provider flag. | Definition-dependent text. | For a returned flag. |
| `RiskFlagHitIndicator` | String | Whether the configured condition hit. | Commonly `"Yes"` or `"No"`. | When supplied by CLEAR. |
| `RiskFlagScore` | String | Points assigned to the flag. | Signed decimal string. | For a scored flag. |
| `RiskFlagDetails` | Object or array | Flag-specific detail such as a count or amount. | Definition-dependent. | Only when CLEAR supplies detail. |
| `DocumentIdentifierInfo` | Object or array | Source label and opaque supporting-document identifier. | `SourceName` and `DocumentGuid`. | When source records support the flag. |
| `TotalScore` | String | Total points for the configured definition. | Signed decimal string; not a percentage. | For a scored entity. |

### Missing values and variable shapes

| Shape | Interpretation |
| - | - |
| Missing key or `null` | CLEAR did not return the section, the definition did not include it, or no completed result is stored. |
| Empty array | An XML element was empty. Do not interpret it as `false` or zero risk. |
| Object or array | XML conversion can produce one object for one record and an array for repeated records. Support both shapes. |
| Numeric-looking string | Preserve scores, amounts, counts, and identifiers as strings unless your own validated parser converts them. |

## Errors and statuses

| Signal | Meaning | Action |
| - | - | - |
| `Not yet started` | No run is recorded. | Queue the service or execute the published workflow. |
| `Started` | Lendflow is processing or polling CLEAR. CLEAR can return provider status `204` while results are not ready. | Continue polling. |
| `Success` | Lendflow stored a response. It does not mean a flag hit or that a record belongs to the subject. | Inspect the provider status and result object. |
| `Authorization failed.` | CLEAR rejected the configured credentials. | Correct the organization's CLEAR configuration or contact Lendflow. |
| Validation message | Required application data or a formatted value is invalid. | Correct the application and rerun. |
| Empty result or missing section | CLEAR returned no usable match or the configured definition omitted that section. | Treat the value as unavailable, not as a negative finding. |
| Provider or service error | CLEAR or Lendflow could not complete the operation. | Follow the stored message; retry only when appropriate. |

See [Data Provider Status Messages](/api-docs/docs/error-handling-external-data-provider-status-messages) for shared status guidance.

## FAQ

<AccordionGroup>
  <Accordion title="Which provider ID should I send?">
    Send `clear_risk_inform_person_search`. The Workflow Builder block ID `clear_bankruptcies` is not an enrichment provider ID.
  </Accordion>

  <Accordion title="Does the block return only bankruptcy flag group?">
    No. CLEAR returns the complete configured Risk Inform response. The dashboard selects the relevant nested result for this block.
  </Accordion>

  <Accordion title="Do I send CLEAR credentials or permissible-purpose values?">
    No. Lendflow resolves them from service configuration. Send only your Lendflow bearer token.
  </Accordion>

  <Accordion title="Does Success mean a record was found?">
    No. `Success` means Lendflow stored the response. Confirm the expected result and its `RiskFlagHitIndicator`.
  </Accordion>

  <Accordion title="Why is the relevant section missing?">
    CLEAR sections and flags depend on the account's Risk Inform definition and available public records. Missing data is unavailable, not a negative finding.
  </Accordion>
</AccordionGroup>
