Request Body
Human-readable name for the plan.Example: "Pro Plan"
Unique identifier for looking up the plan programmatically.Example: "pro-monthly"
Detailed description of what the plan includes.Example: "Professional tier with advanced features"
Order in which this plan should be displayed (lower numbers appear first).Example: 2
Arbitrary key-value pairs for storing additional information.Example: {"tier": "professional", "features": "advanced"}
Response
Unique identifier for the plan.Example: "plan_a1b2c3d4e5f6g7h8i9j0"
Human-readable name for the plan.
Display order for the plan.
Environment ID where the plan exists.
Tenant ID that owns this plan.
Status of the plan.Values: "published", "draft", "archived"
ISO 8601 timestamp when the plan was created.
ISO 8601 timestamp when the plan was last updated.
ID of the user who created the plan.
ID of the user who last updated the plan.
Example Request
curl --request POST \
--url https://api.flexprice.io/v1/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Pro Plan",
"lookup_key": "pro-monthly",
"description": "Professional tier with advanced features",
"display_order": 2,
"metadata": {
"tier": "professional",
"recommended": "true"
}
}'
Example Response
{
"id": "plan_a1b2c3d4e5f6g7h8i9j0",
"name": "Pro Plan",
"lookup_key": "pro-monthly",
"description": "Professional tier with advanced features",
"display_order": 2,
"metadata": {
"tier": "professional",
"recommended": "true"
},
"environment_id": "env_123",
"tenant_id": "tenant_123",
"status": "published",
"created_at": "2024-03-20T15:04:05Z",
"updated_at": "2024-03-20T15:04:05Z",
"created_by": "user_456",
"updated_by": "user_456"
}