code, a fixed message for that code, and a moreInfo string describing the specific failure. The main exception is a failed authentication, which returns 401 with an empty body (see Authentication and Permission Failures). This page lists the conditions you are most likely to hit, with the exact text each returns and what to do about it.
How to read an error
Thecode alone is rarely enough to identify a problem. Several codes are deliberately broad: -125 covers every kind of bad input, and -1003 covers everything from a missing permission to a deleted token. Three pieces of information together identify a condition:
The code
The moreInfo string
The endpoint you called
-1003 with HTTP 403 is a permission problem; with HTTP 401 on a token call it usually means the token is not accessible to you.Codes and their fixed text
Themessage for a given code never varies. Only moreInfo changes. The one exception is the 403 permission response, where the two fields are swapped (see Authentication and Permission Failures).
-174, -176, -180, -1004, -1005 or -1006. You will not see -1002 (Missing authentication header) either: a missing Authorization header returns 401 with an empty body.Response Format
Errors in PCI Booking’s standard format (code, message, moreInfo) are JSON only when the request asks for JSON in its Accept header. In every other case they are XML. The format of the request body does not change this.
*/* or no Accept header by default, so without the header you receive XML errors. A browser sends text/html first, so an error shown in an iframe is XML too.
Two kinds of error do not use this format and follow standard content negotiation instead, which returns JSON unless you ask for something else:
- The standard
400validation response returned by some endpoints, for example the Payments Library, Card Display with OTP and payment gateway credentials endpoints. It lists the invalid fields in anerrorsobject. - Plain text messages, such as
Session token is invalidon the Payments Library session endpoints.
null.
Authentication and Permission Failures
PCI Booking checks each request in two steps. First it identifies the caller from the API key, session token or access token (authentication). Then it checks that this caller is allowed to use the endpoint (permissions). The two steps fail in different ways:Authentication failed: 401 with an empty body
The response is the same for every authentication cause, so the body cannot tell you which one applies. Check each cause in the entry below.401 with an empty body - authentication failed
401 with an empty body - authentication failed
401Response body: empty. There is no code, message or moreInfo.Reason. PCI Booking could not identify the caller. The response is the same for every cause:- The
Authorizationheader (or thex-pcibooking-api-keyheader) is missing, badly formatted, or has noAPIKEYkeyword. - The API key is not valid, or it belongs to the other environment (sandbox or production).
- The
sessionTokenis not valid or has expired. - The
accessTokenis not valid, has expired, has an expiration time further ahead than the maximum allowed, or was already used. An access token works once only, so reloading a page that uses it, such as a card display iframe, also returns this response.
- Confirm the
APIKEYprefix is present and there is a single space between it and the key. - Confirm the key belongs to the same environment as the host you called. Sandbox and production keys are not interchangeable.
- If you use a session token, check it has not expired and start a new session if it has.
- If you use an access token, generate a new one for every request, including every reload of an iframe.
- Check that your HTTP client does not drop the
Authorizationheader on a redirect. Most clients remove it after a 301 or 302.
401 that does have a body, with code -1003, is not an authentication failure, except on the Payments Library session endpoints. PCI Booking identified the caller, but the caller cannot use the token or the sender in the request, or the account is not set up for CVV retention (User is not authorized to handle bank cards). See Token and sender access and Token Not Found or Not Accessible.Permission denied: 403 with code -1003
When PCI Booking identifies the caller but the caller is not allowed to use the endpoint, the response is403 with code -1003. In this response the two text fields are the other way round compared with other errors: message holds the specific reason, and moreInfo holds the fixed -1003 text.
Payments Library session endpoints
The Payments Library endpoints under/api/eWalletOperation that take a session in an Authorization: Bearer <session token> header behave differently. If that header is missing or is not in the Bearer form, they return 401 with a body:
Bearer form but the session token is not valid, they return 401 with the plain text body Session token is invalid.
Token and sender access
Token Not Found or Not Accessible
PCI Booking does not tell you whether a token exists unless you are allowed to use it. This is a security measure: nobody can use the API to find out whether a token exists. On every token endpoint except Delete Token, these three cases return the same response, HTTP401 with code -1003:
- The token never existed.
- The token was deleted.
- The token belongs to another account and is not associated with yours.
moreInfo text depends on the endpoint and on which access check ran. It never tells you which of the three cases applies. The possible texts are listed in the -1003 entry under Token and sender access.
Delete Token is the exception
Delete Token checks whether the token exists before it checks who owns it, so it tells the cases apart:404 / -160.
Malformed tokens
A token is 32 hexadecimal characters. If the value you send is not in that format, the response depends on where the token is in the request:- Token in the URL path (for example
/api/payments/paycard/{cardToken}/meta): HTTP404with an empty body and no PCI Booking error code. The request did not match any endpoint. - Token in a query parameter, and the card display form: HTTP
401with code-1003, the same as a token that does not exist. This applies tocardTokenon Token Replacement,cardUrion Duplicate Token and Network Tokenize from Token, and the path token on Request Card Display Form.
How to confirm that a token was deleted
Use any of these:- The delete response. A
200from Delete Token means the token was deleted. - Send the DELETE again. A
404with code-160confirms the token no longer exists. A401with code-1003means the token exists but is not yours. - Query by reference. If you gave the token a unique reference, call Query Tokens with that reference. A
200with an empty array means no token that you own has that reference. Only tokens your account owns are searched. - Ask support. Send the token to support@pcibooking.net and we will check it for you.
Tokens
-160 Uri not found - wrong operation for this kind of record
-160 Uri not found - wrong operation for this kind of record
404message: Uri not foundmoreInfo:- Check which endpoint created the token, and use the matching endpoint to read or update it.
- For a card captured through a hosted form, use the retrieval endpoint for that capture type.
-125 Bad input data - expiration date rejected
-125 Bad input data - expiration date rejected
400message: Bad input datamoreInfo:- Send the month as two digits,
01through12. - Check the year format the endpoint expects. Some accept two digits and some four, and they are not interchangeable.
- Check the date is not in the past. An expired card is rejected at tokenization.
-179 Bad input parameter - CVV format rejected
-179 Bad input parameter - CVV format rejected
400message: Bad input parametermoreInfo:- Send three or four digits, digits only, with no spaces or punctuation. The API accepts either length for any brand - it does not require four digits for American Express, and it does not reject four digits on other brands.
- Omit the field entirely rather than sending an empty string. An absent or empty CVV is accepted, and the card is simply stored without one.
Accounts and merchant association
-125 Bad input data - merchant not found for this account
-125 Bad input data - merchant not found for this account
400message: Bad input datamoreInfo: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
403message: This operation is not allowed for the given entitymoreInfo:- 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.
Token replacement and relay
-125 Bad input data - profile not found
-125 Bad input data - profile not found
400message: Bad input datamoreInfo: the wording depends on which endpoint you called:paycard/relay). The second is returned by tokenization on response (paycard/capture). They mean the same thing.Reason. The profileName you passed could not be resolved for the account making the request. In almost every case the profile does exist, but on a different account than the one your credentials belong to. A misspelled profile name produces the same error.How to resolve.A PCI Shield profile belongs to the account, not to the sub-user that calls the API. When a sub-user makes a request, the profile is looked up against that sub-user’s parent account. A profile configured on one account is never visible to a sub-user of a different account, and sandbox and production accounts are separate.To check which profiles your credential can see:- Identify the parent account of the sub-user whose credentials you are using.
- Sign in to the PCI Booking portal as that account and open PCI Shield Settings > PCI Shield Profile Settings.
- Confirm the profile name appears there, spelled exactly as you send it. Profile names are matched exactly.
- If the profile is listed under a different account, switch your request to a sub-user of that account rather than copying the profile.
GET /api/booker returns the platform-wide preset tokenization profiles, which are a different set. Your own profiles are visible in the portal only.-125 Bad input data - card data could not be substituted
-125 Bad input data - card data could not be substituted
400message: Bad input datamoreInfo:- Compare the profile’s selectors against the exact payload you sent. A selector that assumes a different nesting depth or element name matches nothing.
- Check the namespaces. For XML and SOAP, a selector written without namespace handling will not match a namespaced document.
- Confirm the body is the format the profile was written for. A profile written for XML will not match a JSON body.
- Test the profile against a saved copy of a real request before using it in production.
-125 Bad input data - request body is empty
-125 Bad input data - request body is empty
400message: Bad input datamoreInfo:- Send the third-party request you want relayed as the body of the call, not as a query parameter.
- If you are pointing at the content with a parameter name, check that parameter is present and actually carries the payload.
- Check no proxy or client library between you and the API is dropping the body on a
GETrelay.
-125 Bad input data - Content-Type header missing
-125 Bad input data - Content-Type header missing
400message: Bad input datamoreInfo:Content-Type header it cannot choose a parser.How to resolve.- Set
Content-Typeto match the body you are sending, for exampleapplication/json,text/xml, orapplication/x-www-form-urlencoded. - Send the charset if the third party requires one, for example
text/xml; charset=UTF-8.
-125 Bad input data - unsupported httpMethod value
-125 Bad input data - unsupported httpMethod value
400message: Bad input datamoreInfo:httpMethod parameter names a method the relay does not forward.How to resolve.- Use one of
POST,GET,PUT,PATCHorDELETE, in upper case. - Omit the parameter to accept the default of
POST.
-125 Bad input data - targetUri not usable
-125 Bad input data - targetUri not usable
400message: Bad input datamoreInfo:targetUri could not be parsed as an absolute URL, so the relay had nowhere to send the request.How to resolve.- Send an absolute URL including the scheme, for example
https://api.example.com/path. - URL-encode the value if you pass it as a query parameter, so that its own query string does not terminate yours.
-125 Bad input data - no token found in the custom header
-125 Bad input data - no token found in the custom header
400message: Bad input datamoreInfo:X-pciBooking-cardUri header, but the header was absent or held no readable token.How to resolve.- Add the
X-pciBooking-cardUriheader carrying the full token URI. - Separate multiple tokens as the endpoint documents, and check none of them is empty.
-175 Request timed out - third party did not respond in time
-175 Request timed out - third party did not respond in time
504message: Request timed outmoreInfo: not populated for this condition. The code and the endpoint are the only signal.Reason. PCI Booking relayed your request but the target server did not answer within the timeout. The failure is on the far side, not in PCI Booking. Card data may already have reached the third party, so the operation cannot be assumed not to have happened.How to resolve.- Check how long the third party takes to respond. The complete round trip must finish within 29 seconds, so raising
timeoutbeyond that does not help. If the third party regularly needs longer, contact support@pcibooking.net for an alternative setup. - Confirm the target host is reachable and not rate limiting or blocking the call. PCI Booking calls the third party from its own addresses, which the third party may need to allow.
- Do not blind retry a charge. Query the third party for the outcome first. A timeout is an unknown result, not a failure.
Request format
-123 Message badly formatted - body is not valid XML for this endpoint
-123 Message badly formatted - body is not valid XML for this endpoint
400message: Message badly formattedmoreInfo:moreInfo.How to resolve.- Read the list in
moreInfo. It names the elements that failed, which is usually enough on its own. - Check element order. The schema is sequence-sensitive, so correctly named elements in the wrong order still fail.
- Check the declared encoding matches what you actually sent.
Payment gateway
-125 Bad input data - request object could not be parsed
-125 Bad input data - request object could not be parsed
400message: Bad input datamoreInfo:- Validate the body against the endpoint’s schema before sending.
- Check for a value sent as the wrong type, most often a number sent as a string or an object sent where an array is expected.
- Check
Content-Typematches the body format.
-125 Bad input data - card or token missing from the request
-125 Bad input data - card or token missing from the request
400message: Bad input datamoreInfo:CardToken property is missing or not a readable token URI.How to resolve.- Send exactly one of a card object or a
CardToken, as the endpoint requires. - Pass the full token URI, not the bare 32-hex token, unless the endpoint documents otherwise.
- Check the property name and its capitalisation against the endpoint reference.
-125 Bad input data - required transaction field missing
-125 Bad input data - required transaction field missing
400message: Bad input datamoreInfo:GatewayReference of the original authorisation, and an amount is required wherever money moves.How to resolve.- Add the field named in
moreInfo. - For a capture, refund or void, send the
GatewayReferencereturned by the original transaction rather than your own reference. - Send the amount in the units the gateway expects, and check whether it takes minor units.
Card requests
-160 Uri not found - card request not found
-160 Uri not found - card request not found
404message: Uri not foundmoreInfo:requestID given. Card requests are not permanent: once completed or expired, a request is no longer retrievable.How to resolve.- Check the
requestIDis the one returned when the request was created. - Check the request has not already been completed by the cardholder, or passed its expiry.
- Confirm the credential belongs to the account that created the request.
When to contact support
Some conditions cannot be resolved from your side. Contact support when:- A
-1003persists after you have ruled out deletion, environment and association. Support can tell you whether a token was deleted, and by which user. To check a deletion yourself first, see How to confirm that a token was deleted. - Calls that used to work start failing with
403and-1003across the whole account at once, which suggests a processing allowance block. - A
-150repeats on the same well-formed request. - A client certificate is named correctly but cannot be loaded.
code, message and moreInfo verbatim, the endpoint and HTTP method, the token URI or your own reference, and whether the call was against sandbox or production.
Related
- Return Codes - flat lookup table of every code
- Card Validation Errors - card number, expiration and CVV validation detail
- Troubleshooting - symptom-first guide when you do not have an error code
- API Conventions - request and response formats

