API documentation  POST /leads/new

Send a new lead

POST https://demo.trafficmanager.com/api/v1/leads/new

Authentication:

The request must be authenticated with the following HTTP headers:
  • x-api-key: Your API key, found in the Security page
  • x-user-id: Your User ID, found in the Security page
If the HTTP headers are not passed, but you are logged in to the TrafficManager panel, the current user is used instead (so you can easily preview or download the data using your browser)

GET Parameters:

  • none

POST Parameters:

Always required:
  • offer: offer ID
Required depending on the offer:
  • lp: Landing page ID. The landing page must be a form (see in the offer page, which landing page has the "API" button).
    If the offer has only one landing page with a form, this parameter can be omitted. If the offer has multiple landing pages with forms, you should add this parameter to specify which form (product) the user is buying. If you do not send this parameter, the oldest LP will be used (this ensures backward compatibility if more landing pages are added later).
Each offer may require different data, see each offer for details.
For example, for COD offers the name and phone number are usually required, the other ones are optional (but if they're present it's better to improve the conversion rate, especially the address).
  • name: Full name
  • given-name: First name / Given name
  • family-name: Last name / Surname / Family name or equivalent
  • tel: Full telephone number, with or without country code
  • street-address: Full address. Multiple lines of text are allowed. It may include the city, if the user is shown only a single input.
  • address-level2: The second administrative level, usually the city/town/village. See MDN for more information.
  • address-level1: The first administrative level in the address: State, country, province or similar.
  • email: User email address
  • postal-code: A postal code (ZIP code in the United States)
  • Product variations Some products can have multiple variations (for example, size, color, quantity...). In that case, it's required to send the variation code and name as you see in the offer page.
    Different variations can have different price for the end user and payout for the affiliate.
Optional:
  • clickid: Clickid. If present, the conversion will be assigned to the corresponding click. If missing, a new clickid will be generated.
    This must be a clickid generated by us (starting with TM...), and not your clickid. To send your clickid, use the subid parameter.
  • subid: optional affiliate subid.
  • subid2: optional affiliate subid2.
  • subid3: optional affiliate subid3.
  • subid4: optional affiliate subid4.
  • pubid: optional affiliate pubid.
  • utm_source: optional UTM source
  • utm_medium: optional UTM medium
  • utm_campaign: optional UTM campaign
  • utm_term: optional UTM term
  • utm_content: optional UTM content
The following fields are helpful to identify double orders and to detect the user country, device etc.
If you don't send them, expect more leads to be canceled later when manually processed by the call center.
  • ip: User IP address, IPv4 or IPv6
  • ua: User agent string

Response codes:

  • 200: The lead is received and registered.
  • 400: Invalid request. One or more required fields are missing.
  • 403: Authentication failed.

Returned values:

  • code: see Response codes above
  • message:
    - "OK": the lead has been accepted.
    - "DOUBLE": Lead detected as a duplicate. The lead must not be considered valid (i.e. refrain from loading social media pixels), however, the call center will initiate contact with the user. A notification should be displayed to the user indicating that they will receive a call shortly.
    - "CAP": The offer has reached the daily cap. The traffic source should stop sending traffic to this offer.
    - "POT_FAKE: The lead is suspected to be fake. The status of the lead can change later if the call center confirms the lead.
    - "REJECTED": The advertiser has rejected the lead. This may happen for reasons such as client blacklisted, invalid phone number, etc. This status is available only for the advertisers that support it.
    Note: new messages could be added at any time without prior notice. Any non-listed message should be considered as invalid/rejected.
  • clickid: the clickid of the conversion. If a valid clickid is passed in the request, it's the same. If not, a new one is generated.
  • leadId: lead UUID. This is a standard UUIDv7 string. It must be used to request the lead status via the leads status API.
    As advertised for several months, starting from November 1, 2024, this value switched from numeric to UUID format.

Request example

curl --location --request POST 'https://demo.trafficmanager.com/api/v1/leads/new' \
--header 'x-user-id: 04120c02-b144-439f-9f0a-85824e66fc00' \
--header 'x-api-key: TM04dca746122da971e02d55d496ebc457f20a8300' \
--form 'ip=51.179.111.205' \
--form 'lp=15' \
--form 'name=test 3' \
--form 'offer=10' \
--form 'street-address=via dei test 3' \
--form 'tel=3329090907' \
--form 'ua=Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/84.0.4147.105 Safari\/537.36' \
--form 'offerta=M'

Response example

Order OK:
{
    "code": 200,
    "message": "OK",
    "clickid": "TMd59e6a59297f6b698469b3f02cd57f40",
    "leadId": "01913190-5ec5-72a5-a23b-7609ad5328d0",
    "source": null
}
    
Order Double:
{
    "code": 200,
    "message": "DOUBLE",
    "clickid": "TMf5dd00397a858bb74de58d19f7a728ac",
    "leadId": "01913190-5ec5-72a5-a23b-7609ad5328d0",
    "source": null
}