What does BR-51 mean?
An invoice must never state the full card primary account number (BT-87). The security standards for card payments allow at most the first six and the last four digits. You must mask every digit in between. That protects the buyer's card data.
Common causes of BR-51
- The point-of-sale system writes the complete card number into ram:ID.
- The number was taken from a payment receipt without masking.
- The step that replaces the middle digits with placeholders is missing.
How to fix BR-51
- Find the faulty spot in the XML. Open the XML of the invoice and go to field BT-87 along this XPath:
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:ApplicableTradeSettlementFinancialCard/ram:ID - Apply the fix. Mask the middle digits in ram:ApplicableTradeSettlementFinancialCard/ram:ID so that only the first six and the last four remain, for example 411111______1111.
- Validate again. Save the file and validate it again to check that BR-51 is no longer reported.
Mask the middle digits in ram:ApplicableTradeSettlementFinancialCard/ram:ID so that only the first six and the last four remain, for example 411111______1111.
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:ApplicableTradeSettlementFinancialCard/ram:IDBefore / after: the XML example
This is the spot in question before and after the fix (Cross Industry Invoice, ZUGFeRD/Factur-X).
<ram:ApplicableTradeSettlementFinancialCard>
<ram:ID>4111111111111111</ram:ID>
<ram:CardholderName>Max Mustermann</ram:CardholderName>
</ram:ApplicableTradeSettlementFinancialCard>
<ram:ApplicableTradeSettlementFinancialCard>
<ram:ID>411111______1111</ram:ID>
<ram:CardholderName>Max Mustermann</ram:CardholderName>
</ram:ApplicableTradeSettlementFinancialCard>
Frequent questions about BR-51
How many digits may I show?
Do I have to give the card number at all?
Related error codes
Check BR-51 automatically
Instead of digging through the XML by hand you can validate your ZUGFeRD or XRechnung file online – upload the PDF or the XML and you get every error with rule ID, affected field, fix and XPath, as a readable report or as JSON through the API.