Organization
Delete a trading plan
Delete a trading plan. Admin only.
Two outcomes, by design:
| Plan state | Result |
|---|---|
| Never used in a purchase | Permanently deleted (hard delete) |
| Used in ≥1 purchase | Delete refused with 409 PLAN_IN_USE — archive it instead |
Plans with purchase history can never be hard-deleted: your billing records, accounts, and audit trail reference them (same model as Stripe products). The 409 response includes a hint field with the exact archive call.
Archiving instead of deleting:
curl -X PATCH ".../trading-plans/{planId}" -d '{"isActive": false}'
Archived plans can’t be purchased and can be excluded from listings with GET /trading-plans?isActive=true.
Example:
curl -X DELETE "https://api.example.com/platform/v1/organization/trading-plans/{planId}" \
-H "X-API-Key: hp_live_your_key_here"
Error Codes:
| Code | Description |
|---|---|
PLAN_NOT_FOUND | No plan exists with this ID |
PLAN_NOT_IN_ORG | Plan belongs to different organization |
PLAN_IN_USE | Plan has purchase history — archive it instead (see hint in response) |
ADMIN_REQUIRED | Only admins can delete plans |
DELETE
Delete a trading plan
Authorizations
JWT Bearer token for user session auth. Format: "Bearer {token}". Used by User and Organization endpoints.
Path Parameters
The plan ID to delete
Related topics
Delete a trading ruleUpdate a trading planDelete a copy trading configDelete all copy trading configsGet a specific trading plan