Flows

On this page

These five functions let you create, configure, read, and delete a flow without opening the cabinet. You can also upload traffic costs from your own program or spreadsheet. A setting you change in the “Flows” section of the cabinet changes here too.

A flow is your link to an offer. It stores the landing and prelanding, the link type, tags and pixels, filters, and postback. All click and lead statistics are counted by flow. You take the link for an ad campaign from the flow. You cannot change a flow's offer, so create a separate flow for each offer.

Getting started#

  1. Choose an offer. offer/list returns the offers with their IDs. The offer must be available to you (available: true), or the flow is not created.
  2. Create a flow. Call wm/add with the offer ID. The response returns the flow ID and code. The flow is ready to use at once, with the default settings.
  3. Configure the flow. Take the landing and prelanding from offer/sites and pass them to wm/edit together with the tags, postback, and other settings.
  4. Get the working link. Neither wm/add nor wm/edit returns the link. Read it in wm/flows and paste it into your ad campaign. Read the link again after every settings change, because it may change.
  5. Enter the expenses. When clicks have piled up, set a cost per click on them with wm/cost. Then expenses, profit, and ROI appear in the statistics.

Good to know#

  • All five functions work on your behalf and see only your flows. Someone else's flow, or one that does not exist, gives the error access-denied.
  • The request address, token, response formats, and common errors (key, ban, func, and others) are described on the General API rules page. This page covers only what concerns flows.
  • The flow list wm/flows comes without the status envelope. It is the object with the flows itself. The other four functions answer with the usual envelope.
  • wm/edit reads settings only from the POST body. If a value is not accepted, wm/edit usually reports no error. It silently skips the value and answers ok. The table below collects these cases.
  • The manual explains what the settings mean: creating a flow and its settings, link types, tags and pixels, filters and trafback, postbacks, parked domains, expenses.
What you need to do Function
Get the working link and settings of a flow wm/flows
Create a flow for an offer wm/add
Choose a landing, set tags, postback, pixels, filters wm/edit
Delete a flow wm/del
Set a cost per click or upload an expense wm/cost

Which function does what.

wm/flowsList flows#

GETPOSThttps://lk.dalead.pro/api/wm/flows.json?id={token}

Returns all your flows: ID, code, working links, offer, landing, metrics, and main settings. Only this function returns the working link. wm/add and wm/edit do not.

The response is not split into pages: all flows come at once. You can narrow it only by offer. The response does not hold the full set of settings. It has only the fields from the tables below. For the other settings (filters, SubID, prices, Conversion API pixels, and more), check the cabinet.

Parameters

ParameterTypeReq.Description
offerint—The offer ID. Without the parameter, or with 0, you get the flows of all offers. If you have no flows for the offer, the response is empty.

Request

Flows of one offer
https://lk.dalead.pro/api/wm/flows.json?id={token}&offer=64
An offer with none of your flows
https://lk.dalead.pro/api/wm/flows.json?id={token}&offer=72

Response

JSON
{
  "127": {
    "id": 127,
    "code": "2A4E-581D-AC66-289D",
    "url": "https://lk.dalead.pro/to-5d8bf0342f2ceaaa?utm_source=facebook&utm_campaign=whisker-es-01&utm_content={{ad.id}}",
    "urls": {
      "classic": "https://lk.dalead.pro/whisker-boost-vet-review/?flow=127&l=405&fb=1234567890123456&fbe=Purchase&utm_source=facebook&utm_campaign=whisker-es-01&utm_content={{ad.id}}&src=9",
      "short": "https://lk.dalead.pro/to127?utm_source=facebook&utm_campaign=whisker-es-01&utm_content={{ad.id}}",
      "encoded": "https://lk.dalead.pro/to-5d8bf0342f2ceaaa?utm_source=facebook&utm_campaign=whisker-es-01&utm_content={{ad.id}}",
      "direct": "https://lk.dalead.pro/to-x5d8bf0342f2ceaaa?utm_source=facebook&utm_campaign=whisker-es-01&utm_content={{ad.id}}"
    },
    "offer": 64,
    "offername": "Whisker Boost",
    "name": "Purr Squad - facebook - es",
    "epc": 0,
    "cr": 0,
    "total": 0,
    "src": 9,
    "srcname": "Social targeting",
    "site": 405,
    "siteurl": "meow.pro/whisker-boost-quiz-landing",
    "space": 407,
    "spaceurl": "meow.pro/whisker-boost-vet-review",
    "traffback": "",
    "postback": "https://meow.pro/pb?click={subid}&status={phase}",
    "metrika": "",
    "google": "",
    "vkcom": "",
    "facebook": "1234567890123456",
    "utm_source": "facebook",
    "utm_campaign": "whisker-es-01",
    "utm_content": "{{ad.id}}",
    "utm_term": "",
    "utm_medium": ""
  }
}
No flows
[]

