Reward Points + Referral program
v3.2.9

# Importing Transactions

Our extension allows data importing from other extensions using the CSV data format.

Note

Unfortunately, we can not add a download sample file due to Magento restrictions.

You can get a sample file by creating a manual transaction on Marketing -> Reward Points -> Transaction and then exporting it using Export -> CSV action of the Grid.

How to Import Transactions data

1) Extract data from your Reward Points extension to the CSV file, so that it contains the following columns (each line of that file would consist of transactions):

  • transaction_id - a unique ID of each transaction. Can be simple counter;
  • customer_name - first an last name of the customer;
  • customer_email - email of the customer;
  • customer_group_name - name of the in-store customer group the customer is assigned to;
  • website_id - shall contain not actual Website ID, but its code, according to your M2 store view setup. base is the most common code used by default.
  • amount - the number of points that will be uploaded in the current transaction.
  • amount_used - number of points used. Typically, this is set to 0. If there is no zero value, then the difference between this and the above will be uploaded.
  • comment - comment on current transaction.
  • code - code of action (upload in this case).This is recommended to pick up the same code for all uploaded transactions, so if the upload was incorrect, the transactions could be easily removed.
  • is_expired - whether uploaded points have expired. It is useful when uploading legacy transactions to maintain balance history.
  • is_expiration_email_sent - whether expiration email is sent. Typically 0, as this does not affect uploads.
  • expires_at - This is the expiration date uploaded in the transaction.
  • created_at - date the transaction was made. Extremely useful for uploading legacy transactions.
  • updated_at - date the last transaction was updated. Typically should be the same as the above.

    Note

    If you're importing data from Mirasvit Reward Points extension, you can use special Migration script.

It will extract your data directly into '/tmp/points_export.csv' file. Feel free to change this SQL to suit your needs.

2) Go to System -> Data Transfer -> Import, and on the drop-down menu Entity Type, select Reward Points Transactions. You will see the following options:

  • Import Behavior - defines which action should be performed. Currently supported:

    • Add/Update - adds or updates of transactions (if transaction_id matches);
    • Replace - replaces transactions regardless of their existence.
    • Delete - deletes all transactions with no IDs on the import file. Useful for cleaning up incorrect upload.
      • Validation Strategy:
    • Stop on Error - stops importing, if errors are found;
    • Skip Error Entries - upload data as valid data will be uploaded, while others will be dropped off.
      • Allowed Errors Count - used if Stop on Error is selected, and it determines the number of errors allowed.
      • Field separator, Multiple value separator and Fields enclosure are CSV parameters, make them match your file format.
  • File to Import - specifies the data file to import.

    • Select File to Import - drop here CSV file, that you had exported in the previous step;
    • Images File Directory - used, if links to pictures are used in the file exported. Typically it's not used at all.

    Note

    Magento 2 Import function can have restrictions on the file size. By default, it's only 2M. The best way to increase it is to - open your .htaccess file, and enter the following options (let us make a limit of 40M):

        php_value upload_max_filesize 40M
        php_value post_max_size 40M

    Select appropriate options, and press Check Data. It will conduct data validation.

3) After validation is finished, you will see the messages with errors found under the optionsection. If data validation is passed (errors' quantity did not exceed the Allowed Errors Count parameter), the Import button appears. Press it to import transactions.

Note

You can also upload only the customer's balance. Just treat them as transactions -per customer.