Skip to main content

Transactions XML import

The API is the preferred way of creating and updating contacts in Engage. However, sometimes file-based imports are more suitable, for example when another system is the master and immediate updates are not crucial.

Engage connects all purchases to the contact who made them and this can later be used for segmentation and analysis. The transaction object has some flexibility in order to fulfill a client’s specific needs. In addition to the standard fields, you can add up to 10 extra string fields and up to 5 extra date fields which can be used for segmentation. Only include fields that are necessary since every additional field can affect the overall performance. Read more about transactions here.

Please read about file based integration before going any further!

Naming the files

Files sent to the FTP server should follow this naming convention:

[Timestamp]_[sequence number OR store id] _transactions.xml

[Timestamp] should be formatted as: YYYYMMDDHHmmss.

The sequence or store id is only needed if there's a risk that several applications might send XML files at the same time, although it is never wrong to include it.

A correct filename has this form: 20220808134729_471_transactions.xml

FTP location

The XML files should be placed here:

[base-ftp-url]/integration/transactionImport

Scheme and field definitions

You can download the basic XSD scheme used for the XML import on the example files page.

Find the complete list of Field definitions here.

Register a purchase

Read more about registering a purchase here.

<?xml version="1.0" encoding="utf-8"?>
<transactions xmlns="http://voyado.Schemas.ImportReceipts">
  <transaction>
    <contact>
      <matchKey>90154424</matchKey>
      <matchKeyType>memberNumber</matchKeyType>
      <contactType>Member</contactType>
    </contact>
    <uniqueReceiptId>14534304434293</uniqueReceiptId>
    <receiptNumber>87684684684</receiptNumber>
    <createdDate>2019-07-23T09:02:01+02:00</createdDate>
    <storeExternalId>12313</storeExternalId>
    <currency>SEK</currency>
    <exchangeRateToGroupCurrency>1.1</exchangeRateToGroupCurrency>
    <totalGrossPrice>200.00</totalGrossPrice>
    <paymentMethods>
      <paymentMethod>
        <type>bonuscheck</type>
        <description>25kr bonuscheck</description>
        <value>25.00</value>
      </paymentMethod>
      <paymentMethod>
        <type>creditcard</type>
        <description>Mastecard</description>
        <value>175.00</value>
        <extraData>
          <item name="cardNumber">489456*</item>
          <item name="cardIssuer">ICA Banken</item>
        </extraData>
      </paymentMethod>
    </paymentMethods>
    <usedBonusChecks>
      <usedBonusCheck>
        <checkNumber>45343</checkNumber>
      </usedBonusCheck>
    </usedBonusChecks>
    <usedPromotions>
      <usedPromotion>
        <couponId>625bafb8-00ee-44c1-aacc-aa9400a77cbb</couponId>
      </usedPromotion>
    </usedPromotions>
    <items>
      <item>
        <type>PURCHASE</type>
        <quantity>2</quantity>
        <grossPaidPrice>200.00</grossPaidPrice>
        <taxAmount>40.00</taxAmount>
        <taxPercent>25.00</taxPercent>
        <sku>23424123456</sku>
        <articleNumber>123456</articleNumber>
        <articleName>Stickad tröja V-neck</articleName>
        <articleGroup>Tröjor</articleGroup>
        <marginPercent>25.00</marginPercent>
        <awardsBonus>false</awardsBonus>
        <datespare1>2019-07-23T09:02:01+02:00</datespare1>
        <discounts>
          <discount>
            <type>325</type>
            <description>50% rabatt nedsatt vara</description>
            <value>-200.00</value>
          </discount>
        </discounts>
      </item>
    </items>
  </transaction>
</transactions>

Register a return

Read about registering a return here.