Offers

On this page

These functions return what you see in the Offers section of your account: the list of offers, rates by country and goal, landings and prelandings. Use them to export the offer catalog to your own tool (a spreadsheet, a bot, a dashboard, a tracker) and to get an offer's ready-made sites for your own hosting. The offer app provides all of this with five functions.

The request rules, the token and the response format are on the General API rules page. The same page lists the common errors of API login: key (the token is wrong) and ban (the account is blocked). Any function below can return them, so the error tables of the functions do not repeat them. The order phases that the metrics refer to are in the value reference.

Export the catalog to your tool#

  1. Call offer/list. One request returns your whole visible catalog in brief: ID, name, category, CPA model, GEO and metrics.

  2. For the offers you need, call offer/show with the offer parameter. It returns rates, sites, products and traffic sources. Request offers one at a time.

  3. If you need only names for report labels, use offer/names. Its response is much shorter.

  4. Store the responses on your side and refresh them on a schedule, not before every operation. The catalog is a heavy response, and the network does not recalculate offer metrics right away anyway.

Get ready-made sites#

  1. Call offer/sites with the offer ID and pick a landing or prelanding with archive: true. Its id is the site parameter.

  2. Get the ID of your flow for this offer. wm/flows returns the list of flows, and wm/add creates a new one.

  3. Call offer/download with the site and flow parameters. The response is a ZIP archive with the ready-made site. The flow must be for the same offer as the site. A landing from such an archive contains api.php with your token. The token opens your whole API, so the archive is personal. Do not publish it and do not upload it anywhere other people can see it (details).

  4. Unpack the archive into an empty folder on your PHP hosting and connect a domain to it (how to install). The pages contain your token, so upload them only to your own tracker that nobody else can access.

What the catalog contains#

The catalog holds only the network's own offers that are enabled and have unblocked traffic. The offer's privacy narrows the list further:

  • A public offer is visible and available to everyone except those the administrator put on its black list, either an individual affiliate or a whole team.
  • A request-only offer is visible in the catalog, but you can work with it only with permission. Until access is granted, it comes with private: true and available: false.
  • A private offer is visible and available only to those on its white list. Everyone else does not see it at all.

Regardless of privacy, the administrator can limit a team to a set of offers or categories. Then the affiliates of that team see only those.

Two response fields tell these states apart. private shows that the offer is not public, and available shows that you may drive traffic to it and submit leads. An offer with available: false is visible in the catalog and you can look at its rates, but you cannot work with it until you get access.

The network recalculates the epc, cr and appr metrics on a schedule over a rolling period. The administrator sets its length from 7 to 90 days, 15 by default.

  • cr is conversion: the number of the offer's orders excluding trash, divided by the number of clicks on its landings, as a percentage.
  • epc is the average income per click: the affiliates' commissions for orders in the “Hold” and “Approve” phases, in the network's main currency, divided by the same number of clicks.
  • appr is the approval rate: the share of orders in the “Hold” and “Approve” phases among all of the offer's orders excluding trash.

offer/listShort list of offers#

GETPOSThttps://lk.dalead.pro/api/offer/list.json?id={token}

A short list of all offers visible to you in the catalog: name, category, CPA model, GEO and three metrics. It has no rates, sites or products. It is a storefront for choosing an offer. Get the details of the chosen offer from offer/show.

The list comes whole. The function has no parameters, so you cannot filter it or split it into pages. Store the response on your side and refresh it on a schedule.

Request

https://lk.dalead.pro/api/offer/list.json?id={token}

Response

JSON
{
  "status": "ok",
  "data": {
    "67": {
      "id": 67,
      "private": false,
      "available": true,
      "cid": 13,
      "cat": "Gifts and fun",
      "name": "Catnip Cola sparkling drink",
      "short": "Catnip Cola",
      "model": "cpl",
      "country": [
        "gb",
        "au"
      ],
      "epc": 0,
      "cr": 0,
      "appr": 0
    },
    "76": {
      "id": 76,
      "private": true,
      "available": false,
      "cid": 6,
      "cat": "Electronics and gadgets",
      "name": "Maine Coon Gadgets smart feeder",
      "short": "Maine Coon Gadgets",
      "model": "cps",
      "country": [
        "mx",
        "au"
      ],
      "epc": 0,
      "cr": 0,
      "appr": 0
    }
  }
}
Field Description
status Result of the operation: ok on success, error on failure.
error Error code for the error status (see below).
data Offers: an object keyed by offer ID. If you see no offers, an empty array [] comes instead.

