Import and update transactions (commissions)

You can use the Import Transaction option for importing new commissions from a custom CSV file or you can use it to update existing commissions. (E.g. you can update the status of existing commissions, change commission values, etc.)

Table of Content

Formatting CSV file

For importing commissions into your Post Affiliate Pro account you need to use a CSV file (a file with the .csv extension). 
To create or edit the CSV file, we recommend using a simple text editor like Notepad++, SublimeText or a simple text editor that you can find in your operating system. Using a non-rich editor like Excel, LibreOffice, etc. can cause disruptions (changed format, delimiter, etc.) in the final CSV file which can cause commissions not to be imported. 

CSV format example

A CSV file has a fairly simple structure. It's a list of data separated by commas or semicolons. The first row can be used as a header for a better identification of what the values represent, but it is not mandatory. For example: 

Affiliate ID,Campaign ID,Order ID,Commission Value,Total Cost,Status
e3bbfwc5,a3732ac1,ORDER_1,15,100,A
c3521177,12390a1e,ORDER_2,10,80,P
91827869,63721d98,ORDER_3,5,70,D

Special Data values 

To ensure a successful import from the CSV file, it's essential to use the exact data values and format that Post Affiliate Pro recognizes.
  • Commission statuses: 
    • A - for approved status
    • P - for pending status
    • D - for declined status
  • Date format:
    • YYYY-MM-DD HH:MM:SS
    • YYYY-MM-DD
  • Commission types: 
    • I - CPM
    • P - CPM per clicks
    • C - Click
    • S - Sale
    • A - Action
    • B - Signup Bonus
    • U - Recurring
    • F - Referral
    • R - Refund
    • H - Chargeback
    • E - Extra Bonus
  • Tracking methods:
    • 1 - 1st party cookie
    • 3 - 3rd party cookie
    • B - User agent and IP address
    • C - Coupon
    • D - Default affiliate
    • F - Flash cookie
    • I - IP address
    • K - Cookie
    • L - Lifetime referral
    • M - Manually created
    • O - Recurring commission
    • R - Forced parameter
    • S - HTML5 storage
    • U - Unknown tracking

Transaction Import configuration

In the merchant panel > Transactions > Commissions, there is a button labelled "Import Transactions". Clicking on this button opens a new popup with the import configuration screen that consists of: 
 
Import file format
  • here you need to specify the fields from your CSV file. Each field represents one value from CSV (row) separated by a delimiter. You have to set the fields in the same exact order as they are defined in your CSV file.
Import file
  • CSV delimiter - select the delimiter used in your CSV file: comma, semicolon, tab
  • My computer - here you can upload your CSV file for import from your PC
  • Skip first row - if you use a header in the CSV file, mark this option so import starts importing data from the second row
Transaction import settings
  • Compute commissions automatically - if checked, commissions will be calculated automatically from the total cost value and based on the campaign's setting. If you have percentage commissions set in your campaign, then in your CSV file you need to specify the Total Cost value (represents the order value from which commissions are calculated)
  • Match transaction by - Use this option to match the existing commissions to update them. You can match commissions based on their Order ID or Transaction ID. Options:
    • Do not match - all commissions even with the same order ID will be imported
    • Order ID - the import script tries to load existing commissions based on the Order ID defined in the CSV file. If such a commission is found then that commission will be updated based on the CSV data (there has to be only one transaction with the particular order ID. If you have two or more transactions with the same order ID, no commission will be imported. If you don't have any existing commission with the particular order ID defined in the CSV, then a new transaction will be created. If you want to update more transactions with the same Order ID (in case of more tier commissions), use the option "Order ID - All tiers".
    • Transaction ID - works the same way as the Order ID option. If there is a transaction found, then that transaction will be updated based on the import data. If you don't have a transaction with a particular transaction ID, then a new transaction will be created.
    • NOTE: if you set Match transaction by order or transaction ID, there will be two new settings displayed:
      • Status of existing transactions - to specify which transaction statuses should be matched. Possible values are: All, Approved, Pending, and Declined. So, for example, you can approve or decline ONLY pending transactions.
      • Keep status of matched transactions - the status of matched transactions will NOT be updated.
  • Status of imported transactions - with this setting, you can set the status of newly imported transactions or the new status of all matched transactions (updating existing commissions). You can choose from: Approved, Pending, Declined or "From input data" which means you would need to specify status in the CSV file. 
This is how the configuration looks like based on the CSV example above (import NEW commissions with set commissions and statuses in the CSV file):

Importing data

After the configuration is finished, you need to click on the Import button. The import process starts and you will see a little popup with the message: 
 
If the import is successful then you should see a new popup with the message like this. You can close the popup and refresh the commissions list to see new or updated commissions.

 

If the import is unsuccessful, you will see a message with an option to download the error file. In the error CSV file, you will find the reason at the end of each row explaining why the particular commission was not imported.

 

Tips

Saving and loading import format

If you frequently import or update commissions, you probably use the same CSV format each time. To avoid configuring the Transaction Import every time, you can set it up once and save the import format. Next time, you can simply load the saved configuration to speed up the process. 

Finding IDs for your CSV

If you want to specify the campaign ID in CSV and you don't know it, you can find it in the merchant panel > Campaigns > Campaign manager. If you don't see it in the campaigns list, then click on the 'Edit view' above the grid listing and check the "ID". Then just save the view or click the OK button at the bottom of the view configuration. 
In the same way you can find out the affiliate IDs, banner IDs, etc. 

CSV encoding

To prevent any CSV formatting issues, such as those caused by special characters, it is advisable to use UTF-8 encoding in your text editor. This will help ensure that the data is imported correctly. In most editors, you can choose to save the file with the specified encoding option:
×