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: {
'x-pcibooking-api-key': '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={
'x-pcibooking-api-key': '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: {
'x-pcibooking-api-key': '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={
'x-pcibooking-api-key': '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 target profile |
| -1003 | 403 | Missing Tokenization 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 | x-pcibooking-api-key header, accessToken or sessionToken. The Authorization header is not used for PCI Booking authentication. |
Parameters
Authentication
API key header, access token or session token. Send one of the three. PCI Booking does not use theAuthorization header on this endpoint. Use it for the third party’s own authorization, in the format the third party requires.
Your API key. See the Authentication guide.
Generated on your side. Single use, and valid for up to 72 hours. How to generate.
Returned by an API call. Valid for 5 minutes, and can be used more than once within that time. How to generate.
Query String
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.
The URI of the third party to relay the request to. PCI Booking sends your request to this endpoint and intercepts the response.
The HTTP method that PCI Booking should use when calling the target URI. Possible values:
POST, GET, PUT, PATCH, DELETE.Whether to save the CVV in the database.
true: save the CVV. false: discard the CVV.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.
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.
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.false(default): A new token is always created, even if the same card was previously stored.
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.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: {
'x-pcibooking-api-key': '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={
'x-pcibooking-api-key': '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 third party answered with a 2xx status and PCI Booking processed its response. The body is the third party’s response with card details masked. If cards were found, their token URIs are inX-pciBooking-cardUri. If none was found, X-pciBooking-Tokenization-Errors contains No cards found in response content. A third party that reports an error with a 2xx status reaches you as 200: read its body and the error header to tell a successful fetch from an empty one.
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.
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.