The response is an object of flows, keyed by flow ID. There is no status envelope, and the function has no error codes. If you have no flows, or none matches the filter, you get an empty array []. The example shows one flow. Your response holds all of them.

Field Description
id The flow ID.
code The flow's text code: sixteen characters in upper case, split by hyphens into groups of four. wm/edit and wm/del accept it instead of the ID.
url The flow's working link, the one you send traffic to. Its form depends on the flow's link type (mode) and the parked domain you chose, so read it again after you change settings. The flow's tags and macros are already in the link.
urls The flow's links of all four types at once: classic (classic link), short (short link), encoded (encoded link), direct (direct link). The manual explains how they differ.
offer The ID of the flow's offer.
offername The offer's short name.
name The flow name.
epc The flow's average income per click, in the network's main currency.
cr The flow's conversion rate, in percent.
total The flow's earnings for all time: your commissions on orders in the “Hold” and “Approve” phases (order phases).
src The ID of the flow's traffic source. 0 means no source is set.
srcname The traffic source name. false means no source is set.
site The ID of the flow's landing. 0 means no landing is chosen.
siteurl The landing address without the scheme. false means no landing is chosen.
space The prelanding ID. 0 means no prelanding is used.
spaceurl The prelanding address without the scheme. false means no prelanding is used.
traffback The white page address for trafback. An empty string means it is not set.
postback The flow's postback address. An empty string means it is not set.
utm_source The flow's utm_source tag.
utm_campaign The flow's utm_campaign tag.
utm_content The flow's utm_content tag.
utm_term The flow's utm_term tag.
utm_medium The flow's utm_medium tag.

The main fields of a flow in the response.

The platform recalculates epc and cr on a schedule, like the offer's metrics. They are counted over a recent period (15 days by default in the network) and by unique clicks. The total click count is used only in a network that has enabled it. cr is the number of the flow's orders over the period, excluding Trash, divided by the number of clicks on its landing over the same period, in percent. epc is your commissions on orders in the “Hold” and “Approve” phases over the period, divided by the same number of clicks. If there were no orders in the period, both metrics reset to zero at the next recalculation. total is counted for all time and does not depend on the period, but it also updates on a schedule.

Additional fields

These fields are always in the response. They are filled only where the offer or the network allows the matching analytics systems and you set them in the flow settings (wm/edit). Otherwise you get an empty string.

Field Description
metrika The Yandex.Metrica counter number.
google The Google Analytics or Tag Manager counter ID.
vkcom The VKontakte pixel ID.
facebook The Facebook pixel ID.

Additional fields of a flow in the response.

wm/addCreate a flow#

GETPOSThttps://lk.dalead.pro/api/wm/add.json?id={token}

Creates a new flow for an offer. The offer must be enabled, not blocked for traffic, and available to you. offer/list lists the available offers. The number of flows is not limited, so you can create as many as you like for one offer.

