curl -i -X POST \ -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \ -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c" \ -F [email protected]/path/to/products.csv \ 'https://api.voucherify.io/v1/products/importCSV'
The CSV file has to include headers in the first line. All properties which cannot be mapped to standard product fields will be added to the metadata object.
Standard product fields mapping
- Create a comma separated value (CSV) file or download our CSV import template. You can find an example template here.
- Supported CSV file headers:
- Name is a required field. The remaining fields in the CSV template are optional.
- Override/Update products' names in Voucherify using this method. Data will be updated for each product included in the CSV file whose source_id matches a Source id in Voucherify. No other data can be updated other than the product name.
- Note that dates and date-time attributes need to be provided in compliance with the ISO 8601 norms. For example, 2022-03-11T09:00:00.000Z or 2022-03-11
- Columns that can't be mapped to standard fields, will be mapped to Custom attributes and added as products' metadata. There is no limit on the number of custom attributes that you can import as metadata.
- To provide the proper data type, you need to add all custom attributes to the metadata schema before importing the file.
- Product attributes (not custom attributes) need to be separated by a comma and enclosed in double quotes, i.e "attribute1,attribute2".
- Headers with metadata names can't contain white-space characters.
- If you import metadata defined in the schema as arrays (multiple), you need to separate each value using a comma, for example:
- array of strings: "subscribed,premium"
- array of numbers: "123,234".
- array of dates: "2000-01-01,2000-01-02"
202 HTTP status code on success. It informs that your request has been accepted and products will be added to the repository asynchronously. To learn about operation status and result, copy the async action ID from the API response and use Get Async Action endpoint.