const response = await fetch('https://service.pcibooking.net/api/dataBlock', {
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Reference: 'booking_12345',
DataBlockLocation: 'DE'
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://service.pcibooking.net/api/dataBlock',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
json={
'Reference': 'booking_12345',
'DataBlockLocation': 'DE'
}
)
print(response.json())
{
"UserId": "Nadya",
"OwnerId": "Frodo",
"Id": "22222222",
"Reference": "my reference",
"ContentType": null,
"DataSize": null,
"CreationTime": "2019-01-16T11:21:25.3241104Z",
"LastAccessedTime": null,
"LastModifiedTime": null,
"DataBlockLocation": "DE"
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "...",
"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.
Data Blocks
Create Data Block
Create a new data block and receive its token ID.
POST
/
api
/
dataBlock
const response = await fetch('https://service.pcibooking.net/api/dataBlock', {
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Reference: 'booking_12345',
DataBlockLocation: 'DE'
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://service.pcibooking.net/api/dataBlock',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
json={
'Reference': 'booking_12345',
'DataBlockLocation': 'DE'
}
)
print(response.json())
{
"UserId": "Nadya",
"OwnerId": "Frodo",
"Id": "22222222",
"Reference": "my reference",
"ContentType": null,
"DataSize": null,
"CreationTime": "2019-01-16T11:21:25.3241104Z",
"LastAccessedTime": null,
"LastModifiedTime": null,
"DataBlockLocation": "DE"
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "...",
"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.
Data Block Tokenization Guide
Store and manage arbitrary data securely with GDPR-compliant storage locations
Error Responses
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | -125 | Validation error. The request body is missing or contains invalid fields (e.g. bad Reference format or invalid DataBlockLocation). |
| 401 | none | Not authenticated. The API key is missing or invalid. The response body is empty. |
| 403 | -1003 | Not authorized. The API key does not have the CanWriteData permission. |
| 500 | -150 | Internal system error. |
Parameter Constraints
| Parameter | Constraint |
|---|---|
Reference | Must match the pattern [a-zA-Z0-9_\-@#=\"']{0,64}. Letters, digits, underscore, hyphen, at-sign, hash, equals, double-quote, and single-quote only. Max 64 characters. |
DataBlockLocation | One of: US, IN, KR, SG, AU, JP, CA, DE, IE, GB, FR, BR. If omitted, defaults to the user’s country when supported, otherwise IE (Ireland). |
Parameters
Authentication
API key only. This endpoint does not accept access tokens or session tokens.string
required
Your API key prefixed with
APIKEY. Example: APIKEY your-api-key. The x-pcibooking-api-key header is also accepted. See the Authentication guide.Request Body
string
A reference value which can then be used to query for this card token.
string
default:"null"
The location to store this data block. Available locations: US, IN, KR, SG, AU, JP, CA, DE, IE, GB, FR, BR. Send
null for the default: your account’s country if it is in this list, otherwise Ireland.const response = await fetch('https://service.pcibooking.net/api/dataBlock', {
method: 'POST',
headers: {
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Reference: 'booking_12345',
DataBlockLocation: 'DE'
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://service.pcibooking.net/api/dataBlock',
headers={
'Authorization': 'APIKEY your-api-key',
'Content-Type': 'application/json'
},
json={
'Reference': 'booking_12345',
'DataBlockLocation': 'DE'
}
)
print(response.json())
Response
{
"UserId": "Nadya",
"OwnerId": "Frodo",
"Id": "22222222",
"Reference": "my reference",
"ContentType": null,
"DataSize": null,
"CreationTime": "2019-01-16T11:21:25.3241104Z",
"LastAccessedTime": null,
"LastModifiedTime": null,
"DataBlockLocation": "DE"
}
{
"code": -125,
"message": "Bad input data",
"moreInfo": "...",
"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.

