Searching Transactions

Introduction

PayEngine provides multiple APIs to search and filter transactions. This document explain the key concepts behind search APIs and help you integrate with search in ways that best suite your needs.

Whenever a sale or refund is executed it is attached to payment object. Payment is a logical grouping of related transactions such as a sale and refund.

Payment - Logical grouping of related transactions

Transaction - A sale or a refund with processing information.

Understanding Payment and Transaction IDs

Transaction detail API works with both paymentId and transaction IDs. Since every transaction is part of a payment the response remains the same regardless of how the API is called.

1. Searching Transaction

Transactions can be searched using Transaction Search API. Based on the search criteria the result is always presented as an array of transactions where very item contains id attribute that is the payment ID that transaction belongs to; and transactionId is the unique transaction ID with its own processing data.

{
    "data": [
        {
            "id": "1504ce6f-b079-4fb0-bddb-3a4d69bc4e60",
            "transactionId": "d6ecf793-c5b7-4938-b23e-907741b6cb89",
            "is_offline": false,
            "amount": "1.00",
            "data": {
                "last_4": "1111",
                "card_type": "visa",
                "card_id": "34e1523f-567d-4ce6-acb5-edb2b59d30bb"
            },
            "host_report": {
                "status": "PASS",
                "responseCode": "A0000",
                "responseMessage": "Success",
                "authCode": 887062,
                "hostReferenceNumber": "584935801236",
                "hostResponseCode": "00",
                "taskID": "36060172",
                "transactionID": "68630475",
                "transactionTimestamp": "2022-03-18T15:58:54",
                "orderNumber": "45389232",
                "returnedAmount": "1.00",
                "externalReferenceID": "45389232",
                "customerReceipt": "...",
                "merchantReceipt": "..."
            },
            "payment_method": "Credit Card",
            "type": "refund",
            "status": "succeeded",
            "created_at": "2022-03-18T15:58:54.453Z",
            "settled": false
        },
        {
            "id": "1504ce6f-b079-4fb0-bddb-3a4d69bc4e60",
            "transactionId": "e4df6407-8c0d-43de-a205-af6205e6102d",
            "is_offline": false,
            "amount": "517.76",
            "data": {
                "last_4": "1111",
                "card_type": "visa",
                "card_id": "34e1523f-567d-4ce6-acb5-edb2b59d30bb"
            },
            "host_report": {
                "status": "PASS",
                "responseCode": "A0000",
                "responseMessage": "Success",
                "authCode": 529529,
                "hostReferenceNumber": "133293843236",
                "hostResponseCode": "00",
                "taskID": "86141473",
                "transactionID": "15741297",
                "transactionTimestamp": "2022-03-18T15:38:34",
                "transactionAmount": "517.76",
                "processedAmount": "517.76",
                "totalAmount": "517.76",
                "addressVerificationCode": "Z",
                "cardHolderVerificationCode": "N",
                "cardType": "V",
                "maskedCardNumber": "1111",
                "customerReceipt": "...",
                "merchantReceipt": "..."
            },
            "payment_method": "Credit Card",
            "type": "payment",
            "status": "succeeded",
            "created_at": "2022-03-18T15:38:32.848Z",
            "settled": false
        }
    ],
    "meta": {
        "total": 2,
        "current_page": 1,
        "total_pages": 1
    }
}

2. Transaction Detail

Using either the id that is payment ID or transactionId from the search (or even from the sale response) Transaction Detail API can be called to get the payment details.

The detail object id that is data.id represents Payment ID and each item in details is a transaction that is part of this Payment. The id attribute of each entry in the details object is a unique Transaction ID. In a typical case, a payment will only have a single transaction with one or more refund transactions.

{
"data": {
    "id": "1504ce6f-b079-4fb0-bddb-3a4d69bc4e60",
    "amount": "516.76",
    "details": [
        {
            "id": "e4df6407-8c0d-43de-a205-af6205e6102d",
            "amount": "517.76",
            "data": {
                "last_4": "1111",
                "card_type": "visa",
                "card_id": "34e1523f-567d-4ce6-acb5-edb2b59d30bb",
                "bank_account_id": null
            },
            "host_report": {
                "status": "PASS",
                "responseCode": "A0000",
                "responseMessage": "Success",
                "authCode": 529529,
                "hostReferenceNumber": "133293843236",
                "hostResponseCode": "00",
                "taskID": "86141473",
                "transactionID": "15741297",
                "transactionTimestamp": "2022-03-18T15:38:34",
                "transactionAmount": "517.76",
                "processedAmount": "517.76",
                "totalAmount": "517.76",
                "addressVerificationCode": "Z",
                "cardHolderVerificationCode": "N",
                "cardType": "V",
                "maskedCardNumber": "1111",
                "customerReceipt": "...",
                "merchantReceipt": "..."
            },
            "payment_method": "Credit Card",
            "status": "succeeded",
            "type": "payment",
            "is_offline": false,
            "updated_at": "2022-03-18T15:38:32.848Z",
            "created_at": "2022-03-18T15:38:32.848Z",
            "settled": false
        },
        {
            "id": "d6ecf793-c5b7-4938-b23e-907741b6cb89",
            "amount": "1.00",
            "data": {
                "last_4": "1111",
                "card_type": "visa",
                "card_id": "34e1523f-567d-4ce6-acb5-edb2b59d30bb",
                "bank_account_id": null
            },
            "host_report": {
                "status": "PASS",
                "responseCode": "A0000",
                "responseMessage": "Success",
                "authCode": 887062,
                "hostReferenceNumber": "584935801236",
                "hostResponseCode": "00",
                "taskID": "36060172",
                "transactionID": "68630475",
                "transactionTimestamp": "2022-03-18T15:58:54",
                "orderNumber": "45389232",
                "returnedAmount": "1.00",
                "externalReferenceID": "45389232",
                "customerReceipt": "...",
                "merchantReceipt": "..."
            },
            "payment_method": "Credit Card",
            "status": "succeeded",
            "type": "refund",
            "is_offline": false,
            "updated_at": "2022-03-18T15:58:54.453Z",
            "created_at": "2022-03-18T15:58:54.453Z",
            "settled": false
        }
    ]
    }
}

Last updated