<content> element for tokenization filters, and inside a <replace> element for token replacement filters.
Writing Filters in the Portal
You do not have to write content filters by hand. The PCI Booking portal includes a dedicated filter editor: go to PCI Shield Settings > PCI Shield Profile Settings and click the edit (pencil) icon on a profile’s Tokenization or Retrieve cards column. The editor gives you:- Sample templates - a dropdown loads a ready-made base filter for each combination of message format (XML or JSON) and direction (tokenization or token replacement). Pick the closest template and adjust the selectors to your message structure.
- Intellisense - as you type
<, a space, or=(or press Ctrl+Space), the editor suggests the valid elements, attributes, and attribute values at that position: the<transform>root,<content>/<replace>children, every card field element,formatvalues, and the full card type name list for type mapping. - Validation - clicking Apply XML validates the filter on the server before saving. Any structural errors are listed in the editor so you can fix them immediately.
Supported Message Formats
Content filters support four message formats. Set thetype attribute on the <transform> element to match your message format.
PCI Booking detects whether body content is XML, JSON, or form-encoded based on the content type header.
Content Filter Structure
A content filter is an XML document whose root element is<transform> in the http://www.pcibooking.net/pciShieldProfiles namespace:
<content> element’s selector attribute points to the parent element containing card fields. Each child element then uses a relative selector to locate its specific field within that parent. For token replacement filters, use a <replace> element instead of <content> - the structure inside is the same.
Format Examples
- XML Body
- JSON Body
- Form-Encoded
- Query String
For XML messages, use XPath expressions. Use Token replacement filter (injecting card data) - note the
local-name() to match elements regardless of XML namespace prefix.Tokenization filter (extracting card data):<replace> element:Card Data Fields
Each<content> element can map the following card fields:
nameOnCard is stored up to 32 characters. If the source field can be longer, use substring="0,32" to truncate it - otherwise tokenization fails validation (see Card Validation Errors).Format Attributes
Theformat attribute controls how date fields are read and written:
expYear:YYYY(default, four digits) orYY(two digits)expMonth:MM(two digits with leading zero) orM(default, no leading zero)
Substring Extraction
When a third party combines multiple values into a single field, use substring extraction to isolate the part you need.substring- extracts a portion of the value when reading from the message (tokenization). Format:"startPosition"or"startPosition,length"(zero-based).dataSubstring- extracts a portion of the replacement data when writing to the message (token replacement). Same format assubstring.
0125 (MMYY) in a single field:
Renaming a Field
Whenever PCI Booking writes a value into the message, the field keeps its original name by default. If the system receiving the message expects that value under a different name, add therename attribute to that field:
<PaymentCard CardCode="MC" CardNumber="5454545454545454" ExpireDate="1228" /> is returned as <PaymentCard CardCode="MC" ExpireDate="1228" Mask="545454******5454" />.
Renaming changes only the message PCI Booking produces. Your original message is unchanged, and the way the field is found is unchanged, so selector still refers to the field name as it arrives.
rename works in both directions and in every supported message format, but the fields it can affect differ, because a field is only renamed where a value is written:
The renamed field keeps its value, but not necessarily its position: a renamed XML attribute moves to the end of the attribute list, and a renamed JSON property moves to the end of its object. Test this if the receiving system is sensitive to field order.
A rename is skipped, and the field keeps its original name, when:
- a field with the new name already exists alongside it, or
- the new name is not valid for the message format. XML names must begin with a letter or an underscore, may contain only letters, digits, hyphens, underscores and periods, and may not begin with “xml”. JSON property names and query string parameter names must not be empty.
Card Type Mapping
When a third party uses different card type codes than PCI Booking, add mapping entries as child elements of the<type> field. Each entry’s element name is PCI Booking’s card type name, and its content is the third party’s code.
3D Secure Fields
Content filters can also map 3DS authentication data alongside card fields. Add these inside a<threeDs> wrapper element, which sits as a sibling of the card field elements inside <content>:
Example with 3DS fields:
Multiple Cards in One Message
If a message contains multiple cards (e.g., a batch of reservations), add areservationSelector attribute to the <content> element. This XPath expression identifies each repeating card block, and PCI Booking processes each one independently.
reservationSelector and applies the card field selectors within each.
When reservationSelector is present, the card selector is evaluated relative to each matching element rather than against the whole message. A selector that works without reservationSelector may find nothing once it is added, so write it relative to the reservation.
customValue
ThecustomValue attribute selects an additional value from each reservation, such as the property or hotel identifier, and is also evaluated relative to the reservation:
Both
reservationSelector and customValue are optional for standard tokenization, but they are mandatory where custom tokenization is in use, including for a message that carries a single reservation.Next Steps
Target Profiles
Create and manage profiles that use content filters
Supported Card Types
Full list of card type values for card type mapping
Tokenization on Response
Tokenize card data from third-party responses
Token Replacement in Request
Replace tokens with real card data in outbound requests