Response fields.

Main fields of the offer:

Field Description
id Offer ID.
cid ID of the offer's category.
cat Category name.
name Full name of the offer, or the short name if the full one is not set.
short Short name of the offer.
model The offer's CPA model as a code: cps, cpl, cpv, cpa, cod, cor, or cpx if no model is set.
country GEO of the offer: an array of two-letter country codes. A single element ww means the whole world.
epc Average income per click in the network's main currency.
cr Conversion in percent.
appr Approval rate.
private true if the offer is not public: private or request-only.
available true if you may work with the offer. false means the offer is visible in the catalog, but you must get access to it.

Offer object.

offer/namesOffer names#

GETPOSThttps://lk.dalead.pro/api/offer/names.json?id={token}

A lightweight lookup of offer IDs and short names. Use it when you do not need the full catalog, for example to label an offer in a report or to check an ID before you submit a lead. Its response is much shorter than that of offer/list, so you can request it more often.

Unlike the other functions on this page, this lookup lists only the offers you may work with. Request-only offers you do not have access to yet are not in it. Names are in alphabetical order. The function has no parameters.

Request

https://lk.dalead.pro/api/offer/names.json?id={token}

Response

JSON
{
  "status": "ok",
  "data": {
    "67": "Catnip Cola",
    "65": "Claw Quest",
    "70": "Kitty Cam Pro"
  }
}
Field Description
status Result of the operation: ok on success, error on failure.
error Error code for the error status (see below).
data Offer names: an object keyed by offer ID, with the short name as the value. If no offers are available to you, an empty array [] comes instead.

Response fields.

offer/showFull offer data#

GETPOSThttps://lk.dalead.pro/api/offer/show.json?id={token}

The whole offer: rates by country or goal, landings and prelandings, and for some offers also product variants, hold and traffic sources. An external system uses this function to build its own catalog and to find out how much commission an order brings and where to send traffic.

A request without offer returns all offers visible to you, including those with available: false, and for each one the full rate table, sites and products. Such a response is very heavy, so request offers one at a time and run the full export rarely, on a schedule. Offers are sorted alphabetically by short name.

The rates in the response are already calculated for you. The response applies special rules: for individual affiliates, teams, VIP affiliates, agencies and affiliates invited by a VIP affiliate, as well as rules with a limited term. So one offer can return different rates to different affiliates.

Parameters

ParameterTypeReq.Description
offerint—Offer ID. If omitted or zero, all offers visible to you are returned, including those with available: false.

Request

One offer
https://lk.dalead.pro/api/offer/show.json?id={token}&offer=68

Response

