save_target
Store a merchant's GOAL for a metric over a calendar period ('we need £80k this month'). TRIGGER: whenever the user states a target/goal/budget for a metric. This saves the merchant's own target in our DB (NOT a write-back to any connected tool). Pacing (are we on track?) is computed later on read by get_targets — never stored. Money metrics (revenue, aov, ltv, …) MUST be scoped to one store via store because the workspace can run multiple currencies; pass targetValue in MAJOR units (80000 for £80k). Non-money metrics (orders, cvr, refund_rate, …) may be workspace-wide (omit store). Setting a target for a slot that already has one supersedes the old target (history is kept). After saving, tell the user in one line what you logged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Optional free-text context, e.g. 'stretch goal after the BFCM push'. | |
| store | No | Sub-store key (e.g. 'acme-store-us'). REQUIRED for money metrics. Omit for a workspace-wide non-money target. | |
| metric | Yes | Canonical metric key, e.g. 'revenue', 'orders', 'aov', 'cvr', 'refund_rate'. Validated against the metric registry. | |
| period | No | Calendar period the target is for. Defaults to 'month'. The target attaches to the CURRENT period of this type. | |
| _offset | No | Pagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page. | |
| targetValue | Yes | The goal value in MAJOR currency units for money metrics (80000 = £80k), or the raw value for counts/percentages (1200 orders, 2.5 for 2.5% cvr). |