The new flow gets the default settings:

  • Landing — the first landing of the offer that is available to you. If the offer has a default landing, that one is used. There is no prelanding.
  • Traffic source — the first of the sources the offer allows. If the offer does not let you choose a source, no source is set (src is 0).
  • Name — the offer's short name and the flow number: Whisker Boost - 127.
  • Link — classic. Postbacks are on for all five phases, and tags and pixels are empty.

If the offer has no landing available to you, the flow is still created, but without a landing (site is 0) and without a working link. In wm/flows, the url link (like urls.classic) looks like http:///?flow=75. The short, encoded, and direct links look normal, but opening them leads to /, that is, to the network's main page. Do not send traffic until a landing is chosen. Choose one from offer/sites through wm/edit. Set up the rest through wm/edit as well.

Parameters

ParameterTypeReq.Description
offerintyesThe offer ID. Take the ID from offer/list.

Request

A new flow for an offer
https://lk.dalead.pro/api/wm/add.json?id={token}&offer=64
The offer does not exist or is unavailable
https://lk.dalead.pro/api/wm/add.json?id={token}&offer=999

Response

JSON
{
  "status": "ok",
  "id": 127,
  "code": "2A4E-581D-AC66-289D"
}
Error: offer unavailable
{
  "status": "error",
  "error": "offer-inactive"
}
Field Description
status The result of the operation: ok on success, error on error.
error The error code for the error status (see below).
id The ID of the created flow. On success only.
code The text code of the created flow. On success only.

Response fields.

The response has no working link. Read it through wm/flows.

Errors

CodeWhat happenedWhat to do
no-idThe offer parameter is missing, zero, or not a number.Pass the offer ID.
offer-inactiveThe offer does not exist, is disabled, is blocked for traffic, or you are not allowed to work with it.Choose an offer from offer/list with available: true.
request-errorThe flow could not be saved to the database.Repeat the request later.

wm/editEdit a flow#

POSThttps://lk.dalead.pro/api/wm/edit.json?id={token}

Changes a flow's settings. The update is partial: pass only the fields you want to change, and the rest stay as they were.

Settings are read only from the POST body, in application/x-www-form-urlencoded or JSON format. You can also pass the flow identifier (flow or code) in the query string, but settings in the query string are ignored.

A settings change often changes the flow's working link, so read it again through wm/flows after the edit.

Note that wm/edit answers ok even when some of the values are not saved. For example, if the offer forbids a setting, the value you passed is silently dropped. The section When the answer is “ok” but the setting did not change describes which values are skipped and what to pass instead.

Parameters

The parameters come in two tables, main and additional. The main ones work with any offer. The additional ones work only where the offer allows the feature or, if the offer does not set it, the network settings allow it. They cover SubID tags, ERID, cost per click, pixels, Conversion API, custom code on pages, and custom prices. A forbidden parameter is silently dropped. The flow form in the cabinet shows whether your offer has the field.

Pass flags (cb, cbot, cgeo, clang, cban, cadid, pb1–pb5) as 1 or 0, and in a JSON body as true or false. HTML tags and edge spaces are removed from text values, and quotes are replaced with the codes " and '. The name and the pixel and counter IDs are cleaned more strictly, see the field descriptions. A value that is too long is cut to the field length without an error.

Main parameters. They work with any offer.

