Skip to Content
Docs

Placeholders

The placeholder language of Vault forwarding. The card and credential fields a request can name, the filters, and where placeholders go.

A placeholder marks where Pay.com fills in a value when it forwards a request. It names a card or a credential, then a field, and optionally a filter:

{{ tok_card_296645958265997326.number }}
{{ tok_card_296645958265997326.exp_year | yy }}
{{ fcred_01JDQ5H7K9M1N3P5Q7R9S1T3V5.api_key }}

Spaces inside the braces are optional. The ID is a tok_card_ token, a pm_card_ payment method, or an fcred_ credential. A request can name up to 10 different pm_card_ IDs.

Card fields

A card placeholder names one of these fields.

FieldValue
numberThe card number, digits only
exp_monthThe expiration month, two digits, such as 07
exp_yearThe expiration year, four digits, such as 2030
nameThe cardholder's name
cvcThe card's security code. It's sent once. See The CVV.
binThe first six digits
last4The last four digits
network_token.numberThe card's network token
network_token.exp_monthThe network token's expiration month
network_token.exp_yearThe network token's expiration year
network_token.cryptogramA cryptogram made for this request
network_token.eciThe electronic commerce indicator (ECI) that comes with the cryptogram

A destination's allowed_fields lists card fields by these names. A field starting network_token. needs a card with a network token, and is otherwise refused with token_not_supported.

Credential fields

A credential's fields are the names you stored it with, such as api_key.

Filters

A filter after | changes the value before it's sent.

FilterWhat it doesExample
yyKeeps the last two digits2030 becomes 30
digitsStrips non-digit characters4242-4242 becomes 42424242
upperConverts the value to uppercaseAda Lovelace becomes ADA LOVELACE

Where placeholders go

Placeholders are allowed in header values and request bodies under these rules:

  • Placeholders are allowed only in header values and request bodies, never in header names, JSON keys, or the URL. A placeholder in the URL returns 400 (invalid_request).
  • In a JSON body, place placeholders inside string values. The substituted value is always a string (for example, "{{ tok_card_….exp_month }}" sends "07").
  • In a string body, place placeholders anywhere. Each value is escaped according to the request's Content-Type: JSON, XML (*/xml and *+xml), or form data (application/x-www-form-urlencoded). String bodies with placeholders and any other content type are rejected.
  • Every {{ in a header value or request body must begin a valid placeholder.
  • Every referenced card field must be listed in the destination's allowed_fields, and every credential must be stored for the destination.

A request containing a raw card number outside a placeholder in the URL, headers, or body is rejected with card_data_not_tokenized, and nothing is sent.

Was this page helpful?