JSON
{
  "status": "ok",
  "data": {
    "68": {
      "id": 68,
      "private": false,
      "available": true,
      "cid": 7,
      "cat": "Home appliances",
      "name": "Meow Air Purifier for pet homes",
      "short": "Meow Air Purifier",
      "model": "cps",
      "epc": 0,
      "cr": 0,
      "appr": 0,
      "country": [
        "fr",
        "de",
        "pl"
      ],
      "hold": 7,
      "land": {
        "418": {
          "id": 418,
          "url": "https://meow.pro/meow-air-purifier-classic-landing/",
          "name": "Classic landing",
          "epc": 0,
          "cr": 0,
          "approve": 0,
          "mobile": 0,
          "default": false,
          "local": true,
          "archive": true
        },
        "419": {
          "id": 419,
          "url": "https://meow.pro/meow-air-purifier-comparison-landing/",
          "name": "Comparison landing",
          "epc": 0,
          "cr": 0,
          "approve": 0,
          "mobile": 0,
          "default": false,
          "local": true,
          "archive": false
        }
      },
      "space": {
        "421": {
          "id": 421,
          "url": "https://meow.pro/meow-air-purifier-vet-review/",
          "name": "Vet review",
          "epc": 0,
          "cr": 0,
          "approve": 0,
          "mobile": 0,
          "default": false,
          "local": true,
          "archive": false
        }
      },
      "geo": {
        "fr": {
          "code": "fr",
          "name": "France",
          "price": 89,
          "currency": "eur",
          "cr": 0,
          "epc": 0,
          "approve": 0,
          "desktop": {
            "base": 17,
            "upsale": 0,
            "xsale": 0,
            "percent": 0,
            "currency": "usd"
          },
          "mobile": {
            "base": 23,
            "upsale": 0,
            "xsale": 0,
            "percent": 0,
            "currency": "usd"
          }
        },
        "pl": {
          "code": "pl",
          "name": "Poland",
          "price": 379,
          "currency": "pln",
          "cr": 0,
          "epc": 0,
          "approve": 0,
          "desktop": {
            "base": 19,
            "upsale": 0,
            "xsale": 0,
            "percent": 0,
            "currency": "usd"
          },
          "mobile": {
            "base": 25,
            "upsale": 0,
            "xsale": 0,
            "percent": 0,
            "currency": "usd"
          }
        }
      },
      "goods": {
        "103": {
          "id": 103,
          "name": "Purifier Max",
          "tid": 0,
          "type": "Main",
          "price": {
            "fr": 129,
            "pl": 549
          }
        },
        "104": {
          "id": 104,
          "name": "Spare Filter Set",
          "tid": 1,
          "type": "Additional",
          "price": {
            "fr": 27,
            "pl": 114
          }
        }
      },
      "allow": {
        "1": "Desktop traffic",
        "6": "Context ads"
      },
      "deny": {
        "7": "Teaser ads"
      }
    }
  }
}
Offer with goals by country
{
  "status": "ok",
  "data": {
    "72": {
      "id": 72,
      "private": true,
      "available": true,
      "cid": 2,
      "cat": "Games",
      "name": "Black Panther Slots online casino",
      "short": "Black Panther Slots",
      "model": "cps",
      "epc": 0,
      "cr": 0,
      "appr": 0,
      "country": [
        "gb",
        "de",
        "br"
      ],
      "hold": 7,
      "land": {
        "432": {
          "id": 432,
          "url": "https://meow.pro/black-panther-slots-classic-landing/",
          "name": "Classic landing",
          "epc": 0,
          "cr": 0,
          "approve": 0,
          "mobile": 0,
          "default": false,
          "local": true,
          "archive": false
        }
      },
      "space": [],
      "goal": {
        "reg": {
          "code": "reg",
          "name": "Registration",
          "price": false,
          "currency": false,
          "geo": {
            "gb": {
              "code": "reg-gb",
              "name": "United Kingdom",
              "price": false,
              "currency": "gbp",
              "cr": 0,
              "epc": 0,
              "approve": 0,
              "desktop": {
                "base": 6,
                "upsale": 0,
                "xsale": 0,
                "percent": 0,
                "currency": "usd"
              },
              "mobile": {
                "base": 6,
                "upsale": 0,
                "xsale": 0,
                "percent": 0,
                "currency": "usd"
              }
            }
          }
        },
        "dep": {
          "code": "dep",
          "name": "Deposit",
          "price": false,
          "currency": false,
          "geo": {
            "gb": {
              "code": "dep-gb",
              "name": "United Kingdom",
              "price": false,
              "currency": "gbp",
              "cr": 0,
              "epc": 0,
              "approve": 0,
              "desktop": {
                "base": 45,
                "upsale": 0,
                "xsale": 0,
                "percent": 0,
                "currency": "usd"
              },
              "mobile": {
                "base": 45,
                "upsale": 0,
                "xsale": 0,
                "percent": 0,
                "currency": "usd"
              }
            }
          }
        }
      },
      "allow": {
        "3": "Websites",
        "2": "Mobile traffic"
      },
      "deny": {
        "9": "Social targeting",
        "7": "Teaser ads"
      }
    }
  }
}
Request-only offer, access not granted (site fields omitted)
{
  "status": "ok",
  "data": {
    "76": {
      "id": 76,
      "private": true,
      "available": false,
      "cid": 6,
      "cat": "Electronics and gadgets",
      "name": "Maine Coon Gadgets smart feeder",
      "short": "Maine Coon Gadgets",
      "model": "cps",
      "epc": 0,
      "cr": 0,
      "appr": 0,
      "country": [
        "mx",
        "au"
      ],
      "hold": 14,
      "geo": {
        "mx": {
          "code": "mx",
          "name": "Mexico",
          "price": 1490,
          "currency": "mxn",
          "cr": 0,
          "epc": 0,
          "approve": 0,
          "desktop": {
            "base": 10,
            "upsale": 0,
            "xsale": 0,
            "percent": 0,
            "currency": "usd"
          },
          "mobile": {
            "base": 10,
            "upsale": 0,
            "xsale": 0,
            "percent": 0,
            "currency": "usd"
          }
        },
        "au": {
          "code": "au",
          "name": "Australia",
          "price": 129,
          "currency": "aud",
          "cr": 0,
          "epc": 0,
          "approve": 0,
          "desktop": {
            "base": 18,
            "upsale": 0,
            "xsale": 0,
            "percent": 0,
            "currency": "usd"
          },
          "mobile": {
            "base": 18,
            "upsale": 0,
            "xsale": 0,
            "percent": 0,
            "currency": "usd"
          }
        }
      },
      "allow": {
        "1": "Desktop traffic",
        "2": "Mobile traffic"
      },
      "deny": {
        "12": "E-mail marketing"
      }
    }
  }
}
Field Description
status Result of the operation: ok on success, error on failure.
error Error code for the error status (see below).
data Offers: an object keyed by offer ID. If no offer matches the request, an empty array [] comes instead. This includes the case when an offer with that ID exists but is not visible to you.