ParameterTypeReq.Description
flowint—The flow ID from wm/flows or wm/add. One of two parameters is required: flow or code.
codestring—The flow's text code from the code field of the wm/flows response. Case does not matter. If you pass both parameters, code is used. If the code cannot be parsed, flow is used.
namestring—The flow name, for easier search. Up to 100 characters. Characters other than letters, digits, _, -, ., and , are replaced with spaces, and repeated spaces are merged.
siteint—The ID of a landing from offer/sites for this flow's offer. A missing or unavailable site is ignored, and the landing stays as it was.
spaceint—The ID of a prelanding from offer/sites for this flow's offer. The value 0, or a missing or unavailable site, removes the prelanding.
modeint—The flow's link type: 0 (classic), 1 (short), 2 (encoded), 3 (direct). The manual describes the differences. Other values are not checked, so do not use them.
drdint—The ID of the parked domain for the flow's link. 0 means the network's standard domain. The domain ID is the id field in the domain/get response. You add domains in the cabinet (Domain parking).
cbbool—The ComeBacker script on the prelanding: 1 turns it on, 0 turns it off. The value is read as a number, so the text true or yes turns the script off instead of on. In a JSON body, true and false work.
deepstring—Deeplink: the address of a specific page inside the target site, up to 250 characters. It is saved only if the flow's landing is a redirect site that points to a third-party address and the domain from the value is in the domain list of that site. Otherwise the value is silently dropped, and if the request has no other fields, the answer is request-error. An empty value clears the field.
srcint—The traffic source ID. 0 means no source. The sources the offer allows and forbids come in the allow and deny fields of the offer/show response. The value is not checked against the lists: any number up to 255 is saved, so use only the sources the offer allows.
urlstring—The white page address for trafback, up to 250 characters. It must be a full valid address (with https://), otherwise the field is cleared. See Filters and trafback.
cactint—The trafback method. 0 redirects by link (302). 1 redirects and glues the domain (301). 2 goes through a separate page (meta). 8 uses a script (js). 3 shows the link in an iframe. 5 shows the content from the link. 4 shows the content from the link without processing. 6 shows an empty page. 7 shows an error page.
cfltrint—The ID of a traffic filtering campaign (Filtering campaigns). The campaign must be yours, otherwise the value resets to 0. A non-zero value turns off the simple filters (cbot, cgeo, clang, cban) and your own country list geos: they reset in the same request. This also happens when someone else's or a nonexistent campaign was reset to 0. The filters and geos are cleared anyway, so send them in a separate request after cfltr. 0 means no campaign is used.
cbotbool—The “Bots” simple filter.
cgeobool—The “Country” simple filter: let through only visitors from the offer's country or from the geos list.
clangbool—The “Language” simple filter: checks the browser language.
cbanbool—The “Black lists” simple filter: checks the address against black lists.
cadidbool—The “Ad ID” filter: let through only visitors with an advertising identifier.
geoslist—Your own countries white list for the cgeo filter: two-letter codes separated by commas (ru,ua,kz) or the geos[] array. Case does not matter. An empty value clears the list.
whiteint—The white site ID. The site must be enabled and belong to you or your team, otherwise the value resets to 0.
pbustring—The flow's postback address with macros (Postbacks). An empty value clears the field.
pb1 … pb5bool—Whether to send a postback for an order phase: pb1 for “Wait”, pb2 for “Hold”, pb3 for “Approve”, pb4 for “Cancel”, pb5 for “Trash” (order phases). All five are on in a flow by default.
utms, utmc, utmn, utmt, utmmstring—The UTM tags inserted into the flow's link: utms is utm_source, utmc is utm_campaign, utmn is utm_content, utmt is utm_term, utmm is utm_medium. Up to 250 characters each.
utmustring—The Customer ID, the customer parameter in the flow's link. Up to 250 characters.

Additional parameters. Only for offers and networks that allow them.

ParameterTypeReq.Description
subidstring—The flow's SubID, inserted into the link. Up to 32 characters.
sub1 … sub5string—The extra tags SubID 1 to SubID 5, up to 250 characters each.
uuidstring—A permanent UUID tag of the flow, up to 250 characters. It is inserted into the link as the uuid parameter. When someone follows the link, it lands in the click's UUID tag, and the {uuid} macro returns it in a postback (Postbacks). If the link also has erid, the click records erid. You cannot turn on uuid in the cabinet, because the list of analytics systems of the offer and the network has no such item. So in an ordinary network the value is silently dropped and the answer stays ok.
eridstring—The ad marking token (ERID), up to 250 characters.
cpcstring—The cost per click macro: a value or an ad network macro (for example {cpc}) that is inserted into the flow's link, up to 50 characters. The price that comes through it is written to the click when the click happens, so you do not need to enter it through wm/cost.
curstring—The currency of the cost per click, a three-letter code (usd). Accepted only together with cpc.
fbstring—The Facebook pixel ID for the landing and prelanding, up to 250 characters.
fbestring—The Facebook conversion event. Only the standard events are accepted, and case matters. An unknown or empty value gives Lead.
gastring—The Google Analytics or Tag Manager counter ID, up to 100 characters.
gadstring—The Google conversion code, up to 100 characters.
vkstring—The VKontakte pixel ID in the format VK-RTRG-12345-abcd, up to 100 characters.
mtrkstring—The Yandex.Metrica counter number, up to 30 characters.
mtstring—The Mail Target pixel ID, up to 100 characters.
ttstring—The TikTok pixel ID, up to 100 characters.
lkistring—The Likee pixel ID, up to 100 characters.
fb2istring—The Facebook Conversion API pixel ID for server events. Only digits are kept, up to 250 characters.
fb2estring—The Conversion API event for a new lead. Only the standard events are accepted, and case matters. An unknown or empty value clears the field, and no event is sent.
fb2hstring—The Conversion API event for the “Hold” phase. The rules are the same as for fb2e.
fb2astring—The Conversion API event for the “Approve” phase. The rules are the same as for fb2e.
fb2tstring—The pixel API token for server requests to Facebook, up to 255 characters.
fb2pstring—A proxy for the server request in the format http://login:password@host:port, up to 200 characters.
fb2mint—The Conversion API mode: 0 sends only the click ID, 1 sends the click ID and the lead data, 2 sends the lead data even without a click ID. Values out of range are not rejected: a value below zero is saved as 0, and a value above three as 3. The cabinet has no mode 3, so use only 0, 1, and 2.
pixs, pixtstring—Your own tracking code: pixs for the main pages of the site, pixt for the thanks page. Accepted only for offers that allow a custom tracking code. PHP code is cut from the value.
head, footstring—Your own HTML code for the header (head) and the footer (foot) of the site pages. Accepted only for offers that allow custom header and footer code. PHP code is cut from the value.
priceobject—Your own prices on the landing. Accepted only for offers with the price setting. The table is replaced whole, so every request must hold all the prices you need. To remove all your own prices, pass any cell with an empty value, for example price[ru][2]=.
price[<country>][<variant>]float—The price in a country. The country key is the two-letter code of one of the offer's countries, and the variant key is the product ID from the goods field of the offer/show response. Variant key 0 is the price of the offer itself (for offers without variants), and key -1 is the landing discount in percent. Negative prices and prices below the minimum set in the offer are dropped.

The pixel and counter IDs (fb, ga, gad, vk, mtrk, mt, tt, lki) are cleaned like the name: characters other than letters, digits, _, -, ., and , are replaced with spaces, and quotes turn into the numbers “34” and “39”. For example, AW-123456789/AbCdEf is saved as AW-123456789 AbCdEf, and A"B as A 34 B.

Standard Facebook events

The parameters fbe, fb2e, fb2h, and fb2a accept one of seventeen names. Case matters: Purchase works, purchase does not.

AddPaymentInfo, AddToCart, AddToWishlist, CompleteRegistration, Contact, CustomizeProduct, Donate, FindLocation, InitiateCheckout, Lead, Purchase, Schedule, Search, StartTrial, SubmitApplication, Subscribe, ViewContent.

Request

Name, landing, source, tags, and postback
curl 'https://lk.dalead.pro/api/wm/edit.json?id={token}' \
  --data-urlencode 'flow=127' \
  --data-urlencode 'name=Purr Squad - facebook - es' \
  --data-urlencode 'site=405' \
  --data-urlencode 'space=407' \
  --data-urlencode 'mode=2' \
  --data-urlencode 'src=9' \
  --data-urlencode 'utms=facebook' \
  --data-urlencode 'utmc=whisker-es-01' \
  --data-urlencode 'utmn={{ad.id}}' \
  --data-urlencode 'pbu=https://meow.pro/pb?click={subid}&status={phase}' \
  --data-urlencode 'pb4=0' \
  --data-urlencode 'pb5=0'
Custom prices and a Facebook pixel (JSON body)
curl 'https://lk.dalead.pro/api/wm/edit.json?id={token}' \
  -H 'Content-Type: application/json' \
  --data-raw '{"flow": 127, "price": {"es": {"100": 36.9, "99": 22.9}}, "fb": "1234567890123456", "fbe": "Purchase"}'
Someone else's flow
curl 'https://lk.dalead.pro/api/wm/edit.json?id={token}' \
  --data-urlencode 'flow=1' \
  --data-urlencode 'name=Purr Squad'

Response

JSON
{
  "status": "ok"
}
Error: someone else's flow or no such flow
{
  "status": "error",
  "error": "access-denied"
}

Errors

CodeWhat happenedWhat to do
no-idNeither flow nor code is passed, or the code could not be parsed and flow is not passed.Pass the flow ID or code from wm/flows.
access-deniedThe flow belongs to another user or does not exist.Check the flow ID in wm/flows.
request-errorThe changes could not be saved to the database, or only a dropped deep or url is left in the request.If you passed only deep or url, add any other field, for example name with its current value. Otherwise repeat the request later.

When the answer is “ok” but the setting did not change

The answer ok only means the request was parsed and there are no errors. It does not say whether each field was saved. Check the result by reading the flow in wm/flows or in the cabinet.

What you sent What happens What to do
Only the flags pb1–pb5 The answer is ok, nothing is saved Send them together with any other field that saves, for example name with its current value
Only the price table The answer is ok, nothing is saved The same: add another field to the request, for example name
A request with no recognized field, for example flow=127 or a field with a wrong name The answer is ok, nothing changes Check the field names against the parameter table
Settings in the query string Ignored Pass them in the POST body, as a form or JSON. Leave only flow or code in the query string
A field that the offer or the network does not allow: SubID tags, uuid, ERID, cost per click, pixels, Conversion API, pixs, pixt, head, foot, price, url The value is silently dropped. Only url answers request-error, and only if the request has no other fields Open the flow in the cabinet. If the field is not in the form, the offer does not allow it
A site or space that does not exist or is unavailable to you site does not change, space is reset to zero Take the IDs from offer/sites
A site, space, or src from another offer or not from the allowed list Saved without a check Take IDs only from offer/sites and offer/show of this flow's offer
A deep that does not fit the landing Silently dropped. If the request has no other fields, the answer is request-error, not ok Use a redirect site and a domain from its domain list. Or add any other field to the request
A url that is not a full address The field is cleared Pass the whole address, with https://
cfltr or white with someone else's or a disabled object Reset to 0. Someone else's cfltr also clears cbot, cgeo, clang, cban, and geos from this request Pass the IDs of your own campaigns and white sites. Send the filters in a separate request afterwards
price Replaces the whole price table of the flow Pass all prices in one request
A flag cbot, cgeo, clang, cban, cadid, or pb1–pb5 with the value false, no, or any non-empty value other than 0 The flag turns on Pass 1 and 0 (in JSON, true and false)
A flag cb with the value true, yes, or other text that is not a number The flag turns off. You cannot turn it on this way, because the value is read as a number and text gives 0 Pass 1 and 0 (in JSON, true and false)
A value longer than the field Cut to the field length Stay within the lengths from the table: for example, the name up to 100 characters, subid up to 32
fb2m outside the range 0–2 The nearest allowed number from 0 to 3 is saved Pass 0, 1, or 2

Cases when wm/edit answers ok (request-error for deep and url without other fields) but does not save the value.

wm/delDelete a flow#

GETPOSThttps://lk.dalead.pro/api/wm/del.json?id={token}

Deletes a flow. You cannot undo the deletion, so do not delete a flow that gets traffic. First stop the campaign or change the link in it.

The flow's link, parked domains, and split tests are not turned off by the deletion. See What remains after deletion for details.

Parameters

ParameterTypeReq.Description
flowint—The flow ID. One of two parameters is required: flow or code.
codestring—The flow's text code as wm/flows returns it. If you pass both parameters, code is used. If the code cannot be parsed, flow is used.

Request

Delete a flow
https://lk.dalead.pro/api/wm/del.json?id={token}&flow=127

Response

JSON
{
  "status": "ok"
}
Error: the flow is already deleted
{
  "status": "error",
  "error": "access-denied"
}

Errors

CodeWhat happenedWhat to do
no-idNeither flow nor code is passed, or the code could not be parsed and flow is not passed.Pass the flow ID or code.
access-deniedThe flow belongs to another user or does not exist (including one that is already deleted).Check the flow ID in wm/flows.
request-errorThe flow could not be deleted from the database.Repeat the request later.

What remains after deletion

  • Link. The flow's old link does not disappear, but it no longer leads to the landing. The short, encoded, and direct links (they go through the network's redirector) answer with a 302 redirect to /, the network's main page. Ad traffic on that link lands there, so first stop the campaign or change the link in it.
  • Statistics. Clicks, orders, and daily statistics stay, but lose their tie to the flow. You still see them by offer and by site, but they no longer stand out by flow.
  • Parked domains. The domain itself stays in your list. The glue of the domain to the flow (the “Glue it” button on the “Parked domains” page, the link field in the domain/get response) is not removed, so the domain keeps pointing to the deleted flow. Before you delete the flow, glue the domain to another flow or unglue it in the cabinet: Domain parking.
  • Split tests. The function does not check whether the flow is in a split test. Remove the flow from the test beforehand: Split tests.

