Bulk imports
Upload members, transactions and products in bulk through the API, and download the records that failed.
Use the import endpoints to load existing data before you go live, for example members and purchase history from your previous loyalty system. Each request uploads one file as multipart/form-data in the file field. The linked guides describe the fields of each file.
| Endpoint | Imports | File format |
|---|---|---|
POST /import/members | Members, with an optional opening balance in points | Import members |
POST /import/transactions | Purchases and returns | Import transactions |
POST /import/products | Your product catalog | Import products |
curl -X POST https://api.staging.scops-loyalty.com/import/members \
-H "X-Api-Key: $SCOPS_API_KEY" \
-F "file=@members.json"The response
The upload returns right away and the import runs in the background.
{
"message": "File uploaded successfully",
"importType": "members",
"uploadedFileKey": "imports/…/source.json",
"validationErrorsKey": "imports/…/validation-errors.json",
"databaseErrorsKey": "imports/…/database-errors.json",
"createdAt": "2026-11-23T10:00:00.000Z"
}Keep both error keys. They point to the files Scops Loyalty writes when it skips records.
Download the errors
When the import has finished, download each file with GET /import/errors/{key}:
curl https://api.staging.scops-loyalty.com/import/errors/imports/…/database-errors.json \
-H "X-Api-Key: $SCOPS_API_KEY" \
-o database-errors.json- The validation errors file lists records that failed validation, such as a missing email or a birth date in the future.
- The database errors file lists records that couldn't be saved, such as a member whose email already exists or a transaction with a duplicate
documentIdentifier. It also has totals: rows in the file, rows imported and rows skipped.
A file that isn't there yet returns 404. Either the import is still running, or it had no errors of that kind.
Imports and campaigns
Imported data runs through your active campaigns, the same as data sent one record at a time:
- Every imported member triggers Registration campaigns, such as a welcome bonus.
- Every imported transaction that is linked to a member triggers Purchase Transaction or Return Transaction campaigns.
Before you import history, deactivate the campaigns that shouldn't apply to it. Otherwise members get welcome bonuses and points for purchases they made in the past.
Tips
- Try the import on staging first, with a few records, and check the error files.
- Import members before transactions, so the transactions can be linked to them.
- Members' opening balances go into the default wallet type, so set up your wallet types first.