Transactions

The transactions API event is usually called at the end of the checkout process performed by the member end user.

The transactions query API presently accommodates two distinct use cases: account payments and guest payments.

  • Account Payments: This pertains to scenarios involving payments made by logged-in users.
  • Guest Payments: This is applicable to instances where payments are made by non-registered guests.

The object is identiqal in both use cases (except the scores value and the accountId parameter which is not needed in case of guest payment).

API Example (account payment)

{
    "queryParameters": {
        "scores": [
            "accountPayment"
        ]
    },
    "tags": {
        "country": "US",
        "accountCreationDate": "2017-09-10T15:46:51Z",
        "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"
    },
    "entity": {
        "transaction": {
            "transactionId": "72c1fd9d-de6c-4593",
            "accountId": "72c1fd9d-de6c-4593-a21f-b3218b417f6a",
            "amount": 100,
            "currencyCode": "USD",
            "paymentMethod": {
                "cardBin": "666666",
                "cardLast4": "1234",
                "methodType": "credit_card"
            },
            "billingAddress": {
                "phone": {
                    "number": "+155555555",
                    "country": "US",
                    "verified": false
                },
                "firstName": "John",
                "lastName": "Doe",
                "streetAddress": {
                    "address1": "123 Woodfield Drive"
                },
                "city": "London",
                "region": "Barnet",
                "postCode": "44444",
                "country": "US",
                "email": {
                    "address": "[email protected]",
                    "verified": true
                }
            },
            "shippingAddress": {
                "phone": {
                    "number": "+155555555",
                    "country": "US",
                    "verified": false
                },
                "firstName": "John",
                "lastName": "Doe",
                "streetAddress": {
                    "address1": "123 Woodfield Drive"
                },
                "city": "London",
                "region": "Barnet",
                "postCode": "44444",
                "country": "US",
                "email": {
                    "address": "[email protected]",
                    "verified": true
                }
            },
            "ip": "1.1.1.1",
            "device": "cccc3482-4a31-4508-a964-3786948bc42b"
              

        }
    }
}

Data Points table

Data PointDescription
accountIdThe unique identifier that represents the user/account
transactionIdThe unique identifier of the transaction
amountThe transaction amount
currencyCodeThe currency code (in 3-letter ISO 4217 format). currently, multi-currency is not supported. the preferred currency code is USD.
paymentMethod (object)The payment methods used to perform the transaction payments. include the following parameters:
1. cardBin - The Bank Identification Number.
2. cardLast4 - last 4 digits of the credit card
3. methodType - method type

The system allows for multiple values in the "methodType" parameter, encompassing various method types from the provided list (see API reference). However, currently, only credit card information can be supplied, utilizing the "cardLast4" field to specify the last 4 digits of the credit card.
billingAddress.phone (object)The object includes the following parameters:

1. number - The phone number of the account.
2. country - country code (2/3 letters ISO. i.e. US). it's recommended to provide the country code in any case (even if the country prefix is provided in the number parameter).
3. verified - an indication of whether the phone number supplied has been through a process of verification. Verification processes typically involve checking that a phone number is valid, reachable, and accessible by the user. Phone number verification is often used as a form of two-factor authentication for certain online accounts. This indication may contribute to the trust level of the data
billingAddress.firstNameThe billing address's first name
billingAddress.lastNameThe billing address's last name
billingAddress.email (object)The object includes the following parameters:

1. address - The email of the account
2. verified - an indication of whether the email has been through a process of being checked and authenticated, to ensure that it’s authentic and valid. This indication may contribute to the trust level of the data. In case there is more than one email listed in the account, you may send two update events to reflect each.
billingAddress.streetAddressThe billing address
shippingAddress (object)The shipping address details (identical to the billingAddress object in terms of parameters)
ipThe IP listed for the account.
If there are multiple IPs listed, you may send multiple update events via the API for each, along with the unique account identifier.
regionThe account region
cityThe account city
deviceThe device ID, identified and provided by an external vendor, and listed for the account.
A device ID (device identification) is a distinctive alphanumeric value, associated with a computer, smartphone or similar handheld device.
If there are multiple Devices listed, you may send multiple update events via the API for each, along with the unique account identifier.
deliverToIndicates the form of shipping destination. May include email, phone, or postal code.
A shipment via email or phone usually represents virtual products such as gift cards, tickets, etc. while postal code destination represents physical goods