wm/costEnter expenses#

GETPOSThttps://lk.dalead.pro/api/wm/cost.json?id={token}

Sets a cost per click on clicks you have already collected. The platform does not know the expense itself. It comes from the cost per click macro cpc in the flow's link (see wm/edit), or you upload it from the ad network. Use this function, upload it by hand from the cabinet, or connect an automatic export (Expenses). The price you set goes into the statistics as expense, and profit and ROI are counted from it (see wm/stats).

The request describes one or more operations. An operation consists of filters that select clicks and a price to set on them. You set the price in one of three ways:

  • cpc — the price of one click. It is set on every selected click as is.
  • cost — the total expense. It is divided by the number of selected clicks, and the result is set on each of them.
  • zero — a reset. The selected clicks get a zero price.

If you pass several ways at once, zero wins, then cpc, then cost. An operation without a price is not performed.

You need at least one filter, because an operation without filters is not performed. Filters work together as AND: a click must meet every condition. Only your own clicks are ever selected. The new price overwrites the previous one.

The period is a filter too

An operation that has only from and to sets the price on all your clicks for that period, across all flows and offers. If you need one flow or one campaign, specify flow and tags. Watch the filter values too. A date that cannot be parsed (from=abc) and a non-numeric flow are silently dropped, and the restriction disappears with them. An operation with one such “empty” date or flow sets the price on all your clicks.

