const response = await fetch(
'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/user/booker-user-123',
{
method: 'PUT',
headers: {
'Authorization': 'APIKEY your-api-key'
}
}
);
console.log(response.status);
import requests
response = requests.put(
'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/user/booker-user-123',
headers={'Authorization': 'APIKEY your-api-key'}
)
print(response.status_code)
Empty response body. Association created successfully.
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Could not find a valid user",
"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.
Third-Party Permissions
Associate with Customer
Associate a token with another PCI Booking customer, allowing them to perform actions on this token.
PUT
/
api
/
payments
/
paycard
/
{cardToken}
/
user
/
{userID}
const response = await fetch(
'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/user/booker-user-123',
{
method: 'PUT',
headers: {
'Authorization': 'APIKEY your-api-key'
}
}
);
console.log(response.status);
import requests
response = requests.put(
'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/user/booker-user-123',
headers={'Authorization': 'APIKEY your-api-key'}
)
print(response.status_code)
Empty response body. Association created successfully.
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Could not find a valid user",
"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.
Third-Party Permissions Guide
Learn how to share tokens with other PCI Booking customers
Error Responses
| Code | HTTP Status | Condition |
|---|---|---|
| -1003 | 401 | The token does not exist, was deleted, or you are neither its owner nor a customer the token has been shared with. See Token Not Found or Not Accessible. |
| -179 | 400 | userId is empty |
Error detail
Each condition below gives the exactmoreInfo text, why it happens and how to resolve it. The full set is on the Error Handling page.
-125 Bad input data - merchant not found for this account
-125 Bad input data - merchant not found for this account
HTTP status: Reason. The
400message: Bad input datamoreInfo:Could not find a valid merchant <merchantId> for <userId>
merchantId you passed is not a merchant that your account can associate a token with. Either the ID does not exist, or it belongs to an account unrelated to yours.How to resolve.- Check the
merchantIdvalue. For a property it is the external user ID, not the internal one. - Confirm the merchant sits under the same parent account as the credential making the call.
-113 This operation is not allowed for the given entity - association must target the primary account
-113 This operation is not allowed for the given entity - association must target the primary account
HTTP status: Reason. A token can only be associated with a primary account. You passed the ID of a sub-user or a secondary property, which cannot own an association.How to resolve.
403message: This operation is not allowed for the given entitymoreInfo:Please associate the card to the primary property
Please associate the card to the primary booker - <accountId>
- Use the primary account’s ID instead. When the message names an account ID, that is the one to use.
- Sub-users of the primary account can then use the token without needing their own association.
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.Path Parameters
string
required
The token ID as returned by one of the tokenization methods.
string
required
The user ID of a PCI Booking customer (“Booker”) that the token should be associated with. You will need to collect this userID from the booker you wish to associate the card with.
const response = await fetch(
'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/user/booker-user-123',
{
method: 'PUT',
headers: {
'Authorization': 'APIKEY your-api-key'
}
}
);
console.log(response.status);
import requests
response = requests.put(
'https://service.pcibooking.net/api/payments/paycard/2821a46d80e14d1b96a7f18f1b81926d/user/booker-user-123',
headers={'Authorization': 'APIKEY your-api-key'}
)
print(response.status_code)
Response
200 - Association created. Empty response body.Empty response body. Association created successfully.
{
"code": -125,
"message": "Bad input data",
"moreInfo": "Could not find a valid user",
"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.

