What Is a Product Export?
A product export automation sends product data from SureDone to an external system. You might export a pricing file to a distributor's FTP server, push catalog updates to a partner's API, or email a daily inventory report to your team. The engine gathers products from your SureDone catalog, formats them according to your configuration, and delivers the result.
Every product export starts with a search that selects which products to include, followed by field mapping that controls which data goes out and how it is formatted.
Selecting Products: Search and Filters
The search config determines which products are included in the export. It uses SureDone's standard search syntax:
"search": "stock:>0 brand:=AcmeParts"
This exports only products that are in stock and belong to the "AcmeParts" brand. You can use any searchable field and any operator -- equals, not equals, greater than, less than, contains, and more. See SureDone's search guide for the full syntax.
If you omit search, the export includes all products in your catalog. For large catalogs, that may be exactly what you want. For targeted exports, always set a search.
You can also use the structured filters array in the file config for more complex filter logic, but search is simpler and covers most cases.
"search": "{{export_search}}" with a parameter lets each installed user specify their own criteria.Output Formats
Product exports support three primary output methods:
CSV File (to FTP/SFTP/S3/Email)
The most common export format. The field_map defines your columns -- the keys are SureDone field names, and the values become the column headers in the output file:
"field_map": {
"guid": "SKU",
"title": "Product Name",
"stock": "Quantity Available",
"price": "Sell Price"
}
This produces a CSV with headers SKU, Product Name, Quantity Available, and Sell Price.
HTTP API Call
For API-based integrations, combine an HTTP connection with a template to send data as JSON, XML, or any custom format. Each product is sent as an individual request (when payload_multi is false) or all products are bundled into a single request (when payload_multi is true).
Email Attachment
Use an email connection with send_as_attachment: true to email the export file. The subject and body fields support dynamic variables from the exported data using {{fieldname}} syntax.
Field Map for Exports
In export automations, field_map works differently than in imports:
- Keys = SureDone field names (the data source)
- Values = Column headers in the output file (or identifiers for the external system)
Fields listed in field_map are included in the export file. Fields in field_run are available for actions and calculations but are excluded from the output.
"field_map": {
"guid": "SKU",
"stock": "Quantity",
"price": "Price",
"cost": "Cost"
},
"field_run": {
"minstock": "minstock",
"maxstock": "maxstock"
}
Here, minstock and maxstock can be used in suredone_actions for calculations, but they will not appear as columns in the export file.
Templates: Custom Output Formats
When you need to send data as JSON, XML, or any non-CSV format, use the template config with a valid Twig template. The variable data contains all fields from field_map and field_run.
For a single-product-per-request export (payload_multi: false), the template has access to each product's data directly:
"template": "{\"sku\": \"{{data['guid']}}\", \"qty\": {{data['stock']}}, \"price\": {{data['price']}}}"
For a multi-product export (payload_multi: true), you iterate over the data array in your template:
"template": "{\"products\": [{% for key, item in data %}{\"sku\": \"{{item['guid']}}\", \"qty\": {{item['stock']}}}{% if not loop.last %},{% endif %}{% endfor %}]}"
Templates give you complete control over the output format, including conditional logic, loops, and string manipulation using Twig's built-in filters.
Response Field Map
When exporting via HTTP API, the external system may return data you want to save back to SureDone -- a vendor product ID, a confirmation code, an updated price. The response_field_map handles this:
"response_field_map": {
"vendorproductid": "$.vendor_id",
"vendorstatus": "$.listing_status"
}
After each successful export request, the engine reads the response, extracts the mapped fields (using JSONPath or plain field names), and updates the corresponding SureDone product. This is especially powerful for two-way integrations where you need to store the vendor's identifier for future reference.
$.vendor_id) in response_field_map values, you must also set "jsonpath": true in the file config so the engine knows how to parse the response.Batch Export Limits
When using payload_multi: true with a large catalog, you may need to split the export into multiple batches. The limit_export config controls how many products are included per request:
"payload_multi": true,
"limit_export": 500
This sends products in batches of 500 rather than cramming them all into a single request. Each batch uses the same template and connection settings.
Field Calculations
The field_calculate config lets you compute values for the export without modifying your SureDone data:
"field_calculate": {
"total_inventory": {
"sumFields": ["stock_warehouse1", "stock_warehouse2", "stock_warehouse3"]
}
}
The sumFields function adds the values of the listed fields and makes the result available as total_inventory in the export.
Date in Filename
Use {{DATE}} or {{TIME}} in the name config to include a timestamp in the exported filename. Control the format with date_format and time_format:
"name": "inventory-export-{{DATE}}.csv",
"date_format": "Y-m-d"
This produces filenames like inventory-export-2026-03-30.csv. The {{TIME}} placeholder uses time_format (defaults to Y-m-d H:i:s) and is useful when you need a more precise timestamp.
Headers
The headers config for exports is a boolean. Set to true (the default) to include column headers from field_map as the first row in the CSV. Set to false to export data rows only:
"headers": false
Some vendor systems expect files without a header row -- this setting handles that.
Export Empty File
By default, if no products match your search criteria, the automation does not send a file. Some vendors expect a file regardless -- even if it is empty. Set export_empty_file: true to send an empty file (with headers only, if enabled) when there are no matching products:
"export_empty_file": true
Complete Example: Product Catalog Export to SFTP as CSV
This automation exports your full active catalog to a partner's SFTP server every morning, with calculated stock values and actions to set static fields.
{
"name": "Daily Catalog Export",
"vendor": "PartnerCo",
"active": true,
"schedule": "0 8 * * *",
"type": "products",
"action": "export",
"connection": {
"type": "sftp",
"address": "sftp.partnerco.com",
"username": "{{sftp_user}}",
"password": "{{sftp_pass}}",
"path": "/incoming/catalog",
"port": 22
},
"file_configs": [
{
"name": "catalog-{{DATE}}.csv",
"date_format": "Ymd",
"search": "stock:>0 condition:=New",
"field_map": {
"guid": "SKU",
"title": "Product Name",
"brand": "Brand",
"mpn": "MPN",
"upc": "UPC",
"price": "Sell Price",
"stock": "Quantity",
"weight": "Weight (lbs)",
"MARKETPLACE_ID": "Marketplace ID",
"CURRENCY": "Currency"
},
"vendor_actions": [
{
"setValue": {
"MARKETPLACE_ID": "PARTNER_123",
"CURRENCY": "USD"
}
}
],
"headers": true
}
],
"parameters": [
{
"name": "sftp_user",
"value": "",
"label": "SFTP Username"
},
{
"name": "sftp_pass",
"value": "",
"encrypted": true,
"label": "SFTP Password"
}
]
}
What this does:
- Runs daily at 8:00 AM UTC
- Exports all in-stock, new-condition products
- Includes product details with
SKU,Product Name,Brand,MPN,UPC,Sell Price,Quantity, andWeight - Adds static values for
Marketplace IDandCurrencyusingvendor_actions - Uploads the file as
catalog-20260330.csvto the partner's SFTP server
Complete Example: Price Update via HTTP API with Template
This automation pushes price updates to a vendor's REST API for products that have been modified in the last day.
{
"name": "Price Sync API",
"vendor": "PriceHub",
"active": true,
"schedule": "30 * * * *",
"type": "products",
"action": "export",
"connection": {
"type": "http",
"address": "https://api.pricehub.com/v1/products/update",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {{api_key}}"
}
},
"file_configs": [
{
"search": "dateupdateutc:>\"-1 day\" vendorproductid:-=",
"template": "{\"products\": [{% for key, item in data %}{% if key > 0 %},{% endif %}{\"vendor_id\": \"{{item['vendorproductid']}}\", \"sku\": \"{{item['guid']}}\", \"price\": {{item['price']}}, \"sale_price\": {{item['saleprice']}}, \"stock\": {{item['stock']}}}{% endfor %}]}",
"payload_multi": true,
"limit_export": 200,
"field_map": {
"guid": "sku",
"price": "price",
"saleprice": "sale_price",
"stock": "stock"
},
"field_run": {
"vendorproductid": "vendorproductid"
},
"response_field_map": {
"vendorlastsync": "$.sync_timestamp"
},
"jsonpath": true
}
],
"parameters": [
{
"name": "api_key",
"value": "",
"encrypted": true,
"label": "PriceHub API Key"
}
]
}
What this does:
- Runs every 30 minutes
- Searches for products updated in the last day that have a
vendorproductid(already known to the vendor) - Sends up to 200 products per request as a JSON array using the Twig template
- After each successful request, maps the vendor's
sync_timestampresponse back to thevendorlastsyncfield in SureDone - Splits into multiple batches automatically if more than 200 products match