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.
| Field | Value |
|---|---|
number | The card number, digits only |
exp_month | The expiration month, two digits, such as 07 |
exp_year | The expiration year, four digits, such as 2030 |
name | The cardholder's name |
cvc | The card's security code. It's sent once. See The CVV. |
bin | The first six digits |
last4 | The last four digits |
network_token.number | The card's network token |
network_token.exp_month | The network token's expiration month |
network_token.exp_year | The network token's expiration year |
network_token.cryptogram | A cryptogram made for this request |
network_token.eci | The 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.
| Filter | What it does | Example |
|---|---|---|
yy | Keeps the last two digits | 2030 becomes 30 |
digits | Strips non-digit characters | 4242-4242 becomes 42424242 |
upper | Converts the value to uppercase | Ada 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 (*/xmland*+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.