Skip to content

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 completed or processing for 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:

  1. 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.

  2. Order status: Go to WooCommerce > Orders and check the order status. The entitlement pipeline triggers on completed or processing status. If the order is still pending or on-hold, the payment has not been confirmed yet.

  3. Stripe webhook: Go to your Stripe dashboard > Developers > Webhooks and check recent events. Look for payment_intent.succeeded or invoice.paid events. Verify they returned HTTP 200. If they show errors, check the webhook URL is correct (/webhooks/stripe/br or /webhooks/stripe/llc).

  4. Banco Inter webhook: For Pix/Boleto payments, check MIDDAG Account > Logs for Banco Inter callback entries. The payment confirmation callback must have arrived.

  5. 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:

  1. Go to MIDDAG Account > Entitlements and click New Entitlement.
  2. Select the Organization.
  3. Select the Entitlement Class that matches the product.
  4. Link the WooCommerce order.
  5. Set the start and end dates.
  6. 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 draft or active status.
  • 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 active exists, 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