fluentcart-developer 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +22 -22
- package/LICENSE +21 -21
- package/README.md +169 -127
- package/SKILL.md +127 -127
- package/bin/index.js +281 -281
- package/package.json +48 -37
- package/skills/fluentcart-developer/SKILL.md +172 -172
- package/skills/fluentcart-developer/examples/README.md +25 -25
- package/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
- package/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
- package/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +114 -114
- package/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +149 -149
- package/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
- package/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +62 -62
- package/skills/fluentcart-developer/references/action-hooks-admin-templates.md +787 -787
- package/skills/fluentcart-developer/references/action-hooks-cart-checkout.md +1355 -1355
- package/skills/fluentcart-developer/references/action-hooks-customers-users.md +266 -266
- package/skills/fluentcart-developer/references/action-hooks-licenses.md +855 -855
- package/skills/fluentcart-developer/references/action-hooks-orders.md +631 -631
- package/skills/fluentcart-developer/references/action-hooks-payments-integrations.md +963 -963
- package/skills/fluentcart-developer/references/action-hooks-products-coupons.md +585 -585
- package/skills/fluentcart-developer/references/action-hooks-subscriptions.md +661 -661
- package/skills/fluentcart-developer/references/database-models-query-builder.md +194 -194
- package/skills/fluentcart-developer/references/database-models-reference.md +604 -604
- package/skills/fluentcart-developer/references/database-schema-reference.md +940 -940
- package/skills/fluentcart-developer/references/engineering-notes.md +154 -154
- package/skills/fluentcart-developer/references/fee-system-guide.md +449 -449
- package/skills/fluentcart-developer/references/filter-hooks-cart-checkout.md +1202 -1202
- package/skills/fluentcart-developer/references/filter-hooks-customers-subscriptions.md +902 -902
- package/skills/fluentcart-developer/references/filter-hooks-integrations-advanced.md +1598 -1598
- package/skills/fluentcart-developer/references/filter-hooks-orders-payments.md +1319 -1319
- package/skills/fluentcart-developer/references/filter-hooks-products-pricing.md +628 -628
- package/skills/fluentcart-developer/references/filter-hooks-settings-configuration.md +1177 -1177
- package/skills/fluentcart-developer/references/fluentcart-developer-guide.md +154 -154
- package/skills/fluentcart-developer/references/ghost-product-selling.md +458 -458
- package/skills/fluentcart-developer/references/modules-and-extensions-reference.md +224 -224
- package/skills/fluentcart-developer/references/payment-gateway-integration.md +761 -761
- package/skills/fluentcart-developer/references/rest-api-checkout.md +286 -286
- package/skills/fluentcart-developer/references/rest-api-coupons.md +794 -794
- package/skills/fluentcart-developer/references/rest-api-customer-profile.md +190 -190
- package/skills/fluentcart-developer/references/rest-api-customers.md +1121 -1121
- package/skills/fluentcart-developer/references/rest-api-dashboard-utilities.md +219 -219
- package/skills/fluentcart-developer/references/rest-api-email-notifications.md +619 -619
- package/skills/fluentcart-developer/references/rest-api-files.md +290 -290
- package/skills/fluentcart-developer/references/rest-api-integrations.md +324 -324
- package/skills/fluentcart-developer/references/rest-api-labels-attributes.md +321 -321
- package/skills/fluentcart-developer/references/rest-api-licensing.md +171 -171
- package/skills/fluentcart-developer/references/rest-api-order-bumps.md +200 -200
- package/skills/fluentcart-developer/references/rest-api-orders.md +1241 -1241
- package/skills/fluentcart-developer/references/rest-api-overview.md +131 -131
- package/skills/fluentcart-developer/references/rest-api-products.md +2563 -2563
- package/skills/fluentcart-developer/references/rest-api-public-shop.md +172 -172
- package/skills/fluentcart-developer/references/rest-api-reference.md +552 -552
- package/skills/fluentcart-developer/references/rest-api-reports.md +377 -377
- package/skills/fluentcart-developer/references/rest-api-roles-permissions.md +147 -147
- package/skills/fluentcart-developer/references/rest-api-settings.md +528 -528
- package/skills/fluentcart-developer/references/rest-api-shipping.md +799 -799
- package/skills/fluentcart-developer/references/rest-api-subscriptions.md +606 -606
- package/skills/fluentcart-developer/references/rest-api-tax.md +356 -356
- package/skills/fluentcart-developer/references/subscription-customization.md +197 -197
- package/skills/fluentcart-developer/scripts/cli.js +1 -1
- package/.gitattributes +0 -2
- package/CONTRIBUTING.md +0 -73
- package/copy-skills.js +0 -43
- package/skills.sh.json +0 -13
|
@@ -1,171 +1,171 @@
|
|
|
1
|
-
# Software Licensing API (Pro)
|
|
2
|
-
|
|
3
|
-
Comprehensive developer reference for managing software licenses in FluentCart Pro, including admin license management, per-product license rules, customer portal self-service, site license activation, and the public non-REST software update API for plugins and themes.
|
|
4
|
-
|
|
5
|
-
**Base URLs:**
|
|
6
|
-
- REST API: `https://your-site.com/wp-json/fluent-cart/v2`
|
|
7
|
-
- Public Update API (Non-REST): `https://your-site.com/?fluent-cart={action}`
|
|
8
|
-
|
|
9
|
-
**Policies:** `LicensePolicy` (Admin) / `CustomerFrontendPolicy` (Customer Portal) / `AdminPolicy` (Site License) / `PublicPolicy` (Public Update API)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Endpoints Overview
|
|
14
|
-
|
|
15
|
-
| Group | Method | Endpoint | Authorization | Description |
|
|
16
|
-
|-------|--------|----------|---------------|-------------|
|
|
17
|
-
| **Admin Licensing** | GET | `/licensing/licenses` | `licenses/view` | List licenses with tab filters (`active`, `expired`, `disabled`, `inactive`) |
|
|
18
|
-
| | GET | `/licensing/licenses/customer/{id}` | `licenses/view` | List licenses for a specific customer |
|
|
19
|
-
| | GET | `/licensing/licenses/{id}` | `licenses/view` | Get full license details, activations, & order relation |
|
|
20
|
-
| | POST | `/licensing/licenses/{id}/regenerate-key` | `licenses/manage` | Generate new random key & invalidate old key |
|
|
21
|
-
| | POST | `/licensing/licenses/{id}/extend-validity` | `licenses/manage` | Change expiration date (`YYYY-MM-DD HH:MM:SS` or `lifetime`) |
|
|
22
|
-
| | POST | `/licensing/licenses/{id}/update_status` | `licenses/manage` | Change status (`active`, `disabled`, `expired`) |
|
|
23
|
-
| | POST | `/licensing/licenses/{id}/update_limit` | `licenses/manage` | Update max site limit (`0` or `"unlimited"`) |
|
|
24
|
-
| | POST | `/licensing/licenses/{id}/activate_site` | `licenses/manage` | Manually activate site URL |
|
|
25
|
-
| | POST | `/licensing/licenses/{id}/deactivate_site` | `licenses/manage` | Deactivate specific site activation by `activation_id` |
|
|
26
|
-
| | DELETE | `/licensing/licenses/{id}/delete` | `licenses/delete` | Delete software license |
|
|
27
|
-
| **Product Settings** | GET | `/licensing/products/{id}/settings` | `licenses/view` | Get per-product variation validity & activation rules |
|
|
28
|
-
| | POST | `/licensing/products/{id}/settings` | `licenses/manage` | Save per-product license configuration (Guarded for bundles) |
|
|
29
|
-
| **Customer Portal** | GET | `/customer-profile/licenses/` | Portal Auth | List logged-in customer's licenses (uses `license_key`) |
|
|
30
|
-
| | GET | `/customer-profile/licenses/{key}` | Portal Auth | Get customer license details & section parts |
|
|
31
|
-
| | GET | `/customer-profile/licenses/{key}/activations` | Portal Auth | List active sites (`is_local` sites don't count towards limit) |
|
|
32
|
-
| | POST | `/customer-profile/licenses/{key}/deactivate_site` | Portal Auth | Deactivate site from customer portal |
|
|
33
|
-
| **Plugin Pro License** | GET | `/settings/license/` | `AdminPolicy` | Get site's FluentCart Pro plugin license status |
|
|
34
|
-
| | POST | `/settings/license/` | `AdminPolicy` | Activate FluentCart Pro plugin license key on site |
|
|
35
|
-
| | DELETE | `/settings/license/` | `AdminPolicy` | Deactivate FluentCart Pro plugin license on site |
|
|
36
|
-
| **Public API (Non-REST)** | GET/POST | `/?fluent-cart=check_license` | Public | Verify license validity & activation count |
|
|
37
|
-
| | POST | `/?fluent-cart=activate_license` | Public | Activate site (Auto-detects staging/local sites) |
|
|
38
|
-
| | POST | `/?fluent-cart=deactivate_license` | Public | Deactivate site URL |
|
|
39
|
-
| | GET/POST | `/?fluent-cart=get_license_version` | Public | Fetch plugin/theme version, changelog, & 48h signed download package URL |
|
|
40
|
-
| | GET | `/?fluent-cart=download_license_package` | Public (Token) | Validates `fct_package` token & 302 redirects to file |
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## 1. Admin License Management
|
|
45
|
-
|
|
46
|
-
**Prefix:** `/fluent-cart/v2/licensing/licenses` | **Policy:** `LicensePolicy`
|
|
47
|
-
|
|
48
|
-
### List Licenses
|
|
49
|
-
|
|
50
|
-
`GET /fluent-cart/v2/licensing/licenses`
|
|
51
|
-
|
|
52
|
-
#### Parameters
|
|
53
|
-
|
|
54
|
-
| Parameter | Type | Required | Description |
|
|
55
|
-
|-----------|------|----------|-------------|
|
|
56
|
-
| `active_view` | string | No | Tab filter: `active`, `expired`, `disabled`, `inactive` |
|
|
57
|
-
| `search` | string | No | Search across license key, order ID, customer, activated URLs, or operator syntax (`license_key = abc`) |
|
|
58
|
-
| `sort_by` | string | No | Fillable column to sort by (default: `id`) |
|
|
59
|
-
| `sort_type` | string | No | `asc` or `desc` (default: `desc`) |
|
|
60
|
-
| `filter_type` | string | No | `simple` or `advanced` |
|
|
61
|
-
| `advanced_filters` | string (JSON) | No | JSON filter array (by product variation, customer names, status, activations count, expiration date) |
|
|
62
|
-
| `user_tz` | string | No | Timezone string for date filtering |
|
|
63
|
-
|
|
64
|
-
> **Status Override Note:** If a license has an `expiration_date` in the past, its status field is dynamically overridden to `expired` in the API response even if stored as `active`.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
### Extend License Validity
|
|
69
|
-
|
|
70
|
-
`POST /fluent-cart/v2/licensing/licenses/{id}/extend-validity`
|
|
71
|
-
|
|
72
|
-
#### Parameters
|
|
73
|
-
|
|
74
|
-
| Parameter | Type | Required | Description |
|
|
75
|
-
|-----------|------|----------|-------------|
|
|
76
|
-
| `id` | integer | Yes | License ID |
|
|
77
|
-
| `expiration_date` | string | Yes | Date string (`YYYY-MM-DD HH:MM:SS`) or string `lifetime` |
|
|
78
|
-
|
|
79
|
-
> Automatically updates status to `active` if currently `inactive` or non-active.
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
### Product License Settings
|
|
84
|
-
|
|
85
|
-
`GET /fluent-cart/v2/licensing/products/{id}/settings`
|
|
86
|
-
`POST /fluent-cart/v2/licensing/products/{id}/settings`
|
|
87
|
-
|
|
88
|
-
Configures software versioning, auto-update file, WP readme/banner metadata, and variation validity rules (`unit`: `day`, `week`, `month`, `year`, `lifetime`; `value`: integer; `activation_limit`: integer/string).
|
|
89
|
-
|
|
90
|
-
> **Bundle Product Guard:** Licensing is disabled for bundle products (`is_bundle_product: true`). Bundle item licenses are generated based on each individual bundle item's license settings. Attempting to save licensing settings on a bundle product returns HTTP `422`.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## 2. Customer Portal Self-Service
|
|
95
|
-
|
|
96
|
-
Endpoints under `/fluent-cart/v2/customer-profile/licenses` identify licenses by their `license_key` string (not numeric ID).
|
|
97
|
-
|
|
98
|
-
- `GET /customer-profile/licenses/` — List customer's licenses. Returns `license_key`, `status`, `expiration_date`, `activation_count`, `limit`, `renewal_url`, `has_upgrades`.
|
|
99
|
-
- `GET /customer-profile/licenses/{key}` — Full details & `section_parts` extension hooks.
|
|
100
|
-
- `GET /customer-profile/licenses/{key}/activations` — List activated sites (`site_url`, `is_local`, `status`). `is_local: 1` sites do not count towards the activation limit.
|
|
101
|
-
- `POST /customer-profile/licenses/{key}/deactivate_site` — Deactivate site (`site_url`).
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## 3. Public License & Software Update API (Non-REST)
|
|
106
|
-
|
|
107
|
-
Designed for distributed software (plugins, themes, desktop applications) to perform automatic updates and activation directly via query string requests.
|
|
108
|
-
|
|
109
|
-
**Base URL:** `https://your-site.com/?fluent-cart={action}`
|
|
110
|
-
|
|
111
|
-
### Key Endpoints
|
|
112
|
-
|
|
113
|
-
#### 1. Activate License (`/?fluent-cart=activate_license`)
|
|
114
|
-
|
|
115
|
-
`POST /?fluent-cart=activate_license`
|
|
116
|
-
|
|
117
|
-
**Parameters:** `license_key`, `item_id`, `site_url`, `server_version`, `platform_version`.
|
|
118
|
-
|
|
119
|
-
> **Local & Staging Site Auto-Detection:**
|
|
120
|
-
> Sites matching common staging patterns are automatically assigned `is_local = 1` and do not count toward activation limits:
|
|
121
|
-
> - **Subdomains:** `staging.`, `dev.`, `test.`, `qa.`, `sandbox.`, `beta.`, `preview.`, `uat.`, `development.`
|
|
122
|
-
> - **Subfolders:** `/staging/`, `/dev/`, `/test/`
|
|
123
|
-
> - **Domains:** `localhost`, `.wpengine.com`, `.kinsta.cloud`, `.cloudwaysapps.com`, `.pantheonsite.io`
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
#### 2. Get License Version (`/?fluent-cart=get_license_version`)
|
|
128
|
-
|
|
129
|
-
`GET/POST /?fluent-cart=get_license_version`
|
|
130
|
-
|
|
131
|
-
**Parameters:** `item_id`, `license_key` (or `activation_hash`), `site_url`.
|
|
132
|
-
|
|
133
|
-
Returns version metadata (`new_version`, `stable_version`, `sections.changelog`, `banners`, `icons`).
|
|
134
|
-
- **Valid License:** Includes `package` signed URL containing a time-limited token (**expires in 48 hours**).
|
|
135
|
-
- **Invalid / Expired License:** Returns version metadata but sets `package: ""` and `download_link: ""`.
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
#### 3. Download Package (`/?fluent-cart=download_license_package`)
|
|
140
|
-
|
|
141
|
-
`GET /?fluent-cart=download_license_package&fct_package={token}`
|
|
142
|
-
|
|
143
|
-
Validates `fct_package` Base64 token and returns an HTTP `302` redirect to the actual file download payload.
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Hooks & Filters Reference
|
|
148
|
-
|
|
149
|
-
```php
|
|
150
|
-
// Filter check license response payload
|
|
151
|
-
add_filter('fluent_cart/license/check_license_response', function($response) {
|
|
152
|
-
// Modify response array
|
|
153
|
-
return $response;
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// Customize staging domain detection
|
|
157
|
-
add_filter('fluent_cart/license/staging_domains', function($domains) {
|
|
158
|
-
$domains[] = 'mycompany-staging.com';
|
|
159
|
-
return $domains;
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
// Customize license expiration grace period (default 15 days)
|
|
163
|
-
add_filter('fluent_cart/license/grace_period_in_days', function($days) {
|
|
164
|
-
return 30;
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
// Action triggered on successful site activation
|
|
168
|
-
add_action('fluent_cart/license/site_activated', function($activationData) {
|
|
169
|
-
// Handle post-activation logic
|
|
170
|
-
});
|
|
171
|
-
```
|
|
1
|
+
# Software Licensing API (Pro)
|
|
2
|
+
|
|
3
|
+
Comprehensive developer reference for managing software licenses in FluentCart Pro, including admin license management, per-product license rules, customer portal self-service, site license activation, and the public non-REST software update API for plugins and themes.
|
|
4
|
+
|
|
5
|
+
**Base URLs:**
|
|
6
|
+
- REST API: `https://your-site.com/wp-json/fluent-cart/v2`
|
|
7
|
+
- Public Update API (Non-REST): `https://your-site.com/?fluent-cart={action}`
|
|
8
|
+
|
|
9
|
+
**Policies:** `LicensePolicy` (Admin) / `CustomerFrontendPolicy` (Customer Portal) / `AdminPolicy` (Site License) / `PublicPolicy` (Public Update API)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Endpoints Overview
|
|
14
|
+
|
|
15
|
+
| Group | Method | Endpoint | Authorization | Description |
|
|
16
|
+
|-------|--------|----------|---------------|-------------|
|
|
17
|
+
| **Admin Licensing** | GET | `/licensing/licenses` | `licenses/view` | List licenses with tab filters (`active`, `expired`, `disabled`, `inactive`) |
|
|
18
|
+
| | GET | `/licensing/licenses/customer/{id}` | `licenses/view` | List licenses for a specific customer |
|
|
19
|
+
| | GET | `/licensing/licenses/{id}` | `licenses/view` | Get full license details, activations, & order relation |
|
|
20
|
+
| | POST | `/licensing/licenses/{id}/regenerate-key` | `licenses/manage` | Generate new random key & invalidate old key |
|
|
21
|
+
| | POST | `/licensing/licenses/{id}/extend-validity` | `licenses/manage` | Change expiration date (`YYYY-MM-DD HH:MM:SS` or `lifetime`) |
|
|
22
|
+
| | POST | `/licensing/licenses/{id}/update_status` | `licenses/manage` | Change status (`active`, `disabled`, `expired`) |
|
|
23
|
+
| | POST | `/licensing/licenses/{id}/update_limit` | `licenses/manage` | Update max site limit (`0` or `"unlimited"`) |
|
|
24
|
+
| | POST | `/licensing/licenses/{id}/activate_site` | `licenses/manage` | Manually activate site URL |
|
|
25
|
+
| | POST | `/licensing/licenses/{id}/deactivate_site` | `licenses/manage` | Deactivate specific site activation by `activation_id` |
|
|
26
|
+
| | DELETE | `/licensing/licenses/{id}/delete` | `licenses/delete` | Delete software license |
|
|
27
|
+
| **Product Settings** | GET | `/licensing/products/{id}/settings` | `licenses/view` | Get per-product variation validity & activation rules |
|
|
28
|
+
| | POST | `/licensing/products/{id}/settings` | `licenses/manage` | Save per-product license configuration (Guarded for bundles) |
|
|
29
|
+
| **Customer Portal** | GET | `/customer-profile/licenses/` | Portal Auth | List logged-in customer's licenses (uses `license_key`) |
|
|
30
|
+
| | GET | `/customer-profile/licenses/{key}` | Portal Auth | Get customer license details & section parts |
|
|
31
|
+
| | GET | `/customer-profile/licenses/{key}/activations` | Portal Auth | List active sites (`is_local` sites don't count towards limit) |
|
|
32
|
+
| | POST | `/customer-profile/licenses/{key}/deactivate_site` | Portal Auth | Deactivate site from customer portal |
|
|
33
|
+
| **Plugin Pro License** | GET | `/settings/license/` | `AdminPolicy` | Get site's FluentCart Pro plugin license status |
|
|
34
|
+
| | POST | `/settings/license/` | `AdminPolicy` | Activate FluentCart Pro plugin license key on site |
|
|
35
|
+
| | DELETE | `/settings/license/` | `AdminPolicy` | Deactivate FluentCart Pro plugin license on site |
|
|
36
|
+
| **Public API (Non-REST)** | GET/POST | `/?fluent-cart=check_license` | Public | Verify license validity & activation count |
|
|
37
|
+
| | POST | `/?fluent-cart=activate_license` | Public | Activate site (Auto-detects staging/local sites) |
|
|
38
|
+
| | POST | `/?fluent-cart=deactivate_license` | Public | Deactivate site URL |
|
|
39
|
+
| | GET/POST | `/?fluent-cart=get_license_version` | Public | Fetch plugin/theme version, changelog, & 48h signed download package URL |
|
|
40
|
+
| | GET | `/?fluent-cart=download_license_package` | Public (Token) | Validates `fct_package` token & 302 redirects to file |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 1. Admin License Management
|
|
45
|
+
|
|
46
|
+
**Prefix:** `/fluent-cart/v2/licensing/licenses` | **Policy:** `LicensePolicy`
|
|
47
|
+
|
|
48
|
+
### List Licenses
|
|
49
|
+
|
|
50
|
+
`GET /fluent-cart/v2/licensing/licenses`
|
|
51
|
+
|
|
52
|
+
#### Parameters
|
|
53
|
+
|
|
54
|
+
| Parameter | Type | Required | Description |
|
|
55
|
+
|-----------|------|----------|-------------|
|
|
56
|
+
| `active_view` | string | No | Tab filter: `active`, `expired`, `disabled`, `inactive` |
|
|
57
|
+
| `search` | string | No | Search across license key, order ID, customer, activated URLs, or operator syntax (`license_key = abc`) |
|
|
58
|
+
| `sort_by` | string | No | Fillable column to sort by (default: `id`) |
|
|
59
|
+
| `sort_type` | string | No | `asc` or `desc` (default: `desc`) |
|
|
60
|
+
| `filter_type` | string | No | `simple` or `advanced` |
|
|
61
|
+
| `advanced_filters` | string (JSON) | No | JSON filter array (by product variation, customer names, status, activations count, expiration date) |
|
|
62
|
+
| `user_tz` | string | No | Timezone string for date filtering |
|
|
63
|
+
|
|
64
|
+
> **Status Override Note:** If a license has an `expiration_date` in the past, its status field is dynamically overridden to `expired` in the API response even if stored as `active`.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### Extend License Validity
|
|
69
|
+
|
|
70
|
+
`POST /fluent-cart/v2/licensing/licenses/{id}/extend-validity`
|
|
71
|
+
|
|
72
|
+
#### Parameters
|
|
73
|
+
|
|
74
|
+
| Parameter | Type | Required | Description |
|
|
75
|
+
|-----------|------|----------|-------------|
|
|
76
|
+
| `id` | integer | Yes | License ID |
|
|
77
|
+
| `expiration_date` | string | Yes | Date string (`YYYY-MM-DD HH:MM:SS`) or string `lifetime` |
|
|
78
|
+
|
|
79
|
+
> Automatically updates status to `active` if currently `inactive` or non-active.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### Product License Settings
|
|
84
|
+
|
|
85
|
+
`GET /fluent-cart/v2/licensing/products/{id}/settings`
|
|
86
|
+
`POST /fluent-cart/v2/licensing/products/{id}/settings`
|
|
87
|
+
|
|
88
|
+
Configures software versioning, auto-update file, WP readme/banner metadata, and variation validity rules (`unit`: `day`, `week`, `month`, `year`, `lifetime`; `value`: integer; `activation_limit`: integer/string).
|
|
89
|
+
|
|
90
|
+
> **Bundle Product Guard:** Licensing is disabled for bundle products (`is_bundle_product: true`). Bundle item licenses are generated based on each individual bundle item's license settings. Attempting to save licensing settings on a bundle product returns HTTP `422`.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 2. Customer Portal Self-Service
|
|
95
|
+
|
|
96
|
+
Endpoints under `/fluent-cart/v2/customer-profile/licenses` identify licenses by their `license_key` string (not numeric ID).
|
|
97
|
+
|
|
98
|
+
- `GET /customer-profile/licenses/` — List customer's licenses. Returns `license_key`, `status`, `expiration_date`, `activation_count`, `limit`, `renewal_url`, `has_upgrades`.
|
|
99
|
+
- `GET /customer-profile/licenses/{key}` — Full details & `section_parts` extension hooks.
|
|
100
|
+
- `GET /customer-profile/licenses/{key}/activations` — List activated sites (`site_url`, `is_local`, `status`). `is_local: 1` sites do not count towards the activation limit.
|
|
101
|
+
- `POST /customer-profile/licenses/{key}/deactivate_site` — Deactivate site (`site_url`).
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 3. Public License & Software Update API (Non-REST)
|
|
106
|
+
|
|
107
|
+
Designed for distributed software (plugins, themes, desktop applications) to perform automatic updates and activation directly via query string requests.
|
|
108
|
+
|
|
109
|
+
**Base URL:** `https://your-site.com/?fluent-cart={action}`
|
|
110
|
+
|
|
111
|
+
### Key Endpoints
|
|
112
|
+
|
|
113
|
+
#### 1. Activate License (`/?fluent-cart=activate_license`)
|
|
114
|
+
|
|
115
|
+
`POST /?fluent-cart=activate_license`
|
|
116
|
+
|
|
117
|
+
**Parameters:** `license_key`, `item_id`, `site_url`, `server_version`, `platform_version`.
|
|
118
|
+
|
|
119
|
+
> **Local & Staging Site Auto-Detection:**
|
|
120
|
+
> Sites matching common staging patterns are automatically assigned `is_local = 1` and do not count toward activation limits:
|
|
121
|
+
> - **Subdomains:** `staging.`, `dev.`, `test.`, `qa.`, `sandbox.`, `beta.`, `preview.`, `uat.`, `development.`
|
|
122
|
+
> - **Subfolders:** `/staging/`, `/dev/`, `/test/`
|
|
123
|
+
> - **Domains:** `localhost`, `.wpengine.com`, `.kinsta.cloud`, `.cloudwaysapps.com`, `.pantheonsite.io`
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
#### 2. Get License Version (`/?fluent-cart=get_license_version`)
|
|
128
|
+
|
|
129
|
+
`GET/POST /?fluent-cart=get_license_version`
|
|
130
|
+
|
|
131
|
+
**Parameters:** `item_id`, `license_key` (or `activation_hash`), `site_url`.
|
|
132
|
+
|
|
133
|
+
Returns version metadata (`new_version`, `stable_version`, `sections.changelog`, `banners`, `icons`).
|
|
134
|
+
- **Valid License:** Includes `package` signed URL containing a time-limited token (**expires in 48 hours**).
|
|
135
|
+
- **Invalid / Expired License:** Returns version metadata but sets `package: ""` and `download_link: ""`.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
#### 3. Download Package (`/?fluent-cart=download_license_package`)
|
|
140
|
+
|
|
141
|
+
`GET /?fluent-cart=download_license_package&fct_package={token}`
|
|
142
|
+
|
|
143
|
+
Validates `fct_package` Base64 token and returns an HTTP `302` redirect to the actual file download payload.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Hooks & Filters Reference
|
|
148
|
+
|
|
149
|
+
```php
|
|
150
|
+
// Filter check license response payload
|
|
151
|
+
add_filter('fluent_cart/license/check_license_response', function($response) {
|
|
152
|
+
// Modify response array
|
|
153
|
+
return $response;
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// Customize staging domain detection
|
|
157
|
+
add_filter('fluent_cart/license/staging_domains', function($domains) {
|
|
158
|
+
$domains[] = 'mycompany-staging.com';
|
|
159
|
+
return $domains;
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// Customize license expiration grace period (default 15 days)
|
|
163
|
+
add_filter('fluent_cart/license/grace_period_in_days', function($days) {
|
|
164
|
+
return 30;
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// Action triggered on successful site activation
|
|
168
|
+
add_action('fluent_cart/license/site_activated', function($activationData) {
|
|
169
|
+
// Handle post-activation logic
|
|
170
|
+
});
|
|
171
|
+
```
|