Skip to main content
POST

Tokenization on Response Guide

Automatically tokenize cards from gateway responses
PCI Booking forwards your request to the third party, tokenizes any card data found in the response (using your target profile), and returns the sanitized response with the following custom headers:
All URLs must be HTTPS and URL-encoded.

Error Responses

Parameter Constraints

Parameters

Authentication

API key header, access token or session token. Send one of the three. PCI Booking does not use the Authorization header on this endpoint. Use it for the third party’s own authorization, in the format the third party requires.
string
Your API key. See the Authentication guide.
string
Generated on your side. Single use, and valid for up to 72 hours. How to generate.
string
Returned by an API call. Valid for 5 minutes, and can be used more than once within that time. How to generate.

Query String

string
required
The unique ID for the profile set up for the response you will receive for this request. You can set up as many profiles as you require. Read more about target profiles.
string
required
The URI of the third party to relay the request to. PCI Booking sends your request to this endpoint and intercepts the response.
string
default:"POST"
The HTTP method that PCI Booking should use when calling the target URI. Possible values: POST, GET, PUT, PATCH, DELETE.
int
The number of seconds PCI Booking should wait for a response from the third party.
boolean
default:"false"
Whether to save the CVV in the database. true: save the CVV. false: discard the CVV.
string
A reference value which can be used to query for this card token.
string
The user ID of the property to associate the token with. Found under “Property settings” in the user’s site. Property Management only. Property Management is closed to new accounts; see Property Management.
string
The user ID of the PCI Booking customer (booker ID) to associate the token with. The PCI Booking customer must share their user ID with you.
boolean
default:"false"
Controls whether PCI Booking checks if the card already exists as a token in your account. A duplicate is a card with the same card number and expiration date as an existing token in your account; differences in cardholder name or CVV do not matter.
  • true: PCI Booking looks up the card in your stored tokens. If a match is found, the existing token URI is returned instead of creating a new one. The response status will be 200 instead of 201.
  • false (default): A new token is always created, even if the same card was previously stored.
string
The region where the card data is stored. One of: US, IN, AU, JP, CA, IE, GB, BR. If omitted, your account’s default region is used, or Ireland if your account has no default. See Card Storage Regions.

Request Body

The request body and headers are passed through to the third party as-is. Include any body content and headers that the third party requires, including its Authorization header.

Response

200 - The card already exists in your account (when eliminateCardDuplication is true). The response body contains the third-party response with card details masked. The existing token URI is returned in the X-pciBooking-cardUri header. 201 - A new card was tokenized. The response body contains the third-party response with card details masked. The new token URI is returned in the X-pciBooking-cardUri header. Any other status - The third party answered with a status that is not 2xx. No tokenization is done, and the third party’s status code, headers and body are returned to you unchanged. For example, a 401 from the third party reaches you as a 401 with the third party’s body. PCI Booking’s own authentication failure is a 401 with an empty body.
Remember to set the CVV Retention Policy on the token.