The price is set once per visit. If the chain has a prelanding, the expense goes to the click on the prelanding, and the click from the prelanding to the landing gets no price. This way one visit is not counted twice.

You can pass several operations in one request in the batch parameter. It is an array, and each element is an object with the same fields. You usually pass it as a JSON body, but a form like batch[0][flow]=127&batch[0][cpc]=0.2&batch[1][flow]=84&batch[1][cost]=10 works too. Parameters from the query string and from the request body are not merged into one operation. Each group becomes a separate operation, so pass the filters and the price together. If flow is in the query string and cpc is in the body, you get two incomplete operations and the answer empty. Operations in batch without filters or without a price are silently skipped.

Parameters

Each parameter is optional on its own, but you need at least one filter and one price. Filters: flow, tags, from, and to. Price: cpc, cost, or zero.

ParameterTypeReq.Description
flowint—The flow ID. One flow per operation. For several flows, use batch.
utms, utmc, utmn, utmt, utmmstring—The value of the click's tag: utms is utm_source, utmc is utm_campaign, utmn is utm_content, utmt is utm_term, utmm is utm_medium. A tag is compared for an exact match, and case matters.
fromstring—The start of the period: a date and time as a string (2026-10-01, 2026-10-01 12:00:00) or Unix time as a number. Clicks strictly later than this moment are taken. Write the date with hyphens. A value of digits only, for example 20261001, is read as Unix time (that is August 1970), and the period silently widens to all time. For precision, pass Unix time, because it does not depend on the time zone.
tostring—The end of the period in the same form. Write the date with hyphens here too: 20261031 of digits only is read as Unix time (1970), and no click falls in the period. Clicks up to this moment inclusive are taken. A date without a time is midnight at the start of the day, so to=2026-10-31 does not include October 31. To take the whole day, use 2026-10-31 23:59:59.
cpcfloat—The price of one click. Up to six digits after the decimal point. A price below 0.0001 is not accepted, and the operation goes to bad.
costfloat—The total expense to divide among the selected clicks. If no click is selected, the operation goes to bad.
zerobool—Set a zero price on the selected clicks.
validbool—Take only valid clicks, those the filters did not cut off.
uniquebool—Take only unique clicks.
currstring—The currency of the price, a three-letter code (usd). An unknown code, or no parameter, gives the network's main currency. The cur parameter does not work here: write curr or currency.Aliases: currency
batchlist—An array of operations. Each element is an object with the fields from this table.
extustring—Agency only: the click or order identifier on the agency side (the extu tag). Compared for an exact match.
extsstring—Agency only: the traffic source identifier on the agency side (the exts tag). Compared for an exact match.

