const params = new URLSearchParams({
profileName: 'MyOTAProfile',
targetURI: 'https://api.thirdparty.com/reservations/12345',
httpMethod: 'POST',
saveCVV: 'true',
ref: 'booking-12345'
});
const response = await fetch(
`https://service.pcibooking.net/api/payments/paycard/capture?${params}`,
{
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/xml'
},
body: '<ReservationRequest><ID>12345</ID></ReservationRequest>'
}
);
const tokenUri = response.headers.get('X-pciBooking-cardUri');
console.log('Token URI:', tokenUri);
const data = await response.text();
console.log('Sanitized response:', data);
import requests
response = requests.post(
'https://service.pcibooking.net/api/payments/paycard/capture',
params={
'profileName': 'MyOTAProfile',
'targetURI': 'https://api.thirdparty.com/reservations/12345',
'httpMethod': 'POST',
'saveCVV': 'true',
'ref': 'booking-12345'
},
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/xml'
},
data='<ReservationRequest><ID>12345</ID></ReservationRequest>'
)
token_uri = response.headers.get('X-pciBooking-cardUri')
print('Token URI:', token_uri)
print('Sanitized response:', response.text)
The third-party response body is returned with card details replaced by token placeholders.
The X-pciBooking-cardUri header contains the new token URI.
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Couldn't fetch a valid pciShield profile:: <profileName>",
"errorList": null
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Invalid target Uri::",
"errorList": null
}
Empty response body.
Authentication failed: the API key, session token or access token is missing or was not accepted.
See "Authentication and Permission Failures" on the Error Handling page.
Server-Side Tokenization
Tokenization in Response
Route a request to a third party through PCI Booking, which intercepts the response, tokenizes card data, masks the details, and returns the sanitized response.
POST
/
api
/
payments
/
paycard
/
capture
const params = new URLSearchParams({
profileName: 'MyOTAProfile',
targetURI: 'https://api.thirdparty.com/reservations/12345',
httpMethod: 'POST',
saveCVV: 'true',
ref: 'booking-12345'
});
const response = await fetch(
`https://service.pcibooking.net/api/payments/paycard/capture?${params}`,
{
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/xml'
},
body: '<ReservationRequest><ID>12345</ID></ReservationRequest>'
}
);
const tokenUri = response.headers.get('X-pciBooking-cardUri');
console.log('Token URI:', tokenUri);
const data = await response.text();
console.log('Sanitized response:', data);
import requests
response = requests.post(
'https://service.pcibooking.net/api/payments/paycard/capture',
params={
'profileName': 'MyOTAProfile',
'targetURI': 'https://api.thirdparty.com/reservations/12345',
'httpMethod': 'POST',
'saveCVV': 'true',
'ref': 'booking-12345'
},
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/xml'
},
data='<ReservationRequest><ID>12345</ID></ReservationRequest>'
)
token_uri = response.headers.get('X-pciBooking-cardUri')
print('Token URI:', token_uri)
print('Sanitized response:', response.text)
The third-party response body is returned with card details replaced by token placeholders.
The X-pciBooking-cardUri header contains the new token URI.
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Couldn't fetch a valid pciShield profile:: <profileName>",
"errorList": null
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Invalid target Uri::",
"errorList": null
}
Empty response body.
Authentication failed: the API key, session token or access token is missing or was not accepted.
See "Authentication and Permission Failures" on the Error Handling page.
Tokenization on Response Guide
Automatically tokenize cards from gateway responses
| Header | Description |
|---|---|
X-pciBooking-cardUri | Semicolon-separated list of token URIs for each card tokenized. The header name can be customized per profile. |
X-pciBooking-Tokenization-Errors | Errors encountered during tokenization (e.g. invalid card number, missing fields). Present only if errors occurred. |
X-pciBooking-Tokenization-Warnings | Warnings encountered during tokenization (e.g. expired card accepted). Present only if warnings occurred. |
All URLs must be HTTPS and URL-encoded.
Error Responses
| Code | HTTP Status | Condition |
|---|---|---|
| -125 | 400 | Empty relay message content (null body) |
| -125 | 400 | Could not fetch a valid PCI Shield profile |
| -1003 | 403 | Missing CanTokenize permission. message names the reason. |
Parameter Constraints
| Parameter | Type | Required | Constraints |
|---|---|---|---|
| targetURI | string | Yes | Must be a valid HTTPS URL |
| profileName | string | Yes | Must match a configured target profile |
| httpMethod | string | Yes | Defaults to POST. Accepted values: POST, GET, PUT, PATCH, DELETE |
| timeout | integer | No | Number of seconds to wait for the third party’s response. Defaults to 60 (also when you send 0). The full round trip must still finish within 29 seconds. |
| Auth | string | Yes | ApiKey, AccessToken, or SessionToken |
Parameters
Authentication
API key, access token or session token. Use the API key for server-to-server calls, and an access token or a session token when the call is made from a browser. Send one of the three.string
Your API key prefixed with
APIKEY. Example: APIKEY your-api-key. The x-pcibooking-api-key header is also accepted. 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 be200instead of201.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.
const params = new URLSearchParams({
profileName: 'MyOTAProfile',
targetURI: 'https://api.thirdparty.com/reservations/12345',
httpMethod: 'POST',
saveCVV: 'true',
ref: 'booking-12345'
});
const response = await fetch(
`https://service.pcibooking.net/api/payments/paycard/capture?${params}`,
{
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/xml'
},
body: '<ReservationRequest><ID>12345</ID></ReservationRequest>'
}
);
const tokenUri = response.headers.get('X-pciBooking-cardUri');
console.log('Token URI:', tokenUri);
const data = await response.text();
console.log('Sanitized response:', data);
import requests
response = requests.post(
'https://service.pcibooking.net/api/payments/paycard/capture',
params={
'profileName': 'MyOTAProfile',
'targetURI': 'https://api.thirdparty.com/reservations/12345',
'httpMethod': 'POST',
'saveCVV': 'true',
'ref': 'booking-12345'
},
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/xml'
},
data='<ReservationRequest><ID>12345</ID></ReservationRequest>'
)
token_uri = response.headers.get('X-pciBooking-cardUri')
print('Token URI:', token_uri)
print('Sanitized response:', response.text)
Response
200 - The card already exists in your account (wheneliminateCardDuplication 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.
Remember to set the CVV Retention Policy on the token.
The third-party response body is returned with card details replaced by token placeholders.
The X-pciBooking-cardUri header contains the new token URI.
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Couldn't fetch a valid pciShield profile:: <profileName>",
"errorList": null
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Invalid target Uri::",
"errorList": null
}
Empty response body.
Authentication failed: the API key, session token or access token is missing or was not accepted.
See "Authentication and Permission Failures" on the Error Handling page.

