Heycommerce importing sales data - Heyloyalty/api GitHub Wiki

The endpoint used for importing is

https://tracking.heycommerce.dk/api/transaction/import/[id]

where [id] is the specific trackingID found within your account below the Heycommerce integration. The authentication used for the endpoint is the same used to authenticate towards an account.

Parameters

Name Description Type Required
file this is your csv file with historical orderdata csv x
delimiter The delimiter tells us, what separates the columns in the attached file , ; : pipe x
skip_header_line notifies rather we should import the first row in the file. boolean (true/false) x
date_format defines the date format used in the file Y-m-d H:i:s x
sendErrorsTo Who to notify if there is an error with the import string x
fields_selected Array of fields, where the first one matches the first column in the file string

Example

Example in cURL

 curl -X POST \
 https://tracking.heycommerce.dk/api/transaction/import/[integrationID] \
 -H 'Cache-Control: no-cache' \
 -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
 -F file=@/home/sk/booking.csv \
 -F 'delimiter=,' \
 -F skip_header_line=false \
 -F date_format=iso8601 \
 -F [email protected] \
 -F 'fields_selected[]=email' \
 -F 'fields_selected[]=' \
 -F 'fields_selected[]=product_id' \
 -F 'fields_selected[]=created_at' \
 -F 'fields_selected[]=' \
 -F 'fields_selected[]=description' \
 -F 'fields_selected[]=' \
 -F 'fields_selected[]=product_price' \
 -F 'fields_selected[]=original_price' \
 -F 'fields_selected[]=' \
 -F 'fields_selected[]=event_type'

Fields noted with empty value indicates "skip this row in the file" When using the import function, make sure to reference columns in the importfile to the field you wish to import data too, within your heycommerce integration.

fields

Below you'll see a list of all fields available to use in your import

Name Description Type
email The email associated with the purchase string
product_id The specific productID that has been purchased string
category_id The categoryID associated with the product purchased string
category_name The category name with the product purchased string
variation_type If the product has a variation (for instance "red") string
variation_id If the product has a variationID (for instance "123") integer
product_name Name of the product purchased string
product_price Price the product has been sold at integer
product_url URL of the product sold string
original_price If the product had a sale price, this field should contain the originale price integer
discount the amount of discount (if product was on sale) string
description The product description string
currency The currency of the product string
custom_field_1 Defined by the productfeed mapping string
custom_field_2 Defined by the productfeed mapping string
custom_field_3 Defined by the productfeed mapping string
custom_field_4 Defined by the productfeed mapping string
custom_field_5 Defined by the productfeed mapping string
custom_field_6 Defined by the productfeed mapping string
custom_field_7 Defined by the productfeed mapping string
custom_field_8 Defined by the productfeed mapping string
custom_field_9 Defined by the productfeed mapping string
custom_field_10 Defined by the productfeed mapping string
custom_field_11 Defined by the productfeed mapping string
custom_field_12 Defined by the productfeed mapping string
custom_field_13 Defined by the productfeed mapping string
custom_field_14 Defined by the productfeed mapping string
custom_field_15 Defined by the productfeed mapping string
custom_field_16 Defined by the productfeed mapping string
custom_field_17 Defined by the productfeed mapping string
custom_field_18 Defined by the productfeed mapping string
custom_field_19 Defined by the productfeed mapping string
custom_field_20 Defined by the productfeed mapping string
event_type This should always be "bought" when using import string
amount The number of the specific product that has been sold integer