Response fields.

All offer fields sit in one object. Below they are split into groups for easier reading. Fields that some offers and networks do not have are described in Additional fields.

Offer:

Field Description
id, cid, cat, name, short, model, country, epc, cr, appr The same fields as in offer/list.

Main offer fields.

Rates by country. Each rate is a separate row keyed by a two-letter country code or ww (the whole world):

Field Description
geo Rates by country: an object keyed by country code, with a rate row as the value. Offers with goals get goal instead, see Additional fields.

Rates.

Rate row:

Field Description
code Row code: the country code for regular offers, the goal code for offers with goals, and goal-country if goals are also split by country, for example dep-gb.
name Name of the country or goal.
price Product price for the customer or conversion price for the goal, in the currency currency. A number or a string like "111.00". false if no price is set.
currency Three-letter code of the price currency, or false if the currency is not defined.
cr Conversion for this country or goal, in percent.
epc Average income per click for this country or goal.
approve Approval rate for this country or goal.
desktop Rates for desktop traffic (an object, see below).
mobile Rates for mobile traffic (an object, same structure).

Rate row.

The desktop and mobile objects:

Field Description
base Base rate per order in the currency currency.
upsale Extra for each unit of the main product starting from the second.
xsale Extra for each unit of an additional product.
percent Rate as a percentage of the order total, from -100 to 100.
currency Three-letter code of the rate currency. If the rate has no currency of its own, the network's main currency comes instead.

desktop and mobile rates.

If the offer does not distinguish mobile from desktop traffic, both objects are the same.

Sites. Both fields are present in every offer and are empty for an offer without sites:

Field Description
land Landings of the offer: an object keyed by site ID.
space Prelandings of the offer: an object keyed by site ID.

Offer sites.

The site object has the same structure as in the offer/sites response.

Additional fields

Not every offer and not every network has these fields. The network administrator turns on goals, hold, products and traffic source restrictions. The private, available and hold fields always come, and the rest come only if the offer has something to show.

Field Description
private, available The same fields as in offer/list. Not every network has private and request-only offers.
hold Hold in days: the period during which the commission for an approved order is not credited to your balance. false means no hold. Always present. If you have an individual hold, you get exactly that one.
goal Rates by goal, for offers with goals. Comes instead of geo: an offer has exactly one of the two fields. An object keyed by goal code.
goods Product variants: an object keyed by variant ID. Offers without product variants do not have this field.
allow Allowed traffic sources: an object keyed by source ID, with its name as the value. The field is absent if the offer does not narrow the list of sources.
deny Forbidden traffic sources in the same form. The field is absent if there are none.

