Transactions API

The transaction endpoints are included in the Management APIs for Partners that have their own (Domain 5) P2PE compliant decryption environment and who wish to use our platform to manage their partners, merchants and devices. transaction endpoints allow Partners to journal their decryption activity on the P2PE Manager.

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 become taxing on the system. Setting Paging.mode to full is likely to result in high latency, therefore we suggest that 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 it is specifying that: the total transaction count be included in the response, the transactions are filtered by a date range and that only successful transactions are 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, you will notice that it contains more data than the Transaction objects that are 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 are 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"
}

Did this page help you?