Skip to main content
Placeholders are the quickest way to use Token Replacement in Request. You build the message exactly as the third party expects it, and wherever a card value belongs you write a placeholder. PCI Booking replaces each placeholder with the card data from the token before it forwards the message. Not sure whether placeholders or a target profile suit your integration better? See Choosing a Replacement Mode.

How Placeholders Work

  • Write each placeholder as $~Name~$, for example $~Number~$. Names are not case-sensitive.
  • Do not send profileName. If you do, PCI Booking uses the profile and ignores the placeholders.
  • PCI Booking finds placeholders by searching the text of the message. The message does not need to be valid JSON or XML, and placeholders can sit at any depth in a nested structure.
  • Each value is inserted exactly as it is stored. PCI Booking does not add quotes, remove characters or escape anything.
  • If the token has no value for a field, for example no 3D Secure data, the placeholder is replaced with an empty string.

Available Placeholders

The 3D Secure placeholders are filled only when 3D Secure data is stored for the token. See 3DS Auth Management.

Where Placeholders Can Go

In the body. This is the usual case. The body can be in any text format: JSON, XML, SOAP, form data or plain text. A Content-Type header is required. Inside one parameter. Some third parties expect the card data inside a single parameter, for example an XML document posted in a form field. Pass that parameter’s name in contentParam. PCI Booking first looks for the parameter in the query string of targetUri, then in the form body, and replaces placeholders only inside that parameter’s value.

Placeholders in JSON

Because values are inserted as they are, you decide in your message whether each value is a JSON string or a JSON number:
  • For a string, put the placeholder inside quotes: "number": "$~Number~$".
  • For a number, leave the placeholder without quotes and use a format without a leading zero: "expiryMonth": $~ExpirationM~$ and "expiryYear": $~ExpirationYYYY~$.
  • Do not use $~ExpirationMM~$ without quotes. A value such as 07 is not a valid JSON number.
PCI Booking does not escape inserted values. If the name on the card contains a double quote (") or a backslash (\), the resulting JSON is invalid and the third party rejects it. If your cards can contain these characters, use a target profile, which inserts correctly escaped values.
The same applies to XML: a name that contains & or < produces invalid XML unless you use a target profile.

Example: a GraphQL API

GraphQL APIs take a JSON body with a query and a variables object. Put the placeholders inside variables. Headers the third party needs, such as its own Authorization and a User-Agent, are sent as normal and forwarded unchanged.
The third party receives the same request with the card values in variables.card, sent to https://api.example-crs.com/graphql with the same headers. The Authorization header here is the third party’s own. You authenticate to PCI Booking with the accessToken query parameter.