Forecast

Simulate Forecast

POST
/v1/forecast/simulate

Projects the 12 months starting at baseline.windowStart over the same (cached) baseline GET /v1/forecast/baseline returns: the current funnel plus the simulator adjustments.

  • Every % at 0 is the funnel as-is: each month earns the real revenue of the last 30 days.
  • Stage % (stagePct) scales the current conversion of that link. On RETENTION it scales the repurchase orders per month instead (the repurchase rate shown next to the stage moves by the same %).
  • investmentPct scales first-stage traffic and, at a constant cost per unit, the investment. Repurchases do not move with it.
  • ticketPct scales the ticket of every order, acquisition and repurchase (the "Faturamento" control).
  • Every driver ramps linearly from its current value (month 1) to its target (month rampMonths + 1), then holds.

The sector floor of each stage is never applied. Every % is clamped to [-50, 200]. A % on a stage without a measurable rate (null or zero) has no effect. Without media investment the traffic factor scales the measured volume at no cost and the investment stays 0. result is null whenever data.status is not ready. Not cached; the response is computed on every call. The caller's Authorization is forwarded to read the business model.

Deprecated. meta and inputs.extraLayer (the Realista goal and the Super meta layer of the scenario version) are still accepted so older clients are not rejected, and ignored.

Authorization

ClientIdAuthClientSecretAuth
headerx-client-id<token>

Client ID

headerx-client-secret<token>

Client secret

Request Body

application/json
  1. body
organizationId*string

Organization identifier (required).

Length1 <= length
inputs*

Adjustments on top of the current funnel. Every driver is a % change over its current value (20 = +20%), reached linearly over rampMonths and then held. Every % at 0 is the funnel as-is. Every % is clamped to [-50, 200].

meta?unknownDeprecated

Deprecated: the annual goal the old Realista closed. Accepted and ignored.

Response Body

Projeção do forecast

application/json
  1. response
data*|

Discriminated by status. Only ready carries a baseline.

result*|

null whenever data.status is not ready.

curl -X POST "https://example.com/v1/forecast/simulate" \  -H "Content-Type: application/json" \  -d '{    "organizationId": "c0ad4763-173e-4a05-9cff-5208c8ea5f6a",    "inputs": {      "investmentPct": 20,      "ticketPct": 5,      "stagePct": {        "INTEREST": 10,        "DECISION": 5,        "RETENTION": 15      },      "rampMonths": 4    }  }'
{  "data": {    "status": "ready",    "baseline": {      "windowStart": "2019-08-24",      "funnelKind": "ecommerce",      "businessModel": "online_sales",      "monthlyInvestment": 0,      "stages": [        {          "stageId": "EXPOSURE",          "scale": "media",          "role": "sessions",          "count": 0,          "rate": 0,          "sourceLabel": "string",          "floor": 0        }      ],      "averageTicket": 0,      "monthlyRevenue": 0,      "trailingRevenue": {        "value": 0,        "annualized": true      },      "revenueSource": "transactional"    }  },  "result": {    "projection": {      "months": [        {          "month": 1,          "revenue": 0,          "repurchaseRevenue": 0,          "investment": 0,          "orders": 0,          "repurchaseOrders": 0,          "cumulativeRevenue": 0        }      ],      "totals": {        "revenue": 0,        "repurchaseRevenue": 0,        "investment": 0,        "orders": 0,        "repurchaseOrders": 0,        "roas": 0      }    },    "calibrationFactor": 0,    "baselineMonthlyRevenue": 0  }}