Enriched Transaction Schema

Descriptions of output fields

Overview

When a match is generated between your transaction and a receipt on the Banyan network, Banyan generates an Enriched Transaction (eTx). Understanding the schema is essential to using the data you receive from Banyan.

Data is sent in Avro format with guarantees of backwards compatibility. As different types of information is sent depending on the vertical the merchant is in (i.e., "In Room Dining" amount doesn't pertain to a big box retailer receipt), there will be some item objects that are null within the eTx. This is not an error.

eTx Top Level

ElementDescriptionData TypeNullable?Notes
byn_etx_idUnique ID generated by Banyan when creating the enriched recordstringNo
byn_match_idUnique ID generated by Banyan when a receipt is married with a transactionstringNo
match_tsTimestamp of when the receipt is married with a transactiontimestamp-millisNoRecorded in UTC
split_tenderWhether the payment that was matched was the only tender on the receiptbooleanNoTrue means that there is more than one tender

etx.receipt

ElementDescriptionData TypeNullable?Notes
byn_receipt_idUnique ID created by Banyan to represent a receipt received from a merchantstringNo
currencyCurrency of the total amountnumericNo
merchant_total_amountTotal amount for the entire receiptnumericNoCould be different than payment.total_amount if there is a split tender on the receipt
fulfillment_typeHow the items are received by the customerstringYesValid values include {in_store, shipped, delivered, pick_up}
barcode_urlThe URL to the image of a receipt barcodestringYes
merchant_receipt_idMerchant generated ID for the receiptstringNo
order_typeLocation of where the transaction took placestringYesValid values include {web, in_store, phone, third_party_delivery}
received_tsTimestamp when Banyan ingested the receipttimestamp-millisNoPresented in UTC
purchase_tsTimestamp when the customer made the purchasetimestamp-millisNoPresented in UTC
image_urlThe URL to the image of the receiptstringYes
merchant_midThe merchant id provided by the acquiring bankstringYes
paymenttop level objectrecord
itemtop level objectarray
hoteltop level objectmap

etx.receipt.payment

Payments (AKA tenders) are the way that the goods are paid for on the receipt. While there may be more than one payment on a single receipt, your eTx will only contain the payment that pertains to your transaction sent to Banyan. Given this, there is a possibility that the total amount on the receipt (or items amount paid total) will not match your payment amount if more than one payment is used on the receipt. This is not an error, it is the sign of a split tender.

ElementDescriptionData TypeNullable?Notes
subtotal_amountTotal amount less tax amountnumericNo
shipping_amountAmount paid for a ship or delivery fulfillment typenumericYes
total_amountAmount paid by the customernumericNo
payment_typeCredit card vs Debit card transactionstringYes
tax_amountSales tax amountnumericNo
other_negative_amountsAny negative amounts included in the total amount that are not specifiednumericYes
other_positive_amountsAny additional amounts included in the total amount that are not specifiednumericYes

etx.receipt.item

ElementDescriptionData TypeNullable?Notes
image_urlThe URL for the image of the receipt if availablestringYes
descriptionDescribes the ItemstringYes
brandBrand name of itemstringYes
full_price_per_unitThe regular price for the item specified in the item idnumericNoUp to 2 decimal places
merchant_item_idUnique ID for the item sold in the transactionstringYesThis ID is a sequencing ID on the receipt. It could be a unique ID from the basket detail table or a counter on each receipt. Used for QA purposes.
byn_item_idBanyan generated ID for each item in the arraystringNo
upcUniversal product codestringYesIncluding check number
skuStore specific ID of itemstringYes
unit_typeThe unit the item is sold instringYes
tagsLabels provided by the taxonomy of the merchant in the form of key value pairsarray of stringsYesEach merchant will have different tag key value pairs
discount_price_per_unitThe amount paid for the itemnumericNoUp to 2 decimal places
quantityNumber of the same item purchasednumericNoUp to 2 decimal places
amount_paidTotal amount paid for the item, quantity*discount_price_per_unitnumericNoUp to 2 decimal places

etx.receipt.merchant

ElementDescriptionData TypeNullable?Notes
nameDBA of merchantstringYes
display_nameStore display namestringYes

etx.receipt.location

ElementDescriptionData TypeNullable?Notes
merchant_store_idID for the specific location under the merchantstringYes
nameDBA of the storestringYes
display_nameStore display namestringYes
phone numberPhone number of the storestringYes
addressNext level objectobject

etx.receipt.location.address

ElementDescriptionData TypeNullable?Notes
address_line_oneFirst line of street address of the storestringYes
address_line_twoApartment, suite number of the storestringYes
cityCity of the storestringYes
stateState of the storestringYes
postal_codePostal code of the storestringYes
country_codeCountry code of the storestringYes

etx.transaction

The transaction data that you have sent to Banyan will be returned to you within the enriched transaction record to make it easy to join within your systems using your transaction_id (finx_transaction_id).

ElementDescriptionData TypeNullable?Notes
finx_transaction_idUnique transaction id from the finxstringNo
received_tsTimestamp of when Banyan ingested the recordtimestamp-millisNo
byn_transaction_idBanyan created transaction idstringNoThis ID can be used to query the Banyan GET /transaction API end point
order_typeFinX designation of web or in store transactionstringYes
descriptionDescription of the transaction provided by the finxstringYes
finx_consumer_tokenFinx created ID for the account or userstringYes
paymentTop level object
locationTop level object
merchantTop level object

etx.transaction.payment

ElementDescriptionData TypeNullable?Notes
finx_midA merchant identification number (MID) is a distinctive, numerical code that identifies a merchant to their acquirer.stringYes
card_last_fourLast 4 digits on the debit card, credit cardstringYes
arnA unique 16-digit number that tags a credit or debit card transaction when it goes from the merchant’s bank through to the cardholder's bank. Also called a trace ID, this number is often used to determine where a transaction's funds lie at a certain time, and make a transaction traceable in case of an error in bank or merchant accounts.stringYes
schemeThe network the card was issued onstringYes
binBank Identification Number associated with the card usedstringYes
payment_typeCredit card vs Debit card transactionstringYes
currency3 lettered code of the currency the amount is instringNo
auth_codeSix digit alphanumeric code passed between banks that signal a transaction is possiblestringYes
total_amountAmount paid for goods/servicesstringNo

etx.transaction.location

ElementDescriptionData TypeNullable?Notes
merchant_store_idID for the specific location under the merchantstringYes
nameDBA of the storestringYes
display_nameStore display namestringYes
phone_numberPhone number of the storestringYes
addressTop level objectstringYes

etx.transaction.location.address

ElementDescriptionData TypeNullable?Notes
address_line_oneFirst line of street address of the storestringYes
address_line_twoApartment, suite number of the storestringYes
cityCity of the storestringYes
stateState of the storestringYes
postal_codePostal code of the storestringYes
country_codeCountry code of the storestringYes

eTx Example


  "data": [
    {
      "id": "403abe9b-cd9b-43f5-bdc9-924c8e17be77",
      "campaign": {
        "byn_campaign_id": "74567b52-18ca-5974-bb30-8d67830ee080",
        "name": "Walgreens Rewards",
        "byn_publisher_id": 316,
        "created_ts": "2024-08-15T21:32:04.131143Z",
        "updated_ts": "2024-08-15T21:32:04.131143Z"
      },
      "offer_activation": null,
      "offer": {
        "byn_offer_id": "70770c15-0d5b-5e74-89e7-da17a7c19d49",
        "name": "082624: Walgreens 2.5% On Non Private Label Items",
        "publisher_offer_id": "08262024B",
        "return_receipt_detail": true,
        "always_on": true,
        "byn_advertiser_id": 327,
        "byn_publisher_id": 316,
        "amount_back_limit": "0",
        "amount_back_per_dollar": "0.025",
        "amount_back_type": "DOLLAR",
        "start_ts": "2024-08-26T04:00:00Z",
        "expiration_ts": "2025-08-27T03:59:00Z",
        "offer_criteria": {
          "order_types": [
            "any"
          ],
          "item_qualification_expression": "\"PRIVATE_LABEL_IND:|:N\"",
          "item_disqualification_expression": "\"excluded:|:excluded item\"",
          "incl_tags": [
            "PRIVATE_LABEL_IND:|:N"
          ],
          "excl_tags": [
            "excluded:|:excluded item"
          ],
          "incl_sku": [],
          "excl_sku": [],
          "amount_threshold": "0",
          "fulfillment_count_limit": 0
        },
        "offer_hotel_criteria": null,
        "created_ts": "2024-08-15T21:38:00.568616Z",
        "updated_ts": "2024-08-15T21:38:00.568616Z",
        "currency": "",
        "allow_activation_after_purchase": true,
        "prorate_qualified_spend": true,
        "card_issuer": "",
        "card_types": null,
        "activation_window_minutes": null
      },
      "result": {
        "items": {
          "qualified_total_amount": "0.39",
          "qualified_ids": [
            "1b8a79d5-5562-5e37-9f39-e83105d98c16"
          ],
          "unqualified_ids": []
        },
        "fulfilled": true,
        "cumulative_qualified_total_amount": "0.39",
        "amount_back": "0.01",
        "hotel": {
          "qualified_dining_charges": null,
          "unqualified_dining_charges": null,
          "total_qualified_dining_spend": "0",
          "qualified_room_charges": null,
          "unqualified_room_charges": null,
          "total_qualified_room_spend": "0"
        }