Skip to this section only if you've reviewed previous. It discusses complex use cases for postbacks. In the next section, you can see the full documentation for the APIs that serve postbacks.

Working with duplicates

Sometimes a lead creation postback can trigger twice for the same lead and create an extra duplicate. Sometimes the lead creation postback must fire twice and the two leads need to be managed separately. In both cases, we can use exto parameter - a unique lead ID on the advertiser's side.

Postback example with unique ID:

https://domain.com/api/site/click.json?token=12-abc&click={click}&exto={lead_id}

If both click and unique ID are specified in the postback, the required lead is searched for by their combination. For the same pair of click and ID, a new lead wont be created. The status change function will also find exactly the lead with the desired click and unique ID.

Working with goals

An offer can work with different goals. For example, in addition to the standard "registration + deposit" funnel, additional commissions can be used according to the Revenue Share model.

The goal parameter takes the character ID of the goal. The settings for character goal IDs are made in the "Goals" section of the offer. Each goal can have both the main ID and multiple aliases. This is useful if the target network may use different values for the same action (for example, reg and registration).

Postback example with goal:

https://domain.com/api/site/click.json?token=12-abc&click={click}&goal={goal}

You can use goal parameter both in lead creation postbacks and when changing their status. If you change the goal of approved lead, the commissions for it will be recalculated in accordance with the new goal.

Special status names

When sending the status of a lead via the status parameter, it is recognized automatically. You can change this behavior by directly specifying in the request parameters which statuses are considered as approve, cancel or trash.

  • sta - the status that is recognized as approval
  • stc - the status that is recognized as cancellation of the lead
  • stt - the status that is recognized as trash
  • sth - the status that is recognized as lead on hold
  • stw - the status that is recognized as lead in processing
  • stn - status recognized as a new lead (creates a lead instead of changing the status)

If necessary, you can specify more than one status, but several at once, separated by commas. If no matches are found, the status will be recognized automatically.

Postback example with special approve status:

https://domain.com/api/site/status.json?token=12-abc&click={click}&status={status}&sta=lead_ok

Single postback for all statuses

Simple work with statuses requires the use of at least two postbacks - creating a lead and changing the status of a lead. In some situations, the advertiser allows you to set only one postback - a status change.

The stn parameter will help us. We check with the advertiser what status they use for new leads. For example, it could be new or pending. We put this status in the stn parameter in the postback for changing the status. Such a postback will create a new lead if it receives the status specified in stn.

Postback example for all statuses:

https://domain.com/api/site/status.json?token=12-abc&click={click}&status={status}&stn=new

What is the difference between stn=new and auto=1? When using the stn parameter, a lead is created only if the status matches the one specified in stn and enters the "New" status. When using auto=1, the lead will be created immediately in the required status if no other lead with the same click ID was found.

Special commission for advertiser

In some situations, you may want to keep the advertiser's real commission, but give the webmaster a system-selected commission. To do this, add the pay parameter indicating the advertiser's payout amount. It is also recommended to use the cc parameter to specify the commission currency.

Postback example with advertiser's commission:

https://domain.com/api/site/click.json?token=12-abc&click={click}&pay={payout}&cc={currency}

You can use both the wm parameter and the pay parameter at the same time to directly specify the commissions for the webmaster and advertiser. Using the pay parameter will not change the webmaster's commission.

Working without click ID

In some cases, we do not have a click ID for quality tracking. This often happens when working with applications. In such a situation, you can use the flow identifier in the flow parameter, or the symbolic flow code in the code parameter.

Postback example with flow ID:

https://domain.com/api/site/click.json?token=12-abc&flow=1234

Postback example with flow code:

https://domain.com/api/site/click.json?token=12-abc&code=5FAC-D4E8

When working with a flow, it is recommended to use the exto parameter to specify a unique lead ID. With this method, you can both create lead and change their status by a combination of a flow ID and a unique ID.