Grant Access After Purchase
A customer bought a product. This recipe shows how to verify the entitlement was auto-created, troubleshoot if it was not, and confirm that downstream resources (license, service, environment) are in place.
Prerequisites
- WordPress admin access.
- A WooCommerce order exists with status
completedorprocessingfor the customer. - The customer's Organization exists in MIDDAG Account.
Steps
Part A: Verify the entitlement was created
Step 1. Go to MIDDAG Account > Entitlements in the admin sidebar.
Step 2. Search by the Organization name or by the order number.
Step 3. If an entitlement appears linked to the order, open it and check:
- Status is
active. - Class matches the product type (PLG, ENV, SVC, ORD, AFL, or EDU).
- Entitlement code follows the format
{CLASS}-{YYYYMM}{SEQ}(e.g.,PLG-2026050012). - Linked Order points to the correct WooCommerce order.
Step 4. If the entitlement exists and is active, skip to Part C to verify downstream resources.
Part B: Troubleshoot if the entitlement was not created
Step 5. If no entitlement exists for the order, check the following in order:
Product mapping: Go to WooCommerce > Products, open the product, and verify an Entitlement Class is assigned in the MIDDAG Account tab. If it is blank, select the correct class and save.
Order status: Go to WooCommerce > Orders and check the order status. The entitlement pipeline triggers on
completedorprocessingstatus. If the order is stillpendingoron-hold, the payment has not been confirmed yet.Stripe webhook: Go to your Stripe dashboard > Developers > Webhooks and check recent events. Look for
payment_intent.succeededorinvoice.paidevents. Verify they returned HTTP 200. If they show errors, check the webhook URL is correct (/webhooks/stripe/bror/webhooks/stripe/llc).Banco Inter webhook: For Pix/Boleto payments, check MIDDAG Account > Logs for Banco Inter callback entries. The payment confirmation callback must have arrived.
Plugin logs: Go to MIDDAG Account > Logs and filter by the order number or Organization. Look for errors during the provisioning pipeline.
Step 6. Once the issue is resolved, you can create the entitlement manually:
- Go to MIDDAG Account > Entitlements and click New Entitlement.
- Select the Organization.
- Select the Entitlement Class that matches the product.
- Link the WooCommerce order.
- Set the start and end dates.
- Click Save. The system provisions downstream resources automatically.
Part C: Verify downstream resources
Step 7. Based on the entitlement class, verify the correct resources were created:
For PLG (Software License):
- Go to the entitlement detail page and check the License section.
- Verify a license key was generated.
- Verify the maximum site activations match the product configuration.
- Confirm the customer can see the license in the portal under My Products.
For ENV (Managed Environment):
- Check the Environment section on the entitlement detail page.
- Verify an Environment record exists with status
provisioning. - The admin must provision the actual infrastructure (server, DNS, backups) and fill in the environment details.
For SVC (Service):
- Check the Service section -- a Service record should exist.
- Check the Contract section -- if auto-contract creation is enabled in the ProvisioningPolicy, a contract should exist in
draftoractivestatus. - Check the Credit Balance section -- a CreditBalance record should exist (may start at zero).
For ORD (General Purchase):
- Check the Invoice section -- a Stripe invoice should be synced.
- Verify the invoice status is
paid.
Step 8. If downstream resources are missing, check MIDDAG Account > Logs for provisioning errors. Common causes: missing product configuration, integration API errors, or webhook delivery failures.
Expected result
- An entitlement with status
activeexists, linked to the customer's Organization and order. - Downstream resources appropriate to the entitlement class are created and accessible.
- The customer can see their new product or service in the portal.
Further reading
- Entitlement Activation -- the auto-provisioning pipeline.
- Entitlement Classes -- what each class provisions.
- Entitlements -- entitlement lifecycle and statuses.