Skip to content

Entitlement Classes

An Entitlement Class defines what kind of access an entitlement represents. When the system creates an entitlement, the class determines what downstream resources are provisioned, how the entitlement is renewed, and how it appears in the admin interface and customer portal.

Classes are not hardcoded. They are stored in the database and configurable from the WordPress admin. The system ships with built-in classes that cover the most common B2B scenarios, and admins can create custom classes for their own business needs.

Built-in classes

MIDDAG Account ships with these classes:

ClassCode prefixWhat it coversDownstream resources created
PLGPLG-Software plugin or licenseLicense (activation key, max sites), Download
ENVENV-Managed hosting environmentEnvironment (platform, URL, health status), Service Request
SVCSVC-Ongoing service or projectService, Contract, Credit Balance, Service Request, Document
ORDORD-General purchaseOrder link, Invoice link, Document, Download
AFLAFL-Affiliate / partner program memberAffiliate record (commission tier, referral tracking)
EDUEDU-Education, training, or courseOrder link, Document (materials), Download

Each class has its own code prefix. When you see an entitlement code like ENV-2026050003, you immediately know it is a managed environment created in May 2026.

What each class controls

PLG -- Plugin

For software products. When a PLG entitlement is created:

  • A License is generated with an activation key
  • The license has a maximum number of site activations (configured per product)
  • Download access is enabled if the product has downloadable files
  • License status follows the entitlement lifecycle: if the entitlement is suspended, the license becomes inactive

Use PLG for: WordPress plugins, software add-ons, any product that requires a license key and download access.

ENV -- Environment

For managed hosting installations. When an ENV entitlement is created:

  • An Environment record is created with status provisioning
  • The environment tracks platform (Moodle, WordPress, or custom), URL, and health status
  • The URL is filled in manually by an admin or automatically via a webhook from the provisioning system

Use ENV for: managed Moodle sites, managed WordPress installations, any hosted platform you maintain for customers.

SVC -- Service

For ongoing services or time-bound projects. SVC is the most complex class because it supports two lifecycle modes:

  • Ongoing (lifecycle: ongoing) -- a continuous service with recurring billing, like managed hosting support or infrastructure management. Creates a Contract with renewal terms.
  • Project (lifecycle: project) -- a time-bound engagement with a start and end date, like a consulting project or custom development.

When a SVC entitlement is created:

  • A Service record is created tracking the service type (hosting, support, infrastructure, consulting, development, mobile apps, migration, upgrade, project management)
  • A Contract is created if the service is ongoing (or if required by policy), with SLA terms and date range
  • A Credit Balance is created with the initial credits included in the plan
  • Service Requests and Documents are linked as they are created

Use SVC for: support plans, consulting engagements, managed infrastructure, any service your company delivers.

ORD -- Order

The general-purpose class for purchases that do not fit a specialized category. When an ORD entitlement is created:

  • The entitlement is linked to the Order and Invoice of origin
  • Download access is enabled if the product has downloadable files
  • No specialized downstream resources are provisioned

ORD is also the default class: if a product does not have the _middag_entitlement_class meta field set, the system creates an ORD entitlement.

Use ORD for: one-time purchases, general merchandise, products that need tracking but no license or service management.

AFL -- Affiliate

For members of a partner or affiliate program. When an AFL entitlement is created:

  • The entitlement is linked to an Affiliate record in the SolidAffiliate integration
  • Commission tiers and referral tracking follow the SolidAffiliate configuration

Use AFL for: affiliate partnerships, reseller programs, referral tracking.

EDU -- Education

For training, mentoring, and courses. When an EDU entitlement is created:

  • The entitlement is linked to the Order of origin
  • Download access is enabled for educational materials
  • Welcome and onboarding emails are sent to the customer

Use EDU for: online courses, mentoring programs, certification tracks, any educational content you sell.

How classes map to WooCommerce products

The connection between a WooCommerce product and an entitlement class is a single product meta field:

_middag_entitlement_class = PLG | ENV | SVC | ORD | AFL | EDU

When a customer purchases a product and the order is completed, the provisioning service reads this meta field to determine which class of entitlement to create. Additional product meta fields control class-specific behavior:

Product meta fieldUsed byPurpose
_middag_entitlement_classAllWhich class of entitlement to create
_middag_svc_lifecycleSVCongoing or project -- determines service type
_middag_parent_entitlementAnyAuto-link as child of an existing entitlement

This mapping is set once per product. After that, every purchase of that product automatically creates the correct type of entitlement with the correct downstream resources.

Creating custom classes

If the built-in classes do not cover your business, you can create custom classes from the WordPress admin. A custom class needs:

  1. A unique code prefix (3 characters, uppercase) -- used in the entitlement code format
  2. A display name -- shown in the admin interface and customer portal
  3. Downstream resource configuration -- which resources to provision when an entitlement of this class is created
  4. Lifecycle behavior -- how the class handles renewal, expiration, and cancellation

Custom classes are stored in the database alongside built-in classes. They work identically in all respects: code generation, lifecycle management, policy engine, and REST API.

Classes and the Policy Engine

Entitlement class is the second level of the policy override hierarchy:

Global > Entitlement Class > Organization > Product > Individual Entitlement

This means you can set rules like:

  • "All PLG entitlements auto-renew" (class-level policy)
  • "All SVC entitlements have a 30-day cooldown on tier changes" (class-level policy)
  • "ENV entitlements require admin approval for provisioning" (class-level policy)

These class-level policies override global defaults but can themselves be overridden at the organization, product, or individual entitlement level. See Policies for the full explanation.

What admins see

In the WordPress admin, the Entitlement Classes settings page shows:

  • All registered classes (built-in and custom)
  • Code prefix and display name for each
  • Number of active entitlements per class
  • Whether the class is built-in or custom
  • Actions: edit configuration, view all entitlements of this class

When creating or editing a product in WooCommerce, the entitlement class is selectable from a dropdown in the MIDDAG Account product settings panel.