Error Handling

This page describes the the error responses that can be output by the Parser's APIs.

Error Response Structure

The Parser's error response object will always contain a success property that is set to false. It will also contain a human readable errMessage and a machine friendly errCode. If a reference value is included in the API request, it will be included in the response object. Some error responses will include a messageId which can be used to view the decryption record on the P2PEManager. API calls that fail validation are not recorded on the P2PE Manager and will not include a messageId.

{
    "success"   : false,
    "errCode"   : 2800,
    "errMessage": "PAN not found in decrypted data",
    "reference" : "myref",
    "messageId" : "1201804091311071001318556"
}

Sample 2800 "PAN not found in decrypted data" error response.

Error Categories

The following table categorises the errCodes ranges that can be returned from /api/v1/decrypt/parser API call.

errCode HTTP Code Description
1-100 500 Internal server error.
1003 401 Authentication errors.
2000-2008 400 API constraint violation errors.
2100-2280 400 Device errors.
2400 400 KSN error.
2600-2606 400 Decryption errors.
2800 400 Post decryption validation error.
1303 400 All decryptions failed

Specific Error Messages

The following tables outline the error codes, their descriptions, and the steps required to generate the error condition. Where applicable the table will also contain a sample body for a /api/v1/decrypt/parser REST request.

Internal server error

errCode 1-100
errMessage Internal Server Error.
description The Parser cannot communicate with the Decryptx Service

API constrain violations

errCode 1003
errMessage Authentication required
description The API call included invalid credentials

API constrain violations

errCode 2000
errMessage The deviceType parameter is required
description The API call omitted the required deviceType parameter.
errCode 2001
errMessage Invalid deviceType value
description A device type other than generic, idtech, ingenico-ra1, ingenico-rba, miura, prima, verifone, wisepad, or wisepad2 was specified.
errCode 2002
errMessage Invalid Client ID value
description The Client ID parameter exceeded 50 character limit or contained invalid data.
errCode 2003
errMessage Invalid reference value
description The reference parameter exceeded 50 character limit or contained invalid data.
errCode 2004
errMessage Invalid devicePayload value
description The devicePayload parameter was either: omitted, is shorter than 20 characters or longer than 5000 characters.
errCode 2005
errMessage Invalid deviceSerial value
description The deviceSerial parameter contains more than 50 characters.
errCode 2006
errMessage Malformed KSN, the KSN parameter should be a 20 character alphanumeric string
description The KSN parameter has the incorrect format.
errCode 2007
errMessage Invalid iv value
description The iv parameter had the wrong format. It must be a 20 character alphanumeric string
errCode 2008
errMessage Unexpected Parameter in payload. Only partnerId, partnerKey, devicePayload, deviceSerial, ksn, iv, reference and ClientId parameters are allowed
description An API call was sent with an unsupported parameter in the POST body.

Device specific errors (Generic Devices)

errCode 2100
errMessage Missing parameter(s), the deviceSerial, devicePayload, and ksn are required for the generic device
description When making an API call with the deviceType set to generic a deviceSerial, devicePayload, and ksn must be specified.
errCode 2101
errMessage Invalid devicePayload for the generic device
description When making an API call with the deviceType set to generic, the devicePayload must be hex encoded.
errCode 2102
errMessage Invalid KSN for the generic device
description The KSN parameter has the incorrect format.
errCode 2103
errMessage Invalid IV for the generic device
description The IV parameter has the incorrect format.

Device specific errors (IDTECH Devices)

errCode 2120
errMessage Invalid devicePayload value for the IDTECH device
description The devicePayload parameter value is not a valid IDTECH payload.

Device specific errors (Ingenico RA1 Devices)

errCode 2140
errMessage Missing parameter(s), the deviceSerial and devicePayload are required for the Ingenico RA1 device
description When making an API call with the deviceType set to ingenico-ra1 the deviceSerial and devicePayload are required.
errCode 2141
errMessage Invalid devicePayload for the Ingenico RA1 device
description The devicePayload parameter value is not a valid Ingenico RA1 payload.

Device specific errors (Ingenico RBA Devices)

