Transaction API Guide

Track your decryption activity on P2PE Manager using the Management API's Transaction endpoints.

Transaction endpoints are included in the Management APIs for partners who have their own (Domain 5) P2PE compliant decryption environment and who wish to use our platform to manage their partners, merchants and devices.

List All Transactions

The list can be filtered by a number of Transaction properties.

By default, the paging.mode is set to 'nocount': this means that the list total count will not be included in the response. Setting the paging.mode parameter to 'full' will enable the total count. However, we urge partners to exercise caution when including the total count on the transaction list endpoint. The total number of transactions can grow significantly and counting them can tax the system. Setting paging.mode to full is likely to result in high latency; therefore, we suggest you adopt a pagination strategy that does not require the total count.

The following example requests the two most recent transactions with the transaction count omitted:

GET https://cert-apis.p2pemanager.com/api/v1/transactions?partner=6580&client=&take=2&skip=0
Authorization: Basic dXNlcjpwYXNzd29yZA==

{
    "data": [
        {
            "id": "246846321",
            "method": "/decrypt/BPS",
            "success": true,
            "encrypted": 1,
            "decrypted": 1,
            "deviceName": "The Tired Window Ingenico Touch 480",
            "serialNumber": "80612860",
            "alternateKey": null,
            "isVirtual": 0,
            "messageId": "1201712271213122222586516",
            "clientRef": "The Tired Window",
            "reference": "723f57e1-e9c8-48cb-81d9-547ad2b76434",
            "startDate": "2017-12-27T12:13:13.000Z",
            "endDate": "2017-12-27T12:13:13.000Z",
            "created": "2017-12-27T12:13:12.000Z",
            "client": {
                "id": "4684",
                "name": "The Tired Window"
            },
            "partner": {
                "id": "73",
                "name": "ASM Global"
            },
            "directPartner": {
                "id": "6580",
                "name": "ASM Software"
            },
            "location": {
                "id": "33668",
                "name": "The Tired Window Headquarters"
            }
        },
        {
            "id": "246839993",
            "method": "/decrypt/3DES/CBC",
            "success": true,
            "encrypted": 1,
            "decrypted": 1,
            "deviceName": "The Tired Window WisePad 2",
            "serialNumber": "WPC204633000146",
            "alternateKey": null,
            "isVirtual": 0,
            "messageId": "1201712270905182221794911",
            "clientRef": "The Tired Window",
            "reference": "723f57e1-e9c8-48cb-81d9-547ad2b76435",
            "startDate": "2017-12-27T09:05:18.000Z",
            "endDate": "2017-12-27T09:05:18.000Z",
            "created": "2017-12-27T09:05:18.000Z",
            "client": {
                "id": "4684",
                "name": "The Tired Window"
            },
            "partner": {
                "id": "73",
                "name": "ASM Global"
            },
            "directPartner": {
                "id": "6580",
                "name": "ASM Software"
            },
            "location": {
                "id": "33668",
                "name": "The Tired Window Headquarters"
            }
        }
    ]
}

The following example also lists two transactions, this time, specifying that the total transaction count be included in the response, the transactions be filtered by a date range, and that only successful transactions be output.

GET https://cert-apis.p2pemanager.com/api/v1/transactions?partner=73&client=&take=10&skip=0&paging.mode=full&dateFrom=2017-01-10T10:57:47.283Z&dateTo=2018-01-10T10:57:47.283Z&success=true
Authorization: Basic dXNlcjpwYXNzd29yZA==

