Connect your Larapen site to the Envato Marketplace API. Verify customer purchase codes, manage buyers, and turn every verified purchase into a license key of the Licenses add-on, which gates access to helpdesk, forum, and knowledge base by product ownership.
Purchase Verification
Verify Envato purchase codes via the official API. Automatic buyer identity matching.
OAuth Connect
Buyers link their Envato account via OAuth2. Purchases are synced automatically using buyer tokens.
Access Gating
Verified purchases become license keys: the Licenses add-on uses them to gate helpdesk departments, forum categories and KB collections.
Item Management
Import your Envato items, track sales, and link each item to the license product(s) it sells.
Use Cases
CodeCanyon Plugin Author
You sell a premium WordPress plugin or Laravel package on CodeCanyon. You run a support site on Larapen with a helpdesk.
- Import your CodeCanyon items into Larapen.
- Link each item to its license product (Linked license products modal), then link that license product to a helpdesk department (e.g. “Plugin Support”).
- Enable the Licenses option “Require Purchase for HelpDesk” (HelpDesk settings): only customers holding a license key for the product can submit tickets to that department.
- Customers connect their Envato account via OAuth and their purchases are auto-synced.
ThemeForest Author with Community Forum
You sell multiple themes and want a community forum gated by product.
- Create a forum category for each theme.
- Link each Envato item to its license product, and each license product to its forum category.
- Enable the Licenses forum option (
licenses_forum_require_purchase, Forum settings): buyers can only post in the categories of products they own.
Knowledge Base with Premium Content
You have a knowledge base with product-specific documentation that should only be accessible to buyers.
- Link Envato items to license products, and license products to KB collections.
- Enable the Licenses option “Restrict KB by Purchase” (HelpDesk settings): articles of those collections are reserved to buyers.
Requirements
- Larapen CMS v1.0.0 or later
- PHP 8.3+
- MySQL 8.0+
- An Envato personal API token (see Creating an Envato Token)
- The Licenses add-on (required dependency; version 1.0.13 or later for Envato 1.0.6+)
- Optional: the HelpDesk and/or Forum add-on, for access gating (a Licenses feature)
licenses_entity_links) and only applies
when the helpdesk and/or forum add-ons are active.
Installation
Step 1: Upload the Add-on
In the admin panel, go to Admin → Extensions → Add-ons and click the Upload Add-on button. Select the add-on’s ZIP file: the system extracts it automatically and the add-on appears in the installed add-ons list.
Step 2: Activate the Add-on
Find Envato Market Integration in the list and click Activate. Its migrations, seeders (if any) and permissions are set up automatically.
Step 3: Configure
Navigate to Admin → Envato → Settings and enter your Envato API token and author username, then use the Test Connection button to verify. See Configuration.
Step 4: Configure OAuth (Optional)
To allow customers to connect their Envato accounts via OAuth:
- Register an app at build.envato.com.
- Set the callback URL to
https://yoursite.com/auth/envato/callback. - In Admin → Settings → Social Auth, enable the Envato driver and enter
the
Client IDandClient Secret.
Purchase Code (License Key)
Envato Market Integration is sold as a separate product, so it has its own purchase code (license key), distinct from the purchase code of the main application and from the one of every other add-on. You are asked for it when you activate Envato Market Integration in Admin panel → Add-ons.
Our products are sold on three platforms. The way you receive a purchase code depends on where you bought the product.
| Platform / Marketplace | How you get the purchase code | Where to find it again |
|---|---|---|
| bedigit.com Store In-site purchase (Shop) |
Generated automatically when the order is paid, then sent by email, either in its own license email, or inside the order confirmation email. | My Account → My Licenses on bedigit.com |
| Gumroad | Created as soon as Gumroad notifies us of the sale, then sent in a separate email, in addition to the Gumroad receipt. | The license email, your Gumroad Library, and My Account → My Licenses on bedigit.com |
| Envato Market CodeCanyon |
Issued by Envato, not by us, and never sent by email: you download it yourself from your Envato account. | Envato account → Downloads → License certificate & purchase code |
1. bedigit.com Store (in-site purchase)
- As soon as the order’s payment status becomes Paid, a license key is generated automatically for every licensed item in the order (one key per purchased unit: buying 3 units gives 3 distinct keys).
- It is emailed to the address used on the order, either in a dedicated license email or inside the order confirmation email. Check your inbox and your spam / junk folder.
- The key stays available in your account under My Account → My Licenses. Keys are masked in the list; open the license detail page to reveal and copy the full key, see the domains it is activated on, and deactivate a domain to free an activation slot.
- The matching invoice is under My Account → My Orders.
2. Gumroad
- A Gumroad purchase produces two separate emails: the Gumroad receipt (sent by Gumroad, giving access to the files) and a license key email (sent by bedigit.com) that contains your purchase code.
- The license key email is generated as soon as Gumroad notifies us of the sale, so it normally arrives within seconds of the payment. Here too, check your inbox and your spam / junk folder.
- When the Gumroad product uses Gumroad’s own license-key feature, the same key also appears in your Gumroad receipt and under Library → your purchase on gumroad.com.
- Use the same email address on bedigit.com as on Gumroad: your keys are then linked to your account automatically and listed under My Account → My Licenses, even if you register after the purchase. You can also add a Gumroad key manually from My Account → My Gumroad Licenses.
3. Envato Market (CodeCanyon)
- Envato purchase codes are issued and delivered by Envato Market, never emailed by us, so there is nothing to look for in your spam folder: you retrieve the code from your Envato account.
- Log in to your Envato / CodeCanyon account, open the Downloads page, find the item, and choose License certificate & purchase code from the Download dropdown. The code is written in that certificate.
- An Envato purchase code looks like
12345678-90ab-cdef-1234-567890abcdef(8-4-4-4-12 characters). It never changes, and renewing item support does not issue a new one. - Official Envato article: Where Is My Purchase Code?
Configuration
All settings are managed in Admin → Envato → Settings (stored in the settings table, group envato).
| Setting | Description | Default |
|---|---|---|
envato_api_token |
Personal Envato API token for author-level API calls (verify sales, import items). | (empty) |
envato_author_username |
Your Envato Marketplace username. | (empty) |
envato_require_email_match |
When enabled, the buyer’s Envato email must match their site account email for purchase verification to succeed. | false |
envato_link_multiple_products |
Allow an Envato item to be linked to several license products (bundles). Off: the Linked license products modal accepts a single product. | false |
envato_license_sync_queued |
Run the Licenses → Envato sync (customer and item records created when a key is verified through the Licenses add-on) on the queue instead of inline. | false |
envato_helpdesk_require_purchase,
envato_forum_require_purchase and envato_kb_restrict_by_purchase toggles no longer exist.
Gating is configured in the Licenses add-on: licenses_helpdesk_require_purchase and
licenses_kb_restrict_by_purchase (HelpDesk settings) and licenses_forum_require_purchase (Forum settings).
Whether Envato purchase codes are accepted as license keys is the Licenses setting
licenses_envato_marketplace_enabled (Licenses → Settings → Marketplaces).
Environment Variables
OAuth Configuration (Social Auth)
Envato OAuth is configured through the core Social Auth settings, not the add-on directly:
social_auth_envato_enabled: Enable/disable the Envato OAuth driversocial_auth_envato_client_id: OAuth Client ID from build.envato.comsocial_auth_envato_client_secret: OAuth Client Secret
Creating an Envato Token
- Go to build.envato.com/create-token.
- Give it a descriptive name (e.g. “Larapen Support Site”).
- Enable these permissions:
- View and search Envato sites
- View the user’s Envato Account username
- View the user’s email address
- View the user’s account profile details
- View the user’s items’ sales history
- Copy the generated token and paste it in Admin → Envato → Settings.
author/sale API call will fail.
Admin: Settings
The settings page (Envato → Settings) is organized into tabs:
API Configuration
- Personal Token: Masked password field with show/hide toggle.
- Author Username: Your Envato Marketplace username.
- Test Connection button: AJAX call that tests the token in real time (works with unsaved values typed into the form). Returns the resolved username on success.
Dependency Status
Shows whether the required Licenses add-on is active, with a warning when it is not.
Verification Options
- Require Email Match: when enabled, the buyer’s Envato email must match their site account email.
Licenses Sync
Shown while the Licenses add-on is active:
- Allow several license products per item (
envato_link_multiple_products): off by default, so an item links to one license product and the Linked license products modal swaps it when another is picked. - Run sync in the background (
envato_license_sync_queued): when a key is verified through the Licenses add-on with the Envato marketplace, the matching customer and item records are created here; enable this only with a running queue worker.
Admin: Items
The Items page (Envato → Items) manages your local catalog of Envato Marketplace items.
Items List
A sortable, paginated table (20 per page) showing:
- Thumbnail: item icon from Envato
- Name & Envato ID
- Marketplace site (e.g. codecanyon, themeforest)
- Price (formatted from cents)
- Sales count
- Links: how many license products this item is linked to; the linked products are also shown as badges under the item name
- Last synced date
Per-item actions: View, Manage Links (opens the Linked license products modal, where a license product can also be created from the item: see License Product), Delete. Bulk delete with checkbox selection. Filters: search (name or Envato ID), marketplace site, linked / not linked, with / without purchases.
Importing Items
Click Import from Envato to start a JavaScript-driven sequential import:
- The UI sends
POST admin/envato/items/import?page=1. - The server fetches one page (up to 10 items) from the Envato
author/salesendpoint. - For each new item (not already in DB), it calls
getCatalogItem()to get full details. - A progress bar updates in real time showing: new items imported, items skipped (duplicates), pages processed.
- If
hasMore = true, the JS automatically requests the next page.
Item Detail & Sync
The item detail page (Envato → Items → {item}) shows:
- Item info card: thumbnail, name, Envato ID, marketplace, author, price, sales count, rating, “View on Envato” link
- Linked license products badges under the item name (when the Licenses add-on is active), see License Product
- Sync Now button: re-fetches the item from the Envato catalog API and updates all fields
- Add Purchase Code form: admin can manually add a known purchase code for this item
- Purchases table: all verified purchases for this item, showing buyer username, linked site user, email, purchase code (full, visible to admin), license type, amount, sold date
- Linked To sidebar: the license products this item is linked to (inactive ones flagged), with an Edit button that opens the Linked license products modal
Creating a License Product from an Item
When the Licenses add-on is active, the Linked license products modal of an item has a Create license product button. It is the per-item counterpart of the Licenses add-on's bulk Import from Envato: use it to turn a single item into a license product on demand, without re-running the whole import.
- One click creates a license product from the item (name, description and metadata such as marketplace, author, price and sales count), links the item to it and selects it in the modal. If the item already has a license product, that product is refreshed instead, so no duplicate is created.
- The product’s SKU is its own identifier and is not the Envato item ID: the item ID is kept in the item’s
Envato listing (
licenses_product_marketplace), which is what identifies the product for Envato purchase codes. - Importing items on this page also creates the matching license products (when the Envato marketplace is enabled in the Licenses settings).
Admin: Linked License Products
An Envato item is linked to the license product(s) it sells. License products are the only thing an item can be linked to: helpdesk departments, KB collections and forum categories are linked to license products in the Licenses add-on, never to Envato items.
Editing Links
- Open the Linked license products modal from the link icon of an item row on Envato → Items, or from the
Edit button of the item page’s Linked To card (permission
envato.links.edit). There is no separate links page any more: the old/admin/envato/linkspage was retired in 1.0.5. - The modal uses the shared License Products picker (searchable, with slug / SKU / version on each row).
One product per item by default; several when
envato_link_multiple_productsis on. - Create license product (shown with the
licenses.products.createorlicenses.products.editpermission) creates the product from the item in one click and selects it. - Saving replaces the item’s links with the selected products.
licenses_product_marketplace table (external_id = the Envato item ID, listing_id = envato_items.id).
The former envato_item_links table is dropped by the 1.0.6 update after its rows are copied there.
The same record is shown in the Envato section of the license product form (Licenses → Products).
Admin: Customers
The Customers page (Envato → Customers) provides an aggregated view of all buyers.
Customers List
Purchases are grouped by buyer_username, showing:
- Envato username
- Linked site account (if any)
- Purchases count & Items count
- Total spent
- Support status (active/expired badge)
- Last purchase date
Searchable by buyer username, buyer email, or linked user name/email.
Customer Detail
Click a customer row to see their full purchase history:
- Sidebar: username, email, linked site account with “Revoke Link” button, stats grid (purchases, items, total spent, verified count), support status alert
- Purchases table: item thumbnail, item name, purchase code, license type, amount, sold date, support expiry badge
Revoking a Link
The Revoke Link action:
- Removes all
envato_user_purchasesrecords for the buyer - Clears the user’s Envato OAuth data (
provider,provider_id,provider_token, etc.) - The user loses access to all purchase-gated features immediately
Linked Accounts
The Linked Accounts page (Envato → Linked Accounts) shows all site users who have connected their Envato account via OAuth.
- Site user: avatar, name, email
- Envato username badge
- Purchases count
- Linked at date
Per-row actions:
- Sync Purchases (AJAX): calls the Envato
buyer/purchasesendpoint using the user’s stored OAuth token and imports any new purchases. Updates the count badge inline. - View Purchases: navigates to the customer detail page
- Revoke Link: disconnects the Envato account and removes all purchases
OAuth Flow
The Envato OAuth integration uses Laravel Socialite and is handled by the core SocialAuthController.
For New Users (Login/Register)
- User clicks “Login with Envato” on the login page.
- Redirected to Envato’s OAuth authorization page.
- After approval, Envato redirects back to
/auth/envato/callback. - The system finds or creates a user account (matching by Envato username, then email).
- OAuth tokens (
provider_token,provider_refresh_token,provider_token_expires_at) are stored on theuserstable. - All the user’s Envato purchases are automatically synced via
syncUserPurchases(). - User is logged in and redirected.
For Existing Users (Linking Account)
- Authenticated user clicks “Connect Envato Account” on the My Purchases page.
- Redirected to Envato OAuth.
- After approval, the callback links the Envato account to the existing user.
- Revalidation: Any existing purchases that belong to a different Envato buyer are removed.
- Sync: All new purchases from the buyer’s account are imported.
- User is redirected back to the My Purchases page with a summary message.
Token Refresh
The EnvatoApiClient::getBuyerPurchases() method automatically checks token expiry.
If the token is expired (or expires within 5 minutes), it calls refreshUserToken()
which uses the stored refresh token to get a new access token from the Envato API.
The new token is saved to the database transparently.
My Purchases
The front-end purchases page is available at /{locale}/envato/purchases (requires authentication).
URL & Routes
| Method | URL | Route Name | Description |
|---|---|---|---|
| GET | /{locale}/envato/purchases |
envato.purchases.localized |
My Purchases page |
| POST | /{locale}/envato/purchases/add |
envato.purchases.store.localized |
Add a purchase code |
| DELETE | /{locale}/envato/purchases/disconnect |
envato.purchases.disconnect.localized |
Disconnect Envato account |
| POST | /{locale}/envato/purchases/{id}/register-as-license |
envato.purchases.register-as-license.localized |
Register a verified purchase as a license key (Licenses add-on, JSON) |
| DELETE | /{locale}/envato/purchases/{id} |
envato.purchases.destroy.localized |
Remove a specific purchase |
Non-localized variants (without {locale}) are also registered.
Page Layout
Three-column responsive layout (col-lg-8 + col-lg-4):
Main Content
- Not connected: A styled “Connect Your Envato Account” card with an Envato-green connect button. Shows a warning if OAuth is disabled in settings.
- Connected: A “Connected as {username}” badge with a Disconnect button.
- Add Purchase Code form: text input for the purchase code (UUID format) + submit button. Only shown when the user’s Envato account is connected.
- Verified Purchases list: each purchase shows: item thumbnail, name, masked purchase code, license type, support expiry date, verification date, and a Remove button.
Sidebar
- Envato Account status card (connected/not-connected badge, connect/disconnect action)
- Need Support? card with helpdesk link (shown only if HelpDesk add-on is active)
- Help tips list
Disconnecting
When a user disconnects their Envato account:
- All their
envato_user_purchasesrecords are deleted. - The
provider,provider_id,provider_token,provider_refresh_token,provider_token_expires_at, andprovider_avatarcolumns on theuserstable are set to null. - They lose access to all purchase-gated features immediately.
Purchase Validation Flow
When a user submits a purchase code (via the My Purchases page), the system follows this validation flow:
- Check local database: is this purchase code already in
envato_user_purchases? If so, check ownership:- If the code belongs to the current user: return “already added”.
- If the code belongs to another user: return
already_usederror.
- Verify via Envato API: call
author/sale?code={code}using the author’s personal token. - Find or create item: match the response’s
item.idto a localenvato_itemsrecord. If not found, auto-create the item from the API response. - Buyer identity check: verify the user is the actual buyer using this priority:
- Envato OAuth match:
provider = 'envato'ANDprovider_id = buyer_username(most reliable) - Name match: user’s name matches buyer username
- Email prefix match: email prefix matches buyer username
- Envato OAuth match:
- Create purchase record: insert into
envato_user_purchaseswith verification data. - Auto-register license: if the Licenses add-on is active, automatically create a
LicenseKeyrecord (see Licenses Integration).
Validation Statuses
| Status | Description |
|---|---|
valid |
Purchase code verified and added successfully. |
invalid |
Purchase code not found on Envato or does not belong to the configured author. |
already_used |
Purchase code is already registered by another user on this site. |
email_mismatch |
Email match is required but the buyer’s email doesn’t match the user’s email. |
item_mismatch |
The purchase code is valid but belongs to a different item than expected. |
api_error |
An error occurred communicating with the Envato API (network error, invalid token, etc.). |
Access Control: Purchase Gating
Access gating is a feature of the Licenses add-on (since Envato 1.0.2). The Envato add-on’s role is to turn verified
purchases into license keys; it no longer links items to helpdesk, forum or KB entities, and its former
EnvatoPurchaseValidator class, envato.access.checker binding and items-for-entity endpoint are gone.
How Gating Works
- An admin links each Envato item to its license product (Linked license products).
- An admin links license products to helpdesk departments, KB collections or forum categories (stored in the Licenses
licenses_entity_linkstable), from the HelpDesk and Forum admin pages. - An admin enables the matching Licenses option:
licenses_helpdesk_require_purchase,licenses_kb_restrict_by_purchaseorlicenses_forum_require_purchase. - When a buyer adds a purchase code (or verifies one through the License API), the Envato add-on registers a license key for the item’s license product (see Licenses Add-on Integration).
- The helpdesk / forum add-ons ask the Licenses add-on (
LicensesAccessService) whether the user holds an active license key for a product linked to the entity.
HelpDesk Integration
When licenses_helpdesk_require_purchase is enabled (HelpDesk settings), a department linked to license products only accepts tickets
from users holding a license key for one of them. The ticket form links to the My Purchases page so buyers can add their
Envato purchase code. Admins also see the customer’s Envato purchases in the ticket sidebar.
Forum Integration
When licenses_forum_require_purchase is enabled (Forum settings), threads and replies in a category linked to license products are
reserved to users holding a license key for one of them: whatever marketplace the key comes from (Envato, Gumroad, Shop or manual).
Knowledge Base Integration
When licenses_kb_restrict_by_purchase is enabled (HelpDesk settings), a KB collection linked to license products is only readable by
users holding a license key for one of them: guests are sent to the login page, and signed-in users without a key to their
My Licenses page, where they can register one.
Licenses Add-on Integration
When both the Envato and Licenses add-ons are active, and the Envato marketplace is enabled in
Licenses → Settings → Marketplaces (licenses_envato_marketplace_enabled), the integration is bidirectional.
Envato → Licenses (Automatic Key Creation)
When a verified Envato purchase is created, a license key is automatically registered:
- Checks if the Licenses add-on is active.
- Checks if a license key with this purchase code already exists (skips if so).
- Resolves the
LicenseProductin this order: the active product(s) the item is linked to (Linked license products) → any product with an Envato listing for the item ID → a product whose slug or slug alias matches the item name → the first active product → a new product, which is immediately listed under the item so the next sale resolves through the link. - Maps the Envato license type: “Extended License” →
extended, all others →standard. - Creates a license key with
marketplace = 'envato', the purchase code as the key, andexpires_at = null(Envato licenses are perpetual).
Envato Items → Licenses Products Sync
When the Envato marketplace is enabled in the Licenses settings:
- Import: Importing Envato items on Admin → Envato → Items automatically creates corresponding
license products and records each item as the product’s Envato listing (
licenses_product_marketplace). The Envato item ID is not written into the product SKU or metadata; an item already listed keeps its product. - Delete: Deleting Envato items also removes the license product listed under the item’s Envato ID, and the item’s listings.
Licenses → Envato (Marketplace Verification)
When a purchase code is verified via the Licenses API (GET /api/licenses/verify) and is not found locally,
the Envato marketplace automatically verifies it against the Envato API. If valid, the key is created for future lookups, against the license product the item is linked to.
The item and purchase are then mirrored into the Envato Items and Customers pages (see envato_license_sync_queued).
If the Envato add-on is active, its API client is used for verification. Otherwise, the Licenses add-on makes direct HTTP calls to the Envato API.
What the License API accepts as the product
A client app sends the product parameter next to the purchase code on GET /api/licenses/verify. The Licenses add-on accepts several
identifiers of the same product, and the Envato item ID is one of them, through the item’s listing, not through the SKU:
| What the client sends | What happens |
|---|---|
| The license product’s SKU | Accepted first. This is what current client apps send before anything else (manifest key sku). |
| One of its slug aliases | Accepted next. An alias may be shared by several products, so a key of either one verifies. |
| The Envato item ID | Accepted when the item is listed under that license product (see Linked license products). This is the manifest’s
marketplace_item_ids.envato. If the product has no Envato listing for that ID, nothing matches and the answer is
“License key does not belong to this product.” |
| Its slug (directory name) | Accepted last, which is what old client apps send. |
No product at all |
The product check is skipped: the key verifies as long as it exists, is active and its activation limit allows it. The answer still names the real product. |
item_id= instead of product=. On GET /api/licenses/verify that parameter is
ignored, so the call behaves like the last row above: verified, but against no particular product. It is only read by the Licenses
legacy verification endpoint (whose path defaults to envato.php, the one those clients already call), which resolves the item ID
to its license product through the Envato listing and then does check it. Matching is exact: case-sensitive and untrimmed.
The full order the server tries, and the other marketplaces’ identifiers, are documented in the Licenses add-on documentation (How the API Recognizes a Product).
Updating
There are two ways to update this add-on: via the admin panel (recommended) or manually replacing files.
Method 1: Admin Panel Upload (Recommended)
- Download the latest
.zipfile of this add-on. - Go to Admin panel → Add-ons and click the Upload button.
- Select or drag the
.zipfile into the upload area. - A confirmation prompt will show the current and new version numbers. Click Replace to proceed.
- Go to Admin panel → System Update (
/admin/update) to apply any pending database migrations.
Method 2: Manual File Replacement
Step 1: Replace Files
Replace the add-on directory with the new version.
Step 2: Run Migrations
php artisan migrate
Pending migrations run once, so the command is safe to repeat.
Step 3: Clear Caches
php artisan config:clear
php artisan route:clear
php artisan view:clear
Step 4: Verify
Visit Envato → Settings and click Test Connection to confirm the API token still works.
licenses_product_marketplace
table and drops envato_item_links; while the Licenses tables are missing it skips that step and keeps the table until the Licenses update has run.
Uninstallation
Switching an add-on off without losing anything is a deactivation: go to Admin panel → Add-ons, find Envato Market Integration and click Deactivate.
- Its routes, views, admin menu entries and permissions stop being registered, and its front-end pages stop answering.
- Its database tables and all the data they hold are kept, and its files stay under
extensions/addons/envato/. Nothing is deleted. - The purchase code recorded at activation is kept too, so activating the add-on again does not ask for it.
- Deactivation is refused while another active add-on depends on this one: deactivate that add-on first.
Click Activate on the same card to switch it back on. Pending migrations are re-run, assets are republished, and the add-on picks up exactly where it left off.
Removing
Removing is permanent and destroys the add-on's data. The Remove button only appears on a deactivated add-on, so removal is always two steps:
- Deactivate Envato Market Integration (see Uninstallation).
- Click Remove on its card and confirm the prompt.
The admin panel then, in one pass:
- runs the add-on's uninstall hook, if it ships one, while its code is still on disk;
- revokes the permissions declared in its
addon.json; - rolls back its migrations (this drops its database tables and every row they hold) and purges its entries from the
migrationstable, so a later reinstall migrates from scratch; - deletes its published assets:
public/addons/envato/,public/vendor/envato/andstorage/app/public/addons/envato/; - deletes the add-on directory
extensions/addons/envato/; - deletes its row in the
addonstable (the recorded purchase code goes with it) and clears the application cache.
Removal is refused, with an explanatory message and before anything is destroyed, when the add-on is still active, when another active add-on depends on it, or when the web server (PHP) user cannot delete extensions/addons/envato/. In that last case, give that user write permission on the directory and on its parent, then try again.
Deleting the folder over FTP or SSH is not equivalent: the add-on's tables, its entries in the migrations table and its addons row are all left behind, and its card stays in the list. Use Remove in the admin panel instead.
Troubleshooting
Test Connection fails: “Could not connect to Envato API”
Check that:
- The API token is correct and has not been revoked.
- The token has the required permissions (especially “View sales history”).
- Your server can reach
api.envato.com(no firewall blocking outbound HTTPS).
Import finds no items
The import uses the author/sales endpoint, which only returns items you have sold.
If you have a new item with zero sales, it won’t appear in the import. You can manually add items
to the database or wait for the first sale.
Purchase code verification fails: “Invalid purchase code”
- Ensure the purchase code is a valid UUID (36 characters, including dashes).
- Verify the code belongs to one of your items (the
author/saleendpoint only returns sales by the configured author). - Check that
envato_author_usernameis set correctly in settings.
User can’t connect Envato account
- Ensure the Envato OAuth driver is enabled in Admin → Settings → Social Auth.
- Verify the
Client IDandClient Secretare set. - The callback URL at Envato must match
https://yoursite.com/auth/envato/callbackexactly.
Purchases not syncing after OAuth connect
- The OAuth token may have expired. Try disconnecting and reconnecting.
- Check that the
provider_tokenandprovider_refresh_tokencolumns exist on theuserstable (runphp artisan migrateif the migration hasn’t run). - Check server logs for Envato API errors during the sync process.
Purchase gating not working: users can access without a purchase
- Gating is a Licenses feature: ensure the relevant Licenses option is enabled (
licenses_helpdesk_require_purchase,licenses_forum_require_purchaseorlicenses_kb_restrict_by_purchase). - Ensure at least one license product is linked to the entity (
licenses_entity_links). Entities with no linked product are always unrestricted. - Ensure the Envato item is linked to that license product (Linked license products); otherwise the buyer’s key is registered against another product.
License key registered against the wrong product
- A purchase is registered against the license product the item is linked to. Open the item, check its Linked To card and fix the link.
- Without a link, the product is guessed (slug or alias of the item name, then the first active product): always link your items.
- Run
php artisan licenses:doctor: it reports links pointing at a deleted item or product (orphan_link), products imported from Envato but linked to none of its items (source_without_link) and linked items whose title differs (title_mismatch).
Item links disappeared after updating
- Envato 1.0.6 copies the remaining
envato_item_linksrows into the Licenseslicenses_product_marketplacetable, then drops the table. Update the Licenses add-on to 1.0.13 first: its update copies the links too, and the Envato migration skips the copy (and keeps the table) while the Licenses tables do not exist. - If Envato was updated first, update Licenses, then run the pending updates again from Admin → System Update so the Envato migration can finish.
Buyer identity mismatch: purchase rejected despite valid code
The system tries to match the buyer to the authenticated user via three methods (in order):
- Envato OAuth match (provider_id = buyer username): most reliable
- Name match
- Email prefix match
If none match, the purchase is rejected. Solution: have the user connect their Envato account via OAuth first, then add the purchase code. The OAuth match is definitive.
Auto-license creation not working
- Ensure the Licenses add-on is installed and active.
- Check that
Addons\Licenses\Services\LicenseKeyServiceclass exists. - Check that the Envato marketplace is enabled in Licenses → Settings → Marketplaces (
licenses_envato_marketplace_enabled) for License API verifications and item imports. - Check server logs for warnings during the auto-registration process.
- If a license key with the same purchase code already exists, auto-creation is skipped (by design).
Envato Market Integration v1.0.0: Part of the Larapen CMS platform.
© BeDigit. All rights reserved.