Additional offer fields.

What goal contains. If goals are not split by country, the value is a rate row right away, with the code field equal to the goal code. If goals are also split by country, as in offer 72 in the example above, the value is a goal object:

Field Description
code Goal code.
name Goal name.
price Conversion price for the goal, or false if the price is set per country and not on the goal.
currency Three-letter code of the price currency, or false if the goal has no currency.
geo Rates by country for this goal: an object keyed by two-letter country code, with a rate row as the value.

Goal object.

Product variant object:

Field Description
id Variant ID. You put it into the order contents when submitting a lead.
name Variant name.
tid Variant type: 0 for the main product, 1 for an additional product, 2 for delivery.
type Name of the variant type.
price Variant prices by country: an object keyed by two-letter country code, with the price of one unit in that country's currency as the value. Only countries with a price set are included. If there are no prices at all, an empty array [] comes instead.

Product variant.

offer/sitesOffer sites#

GETPOSThttps://lk.dalead.pro/api/offer/sites.json?id={token}

Landings and prelandings of one offer. Use this function when you already know the rates and products and only need to refresh the list of sites, for example before you create a flow or to choose a site to download.

An offer's sites fall into two groups. A landing is the destination page with the order form, and the lead comes from it. A prelanding (also called a presell page) is an intermediate page, such as a review, an article, a quiz or a news story, that warms the visitor up to the purchase and sends them on to the landing. In a pair, the visitor first lands on the prelanding and moves from there to the landing. The landing is required in a pair, the prelanding is not.

The land group collects landings of all kinds: the network's physical sites, redirect pages to an external address and TDS pages. You can tell them apart by the local field. Sites hidden from the lists and private sites you have no access to are not returned. Sites are sorted alphabetically by address.

The address in the url field is the address of the page itself, not a link for traffic. It is there so you can look at the site. You send traffic to your flow URL (wm/flows), and you choose the landing and prelanding in the flow settings (wm/edit) by entering the IDs from this response.

Parameters

ParameterTypeReq.Description
offerintyesOffer ID.

Request

https://lk.dalead.pro/api/offer/sites.json?id={token}&offer=68

Response

JSON
{
  "status": "ok",
  "land": {
    "418": {
      "id": 418,
      "url": "https://meow.pro/meow-air-purifier-classic-landing/",
      "name": "Classic landing",
      "epc": 0,
      "cr": 0,
      "approve": 0,
      "mobile": 0,
      "default": false,
      "local": true,
      "archive": true
    },
    "419": {
      "id": 419,
      "url": "https://meow.pro/meow-air-purifier-comparison-landing/",
      "name": "Comparison landing",
      "epc": 0,
      "cr": 0,
      "approve": 0,
      "mobile": 0,
      "default": false,
      "local": true,
      "archive": false
    }
  },
  "space": {
    "421": {
      "id": 421,
      "url": "https://meow.pro/meow-air-purifier-vet-review/",
      "name": "Vet review",
      "epc": 0,
      "cr": 0,
      "approve": 0,
      "mobile": 0,
      "default": false,
      "local": true,
      "archive": false
    }
  }
}
Offer with a redirect to an external address (some sites not shown)
{
  "status": "ok",
  "land": {
    "429": {
      "id": 429,
      "url": "https://meow.pro/tabby-credit-classic-landing/",
      "name": "Classic landing",
      "epc": 0,
      "cr": 0,
      "approve": 0,
      "mobile": 0,
      "default": false,
      "local": true,
      "archive": false
    },
    "438": {
      "id": 438,
      "url": "https://meow.pro/tabby-credit-partner-redirect/",
      "name": "Partner redirect",
      "epc": 0,
      "cr": 0,
      "approve": 0,
      "mobile": 0,
      "default": false,
      "local": false,
      "archive": false
    }
  },
  "space": {
    "431": {
      "id": 431,
      "url": "https://meow.pro/tabby-credit-money-blog/",
      "name": "Money blog",
      "epc": 0,
      "cr": 0,
      "approve": 0,
      "mobile": 0,
      "default": false,
      "local": true,
      "archive": false
    }
  }
}
Error: the offer is not available to you yet
{
  "status": "error",
  "error": "access-denied"
}
Field Description
status Result of the operation: ok on success, error on failure.
error Error code for the error status (see below).
land Landings of the offer: an object keyed by site ID. An empty array [] if there are no matching sites.
space Prelandings of the offer in the same form.

