Postbacks are configured on the advertiser's side — in a personal account or through a personal manager. You can get postback samples on the redirect site settings page.
Postback basis: click ID
The most important element of a postback is the click identifier. Before configuring a postback, you need to find out exactly what it looks like in your case. It can be found in the postback documentation.
Most often, the macro for the click ID will be the same as the parameter you used in the redirect URL, but in curly brackets. For example, in the link it is specified as sub1={click}; in the postback, it will be click={sub1}.
The easiest option: ask your personal manager at the target network for the macro you need. If it's missing, refer to the documentation.
Further on in this text, we'll assume the macro for the click ID looks like {click}, and that macros for other parameters are also given in curly brackets.
SOI postback
The easiest postback that creates a confirmed lead. Used in dating offers, with payment on the site, in applications with payment for registration.
General view of SOI postback:
https://domain.com/api/site/click.json?token=12-abc&click={click}&accept=1
The accept=1 parameter is responsible for automatic confirmation of the lead at the time it is received. You can skip it and instead enable the “Automatically approve all incoming leads” option in the offer settings — the effect will be the same.
DOI postback
A pair of postbacks is used: the first creates a pending lead, the second approves it. This is the most popular option. Used in offers with confirmed registration, payment for the first deposit, the achievement of a baseline or any other option in which the profile is approved after registration.
Lead creation postback: “Registration”
https://domain.com/api/site/click.json?token=12-abc&click={click}
Lead approval postback: “Deposit”
https://domain.com/api/site/status.json?token=12-abc&click={click}&status=approve&auto=1
The status=approve parameter is responsible for approving the previously created lead. The auto=1 parameter is responsible for creating a new lead if, for some reason, the registration postback was lost (it happens).
Please note: the postback that creates a lead uses the click function, while the postback that changes the lead status uses the status function.
Postback with status
This is an extension of the DOI postback option. A pair, or several postbacks, may be used. The postbacks for lead creation (registration) and lead approval (deposit) remain the same. A couple of new postbacks are added:
Valid lead cancellation postback: “Cancel”
https://domain.com/api/site/status.json?token=12-abc&click={click}&status=cancel&auto=1
Invalid lead cancellation postback: “Trash”
https://domain.com/api/site/status.json?token=12-abc&click={click}&status=trash&auto=1
In the status parameter, you can pass a variety of values; the automation will try to recognize them and map them to the appropriate status. You can use the {status} macro on the target network's side in combination with the status parameter.
Postback with smart status change by macro:
https://domain.com/api/site/status.json?token=12-abc&click={click}&status={status}&auto=1
Adding payout amount
You can receive the payout amount for the affiliate directly in the postback. To do this, add the wm parameter with the payout amount and cc with the ISO code of the payout currency.
Postback with payout specified:
https://domain.com/api/site/click.json?token=12-abc&click={click}&wm={payout}&cc={currency}
The payout can be added both to the status-change postback and to the lead-creation postback.
Please note: if the payout is passed in the postback, it overwrites the payout determined by the system. To set the affiliate commission, use “Manual payments”.
Adding country
Sometimes the payout amount depends on the country, and the country is determined on the target network's side by the phase of the fifth moon of Saturn. You can add the country parameter to the postback with the ISO code of the recipient's country.
Postback example with country code:
https://domain.com/api/site/click.json?token=12-abc&click={click}&country={geo}
Using the exact indication of the country, you will not need to use manual payments settings.
Adding order price
Important! Order price is not the same as the commission amount. It's the receipt total for product leads, or the deposit amount. Percentage-based commissions can be calculated from the order price.
Postback example with lead price:
https://domain.com/api/site/click.json?token=12-abc&click={click}&base={price}¤cy={currency}
The base parameter carries the order's receipt amount, and the currency parameter carries the ISO code of the order currency.
Global postback
Sometimes you need to connect several offers, but you can only set one postback for all. In this case, the global postback key comes in handy. Go to Control — Settings — Sites. Toward the bottom of the page, find the “Global API key” field in the “Technical settings” block. Put it in the token parameter of the postback URL.
For example, it was:
token=123-2fc78e4643ec1f8b6a8039e09d39dcc3
We change it to:
token=jkUYwu9EBECEolXfnL9GIuwgiOJiB0rG
The numbers and the hyphen are also removed. What remains is just the key — a strange set of characters.
Checking postbacks
After setting up postbacks, it is recommended to check if they work correctly. To do this, go to Control — Settings — API Requests. Here, choose to search by the site application. You are interested in the click and status functions. You can find the requests you need by specifying the ID of the site for which the postback was created.
Life hack for global postbacks: you can add a z parameter to the postback with an arbitrary value. For example, specify the name of the affiliate network you work with. The search for the z parameter is performed through the Tag field. However, the use of the tag is recommended for any postbacks.
Postback example with tag:
https://domain.com/api/site/click.json?token=12-abc&click={click}&z=BestNetwork