API Reference
This page describes the Bluefin Parser's REST API Endpoint.
Development vs Production
These examples use the Decryptx certification environment. To evaluate your requests against the production environment replace the host cert-parser.decryptx.com
with secure-parser.decryptx.com
.
Bluefin protects our REST endpoints with an IP address whitelist. If you would like to try the examples below please contact us to request access.
Headers
All API Endpoints support the following header:
Property | Required | Description |
---|---|---|
Authorization | no | Our APIs support a number of authentication methods, including: Transparent, Basic, Digest, HMAC, and RSA auth. Transparent authentication requires that a partner embeds their credentials (partnerId and partnerKey) in the body of the request. Basic, Digest, HMAC and RSA authentication require that partner's place an authorization header in the request. For more information on each authentication method check out our documentation. |
All API Endpoints consume and produce JSON data (Content-Type: application/json).
Process Payload
The Process Payload endpoint extracts parameters from a device payload and decrypts track data with the Decryptx service. It also parses the decrypted data and attaches the extracted data to the response object.
Request Path
POST /api/decrypt/parser
Request Object
This API consumes a JSON object with the following properties:
Property | Type | Description |
---|---|---|
partnerId | String | ID provided by Bluefin for access to the Decryptx API. |
partnerKey | String | API Key provided by Bluefin for access to the Decryptx API. This value can be changed on request from the partner or by the partner via the Decryptx portal. |
deviceType | enum | The type of terminal that generated the payload to be decrypted. The value must be one of the following: generic, idtech, ingenico-ra1, ingenico-rba, miura, prima, verifone, wisepad, or wisepad2 |
devicePayload | String | The payment terminal's payload to be decrypted. |
deviceSerial (optional) | String | The serial number of the device that generated the payload. This parameter is not required when decrypting IDTech payloads as they have the device serial number embedded. |
ksn (optional) | String | The key sequence number (KSN) used to encrypt the payload. This parameter is not required when decrypting payloads from the IDTech or Ingenico devices as they embed the KSN in their payloads. |
reference (optional) | String | A string (of up to 50 characters) that helps partners identify individual API calls. If provided, the value will be logged to the P2PE Manager where it can be used to troubleshoot technical issues. It is highly recommended that a unique value be used on each Decryptx API call. The reference value will be returned in the response body, whether the API call is successful or not. |
clientId | String | Identifier for partner client that this device belongs to. This value is configured by the partner when the device is provisioned and is optional. This parameter provides an additional level of uniqueness in case device serial numbers are not unique between manufacturers. It also provides a more detailed level of reporting as API usage can be reported to the Client level. All devices provisioned for a partner must have a unique combination of Serial Number and Client. If a partner does not wish to use a client identifier, all devices provisioned for that partner must have a unique Serial Number. |
luhnCheck | Boolean | A mathematical checksum used to validate standard card numbers once decrypted. Some specialised cards (e.g. EBT) don’t follow this rule, so the check can be toggled off when needed. |
Response Object
A successful API call outputs a JSON object with the following properties:
Property | Type | Description |
---|---|---|
success | Boolean | Indicates if the decryption was successful or not. |
reference | String | A string (of up to 50 characters) that helps partners identify individual API calls. If provided, the value will be logged to the P2PE Manager where it can be used to troubleshoot technical issues. It is highly recommended that a unique value be used on each Decryptx API call. The reference value will be returned in the response body, whether the API call is successful or not. |
messageId | String | Bluefin assigned unique identifier for each response from the Decryptx API. This can and should be stored for troubleshooting purposes. This will be 25 numeric characters. |
meta | Object |
|
track1 (optional) | Object |
|
track2 (optional) | Object |
|
track3 (optional) | Object |
|
tlv (optional) | Object |
|
track2equivalent (optional) | Object |
|
keyed (optional) | Object |
|
extracted | Object |
|
cURL Example
curl 'https://cert-parser.decryptx.com/api/decrypt/parser' \
-X POST \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
-d '{
"partnerId" : "?????????",
"partnerKey" : "ef1ad938150fb15a1384b883a104ce70",
"clientId" : "bobs_burgers",
"reference" : "723f57e1-e9c8-48cb-81d9-547ad2b76435",
"luhnCheck" : false,
"deviceType" : "idtech",
"deviceSerial" : "541T112708",
"devicePayload" : "029C01801F322400839B%*4124********9990^TEST/BLUEFIN^2212************?*;4124********9990=2212************?*6B8C6CAF90CA99315585BE485CFDAB1242477885E2BAE018FB3644140C1BEB5A4AE1731FFA5C2F37D186273BAC4B165EE7BA4F36E831945A9D7C5A9765F5E06933160B3A288670537EC6A37919555328E254D2033665F34BF5BD3BF0A1EAF1A40000000000000000000000000000000000000000000000000000000000000000000000000000000035343154313132373038629949960E001D200229629C03"
}'
If your credentials are correct and you sent a valid payload you should see a response like the one below:
{
"success" : true,
"messageId" : "1201703221545061032173045",
"reference" : "723f57e1-e9c8-48cb-81d9-547ad2b76435",
"clientId" : "bobs_burgers",
"meta": {
"device" : "IDTECH",
"serial" : "541T112708",
"mode" : "swiped"
},
"track1": {
"decrypted": "2542343132343933393939393939393939305e544553542f424c554546494e5e323231323130313132333435363738393f3c000000000000",
"encoding": "hex",
"length": 50,
"ascii": "%B4124939999999990^TEST/BLUEFIN^2212101123456789?<",
"masked": "%*4124********9990^TEST/BLUEFIN^2212************?*"
},
"track2": {
"decrypted": "3b343132343933393939393939393939303d323231323130313132333435363738393f3b00000000",
"encoding": "hex",
"length": 36,
"ascii": ";4124939999999990=2212101123456789?;",
"masked": ";4124********9990=2212************?*"
},
"extracted": {
"PAN": "4124939999999990",
"EXPY": "1222",
"ExpyRaw": "2212",
"ExpiryMonth": "12",
"ExpiryYear": "22",
"ExpiryFullYear": "2022",
"ServiceCode": "101",
"Discretionary": "123456789",
"FirstName": "BLUEFIN",
"Surname": "TEST",
"FullName": "BLUEFIN TEST",
"RawName": "TEST/BLUEFIN",
"Track1": "B4124939999999990^TEST/BLUEFIN^2212101123456789",
"Track2": "4124939999999990=2212101123456789"
}
}
Track 2 Equivalent Data
Track 2 equivalent Data: Overview
A Track 2 equivalent is the data within an EMV chip card that replicates the information found on the magnetic stripe's Track 2, including the card number and expiration date, formatted as Tag 57 in the EMV transaction data. This data is included in online authorization requests and contactless transactions to allow for legacy system compatibility while maintaining security, as the equivalent data, especially the iCVV (chip card verification value), is chip-specific and not easily counterfeited.
There is an example of the device that parses and extracts the track2equivalent
field, using a wisepad device model.
Request
curl 'https://cert-parser.decryptx.com/api/decrypt/parser' \
-X POST \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
-d '{
"partnerId" : "?????????",
"partnerKey" : "ef1ad938150fb15a1384b883a104ce70",
"reference" : "723f57e1-e9c8-48cb-81d9-547ad2b76435",
"ksn" : "02400810160051000027",
"deviceSerial" : "WPC204633000051",
"deviceType" : "wisepad2",
"devicePayload" : "5EAC71D98947BD5AB362169B0394F122A22B6F6AF0401CF5F870AFCED8390172B526C6296B9DA7C1"
}'
While it contains sensitive cardholder data, the iCVV (chip card verification value) makes the Track 2 equivalent data different from the magnetic stripe data, preventing its use for counterfeiting.
Response
{
"success": true,
"messageId": "1202509081307161222906335",
"reference": "723f57e1-e9c8-48cb-81d9-547ad2b76435",
"meta": {
"device": "bbpos",
"serial": "WPC204633000051",
"mode": "swiped"
},
"track2equivalent": {
"decrypted": "b5415244444444444d2212101123456789f800000000000000000000000000000000000000000000",
"encoding": "ascii",
"length": 36,
"ascii": "b5415244444444444d2212101123456789f8",
"masked": "b541524******4444d2212************f*"
},
"track2": {
"decrypted": ";5415244444444444=2212101123456789?8",
"encoding": "ascii",
"length": 36,
"ascii": ";5415244444444444=2212101123456789?8",
"masked": ";541524******4444=2212************?*"
},
"extracted": {
"PAN": "5415244444444444",
"EXPY": "1222",
"ExpyRaw": "2212",
"ExpiryMonth": "12",
"ExpiryYear": "22",
"ExpiryFullYear": "2022",
"ServiceCode": "101",
"Discretionary": "123456789",
"Track2": "5415244444444444=2212101123456789?8",
"Track2Equivalent": "5415244444444444D2212101123456789"
}
}
Security: Logging Best Practices
Our API responses include decrypted CHD, which must never be logged in plaintext. Logging these values can result in PCI DSS violations, data breaches, and legal consequences.
Key PCI DSS Requirements
Requirement | Summary |
---|---|
3.3 | PAN must be masked when displayed (first 6 / last 4 digits). |
3.4 | CHD must be rendered unreadable if stored or logged. |
3.5.x | Cryptographic keys must be protected from misuse. |
Below is a portion of an API response. It contains decrypted track data, PAN, expiry, and full cardholder name — all of which are considered CHD:
"track1": {
"ascii": "%B4124939999999990^TEST/BLUEFIN^2212101123456789?",
"masked": "%*4124********9990^TEST/BLUEFIN^2212************?*"
},
"extracted": {
"PAN": "4124939999999990",
"FullName": "BLUEFIN TEST",
"Track1": "B4124939999999990^TEST/BLUEFIN^2212101123456789",
"Track2": "4124939999999990=2212101123456789"
}
Do Not Log These Fields
Field | Reason | Action |
---|---|---|
PAN | Full card number (CHD) | Mask or exclude |
Track1 , Track2 , Track2Equivalent | Decrypted track data (CHD) | Exclude |
ExpiryMonth , ExpiryYear , ExpyRaw , EXPY | CHD | Mask or exclude |
ServiceCode | CHD component | Mask or exclude |
FullName , FirstName , Surname , RawName | PII | Mask or exclude |
devicePayload | Encrypted CHD | Exclude |
partnerKey | API credential | Exclude |
ksn | May aid decryption | Mask or exclude |
Important
The combination of
devicePayload
,ksn
, andpartnerKey
could be used to decrypt CHD. Logging these enables attack vectors if logs are leaked.
Recommendations
- Disable request/response logging in production where not explicitly needed.
- If logging is required for debugging, ensure redaction is applied to all sensitive fields.
- Apply strict log access controls and retention policies.
Errors
{
"success" : false,
"errMessage" : "Authentication Required.",
"errCode" : 3000,
"reference" : "723f57e1-e9c8-48cb-81d9-547ad2b76435",
"messageId" : "1201607010104111033014010"
}
Updated 8 days ago