Response fields.

A nonexistent offer ID gives access-denied, the same as an unavailable one. An offer with no matching sites gives ok with two empty arrays.

Contents of the site object:

Field Description
id Site ID. You use it in flow settings, in statistics filters and in offer/download.
url Full address of the site with the scheme and a trailing slash.
name Site name. Can be an empty string.
epc Average income per click for this site in the network's main currency.
cr Conversion of the site in percent.
approve Approval rate for this site.
mobile Mobile support of the site: 0 for not meant for mobile devices, 1 for redirects to a mobile version, 2 for optimized for mobile devices, 3 for responsive design that works on any device.
default true if this is the offer's default site. It is filled into a new flow.
local true if the site is hosted on the network's servers (a landing or prelanding). false means a redirect or TDS that leads to an external address.
archive true if an archive is prepared for the site and you can download it through offer/download.

Site object.

Errors

CodeWhat happenedWhat to do
no-offerThe offer parameter is missing or zero.Pass the offer ID.
access-deniedThe offer catalog is hidden from affiliates by the network settings, the offer does not exist, or you may not work with it.Check available in offer/list.

offer/downloadDownload an offer site#

GETPOSThttps://lk.dalead.pro/api/offer/download.json?id={token}

Returns an offer's landing or prelanding as a ready-made ZIP archive: a site you can deploy on your own hosting and send traffic to. Sites with archive: true in the offer/sites response qualify. The download button in your account does the same: Downloading ready-made sites.

The archive is built personally for you. If you pass flow, it is tied to your flow. The pages get the pixels and the header and footer code from the flow settings, the prices, the flow's tags and the visit counter, and the landing gets api.php, which submits orders on your behalf. The archive is rebuilt on every request, so download it again after you change the flow settings. Agency only: api.php and the visit counter are added even without flow, see the warning below for details.

Your token is in api.php

The api.php file in an archive with flow submits orders on your behalf, and your token is written in it in plain text, in the request URLs. The token opens your whole API: statistics, leads and flows. That is why such an archive is personal:

  • Do not publish the archive or its files. Do not post them in chats, on file-sharing sites, in repositories or in shared folders.
  • Host the archive only on your own hosting. Do not upload it to trackers or hosting that other people can access.
  • After unpacking, delete the .zip itself from the hosting if it sits in a folder reachable at the site's address.
  • If the archive could have fallen into the wrong hands, reset your API key in your profile. The old token stops working immediately, and you will have to download the archives again.

An affiliate's archive without flow has no api.php, so it has no token either.

Agency only: the landing has api.php even without flow. It submits orders for the site's offer, and the agency's token is written in it in plain text the same way, so such an archive is personal too. For an agency, the visit counter is in the pages even without flow.

Orders from the landing go through leads/add, so its conditions apply: you must be allowed to submit leads by API, and the offer must accept leads by API. A prelanding does not submit orders and does not need to.

Parameters

