# BR-DEX-11 Third party payment amount is required

The Third party payment amount (BT-DEX-002) must be provided when the THIRD PARTY PAYMENT group (BG-DEX-09) is present.

## Problem Description

The Third party payment amount (BT-DEX-002) must be provided when the THIRD PARTY PAYMENT group (BG-DEX-09) is present.

> **ERROR**: XRechnung 3.0

## Context and Significance

This XRechnung Extension rule fires only in the Extension scenario, where the THIRD PARTY PAYMENT group (mapped to UBL cac:PrepaidPayment) is available and feeds the amount-due calculation.

## Solution

Add cbc:PaidAmount inside cac:PrepaidPayment with its currencyID. If you do not model third party payments, do not emit the BG-DEX-09 group; the standard XRechnung CIUS profile has no such group.

- validate
- convert

## Valid Examples

- cac:PrepaidPayment with cbc:PaidAmount currencyID="EUR" = 20.00

## Invalid Examples

- cac:PrepaidPayment present but cbc:PaidAmount missing

## Code Examples

### Valid XML
```
<cac:PrepaidPayment>
  <cbc:ID>subsidy</cbc:ID>
  <cbc:PaidAmount currencyID="EUR">20.00</cbc:PaidAmount>
  <cbc:InstructionID>Care fund contribution</cbc:InstructionID>
</cac:PrepaidPayment>
```

### Invalid XML
```
<cac:PrepaidPayment>
  <cbc:ID>subsidy</cbc:ID>
  <cbc:InstructionID>Care fund contribution</cbc:InstructionID>
</cac:PrepaidPayment>
```

## Affected Fields

- [BT-DEX-002 Third party payment amount](/resources/xrechnung)
- [BG-DEX-09 Third party payment](/resources/xrechnung)

## Related Rules

- [BR-DEX-09](/resources/kosit-validator-errors/br-dex-09-amount-due-with-third-party-payment)
- [BR-DEX-13](/resources/kosit-validator-errors/br-dex-13-third-party-payment-amount-two-decimals)

## Validation Tools

- [Official KoSIT Validator](https://erechnungsvalidator.service-bw.de/): Validate your XRechnung files against all BR-DE rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Automatic validation error fixes when converting.

## Related Resources

- [Official Specification](https://xeinkauf.de/xrechnung/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [Complete Error List](/resources/kosit-validator-errors): Overview of all German XRechnung validation rules.
