Working with agencies (resell)

This is a section on how to take orders from third-party organizations. How to send orders is described in the "Integration" section.

There are several methods to work with third-party order vendors. Working with the organization as a simple webmaster is not recommended, it is better to create a new unit in the "Agencies" section and link all orders to it. This way, you can assign individual charges to large order vendors and provide them with a convenient API.

Simple method of working with agencies

Most affiliate networks suitable method of working at the API level. The platform implements the appropriate tools: the function of adding an order to the system and the function of checking the status of orders. To start working with the Agency, you need:

  1. In the "Agencies" section of your affiliate network, add a new entity. Special user account will be created automatically.
  2. Go to the "People" section, find at the very end of the "Agency" type user and copy the "Login" link from it. Send this link to the Agency's specialists as a "Enter your personal account".
  3. Send the Agency's specialists a link to the API documentation of your network. It looks something like this:
  4. Assist Agency specialists in the integration process by canceling and confirming their test orders.
  5. If necessary, add separate deductions for offers for the new Agency.

This is where the simple part of integration ends. In most cases, this will be enough. Most networks are able to work with such API. But in difficult cases, additional functions can be useful.

Sending an order change request

Some agencies may be at odds with the lead verification API and work at the level of PostBack notifications. Setting up PostBack occurs when editing the Agency.

You can set different types of notifications for the following order statuses: New, Callback, Hold, Accepted, Rejected, Paid, Refund, Deleted.

In the URL, you can use the following replacement codes:

  • {id} - order ID
  • {uid} - order ID in the Agency system
  • {src} - the ID of the source order
  • {time} - current time in UNIX-timestamp format
  • {now} - the current time in the format DD.MM.YYYY HH:MM
  • {reason} - reason for refusal
  • {rcode} - reason for refusal`s code
  • {price} - the total price of the order
  • {count} - number of units in order
  • {cash} - payment amount (only for accepted orders)
  • {mobile} - traffic type: 0 - desktop, 1-mobile
  • {ip} - customer IP
  • {offer:xxx} - the main field of xxx offer from the database
  • {data:xxx} - parameter xxx of the offer
  • {meta:xxx} - order xxx metadata

Although this technology is called PostBack, requests are sent by the GET method.

Receiving orders through your own websites

Some agencies collect orders using your own landing pages. This allows you to leave the bulk of the work on your side and simplify the work of the Agency. Typically, these agencies attract traffic to you from links that contain a unique referral ID and source ID. By ID you can identify the order data. These IDs can be intercepted on the landing page and used to work with agencies. To implement this option, you must modify the ext() function in the config.php file in your landing pages and prelandings.

Suppose that some Agency MyAgency with ID 12 in our system sends traffic on the link like that:

In this link, the maid parameter is responsible for the unique ID of the click, and masrc - for the ID of the transition source.

It`s time to Case study! Advertising Agency Advertstar passed traffic on links of type - where astt was the ID of the click, and astsrc - the ID of the source. Assume that Advertstar works with us under ID 4.

Function ext() should return an array of the form [ 'i' => 12, 'u' => 3255312, 's' => 431 ] where:

  • i - an integer Agency indicator in your system
  • u - a unique click ID or other parameter that the Agency sends and by which it can uniquely identify the conversion. Can contain any characters up to 128 in length.
  • s - transition source ID, an optional parameter required by some agencies. An integer in the range -2147483648 to 2147483647

In this case, the ext() function will take the following form:

function ext() {
  if ( isset( $_GET['astt'] ) ) {
    return array( 'i' => 4, 'u' => filter_var( $_GET['astt'], ), 's' => (int) $_GET['astsid] );
  } elseif ( isset( $_GET['maid'] )) { 
    return array( 'i' => 12, 'u' => $_GET['maid'], 's' => (int) $_GET['masrc'] );
  } else return array();

It is necessary to return an empty array if the Agency is not detected.