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

# Validations

> Validating card files.

<Info>
  Beyond the standard required and optional field checks and data type validations, Lead performs additional validations.
</Info>

## Enforced Today

| **Validation**                                  | **Description**                                                                                            |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| Missing closure details                         | `closed_at` and `closed_reason` must be provided for closed accounts                                       |
| Invalid Expiration                              | `expiry_date` may not be before `activated_at` or `created_at`                                             |
| Invalid Account Reference                       | `account_id` must match an account within our system that was previously submitted via Accounts Daily file |
| Invalid Entity Reference                        | `entity_id` must match a `client_customer_id` or `entity_id` within our system                             |
| Disallowed Entity Reference                     | `entity_id` must match an `account_holder` or `authorized_user` on the linked account.                     |
| Invalid Card Reference                          | `replaced_by` must match a `client_card_id` within our system (or within the same file)                    |
| Nonterminating Update to Card on Closed Account | Updates to existing cards must include a “closed” or “expired” card status if the account is closed.       |

## Future Enforcements

<Warning>
  Lead expects partners to comply with the below validations; however we do not currently enforce them upon daily processing. We will provide you with 60 days notice before enforcing the following validations.
</Warning>

| **Validation**                                 | **Description**                                                                                                                                |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| Invalid Namespace                              | client\_card\_id may not start with the characters `card_`                                                                                     |
| Card with ReplacedBy must be in terminal state | If a card has been replaced, it must not still be active.                                                                                      |
| Updates not allowed on Immutable Fields        | `account_id`, `entity_id`, `is_virtual`, `card_type`, `created_at`, `activated_at`, `expiry_date`, `closed_at`, `closed_reason`, `replaced_by` |
| Card Creation on Closed Account Not Permitted  | New cards may not be created when the linked `account_id` has a status of `closed`                                                             |