Request

Cost per click by tag
https://lk.dalead.pro/api/wm/cost.json?id={token}&flow=127&utms=facebook&cpc=0.35
Monthly cost for a creative
https://lk.dalead.pro/api/wm/cost.json?id={token}&flow=127&utmn=purr-creative-01&from=2026-10-01&to=2026-10-31%2023%3A59%3A59&cost=420.5&curr=usd&valid=1
Two operations in one request
curl 'https://lk.dalead.pro/api/wm/cost.json?id={token}' \
  -H 'Content-Type: application/json' \
  --data-raw '{"batch": [{"flow": 127, "utms": "facebook", "utmc": "whisker-es-01", "from": "2026-10-01", "to": "2026-10-31 23:59:59", "cost": 420.5, "curr": "usd"}, {"flow": 127, "utms": "facebook", "cpc": 0.35}]}'
A price without a filter
https://lk.dalead.pro/api/wm/cost.json?id={token}&cpc=0.35&valid=1

Response

JSON
{
  "status": "ok",
  "ok": 1,
  "bad": 0
}
No click matched the filters of “Monthly cost for a creative”
{
  "status": "ok",
  "ok": 0,
  "bad": 1
}
Two operations: the first found no clicks
{
  "status": "ok",
  "ok": 1,
  "bad": 1
}
Error: no filter
{
  "status": "error",
  "error": "empty"
}
Field Description
status The result of the operation: ok on success, error on error.
error The error code for the error status (see below).
ok The number of operations performed. An operation with cpc or zero counts as performed even when no matching clicks were found.
bad The number of operations not performed. An operation is not performed if, with cost, no click matched the filters, or if the price came out as zero after rounding.

Response fields.

The response counts operations. The function does not report how many clicks got the price. Check the result in the statistics (wm/stats): the expense and the number of clicks with a price show up there in the additional fields cpc and cpv.

Errors

CodeWhat happenedWhat to do
emptyThe request has no operation that has both a filter and a price.Add a filter (flow, a tag, or a period) and a price (cpc, cost, or zero) in one place of the request: in the query string or in the body.

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