Making your initial upload
If you are a Smart Insight customer, you can still choose to upload your sales data to our SFTP servers. Please note, however, that this is a legacy option that has several disadvantages compared to using the Sales Data API. If you still prefer to use our SFTP, please contact Emarsys Support.
Once your sales data file is ready and formatted as per our specifications, upload it through the Sales Data page.
To open the Sales Data page, go to Admin > Data Sources, and in the Sales Data box click either Set up sales data uploads (if this is your file upload) or Manage sales data (if you have already uploaded at least one sales data file).
- If you upload the same file here more than once, this will not result in duplicate data if the file name does not change.
- If you upload the same file with a different name (e.g. an updated timestamp), or upload different files containing the same orders, then the data will be duplicated.
The columns in the header of your sales data file must be in the order that was agreed during the Smart insight onboarding implementation. If they are not, the upload will fail.
The columns are displayed in order at the top of the Sales Data page, for example:
Manual upload via the Sales Data page is the preferred method for making your initial upload of historical sales data during the onboarding process, as it allows you to validate the file and correct any errors straight away. Proceed as follows:
- On the Sales Data page, click Validate/upload file.
- Browse for your sales data file and select it.
- If issues are detected, they will be listed as warnings and errors. Fix them and try the upload again.
- If no issues are detected, finalize the upload by clicking Activate upload.
You will not be able to upload your sales data file as long as it contains errors; you must fix these first.
Setting up regular updates
If you are a Smart Insight customer, you can still choose to upload your sales data to our SFTP servers. Please note, however, that this is a legacy option that has several disadvantages compared to using the sales data API. If you still prefer to use our SFTP, please contact Emarsys Support.
Once you made a single upload of your historical sales data, you need to set up regular updates. The easiest way to automate regular sales data imports to Emarsys is to use our Sales Data API.
Open the Sales Data page by going to Admin > Data Sources, in the Sales Data box click Manage sales data. Then click Show API upload details, which will display all information you need to set up the import with minimal effort.
Sales data uploads are incremental, meaning new uploads add to existing sales data and do not overwrite them.
Sales Data API specifications
|merchant-id||string||Your 16-letter merchant ID provided by Emarsys.
The request should contain an
Authorization header with the following value:
<token> is a security token, which can be obtained by clicking the Show API upload details button on the Sales Data page.
You must upload the sales data .csv file as a binary (
data-binary) payload in the request body. See Formatting your sales data file for details about the accepted format.
Request example (curl)
curl --request POST \ --header 'Authorization: Bearer <token> \ --header 'Content-type: text/csv' \ --header 'Accept: text/plain' \ --data-binary @/myhome/salesdata-2018-03-26.csv \ https://admin.scarabresearch.com/hapi/merchant/<id>/sales-data/api
If the API is called after each purchase event in a separate request or more often than every five minutes, make sure to append the parameter
?live=true to the endpoint URL. This will allow our servers to bundle, validate and submit the events in hourly batches.
Gzip compression is supported. To upload gzip compressed files, use the
Content-Encoding: gzip header.
|200||Upload is accepted (with possible warnings).
|400||Upload is rejected due to errors.
|401||Security token is invalid or missing.