Import members

Add many members at once from a JSON file, for example when you move from another loyalty system.

Import members when there are more than you'd create by hand, for example when you move from another loyalty system.

1. Prepare the file

The import file is a JSON array with one object per member.

[
  {
    "email": "ana.petrovic@example.com",
    "firstName": "Ana",
    "lastName": "Petrović",
    "gender": "female",
    "phone": "+381601234567",
    "birthDate": "1990-04-12",
    "loyaltyCardNumber": "100200300",
    "registrationDate": "2024-03-01T10:00:00Z",
    "registeredPlace": "Belgrade store",
    "marketingAgreement": true,
    "dataProcessingAgreement": true,
    "points": 1200,
    "address": {
      "street": "Knez Mihailova 10",
      "city": "Belgrade",
      "postal": "11000",
      "country": "RS"
    },
    "customAttributes": {
      "favouriteStore": "Belgrade"
    }
  },
  {
    "email": "marko.jovanovic@example.com"
  }
]

Fields

Only email is required. Leave out any other field, or set it to null.

FieldFormatNotes
emailTextRequired. A valid email address, at most 90 characters. Must be unique.
firstName, lastNameText
gendermale, female or not_disclosed
phoneTextMust be unique.
birthDateDate, YYYY-MM-DDCan't be in the future.
registrationDateDate and time, ISO 8601For example 2024-03-01T10:00:00Z.
loyaltyCardNumberTextMust be unique.
referralTokenTextMust be unique.
registeredPlaceTextWhere the member signed up.
marketingAgreementtrue / false
dataProcessingAgreementtrue / false
pointsWhole numberOpening balance, for example from your previous loyalty system. It goes into the default wallet type as active units.
addressObjectstreet, address1, address2, city, postal, country
companyObjectname, nip
customAttributesObjectAny key/value pairs.
segmentIdsList of segment IDsAdds the member to these static segments during the import.

2. Upload the file

  1. Go to Members.
  2. Click Import.
  3. In the Upload file dialog, click Choose File, pick your JSON file and click Upload.

Upload file

The message File uploaded successfully confirms that Scops Loyalty received the file.

3. Wait for processing

The import runs in the background. Scops Loyalty checks every record, imports the valid ones and skips the rest. New members appear in the Members list once they are processed.

A record is skipped when:

  • it fails validation, for example a missing or badly formatted email or a birth date in the future;
  • a member with the same email, phone, loyalty card number or referral token already exists;
  • the same value appears twice in the file.

Existing members are never updated by an import. To change them, use PATCH /members/{identifier}.

4. Check the errors

Skipped records are written to error files. When you import through the API, the response has two keys: validationErrorsKey for records that failed validation and databaseErrorsKey for records that couldn't be saved, such as duplicates. Download a file with GET /import/errors/{key} once the import has finished. Bulk imports has an example.

Campaigns

Every imported member counts as a new registration, so active campaigns with the Registration trigger run for them. If you don't want imported members to get a welcome bonus, deactivate that campaign before the import.

Tips

  • Test with a small file first. Import two or three members and check them before you upload the full list.
  • Add segmentIds to put imported members straight into a static segment. To add members who already exist to a segment, use the segment's own upload instead (see Create segment).