ParameterTypeReq.Description
siteintyesID of a landing or prelanding from offer/sites. The site must have a ready archive (archive: true).
flowint—ID of your flow. The flow must be for the same offer as the site. The network accepts a flow for another offer without an error, but prices and the name are taken from the flow's offer, not the site's, so they come out empty or wrong, and api.php submits orders for the flow's offer. Without flow, an affiliate's landing has no api.php and no prices or offer name filled in (an agency has api.php even without it, see What is inside the archive). Someone else's flow or a nonexistent one is silently ignored, and the archive is built as if there were no flow.
trackerint—The tracker the archive is prepared for: from 0 to 6, see Trackers. Default is 0. A value outside the range 0 to 6 acts as 0 in the pages, but addtracker does not work with it: it turns on only when tracker is omitted or zero.
addtrackerbool—Embed a visitor check in the pages by the flow settings (tracker and cloak) and put the flow's white site into the archive if one is set. Works only together with flow and without tracker. Pass 1.
geostring—Two-letter country code for filling in prices and currency, for example pl. Case does not matter: PL and pl give the same result. By default the first country from the offer's country is used. An offer for the whole world (country: ["ww"]) has no default country: without geo nothing is filled in, and the placeholders stay in the pages as they are. If you pass geo empty, the placeholders are not filled in either. If the offer has no price for this country or the code is unknown, the price stays empty, but the currency is still filled in (for an unknown code, the network's main currency).
shortbool—Pixels without JavaScript: image pixels are inserted instead of scripts, and they load faster. Pass 1.
nopagebool—Pixels only on the “Thanks” page. The site's own pages keep only the code that remembers the pixel IDs. Pass 1.
nopixelbool—Do not add pixels at all. Pass 1.

For short, nopage and nopixel, any value except empty and 0 turns the parameter on, including the word false. To turn a parameter off, do not pass it at all.

Request

Landing for your own flow
https://lk.dalead.pro/api/offer/download.json?id={token}&site=404&flow=80
For Keitaro (subid), prices for Poland
https://lk.dalead.pro/api/offer/download.json?id={token}&site=404&flow=81&tracker=1&geo=pl
Landing: pixels without JavaScript and only on the “Thanks” page
https://lk.dalead.pro/api/offer/download.json?id={token}&site=404&flow=80&short=1&nopage=1
Landing for Binom (clickid)
https://lk.dalead.pro/api/offer/download.json?id={token}&site=426&flow=92&tracker=4

Response

A successful response is the ZIP file itself with the Content-Type: application/zip header and no status envelope. The server does not set a file name, so save the response under any name, as in the examples above (site.zip). The extension in the URL (.json, .xml) does not affect a successful response. An error comes in the usual envelope in the format that the extension sets: with .json it is JSON with Content-Type: application/json, with .xml it is XML with Content-Type: application/xml. The HTTP code stays 200 either way (more about the envelope). So tell the archive from the error by Content-Type, not by the HTTP code.

Error: the site has no archive
{
  "status": "error",
  "error": "no-archive"
}
Error: no site passed
{
  "status": "error",
  "error": "no-site"
}

Errors

CodeWhat happenedWhat to do
no-siteThe site parameter is missing or zero.Pass a site ID from offer/sites.
no-archiveThe site has no ready archive, the site does not exist, or the archive file is unavailable.Choose a site with archive: true. If the error persists for such a site, contact the network's support.
inactiveThe site's offer is disabled.Choose a site of another offer.
access-deniedThe offer or the site is not available to you.Check the offer's available in offer/list.

API login errors (key, ban and others) are common to all functions: General API rules.

Price and name substitution

In the source sites, prices and the offer name are set as the placeholders [PRICE], [OLDPRICE], [DISCOUNT], [CURRENCY], [GEO] and [OFFERNAME] (for a product variant, [PRICE<variant ID>] and so on). On download, the placeholders are replaced with values: the price, the old price, the discount in percent, the currency and the country. The price comes from your flow prices, and if there are none, from the offer's prices for the chosen country. The geo parameter sets the country, by default the offer's first country. An offer for the whole world has no default country, and without geo the placeholders are not replaced at all. Prices and the offer name come from your flow's offer, so without flow those places stay empty, while [CURRENCY] and [GEO] are still filled in. The price spot is also empty when geo is wrong or the offer has no price for that country. Placeholders in square brackets stay in the pages only when the country is not defined (geo is passed empty or an offer for the whole world is downloaded without geo).

Trackers

If you send traffic through a tracker, the tracker parameter prepares the archive for it. Every form gets a hidden field with the tracker macro, and the prelanding links point to the tracker macro instead of the network address. The tracker itself replaces the macros in curly braces when it serves the page to a visitor. If the pages are on ordinary hosting, the macros stay in them as they are. To connect a site to a tracker, see Third-party trackers.

