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
| Field | Format | Notes |
|---|---|---|
grossValue | Number | Required. Total value of the transaction. |
products | List | Required. The items in the transaction. Use [] if there are none. |
type | purchase or return | |
email / memberId | Text | Links the transaction to a member. |
documentIdentifier | Text | Your receipt or invoice number. |
linkedTransactionId | Text | For returns, the documentIdentifier of the original purchase. |
transactionDate | Date and time, ISO 8601 | For example 2024-05-14T16:20:00Z. |
currency | Text | For example RSD. |
purchasePlace | Text | The channel where the purchase happened. |
discount | Object | Discounts applied to the whole transaction. |
customAttributes | Object | Any key/value pairs. |
Product fields
| Field | Format | Notes |
|---|---|---|
name | Text | Required. |
quantity | Whole number | Required. |
highPrecisionQuantity | Number | For items sold by weight or volume. |
price | Number | Unit price. |
grossValue | Number | Line total. |
sku, category, brand | Text | Used by segments, promotions and analytics. |
productDiscount | Object | Discounts applied to this line. |
customAttributes | Object | Any key/value pairs. |
2. Upload the file
- Go to Transactions.
- Click Import.
- 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
grossValueor a product withoutname; - a transaction with the same
documentIdentifieralready exists; - the same
documentIdentifierappears 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,categoryandbrand. 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.