# Factur-X Profile Detection (BT-24) & EN 16931 Rule Scoping
> Detect the Factur-X profile from the specification identifier (BT-24) and run the profile-scoped EN 16931 business rules.

- **Canonical URL:** https://stanzaapi.com/tools/factur-x-validator/profiles/en16931-profile-detection
- **Governing Standard:** EN 16931-1 / Factur-X 1.0.x (International Standards Organization)
- **Latency:** <5ms
- **Privacy:** In-memory execution only (zero data stored or logged)

## Technical Overview & Governing Rules
The engine reads the specification identifier (BT-24) from the CII GuidelineSpecifiedDocumentContextParameter and maps it to the canonical Factur-X, ZUGFeRD, or XRechnung profile.

Unknown or missing identifiers never silently pass: the response is valid:false with the FX-PROFILE-UNKNOWN diagnostic.

Reduced profiles (MINIMUM, BASIC WL, BASIC) are checked against their profile-mandatory fields; EN 16931, EXTENDED and XRechnung run the full BR-* rules.

## Specification Matrix
| BT-24 value | Detected profile | Validation scope |
| --- | --- | --- |
| urn:factur-x.eu:1p0:minimum | MINIMUM | Profile-mandatory header fields |
| urn:factur-x.eu:1p0:basicwl | BASIC_WL | Header fields and monetary totals |
| urn:factur-x.eu:1p0:basic | BASIC | Header, totals, and invoice lines |
| urn:factur-x.eu:1p0:en16931 | EN16931 | Full EN 16931 BR-* rule set |
| urn:factur-x.eu:1p0:extended | EXTENDED | Full EN 16931 BR-* rule set |
| urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_3.0 | XRECHNUNG | Full EN 16931 BR-* rule set |
| Unknown or missing value | UNKNOWN | FX-PROFILE-UNKNOWN fatal violation |

## Standard JSON Response Model
```json
{
  "valid": true,
  "syntax": "CII",
  "profile": "EN16931",
  "profileId": "urn:factur-x.eu:1p0:en16931",
  "summary": {
    "status": "COMPLIANT",
    "fatalCount": 0,
    "warningCount": 0
  },
  "violations": []
}
```

## Frequently Asked Questions & Edge Cases
### Q: What happens when the specification identifier is unknown?
**A:** The engine never silently treats an unknown specification identifier as compliant. The response is valid:false with the FX-PROFILE-UNKNOWN fatal violation and the unrecognized guideline value.

### Q: How are business rules and VAT arithmetic checked?
**A:** EN 16931, EXTENDED and XRechnung documents run the full EN 16931 business-rule set, including line extension sum reconciliation, tax exclusive and inclusive balancing, and VAT percentage calculations per category. Reduced profiles are checked against their profile-mandatory fields instead.
