Import transactions

Add historical or offline purchases and returns in bulk by uploading a JSON file.

Import transactions to bring in purchase history from another system, or transactions recorded offline.

1. Prepare the file

The import file is a JSON array with one object per transaction.

[
  {
    "type": "purchase",
    "email": "ana.petrovic@example.com",
    "documentIdentifier": "INV-2024-0001",
    "transactionDate": "2024-05-14T16:20:00Z",
    "grossValue": 12990,
    "currency": "RSD",
    "purchasePlace": "Belgrade store",
    "products": [
      {
        "name": "Wireless headphones",
        "sku": "HP-100",
        "category": "Electronics",
        "brand": "Sony",
        "quantity": 1,
        "price": 12990,
        "grossValue": 12990
      }
    ]
  },
  {
    "type": "return",
    "email": "ana.petrovic@example.com",
    "documentIdentifier": "RET-2024-0001",
    "linkedTransactionId": "INV-2024-0001",
    "grossValue": 12990,
    "products": [
      { "name": "Wireless headphones", "sku": "HP-100", "quantity": 1 }
    ]
  }
]

Transaction fields

FieldFormatNotes
grossValueNumberRequired. Total value of the transaction.
productsListRequired. The items in the transaction. Use [] if there are none.
typepurchase or return
email / memberIdTextLinks the transaction to a member.
documentIdentifierTextYour receipt or invoice number.
linkedTransactionIdTextFor returns, the documentIdentifier of the original purchase.
transactionDateDate and time, ISO 8601For example 2024-05-14T16:20:00Z.
currencyTextFor example RSD.
purchasePlaceTextThe channel where the purchase happened.
discountObjectDiscounts applied to the whole transaction.
customAttributesObjectAny key/value pairs.

Product fields

FieldFormatNotes
nameTextRequired.
quantityWhole numberRequired.
highPrecisionQuantityNumberFor items sold by weight or volume.
priceNumberUnit price.
grossValueNumberLine total.
sku, category, brandTextUsed by segments, promotions and analytics.
productDiscountObjectDiscounts applied to this line.
customAttributesObjectAny key/value pairs.

2. Upload the file

  1. Go to Transactions.
  2. Click Import.
  3. In the Upload file dialog, choose your JSON file and upload it.

3. Wait for processing

The import runs in the background. Imported transactions appear in the Transactions list once they are processed.

A record is skipped when:

  • it fails validation, for example a transaction without grossValue or a product without name;
  • a transaction with the same documentIdentifier already exists;
  • the same documentIdentifier appears twice in the file.

Skipped records are written to error files, which you can download with GET /import/errors/{key}. Bulk imports explains how.

Campaigns

Imported transactions that are linked to a member run through your active campaigns, just like transactions sent through the API. A purchase can earn points and a return can cancel them. When you import old history, deactivate the campaigns that shouldn't apply to it first, or members get points for past purchases.

Tips

  • Fill in sku, category and brand. Segment conditions such as Purchased brands and promotion effects rely on them.
  • Link each return to its purchase with linkedTransactionId.
  • Test with a small file before you upload the full history.