curl -X POST \ https://api.voucherify.io/v1/customers/importCSV \ -F [email protected]/path/to/customers.csv \ -H "X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b" \ -H "X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c"
The CSV file has to include headers in the first line. All properties which cannot be mapped to standard customer fields will be added to the metadata object.
Standard customer fields mapping
"Source_id", "Name", "Description", "Email", "City", "Country", "Address Postal Code", "Address State", "Address State", "Address line 1", "Address line 2", "Phone", "Birthday".
In the case you want to update customer's data, you can do it using the CSV file with new data. However, remember to include a customer_id or source_id in your CSV file to manage the update successfully.
Please note that while updating customers using CSV import, when you provide both customer id and source_id in the CSV file, the source_id field will be ignored.
202 HTTP status code on success. It informs that your request has been accepted and customers will be added to the repository asynchronously.
400 HTTP error status code when the CSV file includes incorrect data e.g. with a wrong data type for the metadata properties.