Pricing Plans
A pricing plan defines how you charge for an agent’s work. It’s the answer to “how much does this cost?” for everything that agent does. You create a pricing plan once, then attach it to a customer via a subscription. Pricing plans belong to your organization and can be linked to one or more agents. The same “Pro Plan” can be offered by multiple agents — no need to recreate it for each one.Important: The pricing plan API described here creates the plan itself — the outer “Pro Plan” container. The actual prices (per-signal rates, tiers, discounts, etc.) are configured through a separate pricing strategies flow, which is still evolving and isn’t fully exposed on the public API yet. For now, plans often start with default prices and get tuned in the dashboard.
Create a pricing plan
In plain English: Create a new pricing plan for your organization. Think of it like defining a “Pro Plan” or “Starter Plan” tier. Optionally link it to an agent right away. Method & URL:name(string, max 255 chars) — The plan’s name. Shows up in the dashboard and on invoices. Examples:"Starter Plan","Pro Plan","Enterprise Custom".
agentId(UUID string) — An agent to link this plan to. If provided, the plan is immediately available for that agent. You can link more agents later viaPOST /v1/pricing-plans/:id/agents.description(string, max 255 chars) — Longer explanation of what’s in this plan. Useful internally.featuresList(object) — Structured list of features this plan includes. Free-form, MarginFront stores but doesn’t interpret. Example:{ "features": ["API Access", "Advanced Analytics", "Priority Support"] }.isActive(boolean, defaulttrue) — Whether this plan is currently offered. Set tofalseto retire a plan without deleting it (keeps historical subscription data intact).
201 Created):
400 Bad Request— Missingname, oragentIdisn’t a valid UUID.404 Not Found— TheagentIddoesn’t match any agent in this org.
Link a plan to an agent
In plain English: Make an existing plan available through a different agent. The plan itself doesn’t change — it just shows up in another agent’s list of available plans. Method & URL:agentId(UUID string) — The agent to link this plan to.
404 Not Found— Plan or agent not found in this org.409 Conflict— Plan is already linked to this agent.
Unlink a plan from an agent
In plain English: Remove a plan from an agent’s available plans. The plan still exists — it’s just no longer offered by this agent. Fails if there are active subscriptions using this plan + agent combination. Method & URL:400 Bad Request— Active subscriptions exist for this plan + agent. Cancel them first.404 Not Found— Plan not found in this org.
Read a pricing plan
Method & URL:List pricing plans
Method & URL:agentId— filter to plans linked to a specific agentisActive— filter to only active/inactive plans
Update a pricing plan
Method & URL:name, description, featuresList, isActive. All optional.
Note: To change which agents a plan is linked to, use the link/unlink endpoints above — not PATCH.
Heads up: Changing pricing on a plan that has active subscriptions usually does NOT retroactively re-price past usage. It only affects billing periods that haven’t been invoiced yet. If you need to correct historical billing, that’s a separate manual process — talk to the team.
Delete a pricing plan
Method & URL:
Prefer isActive: false over delete. Deactivating a plan stops new subscriptions while keeping all the history intact. Deletion is for cleaning up mistakes.
Copy a pricing plan
Method & URL:Using the Node SDK
Pricing plans aren’t exposed as a separate resource in the@marginfront/sdk npm package. To create, update, or delete plans, use the HTTP API above. The SDK references plans indirectly through subscriptions — see subscriptions.
How pricing plans fit into the whole billing chain
- Create an agent (the service/product)
- Create one or more pricing plans for your org (Starter, Pro, Enterprise)
- Link plans to agents — the same plan can be linked to multiple agents
- When a customer signs up, create a subscription tying that customer to an agent + plan
- As the customer uses the product, log usage events — they get priced according to the customer’s subscribed plan, and rolled up into an invoice at the end of each billing period

