Getting Your Data in to Merchstack
Our recommended approach for transferring large amounts of data as part of a custom integration with Merchstack is via file transfer. This can be coupled with our GraphQL Management APIs to enhance certain operations.
Sending Your Data
The file format works using a batch-processing type approach. We will provide you with the address to an S3 bucket where files can be dropped on an agreed cadence. The files must conform to our expected file format (see below) in order for the data to be imported into Merchstack. The format includes additional metadata that will allow our collective teams to track the status of any import. To make sure your file will be accepted by Merchstack you should use the JSON schemas provided to validate your files. There may still be import errors that need to be addressed.
File Format
Merchstack uses the JSONL file format where each line in the file is a JSON record. Each file
should have a maximum of 1000 records per file and imports should be broken up over multiple files. Each file should be
named using the data type and import ID (covered below) and a number such as product_import90100_1.jsonl. Files that
don't follow this format will be ignored.
Import Metadata
Each record of every file for every data-type should have an entry of meta-data that looks like this:
Example Export Metadata
"importMetaData": {
"formatVersion": "1.0",
"importId": "123xyz",
"recordNum": 55,
"recordOf": 300,
"recordType": "category"
},
- Name
formatVersion- Type
- type: string
- Required
- required
- Description
This is the version of the file format you are using. This will allow us to make changes to the format version without every customer needing to upgrade at the same moment.
- Name
importId- Type
- type: string
- Required
- required
- Description
Every import should have a unique ID that identifies it to you and us so that we can track the progress and completeness of imports. This ID should span across all files of a particular export so that they can be tracked together. A time-date stamp string can be used here or a GUID.
- Name
recordNum- Type
- type: number
- Required
- required
- Description
The is what number in the total number of records this particular record. So if there was 89,000 records across all files then this record might be 56451 of 89000. This allows us to account for every single record and ensure it was imported.
- Name
recordOf- Type
- type: number
- Required
- required
- Description
This would be the total number of records across all files of a particular import.
- Name
recordType- Type
- type: string
- Required
- required
- Description
What data type this file contains. The available data type are currently
category,product,inventory, andpricingof which the last two are optional.
- Name
operationType- Type
- type: string
- Required
- required
- Description
What type of operation this record wants to perform. The two currently supported types are
createandupdate.
Data Types
| Dataset | Required | Description |
|---|---|---|
| Category | Yes | Needed for all use cases |
| Product | Yes | Needed for all use cases |
| Pricing | No | Optionally required for certain calculated category strategies and storefront integrations |
| Inventory | No | Optionally required for certain calculated category strategies and storefront integrations |