Read the Leads vs Orders report of AxiTrace (which leads became paying customers, how fast, for how much revenue and at what cost) through REST API v1, MCP tools and the analytics query.

Leads vs Orders through REST API and MCP

Ask the same questions as the Leads vs Orders tab from your own application or an AI assistant: how many leads became customers, how fast, which channel, ad platform and campaign brings the leads that buy, and what a customer from leads costs. Every surface returns the same numbers as the tab, from the same calculation.

Access

The report needs the leads:read scope. The contacts of converted leads (e-mail, phone, name) are returned only when the token also holds lead_contacts:read and your role may see personal data in the workspace; otherwise contact is null and contacts_included is false. Authentication, envelopes, errors and rate limits follow the REST API v1 reference; full schemas are in the OpenAPI document.

Operations

REST answers one section per call: GET /api/v1/workspaces/{workspace_id}/lead-orders/{section}. Each MCP tool answers one section.

SectionMCP toolWhat it answers
kpisget_lead_order_kpiskpis (leads, converted leads, lead-to-customer rate with its 95% interval, median and P90 days to order, revenue per lead, first order revenue per customer, spend, cost per customer, comparison and deltas) and coverage (where every lead of the range went).
cohortsget_lead_order_cohortscohorts (per week or month of the lead date, the share converted within 7, 30, 60, 90 and 180 days) and curve (cumulative conversion by day since the lead).
timelineget_lead_order_timelineLeads and orders from leads per week or month.
time-to-orderget_lead_order_time_to_orderP50, P90 and a histogram of the days from lead to order.
channelsget_lead_order_channelsChannel groups with their source / medium rows.
platformsget_lead_order_platformsAd platforms with spend, CPL, cost per customer, ROAS on leads and the breakeven horizon.
campaignsget_lead_order_campaignsCampaigns, ad sets and ads of one ad_platform (required), the unmatched remainder and the CPL against rate quadrant. Business and Custom plans.
convertedlist_converted_leadsThe converted leads, newest first, 50 per page; follow next_cursor (REST: links.next or cursor). An order in a currency without an exchange rate to your reporting currency has amount: null and missing_rates: true on the row and the page, never 0.

Every answer holds data_as_of (when the lead outcomes were last computed; ages and open windows are measured against it), query (the view as it was resolved) and the section. The section bodies are identical on REST, MCP and the tab.

Parameters

Every section takes the date range and comparison of the shared date picker and the filters of the tab:

  • range: today, yesterday, this_week, last_week, last_7_days, last_14_days, last_30_days, last_90_days (default), last_180_days, this_month, last_month, max_range, days_to_today or days_to_yesterday with days. Or from and to (YYYY-MM-DD, workspace timezone). At most 180 days; last_N_days is the N full days ending yesterday.
  • compare: previous_period (default; week_earlier for today and this week), week_earlier, year_earlier (364 days earlier, same weekdays), custom with compare_from, model with compare_model (first_click or last_click, the other attribution basis; Business and Custom plans), or none.
  • window_days: 7, 30, 60, 90 or 180 (default 30, or 60 when only trial leads are selected).
  • basis: first_touch (default) or last_touch.
  • categories: inquiry, trial, registration, subscribe (default inquiry and trial; REST: comma-separated).
  • match_basis: all (default) or confirmed_links; include_existing_customers: true or false (default).
  • revenue_type: gross (default) or net; revenue_horizon_days: 30, 90 (default) or 180; granularity: week (default) or month.

A comparison period counts each lead's orders only up to the age its mirror lead in the current range has, so a young range is compared fairly. Such deltas carry provisional: true and delta_meta.compared_at_days.

Values

  • Money is {"amount", "currency"} in the workspace reporting currency, converted at one rate date (the end of the range).
  • Rates and shares are fractions from 0 to 1 with 4 decimals; days have one decimal.
  • null means no data (no leads, no spend import, no comparison data), never a hidden zero.

Example: which ad platform brings leads that buy

curl -H "Authorization: Bearer $TOKEN" \
  "https://axitrace.com/api/v1/workspaces/$WORKSPACE/lead-orders/platforms?range=last_90_days&window_days=30"

Analytics query

query_analytics and GET .../analytics have a lead_orders dataset with the metrics cohort_leads, customers_from_leads, lead_to_customer_rate_pct, revenue_per_lead, median_days_to_order, cpl and cost_per_customer, in total or per channel_group, source, medium, campaign, ad_platform, campaign_id, adset_id, ad_id or lead_category. It uses the tab's default filters; its totals equal the kpis section of the same range. When some revenue or spend is in a currency without an exchange rate, notes says so (missing_rates): that money is not in revenue_per_lead, cpl and cost_per_customer.

Errors

StatusCodeMeaning
400invalid_requestA parameter is outside the list above; the message names it.
403insufficient_scopeThe token has no leads:read.
403plan_requiredcompare=model on a plan without attribution model comparison.
403(body {"gated": true, "feature": "lead_orders_drilldown"})The campaign drilldown below the Business plan. MCP returns the same body as the tool error.
404workspace_not_found, leads_unavailableThe workspace is not yours, or the Leads module is not enabled for the account.
409lead_orders_unavailableThe lead outcomes of the workspace are not computed yet. They are computed every few minutes.
503lead_orders_unavailable, report_unavailable, busyThe report is switched off for maintenance, a read failed, or AxiTrace is busy; retry later (busy carries Retry-After).