Create a new usage-based plan owned by the authenticated partner and links it via company_plans. The endpoint stores features + review sites from the payload; plan_type is forced usage-based, is_admin_managed=0.
Auth: Partner (usage-based only). Authentication group, no extra route-level route guard. createPartnerPlan resolves the partner via getAuthPartner (403 if none) and returns 403 (Partner plans can only be created for usage-based companies.) unless partner.billing_model === 'usage-based'. overage_rate is never accepted — it is server-derived from the partner billing config.
Validation branches on the partner contract_model: model-a, then hard_stop required per enabled feature, service_limit required only when hard_stop=true (else unlimited + overage); model-b, then hard_stop forced true at persist (ignored here), service_limit optional. per_pull_data is exempt (quota derives from review-site cadence). ≥1 feature must be enabled.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
plan_name | string | Yes | max 100 |
price | number | Yes | min 0 |
original_price | number | No | nullable, min 0 |
status | string | No | active|inactive (default active) |
plan_end_date | date | No | nullable |
short_info | string | No | nullable, max 255 |
description | string | No | nullable |
enforcement_mode | string | No | per-location|aggregate-pool (default per-location) |
features | array | Yes | min 1, ≥1 enabled |
features.*.feature_name | string | Yes | ai_response, review_flag, response_to_past_reviews, response_posting, review_widgets, review_solicitation_email, review_solicitation_sms, review_qr_code, insight_report, competitive_analysis, per_pull_data |
features.*.enabled | boolean | No | default true |
features.*.hard_stop | boolean | model-a: Yes (per enabled, non-per_pull_data) | model-b: ignored |
features.*.service_limit | integer | conditional | model-a: required when hard_stop=true; min 1 |
features.*.limit_type | string | conditional | monthly|quantity; required if response_to_past_reviews |
review_sites | array | Yes | min 1 |
review_sites.*.review_site_id | integer | Yes | exists in review_sites |
review_sites.*.pull_frequency | string | Yes | hourly|daily|weekly|monthly |
review_sites.*.pull_interval | integer | No | 1–30 |
review_sites.*.pull_times | array | No | each HH:MM |
review_sites.*.pull_days | array | No | nullable; each int 0–6 |
Rate limit: No rate limit.
Response — data is the created Plan with features + plan_review_sites.
Errors: 422 on validation failure.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
