fluentcart-developer 2.3.0 → 2.3.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/README.md +59 -59
- package/dist/cards/fluentcart/tools.d.ts.map +1 -1
- package/dist/cards/fluentcart/tools.js +2301 -2161
- package/dist/cards/fluentcart/tools.js.map +1 -1
- package/dist/skills/fluentcart-developer/.claude-plugin/plugin.json +12 -12
- package/dist/skills/fluentcart-developer/.mcp.json +11 -11
- package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
- package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
- package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
- package/dist/skills/fluentcart-developer/references/action-hooks-cart-checkout.md +1355 -1355
- package/dist/skills/fluentcart-developer/references/action-hooks-customers-users.md +266 -266
- package/dist/skills/fluentcart-developer/references/action-hooks-licenses.md +855 -855
- package/dist/skills/fluentcart-developer/references/action-hooks-orders.md +631 -631
- package/dist/skills/fluentcart-developer/references/action-hooks-payments-integrations.md +963 -963
- package/dist/skills/fluentcart-developer/references/action-hooks-products-coupons.md +585 -585
- package/dist/skills/fluentcart-developer/references/action-hooks-subscriptions.md +661 -661
- package/dist/skills/fluentcart-developer/references/database-models-query-builder.md +194 -194
- package/dist/skills/fluentcart-developer/references/database-models-reference.md +604 -604
- package/dist/skills/fluentcart-developer/references/engineering-notes.md +154 -154
- package/dist/skills/fluentcart-developer/references/fee-system-guide.md +449 -449
- package/dist/skills/fluentcart-developer/references/filter-hooks-cart-checkout.md +1202 -1202
- package/dist/skills/fluentcart-developer/references/filter-hooks-integrations-advanced.md +1598 -1598
- package/dist/skills/fluentcart-developer/references/filter-hooks-products-pricing.md +628 -628
- package/dist/skills/fluentcart-developer/references/filter-hooks-settings-configuration.md +1177 -1177
- package/dist/skills/fluentcart-developer/references/fluentcart-developer-guide.md +154 -154
- package/dist/skills/fluentcart-developer/references/ghost-product-selling.md +458 -458
- package/dist/skills/fluentcart-developer/references/modules-and-extensions-reference.md +224 -224
- package/dist/skills/fluentcart-developer/references/payment-gateway-integration.md +761 -761
- package/dist/skills/fluentcart-developer/references/rest-api-customer-profile.md +190 -190
- package/dist/skills/fluentcart-developer/references/rest-api-customers.md +1121 -1121
- package/dist/skills/fluentcart-developer/references/rest-api-dashboard-utilities.md +219 -219
- package/dist/skills/fluentcart-developer/references/rest-api-email-notifications.md +619 -619
- package/dist/skills/fluentcart-developer/references/rest-api-files.md +290 -290
- package/dist/skills/fluentcart-developer/references/rest-api-integrations.md +324 -324
- package/dist/skills/fluentcart-developer/references/rest-api-labels-attributes.md +321 -321
- package/dist/skills/fluentcart-developer/references/rest-api-order-bumps.md +200 -200
- package/dist/skills/fluentcart-developer/references/rest-api-overview.md +131 -131
- package/dist/skills/fluentcart-developer/references/rest-api-public-shop.md +172 -172
- package/dist/skills/fluentcart-developer/references/rest-api-reference.md +552 -552
- package/dist/skills/fluentcart-developer/references/rest-api-reports.md +377 -377
- package/dist/skills/fluentcart-developer/references/rest-api-roles-permissions.md +147 -147
- package/dist/skills/fluentcart-developer/references/rest-api-settings.md +528 -528
- package/dist/skills/fluentcart-developer/references/rest-api-shipping.md +799 -799
- package/dist/skills/fluentcart-developer/references/rest-api-tax.md +356 -356
- package/dist/skills/fluentcart-developer/references/subscription-customization.md +197 -197
- package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +65 -65
|
@@ -1,219 +1,219 @@
|
|
|
1
|
-
# Dashboard & Utilities API
|
|
2
|
-
|
|
3
|
-
Administrative endpoints for dashboard statistics, onboarding setup, SPA initialization, media attachments, activity logging, order notes, print templates, address locales, and dynamic filter widgets in FluentCart.
|
|
4
|
-
|
|
5
|
-
**Base URL:** `https://your-site.com/wp-json/fluent-cart/v2`
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Endpoints Overview
|
|
10
|
-
|
|
11
|
-
| Group | Method | Endpoint | Permission / Policy | Request Class | Description |
|
|
12
|
-
|-------|--------|----------|--------------------|---------------|-------------|
|
|
13
|
-
| **Dashboard** | GET | `/dashboard` | `AdminPolicy` | — | Get onboarding checklist completion status |
|
|
14
|
-
| | GET | `/dashboard/stats` | `dashboard_stats/view` | — | Get 30-day dashboard summary stats cards |
|
|
15
|
-
| **Onboarding** | GET | `/onboarding` | `AdminPolicy` | — | Get onboarding settings, pages, & currencies |
|
|
16
|
-
| | POST | `/onboarding` | `AdminPolicy` | — | Save onboarding settings & trigger dummy products |
|
|
17
|
-
| | POST | `/onboarding/create-pages` | `AdminPolicy` | — | Bulk create all missing store pages |
|
|
18
|
-
| | POST | `/onboarding/create-page` | `AdminPolicy` | `CreatePageRequest` | Create single store page & set page ID |
|
|
19
|
-
| **App Init & Media** | GET | `/app/init` | `AdminPolicy` | — | Initialize admin SPA config, nonces, & strings |
|
|
20
|
-
| | GET | `/app/attachments` | `AdminPolicy` | — | List Media Library images for media picker |
|
|
21
|
-
| | POST | `/app/upload-attachments` | `AdminPolicy` | — | Upload image to WordPress Media Library |
|
|
22
|
-
| **Activity Log** | GET | `/activity` | `AdminPolicy` | — | List paginated activity log entries |
|
|
23
|
-
| | DELETE | `/activity/{id}` | `AdminPolicy` | — | Delete activity log entry |
|
|
24
|
-
| | PUT | `/activity/{id}/mark-read` | `AdminPolicy` | — | Toggle read/unread status of activity log entry |
|
|
25
|
-
| **Order Notes** | POST | `/notes/attach` | `AdminPolicy` | — | Attach or update note on an order |
|
|
26
|
-
| **Print Templates** | GET | `/templates/print-templates` | `AdminPolicy` | — | Get invoice & slip print templates |
|
|
27
|
-
| | PUT | `/templates/print-templates` | `AdminPolicy` | — | Save customized print HTML templates |
|
|
28
|
-
| **Widgets** | GET | `/widgets` | `customers/view` / `orders/view` | — | Get dynamic widget data for single order |
|
|
29
|
-
| **Address Info** | GET | `/address-info/countries` | `UserPolicy` | — | List all countries formatted as select options |
|
|
30
|
-
| | GET | `/address-info/get-country-info` | `UserPolicy` | — | Get country states & localized address locale |
|
|
31
|
-
| **Advanced Filters** | GET | `/advance_filter/get-filter-options` | `orders/view` / `customers/view` / `products/view` / `labels/view` | — | Fetch dynamic options (variations tree / labels) |
|
|
32
|
-
| | GET | `/forms/search_options` | `super_admin` | — | Fetch dynamic form search options |
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Admin Dashboard
|
|
37
|
-
|
|
38
|
-
Overview and quick stats widgets for the store admin panel.
|
|
39
|
-
|
|
40
|
-
### Get Onboarding Checklist Data
|
|
41
|
-
|
|
42
|
-
`GET /fluent-cart/v2/dashboard`
|
|
43
|
-
|
|
44
|
-
**Policy:** `AdminPolicy`
|
|
45
|
-
|
|
46
|
-
#### Checklist Completion Logic
|
|
47
|
-
|
|
48
|
-
| Step Key | Title | Completed When |
|
|
49
|
-
|----------|-------|----------------|
|
|
50
|
-
| `page_setup` | Setup Pages | All generatable store pages (shop, checkout, etc.) have page IDs assigned |
|
|
51
|
-
| `store_info` | Add Details to Store | Both `store_name` and `store_logo` are configured in store settings |
|
|
52
|
-
| `product_info` | Add Your First Product | At least one product exists in database |
|
|
53
|
-
| `setup_payments` | Setup Payment Methods | At least one payment gateway is enabled |
|
|
54
|
-
|
|
55
|
-
#### Response
|
|
56
|
-
|
|
57
|
-
```json
|
|
58
|
-
{
|
|
59
|
-
"data": {
|
|
60
|
-
"steps": {
|
|
61
|
-
"page_setup": { "title": "Setup Pages", "completed": false },
|
|
62
|
-
"store_info": { "title": "Add Details to Store", "completed": true },
|
|
63
|
-
"product_info": { "title": "Add Your First Product", "completed": false },
|
|
64
|
-
"setup_payments": { "title": "Setup Payment Methods", "completed": true }
|
|
65
|
-
},
|
|
66
|
-
"completed": 2
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
### Get Dashboard Stats Widgets
|
|
74
|
-
|
|
75
|
-
`GET /fluent-cart/v2/dashboard/stats`
|
|
76
|
-
|
|
77
|
-
**Policy:** `DashboardPolicy` | **Permission:** `dashboard_stats/view`
|
|
78
|
-
|
|
79
|
-
> **Metrics Rules:**
|
|
80
|
-
> - Orders, Revenue, and Refunds are calculated for the **last 30 days only**.
|
|
81
|
-
> - Orders with `on_hold` or `failed` status are excluded.
|
|
82
|
-
> - Net Revenue = `total_paid - total_refund - tax_total - shipping_tax` (converted from cents to decimal dollars).
|
|
83
|
-
> - `has_currency: true` indicates value should be formatted with store currency symbol.
|
|
84
|
-
|
|
85
|
-
#### Response
|
|
86
|
-
|
|
87
|
-
```json
|
|
88
|
-
{
|
|
89
|
-
"stats": [
|
|
90
|
-
{
|
|
91
|
-
"title": "Total Products",
|
|
92
|
-
"current_count": 45,
|
|
93
|
-
"icon": "Frame",
|
|
94
|
-
"url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/products?active_view=all"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"title": "Orders",
|
|
98
|
-
"current_count": 128,
|
|
99
|
-
"icon": "AllOrdersIcon",
|
|
100
|
-
"url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/orders"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"title": "Revenue",
|
|
104
|
-
"current_count": 15420.50,
|
|
105
|
-
"icon": "Currency",
|
|
106
|
-
"url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/reports/revenue",
|
|
107
|
-
"has_currency": true
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"title": "Refund",
|
|
111
|
-
"current_count": 350.00,
|
|
112
|
-
"icon": "Failed",
|
|
113
|
-
"url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/reports/refunds",
|
|
114
|
-
"has_currency": true
|
|
115
|
-
}
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## Onboarding Setup Wizard
|
|
123
|
-
|
|
124
|
-
Endpoints for store page creation and initial setup.
|
|
125
|
-
|
|
126
|
-
**Prefix:** `/fluent-cart/v2/onboarding` | **Policy:** `AdminPolicy`
|
|
127
|
-
|
|
128
|
-
- `GET /onboarding` — Retrieve current pages, currencies, and default settings.
|
|
129
|
-
- `POST /onboarding` — Save onboarding settings (`store_name`, `store_logo`, `currency`). Note: Providing `category` triggers asynchronous dummy product generation.
|
|
130
|
-
- `POST /onboarding/create-pages` — Bulk create missing store pages.
|
|
131
|
-
- `POST /onboarding/create-page` — Create single page (`content`: `shop_page_id` / `checkout_page_id` / `customer_profile_page_id`, `page_name`, `save_settings`: `true`).
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## SPA App Initialization & Media
|
|
136
|
-
|
|
137
|
-
**Prefix:** `/fluent-cart/v2/app` | **Policy:** `AdminPolicy`
|
|
138
|
-
|
|
139
|
-
- `GET /app/init` — SPA bootstrap endpoint (returns REST base URL, nonces, asset URLs, translations array, and store currency formats).
|
|
140
|
-
- `GET /app/attachments` — List WordPress media library image attachments for the admin media picker.
|
|
141
|
-
- `POST /app/upload-attachments` — Upload image file (`multipart/form-data`) to media library.
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
## System Activity Log
|
|
146
|
-
|
|
147
|
-
Tracks order status changes, payment webhooks, API calls, and errors.
|
|
148
|
-
|
|
149
|
-
**Prefix:** `/fluent-cart/v2/activity` | **Policy:** `AdminPolicy`
|
|
150
|
-
|
|
151
|
-
### List Activities
|
|
152
|
-
|
|
153
|
-
`GET /fluent-cart/v2/activity`
|
|
154
|
-
|
|
155
|
-
#### Parameters
|
|
156
|
-
|
|
157
|
-
| Parameter | Type | Location | Required | Description |
|
|
158
|
-
|-----------|------|----------|----------|-------------|
|
|
159
|
-
| `search` | string | query | No | Search by ID (prefix with `#`), title, content, or module |
|
|
160
|
-
| `active_view` | string | query | No | Filter tab: `success`, `warning`, `error`, `failed`, `info`, `api` |
|
|
161
|
-
| `sort_by` | string | query | No | Sort column (default: `id`) |
|
|
162
|
-
| `sort_type` | string | query | No | Sort direction (`asc` or `desc`, default: `desc`) |
|
|
163
|
-
| `per_page` | integer | query | No | Results per page (default: 10, max: 200) |
|
|
164
|
-
| `page` | integer | query | No | Page number |
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
### Delete & Toggle Activity Read Status
|
|
169
|
-
|
|
170
|
-
- `DELETE /activity/{id}` — Permanently delete activity entry.
|
|
171
|
-
- `PUT /activity/{id}/mark-read` — Toggle read status (`status`: `read` or `unread`).
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Order Notes & Print Templates
|
|
176
|
-
|
|
177
|
-
- `POST /fluent-cart/v2/notes/attach` — Attach note content to order (`order_id`, `note`).
|
|
178
|
-
- `GET /fluent-cart/v2/templates/print-templates` — Retrieve print templates (`invoice_template`, `packing_slip`, `delivery_slip`, `shipping_slip`, `dispatch_slip`).
|
|
179
|
-
- `PUT /fluent-cart/v2/templates/print-templates` — Save customized print HTML templates (sanitized with `wp_kses_post`).
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Dynamic Widgets, Address Locales, & Filters
|
|
184
|
-
|
|
185
|
-
### Get Contextual Widgets
|
|
186
|
-
|
|
187
|
-
`GET /fluent-cart/v2/widgets`
|
|
188
|
-
|
|
189
|
-
**Policy:** `OrderPolicy` | **Permission:** `customers/view` OR `orders/view`
|
|
190
|
-
|
|
191
|
-
- `filter` (query): Widget context (e.g. `single_order_page`). Dispatches to filter hook `fluent_cart/widgets/{filter}`.
|
|
192
|
-
- `data[order_id]` (query): Order ID context.
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
### Address Info & Country Locales
|
|
197
|
-
|
|
198
|
-
`GET /fluent-cart/v2/address-info/countries` — List all countries as select options (`label`, `value`).
|
|
199
|
-
`GET /fluent-cart/v2/address-info/get-country-info` — Get country states array and localized `address_locale` rules (`country_code` OR `timezone` e.g. `America/New_York`).
|
|
200
|
-
|
|
201
|
-
```json
|
|
202
|
-
{
|
|
203
|
-
"country_code": "US",
|
|
204
|
-
"country_name": "United States",
|
|
205
|
-
"states": [{ "label": "California", "value": "CA" }],
|
|
206
|
-
"address_locale": {
|
|
207
|
-
"state": { "label": "State", "required": true },
|
|
208
|
-
"postcode": { "label": "ZIP Code", "required": true },
|
|
209
|
-
"city": { "label": "City", "required": true }
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
### Advanced Search & Filter Options
|
|
217
|
-
|
|
218
|
-
- `GET /fluent-cart/v2/advance_filter/get-filter-options` — Load options for advanced filter UI (`remote_data_key`: `product_variations` [returns hierarchical tree], `labels` [flat list], or custom resolved via `fluent_cart/advanced_filter_options_{key}`).
|
|
219
|
-
- `GET /fluent-cart/v2/forms/search_options` — Form search options (`search_for`, `search_by`, `is_super_admin`, resolved via `fluent_cart/get_dynamic_search_{search_for}`).
|
|
1
|
+
# Dashboard & Utilities API
|
|
2
|
+
|
|
3
|
+
Administrative endpoints for dashboard statistics, onboarding setup, SPA initialization, media attachments, activity logging, order notes, print templates, address locales, and dynamic filter widgets in FluentCart.
|
|
4
|
+
|
|
5
|
+
**Base URL:** `https://your-site.com/wp-json/fluent-cart/v2`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Endpoints Overview
|
|
10
|
+
|
|
11
|
+
| Group | Method | Endpoint | Permission / Policy | Request Class | Description |
|
|
12
|
+
|-------|--------|----------|--------------------|---------------|-------------|
|
|
13
|
+
| **Dashboard** | GET | `/dashboard` | `AdminPolicy` | — | Get onboarding checklist completion status |
|
|
14
|
+
| | GET | `/dashboard/stats` | `dashboard_stats/view` | — | Get 30-day dashboard summary stats cards |
|
|
15
|
+
| **Onboarding** | GET | `/onboarding` | `AdminPolicy` | — | Get onboarding settings, pages, & currencies |
|
|
16
|
+
| | POST | `/onboarding` | `AdminPolicy` | — | Save onboarding settings & trigger dummy products |
|
|
17
|
+
| | POST | `/onboarding/create-pages` | `AdminPolicy` | — | Bulk create all missing store pages |
|
|
18
|
+
| | POST | `/onboarding/create-page` | `AdminPolicy` | `CreatePageRequest` | Create single store page & set page ID |
|
|
19
|
+
| **App Init & Media** | GET | `/app/init` | `AdminPolicy` | — | Initialize admin SPA config, nonces, & strings |
|
|
20
|
+
| | GET | `/app/attachments` | `AdminPolicy` | — | List Media Library images for media picker |
|
|
21
|
+
| | POST | `/app/upload-attachments` | `AdminPolicy` | — | Upload image to WordPress Media Library |
|
|
22
|
+
| **Activity Log** | GET | `/activity` | `AdminPolicy` | — | List paginated activity log entries |
|
|
23
|
+
| | DELETE | `/activity/{id}` | `AdminPolicy` | — | Delete activity log entry |
|
|
24
|
+
| | PUT | `/activity/{id}/mark-read` | `AdminPolicy` | — | Toggle read/unread status of activity log entry |
|
|
25
|
+
| **Order Notes** | POST | `/notes/attach` | `AdminPolicy` | — | Attach or update note on an order |
|
|
26
|
+
| **Print Templates** | GET | `/templates/print-templates` | `AdminPolicy` | — | Get invoice & slip print templates |
|
|
27
|
+
| | PUT | `/templates/print-templates` | `AdminPolicy` | — | Save customized print HTML templates |
|
|
28
|
+
| **Widgets** | GET | `/widgets` | `customers/view` / `orders/view` | — | Get dynamic widget data for single order |
|
|
29
|
+
| **Address Info** | GET | `/address-info/countries` | `UserPolicy` | — | List all countries formatted as select options |
|
|
30
|
+
| | GET | `/address-info/get-country-info` | `UserPolicy` | — | Get country states & localized address locale |
|
|
31
|
+
| **Advanced Filters** | GET | `/advance_filter/get-filter-options` | `orders/view` / `customers/view` / `products/view` / `labels/view` | — | Fetch dynamic options (variations tree / labels) |
|
|
32
|
+
| | GET | `/forms/search_options` | `super_admin` | — | Fetch dynamic form search options |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Admin Dashboard
|
|
37
|
+
|
|
38
|
+
Overview and quick stats widgets for the store admin panel.
|
|
39
|
+
|
|
40
|
+
### Get Onboarding Checklist Data
|
|
41
|
+
|
|
42
|
+
`GET /fluent-cart/v2/dashboard`
|
|
43
|
+
|
|
44
|
+
**Policy:** `AdminPolicy`
|
|
45
|
+
|
|
46
|
+
#### Checklist Completion Logic
|
|
47
|
+
|
|
48
|
+
| Step Key | Title | Completed When |
|
|
49
|
+
|----------|-------|----------------|
|
|
50
|
+
| `page_setup` | Setup Pages | All generatable store pages (shop, checkout, etc.) have page IDs assigned |
|
|
51
|
+
| `store_info` | Add Details to Store | Both `store_name` and `store_logo` are configured in store settings |
|
|
52
|
+
| `product_info` | Add Your First Product | At least one product exists in database |
|
|
53
|
+
| `setup_payments` | Setup Payment Methods | At least one payment gateway is enabled |
|
|
54
|
+
|
|
55
|
+
#### Response
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"data": {
|
|
60
|
+
"steps": {
|
|
61
|
+
"page_setup": { "title": "Setup Pages", "completed": false },
|
|
62
|
+
"store_info": { "title": "Add Details to Store", "completed": true },
|
|
63
|
+
"product_info": { "title": "Add Your First Product", "completed": false },
|
|
64
|
+
"setup_payments": { "title": "Setup Payment Methods", "completed": true }
|
|
65
|
+
},
|
|
66
|
+
"completed": 2
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### Get Dashboard Stats Widgets
|
|
74
|
+
|
|
75
|
+
`GET /fluent-cart/v2/dashboard/stats`
|
|
76
|
+
|
|
77
|
+
**Policy:** `DashboardPolicy` | **Permission:** `dashboard_stats/view`
|
|
78
|
+
|
|
79
|
+
> **Metrics Rules:**
|
|
80
|
+
> - Orders, Revenue, and Refunds are calculated for the **last 30 days only**.
|
|
81
|
+
> - Orders with `on_hold` or `failed` status are excluded.
|
|
82
|
+
> - Net Revenue = `total_paid - total_refund - tax_total - shipping_tax` (converted from cents to decimal dollars).
|
|
83
|
+
> - `has_currency: true` indicates value should be formatted with store currency symbol.
|
|
84
|
+
|
|
85
|
+
#### Response
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"stats": [
|
|
90
|
+
{
|
|
91
|
+
"title": "Total Products",
|
|
92
|
+
"current_count": 45,
|
|
93
|
+
"icon": "Frame",
|
|
94
|
+
"url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/products?active_view=all"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"title": "Orders",
|
|
98
|
+
"current_count": 128,
|
|
99
|
+
"icon": "AllOrdersIcon",
|
|
100
|
+
"url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/orders"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"title": "Revenue",
|
|
104
|
+
"current_count": 15420.50,
|
|
105
|
+
"icon": "Currency",
|
|
106
|
+
"url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/reports/revenue",
|
|
107
|
+
"has_currency": true
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"title": "Refund",
|
|
111
|
+
"current_count": 350.00,
|
|
112
|
+
"icon": "Failed",
|
|
113
|
+
"url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/reports/refunds",
|
|
114
|
+
"has_currency": true
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Onboarding Setup Wizard
|
|
123
|
+
|
|
124
|
+
Endpoints for store page creation and initial setup.
|
|
125
|
+
|
|
126
|
+
**Prefix:** `/fluent-cart/v2/onboarding` | **Policy:** `AdminPolicy`
|
|
127
|
+
|
|
128
|
+
- `GET /onboarding` — Retrieve current pages, currencies, and default settings.
|
|
129
|
+
- `POST /onboarding` — Save onboarding settings (`store_name`, `store_logo`, `currency`). Note: Providing `category` triggers asynchronous dummy product generation.
|
|
130
|
+
- `POST /onboarding/create-pages` — Bulk create missing store pages.
|
|
131
|
+
- `POST /onboarding/create-page` — Create single page (`content`: `shop_page_id` / `checkout_page_id` / `customer_profile_page_id`, `page_name`, `save_settings`: `true`).
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## SPA App Initialization & Media
|
|
136
|
+
|
|
137
|
+
**Prefix:** `/fluent-cart/v2/app` | **Policy:** `AdminPolicy`
|
|
138
|
+
|
|
139
|
+
- `GET /app/init` — SPA bootstrap endpoint (returns REST base URL, nonces, asset URLs, translations array, and store currency formats).
|
|
140
|
+
- `GET /app/attachments` — List WordPress media library image attachments for the admin media picker.
|
|
141
|
+
- `POST /app/upload-attachments` — Upload image file (`multipart/form-data`) to media library.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## System Activity Log
|
|
146
|
+
|
|
147
|
+
Tracks order status changes, payment webhooks, API calls, and errors.
|
|
148
|
+
|
|
149
|
+
**Prefix:** `/fluent-cart/v2/activity` | **Policy:** `AdminPolicy`
|
|
150
|
+
|
|
151
|
+
### List Activities
|
|
152
|
+
|
|
153
|
+
`GET /fluent-cart/v2/activity`
|
|
154
|
+
|
|
155
|
+
#### Parameters
|
|
156
|
+
|
|
157
|
+
| Parameter | Type | Location | Required | Description |
|
|
158
|
+
|-----------|------|----------|----------|-------------|
|
|
159
|
+
| `search` | string | query | No | Search by ID (prefix with `#`), title, content, or module |
|
|
160
|
+
| `active_view` | string | query | No | Filter tab: `success`, `warning`, `error`, `failed`, `info`, `api` |
|
|
161
|
+
| `sort_by` | string | query | No | Sort column (default: `id`) |
|
|
162
|
+
| `sort_type` | string | query | No | Sort direction (`asc` or `desc`, default: `desc`) |
|
|
163
|
+
| `per_page` | integer | query | No | Results per page (default: 10, max: 200) |
|
|
164
|
+
| `page` | integer | query | No | Page number |
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Delete & Toggle Activity Read Status
|
|
169
|
+
|
|
170
|
+
- `DELETE /activity/{id}` — Permanently delete activity entry.
|
|
171
|
+
- `PUT /activity/{id}/mark-read` — Toggle read status (`status`: `read` or `unread`).
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Order Notes & Print Templates
|
|
176
|
+
|
|
177
|
+
- `POST /fluent-cart/v2/notes/attach` — Attach note content to order (`order_id`, `note`).
|
|
178
|
+
- `GET /fluent-cart/v2/templates/print-templates` — Retrieve print templates (`invoice_template`, `packing_slip`, `delivery_slip`, `shipping_slip`, `dispatch_slip`).
|
|
179
|
+
- `PUT /fluent-cart/v2/templates/print-templates` — Save customized print HTML templates (sanitized with `wp_kses_post`).
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Dynamic Widgets, Address Locales, & Filters
|
|
184
|
+
|
|
185
|
+
### Get Contextual Widgets
|
|
186
|
+
|
|
187
|
+
`GET /fluent-cart/v2/widgets`
|
|
188
|
+
|
|
189
|
+
**Policy:** `OrderPolicy` | **Permission:** `customers/view` OR `orders/view`
|
|
190
|
+
|
|
191
|
+
- `filter` (query): Widget context (e.g. `single_order_page`). Dispatches to filter hook `fluent_cart/widgets/{filter}`.
|
|
192
|
+
- `data[order_id]` (query): Order ID context.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
### Address Info & Country Locales
|
|
197
|
+
|
|
198
|
+
`GET /fluent-cart/v2/address-info/countries` — List all countries as select options (`label`, `value`).
|
|
199
|
+
`GET /fluent-cart/v2/address-info/get-country-info` — Get country states array and localized `address_locale` rules (`country_code` OR `timezone` e.g. `America/New_York`).
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"country_code": "US",
|
|
204
|
+
"country_name": "United States",
|
|
205
|
+
"states": [{ "label": "California", "value": "CA" }],
|
|
206
|
+
"address_locale": {
|
|
207
|
+
"state": { "label": "State", "required": true },
|
|
208
|
+
"postcode": { "label": "ZIP Code", "required": true },
|
|
209
|
+
"city": { "label": "City", "required": true }
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### Advanced Search & Filter Options
|
|
217
|
+
|
|
218
|
+
- `GET /fluent-cart/v2/advance_filter/get-filter-options` — Load options for advanced filter UI (`remote_data_key`: `product_variations` [returns hierarchical tree], `labels` [flat list], or custom resolved via `fluent_cart/advanced_filter_options_{key}`).
|
|
219
|
+
- `GET /fluent-cart/v2/forms/search_options` — Form search options (`search_for`, `search_by`, `is_super_admin`, resolved via `fluent_cart/get_dynamic_search_{search_for}`).
|