E-Documents Tax Classification Filter Hooks

This page documents the filters that let you customize the tax and identifier code lists used when generating e-documents that follow EN16931, including UBL and Peppol BIS compliant outputs. These filters allow you to add codes or override the display labels that appear in your documents.

All filters return associative arrays with code => translated label. Returned values are merged with the built-in defaults as $extra + $defaults, which means your codes take precedence when you reuse an existing key, and defaults remain available for any key you do not include.

Text domain for translations is woocommerce-pdf-invoices-packing-slips.

Quick reference #

Filter namePurposeExpected format
wpo_ips_edi_en16931_vat_catVAT category set, VAT CAT column['VAT' => __( 'Value added tax (VAT)', 'text-domain' )]
wpo_ips_edi_en16931_5305Duty, tax, fee categories, UNCL 5305['S' => __( 'Standard rate', 'text-domain' )]
wpo_ips_edi_en16931_vatexVAT exemption reason codes, VATEX column['VATEX-EU-143' => __( 'Exempt based on article 143…', 'text-domain' )]
wpo_ips_edi_en16931_vatex_remarksRemarks for VATEX, per scheme or code['scheme' => [], 'category' => [], 'reason' => ['VATEX-EU-IC' => __( 'Only use with…', 'text-domain' )]]
wpo_ips_edi_en16931_easElectronic address scheme, EAS column['0088' => __( 'EAN Location Code', 'text-domain' )]
wpo_ips_edi_en16931_icdIdentifier scheme code, ICD column['0199' => __( 'Legal Entity Identifier (LEI)', 'text-domain' )]
wpo_ips_edi_en16931_paymentPayment means code list['58' => __( 'SEPA credit transfer', 'text-domain' )]

Merge behavior #

The plugin merges your array into the defaults with $extra + $defaults.

  1. If you reuse an existing key, your label overrides the default label.
  2. If you add a new key, it becomes available in the UI and in the generated XML where applicable.

Removal of built-in keys is not supported through these filters since the array union keeps default keys that are not present in your return value.

VAT category, VAT CAT #

Filter
wpo_ips_edi_en16931_vat_cat

Purpose
Extend or rename VAT categories used in the VAT CAT column.

Signature
Return array<string, string>

Example

add_filter( 'wpo_ips_edi_en16931_vat_cat', function( $extra ) {
	$extra['VAT'] = __( 'Value Added Tax', 'woocommerce-pdf-invoices-packing-slips' ); // relabel
	return $extra;
} );

Duty, tax, fee categories, UNCL 5305 #

Filter
wpo_ips_edi_en16931_5305

Purpose
Control tax category codes like Standard rate, Exempt, Reverse charge.

Signature
Return array<string, string>

Example

add_filter( 'wpo_ips_edi_en16931_5305', function( $extra ) {
	$extra['S']  = __( 'Standard VAT rate', 'woocommerce-pdf-invoices-packing-slips' );
	$extra['AE'] = __( 'Reverse charge, VAT', 'woocommerce-pdf-invoices-packing-slips' );
	return $extra;
} );

VAT exemption reasons, VATEX #

Filter
wpo_ips_edi_en16931_vatex

Purpose
Provide the VATEX reason codes and labels, including EU and country specific reasons.

Signature
Return array<string, string>

Example

add_filter( 'wpo_ips_edi_en16931_vatex', function( $extra ) {
	$extra['VATEX-EU-IC'] = __( 'Intra-community supply', 'woocommerce-pdf-invoices-packing-slips' );
	return $extra;
} );

VATEX remarks #

Filter
wpo_ips_edi_en16931_vatex_remarks

Purpose
Add optional remarks that the generator can place near VATEX reasons, for example scope limitations or category constraints.

Structure
Return an array with three optional keys

  • scheme for scheme-level remarks
  • category for tax category code level remarks
  • reason for VATEX reason code level remarks

Each key maps to an associative array of code => remark.

Example

add_filter( 'wpo_ips_edi_en16931_vatex_remarks', function( $extra ) {

	$reason_common = __( 'Only use with tax category code %s', 'woocommerce-pdf-invoices-packing-slips' );

	$extra = wp_parse_args( $extra, [
		'scheme'   => [],
		'category' => [],
		'reason'   => [],
	] );

	$extra['reason']['VATEX-EU-IC'] = sprintf( $reason_common, '<code>K</code>' );

	return $extra;
} );

Electronic address scheme, EAS #

Filter
wpo_ips_edi_en16931_eas

Purpose
Control the list of participant identifier schemes such as EAN, Leitweg ID, PEPPOL participant identifier.

Important
Do not include the scheme prefix in the participant ID fields of your settings or data. The scheme is selected independently, the ID should be the bare value.

Signature
Return array<string, string>

Example

add_filter( 'wpo_ips_edi_en16931_eas', function( $extra ) {
	$extra['0088'] = __( 'EAN Location Code', 'woocommerce-pdf-invoices-packing-slips' );
	$extra['0204'] = __( 'Leitweg-ID', 'woocommerce-pdf-invoices-packing-slips' );
	return $extra;
} );

Identifier scheme code, ICD #

Filter
wpo_ips_edi_en16931_icd

Purpose
Control party identifier scheme codes per ISO 6523.

Signature
Return array<string, string>

Example

add_filter( 'wpo_ips_edi_en16931_icd', function( $extra ) {
	$extra['0199'] = __( 'Legal Entity Identifier (LEI)', 'woocommerce-pdf-invoices-packing-slips' );
	$extra['0211'] = __( 'Italian VAT number, Partita IVA', 'woocommerce-pdf-invoices-packing-slips' );
	return $extra;
} );

Payment means codes #

Filter
wpo_ips_edi_en16931_payment

Purpose
Control the Payment Means list used by the document generator, including SEPA codes and common instruments.

Signature
Return array<string, string>

Example

add_filter( 'wpo_ips_edi_en16931_payment', function( $extra ) {
	$extra['58'] = __( 'SEPA credit transfer', 'woocommerce-pdf-invoices-packing-slips' );
	$extra['59'] = __( 'SEPA direct debit', 'woocommerce-pdf-invoices-packing-slips' );
	return $extra;
} );