tracker Tracker Hidden form field Prelanding link
0 Any Not added. If the flow's SubID setting is {subid}, subid = {subid} is added Network address
1 Keitaro (subid) subid = {subid} {offer}
2 Keitaro (utm_term) utm_term = {subid} {offer}
3 Keitaro (utm_medium) utm_medium = {subid} {offer}
4 Binom (clickid) subid = {clickid} {offer_link}
5 Binom (clickid+campaign) subid = {clickid}, utm_campaign = {campaign} {offer_link}
6 AlterCPA Red sub1 = {click} Network address

Values of the tracker parameter.

What is inside the archive

The site files sit right in the archive root, with no common folder. Here is what a landing downloaded with flow looks like:

api.php
index.php
style.css
success.php

In this example the site has one page, index.php, and its styling is in a single file, style.css. Your site may have more pages, folders and files.

File What it is
index.php and other .php files in the root Site pages. Each one has the prices, offer name and country, the pixels and flow codes, and the hidden tracker fields filled in. The form goes to api.php together with all the tags from the page URL.
success.php The “Thanks” page that api.php sends the visitor to after an order. It comes from the site, and a standard one is used if the site has none. Every landing has it. A prelanding has it only if the source site had it.
api.php Receives the form and passes the order to leads/add on behalf of your flow, filling in the flow's tags (for example utm_source) if the visitor came without them. Present only in a landing downloaded with flow. Contains your token. Agency only: the file is present even without flow, with the agency's token.
Other folders and files (css, images, js, fonts) Site styling, unchanged. The archive leaves files in subfolders as they are.
White site folder Only with addtracker, if the flow has a white site set.

Archive files.

What gets added to the pages:

  • Pixels and counters from the flow settings. You can also pass the ID in the page URL, for example ?fb=123456789012345, and it is remembered in a cookie for 30 days. For more, see Tags and pixels.
  • Header and footer codes from the flow settings. The block between <!--site--> and <!--/site--> goes only to the site pages, and the block between <!--thanks--> and <!--/thanks--> goes only to the “Thanks” page.
  • Flow tags in api.php: utm_source and others set in the flow are added to the order if the visitor came without them.
  • Visit counter: at the end of every page, a request goes to the network so the visit is counted in the flow statistics. It is absent without flow. Agency only: it is present even without flow.
  • A prelanding does not get api.php. Instead, the pages begin with an address for links: the address of this prelanding in the network with your flow number (flow) and the from flag. The network uses them to learn which flow and which site the visitor came from. Without flow, the placeholder XXX stays in this link in place of the flow number. Agency only: the link has the agency's connection number (exti) in place of XXX.
  • With addtracker, a visitor check based on the flow's filtering and Trafback settings is embedded at the start of every page. The page then shows the site or a white page, or redirects the visitor.

If the network did not accept the order, the visitor still lands on success.php, but the URL has status=error and the error code from leads/add, and the pixels on the page do not fire.

How to install on your hosting

  1. Prepare the hosting.

    You need hosting or a server with PHP and the cURL extension that serves your domain. For a landing, the hosting must permit outgoing requests, because api.php calls the API of your network.

  2. Unpack the archive into the site folder.

    Put the archive contents in the site root or in the subfolder you need, so that index.php, success.php and api.php sit in one folder. The archive has no common folder inside, so unpack it straight into the site folder. Use an empty folder. The archive files overwrite files with the same names, first of all index.php and success.php, and any other site in that folder breaks. Delete the .zip itself afterward.

  3. Open the site in a browser.

    The page should open with the price, currency and offer name. An empty spot instead of the price means the archive was downloaded without flow, the geo country is wrong, or the offer has no price for it. Placeholders in square brackets ([PRICE]) stay only when the country is not defined: geo was passed empty, or an offer for the whole world was downloaded without geo. In any of these cases, download the archive again.

  4. Send traffic to your site's address.

    The pages pick up tags from the address (utm_source, subid and others) on their own and pass them along with the order. If you work through a tracker, upload the pages only to your own tracker, which other people cannot access, because api.php holds your token. Set the tracker value you need when you download.

  5. Check that the order goes through.

    Submit an order through the form and check that the “Thanks” page opens afterward and the order appears in the list of leads. For repeated checks there is a service number, described in How to run tests back to back.