errCode 2160
errMessage Missing parameter(s), the deviceSerial and devicePayload are required for the Ingenico RBA device
description When making an API call with the deviceType set to ingenico-rba, the deviceSerial and devicePayload are required.
errCode 2161
errMessage Invalid devicePayload for the Ingenico RBA device
description The devicePayload parameter value is not a valid Ingenico RBA payload.

Device specific errors (Miura Devices)

errCode 2180
errMessage Missing parameter(s), the deviceSerial, devicePayload, and ksn are required for the Miura device
description When making an API call with the deviceType set to miura, the deviceSerial, ksn and devicePayload are required.
errCode 2181
errMessage Invalid devicePayload for the Miura device
description The devicePayload parameter value is not a valid Miura payload.
errCode 2182
errMessage Invalid KSN for the Miura device
description The KSN parameter has the incorrect format.

Device specific errors (Prima Devices)

errCode 2200
errMessage Missing parameter(s), the deviceSerial and devicePayload are required for the Prima device
description When making an API call with the deviceType set to prima, the deviceSerial and devicePayload are required.
errCode 2201
errMessage Invalid devicePayload for the Prima device
description The devicePayload parameter value is not a valid Prima payload.
errCode 2202
errMessage Invalid KSN for the Prima device
description The KSN parameter has the incorrect format.

Device specific errors (Verifone Devices)

errCode 2220
errMessage Missing parameter(s), the deviceSerial and devicePayload are required for the Verifone device
description When making an API call with the deviceType set to verifone, the deviceSerial and devicePayload are required.
errCode 2221
errMessage Invalid devicePayload for the Verifone device
description The devicePayload parameter value is not a valid Verifone payload.

Device specific errors (Wisepad Devices)

errCode 2240
errMessage Missing parameter(s), the deviceSerial and devicePayload are required for Wisepad devices
description When making an API call with the deviceType set to wisepad, the deviceSerial and devicePayload are required.
errCode 2241
errMessage Missing parameter(s), the deviceSerial, devicePayload and ksn are required for swiped Wisepad payloads
description When making an API call with the deviceType set to verifone and the devicePayload is a swiped payload, the ksn, deviceSerial and devicePayload parameters are required.
errCode 2242
errMessage Invalid devicePayload for Wisepad
description The devicePayload parameter value is not a valid Wisepad payload.

Device specific errors (Wisepad 2 Devices)

errCode 2260
errMessage Missing parameter(s), the deviceSerial, devicePayload, and KSN are required for WisePad 2 devices
description When making an API call with the deviceType set to wisepad 2, the ksn, deviceSerial and devicePayload parameters are required.
errCode 2261
errMessage Invalid deviceSerial value for Wisepad 2. The serial should begin with the characters WPC and have 12 additional digits
description Malformed deviceSerial for Wisepad 2 devices.
errCode 2262
errMessage Invalid devicePayload value for Wisepad 2
description The devicePayload parameter value is not a valid Wisepad 2 payload.

KSN errors

errCode 2400
errMessage Valid KSN not found in payload
description Malformed KSN. This error is returned when KSN that fails validation is extracted from the devicePayload value. It suggests that the root cause is a malformed payload.

Decryption errors

errCode 2601
errMessage Device serial not specified
description This is a decryption specific error. The serial number was omitted.
errCode 2602
errMessage Device not found
description A device cannot be found to match the specified deviceSerial (or the serial contained within the devicePayload for IDTECH devices).
errCode 2603
errMessage Device is not currently active
description A device is found on the system to match the deviceSerial (or the serial contained within the devicePayload for IDTECH devices), however that device is not set to active. The root cause for this issue could be that the device has not been deployed yet, or the device generated three invalid payloads in a row and was automatically set to malfunctioning by Decryptx.
errCode 2604
errMessage No data to decrypt
description Decryption error.
errCode 2605
errMessage Insufficient data provided
description Decryption error.
errCode 2606
errMessage Decryption failed
description Generic decryption error.

Decryption errors

errCode 2800
errMessage PAN not found in decrypted data
description After the Parser decrypts the payload it extracts the PAN. This error is generated if the extracted PAN fails validation. The PAN must be between 13 and 19 digits and pass the luhn test.