{
    "total": 249158,
    "data": [
        {
            "id": "246846321",
            "method": "/decrypt/BPS",
            "success": true,
            "encrypted": 1,
            "decrypted": 1,
            "deviceName": "The Tired Window Ingenico Touch 480",
            "serialNumber": "80612860",
            "alternateKey": null,
            "isVirtual": 0,
            "messageId": "1201712271213122222586516",
            "clientRef": "The Tired Window",
            "reference": "723f57e1-e9c8-48cb-81d9-547ad2b76434",
            "startDate": "2017-12-27T12:13:13.000Z",
            "endDate": "2017-12-27T12:13:13.000Z",
            "created": "2017-12-27T12:13:12.000Z",
            "client": {
                "id": "4684",
                "name": "The Tired Window"
            },
            "partner": {
                "id": "73",
                "name": "ASM Global"
            },
            "directPartner": {
                "id": "6580",
                "name": "ASM Software"
            },
            "location": {
                "id": "33668",
                "name": "The Tired Window Headquarters"
            }
        },
        {
            "id": "246839993",
            "method": "/decrypt/3DES/CBC",
            "success": true,
            "encrypted": 1,
            "decrypted": 1,
            "deviceName": "The Tired Window WisePad 2",
            "serialNumber": "WPC204633000146",
            "alternateKey": null,
            "isVirtual": 0,
            "messageId": "1201712270905182221794911",
            "clientRef": "The Tired Window",
            "reference": "723f57e1-e9c8-48cb-81d9-547ad2b76435",
            "startDate": "2017-12-27T09:05:18.000Z",
            "endDate": "2017-12-27T09:05:18.000Z",
            "created": "2017-12-27T09:05:18.000Z",
            "client": {
                "id": "4684",
                "name": "The Tired Window"
            },
            "partner": {
                "id": "73",
                "name": "ASM Global"
            },
            "directPartner": {
                "id": "6580",
                "name": "ASM Software"
            },
            "location": {
                "id": "33668",
                "name": "The Tired Window Headquarters"
            }
        }
    ]
}

The List Transactions endpoint can also be filtered by client, location, device serial number, and more. Refer to the API reference for a complete list of supported filters: List Transactions API

Getting a Single Transaction

The following example returns a single transaction resource. Notice that it contains more data than the transaction objects output by the List Transactions endpoint. The errMessage and errCode properties can be used to log decryption errors.

GET https://cert-apis.p2pemanager.com/api/v1/transactions/234234
Authorization: Basic dXNlcjpwYXNzd29yZA==

{
    "id": "234234",
    "method": "/decrypt/BPS",
    "success": true,
    "encrypted": 1,
    "decrypted": 1,
    "deviceName": "The Tired Window Ingenico Touch 480",
    "serialNumber": "80612860",
    "alternateKey": null,
    "isVirtual": false,
    "keyType": "BPS",
    "messageId": "1201712271213122222586516",
    "clientRef": "The Tired Window",
    "reference": "723f57e1-e9c8-48cb-81d9-547ad2b76434",
    "errMessage": null,
    "errCode": null,
    "ipAddress": "102.20.193.16",
    "startDate": "2017-12-27T12:13:13.000Z",
    "endDate": "2017-12-27T12:13:13.000Z",
    "created": "2017-12-27T12:13:12.000Z",
    "client": {
        "id": "4684",
        "name": "The Tired Window"
    },
    "partner": {
        "id": "73",
        "name": "ASM Global"
    },
    "directPartner": {
        "id": "6580",
        "name": "ASM Software"
    },
    "location": {
        "id": "33668",
        "name": "The Tired Window Headquarters"
    },
    "transactionSource": "External Api"
}

Logging a Transaction

The following example creates a transaction entry with a set of referenced resources. It is important that the encryption method and key type be included in the object to create.

POST https://cert-apis.p2pemanager.com/api/v1/transactions
Authorization: Basic dXNlcjpwYXNzd29yZA==

{
    "partner" : {
        "id" : "6580"
    },
    "client" : {
        "id": "4684"
    },
    "device": {
        "id": "175108"
    },
    "keyType": "3DES/CBC",
    "method": "/decrypt/3DES/CBC",
    "reference": "723f57e1-e9c8-48cb-81d9-547ad2b764",
    "messageId": "1201711160847511212306122",
    "clientRef": "The Tired Window",
    "success": true,
    "ipAddress": "102.18.193.16",
    "startDate": "2013-12-25 15:45:34",
    "endDate": "2013-12-25 15:45:37",
    "encrypted": 0,
    "decrypted": 2,
    "errMessage": "",
    "errCode": ""
}

The response object will contain the new transaction's ID:

{
    "id": "234235"
}