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.
Files changed (65) hide show
  1. package/CLAUDE.md +22 -22
  2. package/LICENSE +21 -21
  3. package/README.md +169 -127
  4. package/SKILL.md +127 -127
  5. package/bin/index.js +281 -281
  6. package/package.json +48 -37
  7. package/skills/fluentcart-developer/SKILL.md +172 -172
  8. package/skills/fluentcart-developer/examples/README.md +25 -25
  9. package/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
  10. package/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
  11. package/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +114 -114
  12. package/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +149 -149
  13. package/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
  14. package/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +62 -62
  15. package/skills/fluentcart-developer/references/action-hooks-admin-templates.md +787 -787
  16. package/skills/fluentcart-developer/references/action-hooks-cart-checkout.md +1355 -1355
  17. package/skills/fluentcart-developer/references/action-hooks-customers-users.md +266 -266
  18. package/skills/fluentcart-developer/references/action-hooks-licenses.md +855 -855
  19. package/skills/fluentcart-developer/references/action-hooks-orders.md +631 -631
  20. package/skills/fluentcart-developer/references/action-hooks-payments-integrations.md +963 -963
  21. package/skills/fluentcart-developer/references/action-hooks-products-coupons.md +585 -585
  22. package/skills/fluentcart-developer/references/action-hooks-subscriptions.md +661 -661
  23. package/skills/fluentcart-developer/references/database-models-query-builder.md +194 -194
  24. package/skills/fluentcart-developer/references/database-models-reference.md +604 -604
  25. package/skills/fluentcart-developer/references/database-schema-reference.md +940 -940
  26. package/skills/fluentcart-developer/references/engineering-notes.md +154 -154
  27. package/skills/fluentcart-developer/references/fee-system-guide.md +449 -449
  28. package/skills/fluentcart-developer/references/filter-hooks-cart-checkout.md +1202 -1202
  29. package/skills/fluentcart-developer/references/filter-hooks-customers-subscriptions.md +902 -902
  30. package/skills/fluentcart-developer/references/filter-hooks-integrations-advanced.md +1598 -1598
  31. package/skills/fluentcart-developer/references/filter-hooks-orders-payments.md +1319 -1319
  32. package/skills/fluentcart-developer/references/filter-hooks-products-pricing.md +628 -628
  33. package/skills/fluentcart-developer/references/filter-hooks-settings-configuration.md +1177 -1177
  34. package/skills/fluentcart-developer/references/fluentcart-developer-guide.md +154 -154
  35. package/skills/fluentcart-developer/references/ghost-product-selling.md +458 -458
  36. package/skills/fluentcart-developer/references/modules-and-extensions-reference.md +224 -224
  37. package/skills/fluentcart-developer/references/payment-gateway-integration.md +761 -761
  38. package/skills/fluentcart-developer/references/rest-api-checkout.md +286 -286
  39. package/skills/fluentcart-developer/references/rest-api-coupons.md +794 -794
  40. package/skills/fluentcart-developer/references/rest-api-customer-profile.md +190 -190
  41. package/skills/fluentcart-developer/references/rest-api-customers.md +1121 -1121
  42. package/skills/fluentcart-developer/references/rest-api-dashboard-utilities.md +219 -219
  43. package/skills/fluentcart-developer/references/rest-api-email-notifications.md +619 -619
  44. package/skills/fluentcart-developer/references/rest-api-files.md +290 -290
  45. package/skills/fluentcart-developer/references/rest-api-integrations.md +324 -324
  46. package/skills/fluentcart-developer/references/rest-api-labels-attributes.md +321 -321
  47. package/skills/fluentcart-developer/references/rest-api-licensing.md +171 -171
  48. package/skills/fluentcart-developer/references/rest-api-order-bumps.md +200 -200
  49. package/skills/fluentcart-developer/references/rest-api-orders.md +1241 -1241
  50. package/skills/fluentcart-developer/references/rest-api-overview.md +131 -131
  51. package/skills/fluentcart-developer/references/rest-api-products.md +2563 -2563
  52. package/skills/fluentcart-developer/references/rest-api-public-shop.md +172 -172
  53. package/skills/fluentcart-developer/references/rest-api-reference.md +552 -552
  54. package/skills/fluentcart-developer/references/rest-api-reports.md +377 -377
  55. package/skills/fluentcart-developer/references/rest-api-roles-permissions.md +147 -147
  56. package/skills/fluentcart-developer/references/rest-api-settings.md +528 -528
  57. package/skills/fluentcart-developer/references/rest-api-shipping.md +799 -799
  58. package/skills/fluentcart-developer/references/rest-api-subscriptions.md +606 -606
  59. package/skills/fluentcart-developer/references/rest-api-tax.md +356 -356
  60. package/skills/fluentcart-developer/references/subscription-customization.md +197 -197
  61. package/skills/fluentcart-developer/scripts/cli.js +1 -1
  62. package/.gitattributes +0 -2
  63. package/CONTRIBUTING.md +0 -73
  64. package/copy-skills.js +0 -43
  65. package/skills.sh.json +0 -13
@@ -1,321 +1,321 @@
1
- # Labels & Attributes API
2
-
3
- Manage organizational labels for orders and customers, and product attribute groups and terms used for variation options in FluentCart.
4
-
5
- **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2`
6
- **Policies:** `LabelPolicy` (Labels) / `ProductPolicy` (Attributes)
7
-
8
- ---
9
-
10
- ## Endpoints Overview
11
-
12
- | Group | Method | Endpoint | Permission / Policy | Request Class | Description |
13
- |-------|--------|----------|--------------------|---------------|-------------|
14
- | **Labels** | GET | `/labels` | `labels/view` | — | Retrieve all labels |
15
- | | POST | `/labels` | `labels/manage` | `LabelRequest` | Create label and optionally bind to entity |
16
- | | POST | `/labels/update-label-selections` | `labels/manage` | — | Sync label selection for order/customer |
17
- | **Attribute Groups** | GET | `/options/attr/groups` | `products/view` | — | List attribute groups (Color, Size, etc.) |
18
- | | POST | `/options/attr/group` | `products/create` | `AttrGroupRequest` | Create attribute group |
19
- | | GET | `/options/attr/group/{group_id}` | `products/view` | — | Get single attribute group (with terms) |
20
- | | PUT | `/options/attr/group/{group_id}` | `products/edit` | `AttrGroupRequest` | Update attribute group |
21
- | | DELETE | `/options/attr/group/{group_id}` | `products/delete` | — | Delete attribute group (guarded if in use) |
22
- | **Attribute Terms** | GET | `/options/attr/group/{id}/terms` | `products/view` | — | List terms within attribute group |
23
- | | POST | `/options/attr/group/{id}/term` | `products/create` | `AttrTermRequest` | Create term within attribute group |
24
- | | POST | `/options/attr/group/{id}/term/{term_id}` | `products/edit` | `AttrTermRequest` | Update attribute term |
25
- | | DELETE | `/options/attr/group/{id}/term/{term_id}` | `products/delete` | — | Delete attribute term (guarded if in use) |
26
- | | POST | `/options/attr/group/{id}/term/{term_id}/serial` | `products/edit` | — | Shift term position (`up` or `down`) |
27
-
28
- ---
29
-
30
- ## Labels
31
-
32
- Labels are tags that attach to orders, customers, or other entities via a polymorphic relationship for organizational filtering.
33
-
34
- **Prefix:** `/fluent-cart/v2/labels` | **Policy:** `LabelPolicy`
35
-
36
- ### List Labels
37
-
38
- `GET /fluent-cart/v2/labels`
39
-
40
- #### Permission
41
-
42
- `labels/view`
43
-
44
- #### Response
45
-
46
- ```json
47
- {
48
- "labels": {
49
- "labels": [
50
- { "id": 1, "value": "VIP" },
51
- { "id": 2, "value": "Wholesale" },
52
- { "id": 3, "value": "Priority" }
53
- ]
54
- }
55
- }
56
- ```
57
-
58
- ---
59
-
60
- ### Create Label
61
-
62
- `POST /fluent-cart/v2/labels`
63
-
64
- Create a new label and optionally attach it to an entity (`Order`, `Customer`).
65
-
66
- #### Permission
67
-
68
- `labels/manage` | **Request Class:** `LabelRequest`
69
-
70
- #### Parameters
71
-
72
- | Parameter | Type | Location | Required | Description |
73
- |-----------|------|----------|----------|-------------|
74
- | `value` | string | body | Yes | Label name. Must be unique across `fct_label` table |
75
- | `bind_to_type` | string | body | No | Model class to attach (e.g. `Order`, `Customer`) |
76
- | `bind_to_id` | string | body | Conditional | Entity ID (required if `bind_to_type` is provided) |
77
-
78
- #### Response
79
-
80
- ```json
81
- {
82
- "data": {
83
- "id": 4,
84
- "value": "Returning Customer"
85
- },
86
- "message": "Label created successfully!"
87
- }
88
- ```
89
-
90
- #### Example
91
-
92
- ```bash
93
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/labels" \
94
- -u "username:app_password" \
95
- -H "Content-Type: application/json" \
96
- -d '{
97
- "value": "Returning Customer",
98
- "bind_to_type": "Order",
99
- "bind_to_id": "42"
100
- }'
101
- ```
102
-
103
- ---
104
-
105
- ### Update Label Selections
106
-
107
- `POST /fluent-cart/v2/labels/update-label-selections`
108
-
109
- Sync attached labels for a target entity. Labels in `selectedLabels` are attached; omitted previously attached labels are detached.
110
-
111
- #### Permission
112
-
113
- `labels/manage`
114
-
115
- #### Parameters
116
-
117
- | Parameter | Type | Location | Required | Description |
118
- |-----------|------|----------|----------|-------------|
119
- | `bind_to_type` | string | body | Yes | Target entity model (e.g., `Order`, `Customer`) |
120
- | `bind_to_id` | string | body | Yes | Target entity ID |
121
- | `selectedLabels` | array | body | No | Array of label IDs to attach |
122
-
123
- ---
124
-
125
- ## Attribute Groups
126
-
127
- Attribute groups represent variation categories (e.g., Color, Size, Material).
128
-
129
- **Prefix:** `/fluent-cart/v2/options/attr` | **Policy:** `ProductPolicy`
130
-
131
- ### List Attribute Groups
132
-
133
- `GET /fluent-cart/v2/options/attr/groups`
134
-
135
- #### Permission
136
-
137
- `products/view`
138
-
139
- #### Parameters
140
-
141
- | Parameter | Type | Location | Required | Description |
142
- |-----------|------|----------|----------|-------------|
143
- | `search` | object | query | No | Column search criteria (`title`, `slug`) |
144
- | `filters` | object | query | No | Filter criteria (e.g., `terms_count`) |
145
- | `with` | array | query | No | Eager load relations (e.g., `["terms"]`) |
146
- | `order_by` | string | query | No | Sort column (`title`, `id`, `slug`, `created_at`). Default: `title` |
147
- | `order_type` | string | query | No | Sort direction (`ASC` or `DESC`). Default: `ASC` |
148
- | `per_page` | integer | query | No | Items per page (default: 10) |
149
- | `page` | integer | query | No | Page number |
150
-
151
- #### Response
152
-
153
- ```json
154
- {
155
- "groups": {
156
- "total": 3,
157
- "per_page": 10,
158
- "current_page": 1,
159
- "last_page": 1,
160
- "data": [
161
- {
162
- "id": 1,
163
- "title": "Color",
164
- "slug": "color",
165
- "description": "Product color options",
166
- "settings": null,
167
- "created_at": "2025-01-10 08:30:00",
168
- "updated_at": "2025-01-10 08:30:00",
169
- "terms_count": 5
170
- }
171
- ]
172
- }
173
- }
174
- ```
175
-
176
- ---
177
-
178
- ### Create Attribute Group
179
-
180
- `POST /fluent-cart/v2/options/attr/group`
181
-
182
- #### Permission
183
-
184
- `products/create` | **Request Class:** `AttrGroupRequest`
185
-
186
- #### Parameters
187
-
188
- | Parameter | Type | Location | Required | Description |
189
- |-----------|------|----------|----------|-------------|
190
- | `title` | string | body | Yes | Group title (max 50 chars). Must be unique in `fct_atts_groups` |
191
- | `slug` | string | body | Yes | Group slug (max 50 chars). Must be unique in `fct_atts_groups` |
192
- | `description` | string | body | No | Group description |
193
- | `settings` | object | body | No | Additional settings object |
194
-
195
- ---
196
-
197
- ### Get Attribute Group
198
-
199
- `GET /fluent-cart/v2/options/attr/group/{group_id}`
200
-
201
- #### Parameters
202
-
203
- | Parameter | Type | Location | Required | Description |
204
- |-----------|------|----------|----------|-------------|
205
- | `group_id` | integer | path | Yes | Attribute Group ID |
206
- | `with` | array | query | No | Eager load relations (e.g., `["terms"]`) |
207
-
208
- ---
209
-
210
- ### Update Attribute Group
211
-
212
- `PUT /fluent-cart/v2/options/attr/group/{group_id}`
213
-
214
- #### Permission
215
-
216
- `products/edit` | **Request Class:** `AttrGroupRequest`
217
-
218
- ---
219
-
220
- ### Delete Attribute Group
221
-
222
- `DELETE /fluent-cart/v2/options/attr/group/{group_id}`
223
-
224
- #### Permission
225
-
226
- `products/delete`
227
-
228
- > **Delete Guard:** A group cannot be deleted if any of its terms are currently assigned to product variations. Attempting to delete an active group returns HTTP `403`: `"This group is already in use, can not be deleted."`.
229
-
230
- ---
231
-
232
- ## Attribute Terms
233
-
234
- Individual variation values within an attribute group (e.g., "Red", "Blue", "Green").
235
-
236
- **Prefix:** `/fluent-cart/v2/options/attr/group/{group_id}` | **Policy:** `ProductPolicy`
237
-
238
- ### List Attribute Terms
239
-
240
- `GET /fluent-cart/v2/options/attr/group/{group_id}/terms`
241
-
242
- #### Parameters
243
-
244
- | Parameter | Type | Location | Required | Description |
245
- |-----------|------|----------|----------|-------------|
246
- | `group_id` | integer | path | Yes | Parent attribute group ID |
247
- | `search` | object | query | No | Column search (`title`, `slug`) |
248
- | `order_by` | string | query | No | Sort column (`serial`, `title`, `id`). Default: `serial` |
249
- | `order_type` | string | query | No | Sort direction (`ASC` or `DESC`). Default: `ASC` |
250
- | `per_page` | integer | query | No | Items per page (default: 15) |
251
-
252
- ---
253
-
254
- ### Create Attribute Term
255
-
256
- `POST /fluent-cart/v2/options/attr/group/{group_id}/term`
257
-
258
- #### Permission
259
-
260
- `products/create` | **Request Class:** `AttrTermRequest`
261
-
262
- #### Parameters
263
-
264
- | Parameter | Type | Location | Required | Description |
265
- |-----------|------|----------|----------|-------------|
266
- | `group_id` | integer | path | Yes | Parent attribute group ID |
267
- | `title` | string | body | Yes | Term title (max 50 chars). Must be unique in `fct_atts_terms` |
268
- | `slug` | string | body | Yes | Term slug (max 50 chars). Must be unique in `fct_atts_terms` |
269
- | `description` | string | body | No | Term description |
270
- | `serial` | integer | body | No | Sort order index (default: `10`) |
271
-
272
- ---
273
-
274
- ### Update Attribute Term
275
-
276
- `POST /fluent-cart/v2/options/attr/group/{group_id}/term/{term_id}`
277
-
278
- #### Permission
279
-
280
- `products/edit` | **Request Class:** `AttrTermRequest`
281
-
282
- ---
283
-
284
- ### Delete Attribute Term
285
-
286
- `DELETE /fluent-cart/v2/options/attr/group/{group_id}/term/{term_id}`
287
-
288
- #### Permission
289
-
290
- `products/delete`
291
-
292
- > **Delete Guard:** Terms assigned to product variations return HTTP `403`: `"This term is already in use, can not be deleted."`.
293
-
294
- ---
295
-
296
- ### Change Term Sort Order (Serial Shift)
297
-
298
- `POST /fluent-cart/v2/options/attr/group/{group_id}/term/{term_id}/serial`
299
-
300
- Increments or decrements the sort order `serial` value of a term.
301
-
302
- #### Permission
303
-
304
- `products/edit`
305
-
306
- #### Parameters
307
-
308
- | Parameter | Type | Location | Required | Description |
309
- |-----------|------|----------|----------|-------------|
310
- | `group_id` | integer | path | Yes | Attribute group ID |
311
- | `term_id` | integer | path | Yes | Term ID to reorder |
312
- | `direction` | string | body | No | `up` (decrements serial, min 0) or `down` (increments serial). Default: `up` |
313
-
314
- #### Response
315
-
316
- ```json
317
- {
318
- "data": 2,
319
- "message": "Serial updated."
320
- }
321
- ```
1
+ # Labels & Attributes API
2
+
3
+ Manage organizational labels for orders and customers, and product attribute groups and terms used for variation options in FluentCart.
4
+
5
+ **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2`
6
+ **Policies:** `LabelPolicy` (Labels) / `ProductPolicy` (Attributes)
7
+
8
+ ---
9
+
10
+ ## Endpoints Overview
11
+
12
+ | Group | Method | Endpoint | Permission / Policy | Request Class | Description |
13
+ |-------|--------|----------|--------------------|---------------|-------------|
14
+ | **Labels** | GET | `/labels` | `labels/view` | — | Retrieve all labels |
15
+ | | POST | `/labels` | `labels/manage` | `LabelRequest` | Create label and optionally bind to entity |
16
+ | | POST | `/labels/update-label-selections` | `labels/manage` | — | Sync label selection for order/customer |
17
+ | **Attribute Groups** | GET | `/options/attr/groups` | `products/view` | — | List attribute groups (Color, Size, etc.) |
18
+ | | POST | `/options/attr/group` | `products/create` | `AttrGroupRequest` | Create attribute group |
19
+ | | GET | `/options/attr/group/{group_id}` | `products/view` | — | Get single attribute group (with terms) |
20
+ | | PUT | `/options/attr/group/{group_id}` | `products/edit` | `AttrGroupRequest` | Update attribute group |
21
+ | | DELETE | `/options/attr/group/{group_id}` | `products/delete` | — | Delete attribute group (guarded if in use) |
22
+ | **Attribute Terms** | GET | `/options/attr/group/{id}/terms` | `products/view` | — | List terms within attribute group |
23
+ | | POST | `/options/attr/group/{id}/term` | `products/create` | `AttrTermRequest` | Create term within attribute group |
24
+ | | POST | `/options/attr/group/{id}/term/{term_id}` | `products/edit` | `AttrTermRequest` | Update attribute term |
25
+ | | DELETE | `/options/attr/group/{id}/term/{term_id}` | `products/delete` | — | Delete attribute term (guarded if in use) |
26
+ | | POST | `/options/attr/group/{id}/term/{term_id}/serial` | `products/edit` | — | Shift term position (`up` or `down`) |
27
+
28
+ ---
29
+
30
+ ## Labels
31
+
32
+ Labels are tags that attach to orders, customers, or other entities via a polymorphic relationship for organizational filtering.
33
+
34
+ **Prefix:** `/fluent-cart/v2/labels` | **Policy:** `LabelPolicy`
35
+
36
+ ### List Labels
37
+
38
+ `GET /fluent-cart/v2/labels`
39
+
40
+ #### Permission
41
+
42
+ `labels/view`
43
+
44
+ #### Response
45
+
46
+ ```json
47
+ {
48
+ "labels": {
49
+ "labels": [
50
+ { "id": 1, "value": "VIP" },
51
+ { "id": 2, "value": "Wholesale" },
52
+ { "id": 3, "value": "Priority" }
53
+ ]
54
+ }
55
+ }
56
+ ```
57
+
58
+ ---
59
+
60
+ ### Create Label
61
+
62
+ `POST /fluent-cart/v2/labels`
63
+
64
+ Create a new label and optionally attach it to an entity (`Order`, `Customer`).
65
+
66
+ #### Permission
67
+
68
+ `labels/manage` | **Request Class:** `LabelRequest`
69
+
70
+ #### Parameters
71
+
72
+ | Parameter | Type | Location | Required | Description |
73
+ |-----------|------|----------|----------|-------------|
74
+ | `value` | string | body | Yes | Label name. Must be unique across `fct_label` table |
75
+ | `bind_to_type` | string | body | No | Model class to attach (e.g. `Order`, `Customer`) |
76
+ | `bind_to_id` | string | body | Conditional | Entity ID (required if `bind_to_type` is provided) |
77
+
78
+ #### Response
79
+
80
+ ```json
81
+ {
82
+ "data": {
83
+ "id": 4,
84
+ "value": "Returning Customer"
85
+ },
86
+ "message": "Label created successfully!"
87
+ }
88
+ ```
89
+
90
+ #### Example
91
+
92
+ ```bash
93
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/labels" \
94
+ -u "username:app_password" \
95
+ -H "Content-Type: application/json" \
96
+ -d '{
97
+ "value": "Returning Customer",
98
+ "bind_to_type": "Order",
99
+ "bind_to_id": "42"
100
+ }'
101
+ ```
102
+
103
+ ---
104
+
105
+ ### Update Label Selections
106
+
107
+ `POST /fluent-cart/v2/labels/update-label-selections`
108
+
109
+ Sync attached labels for a target entity. Labels in `selectedLabels` are attached; omitted previously attached labels are detached.
110
+
111
+ #### Permission
112
+
113
+ `labels/manage`
114
+
115
+ #### Parameters
116
+
117
+ | Parameter | Type | Location | Required | Description |
118
+ |-----------|------|----------|----------|-------------|
119
+ | `bind_to_type` | string | body | Yes | Target entity model (e.g., `Order`, `Customer`) |
120
+ | `bind_to_id` | string | body | Yes | Target entity ID |
121
+ | `selectedLabels` | array | body | No | Array of label IDs to attach |
122
+
123
+ ---
124
+
125
+ ## Attribute Groups
126
+
127
+ Attribute groups represent variation categories (e.g., Color, Size, Material).
128
+
129
+ **Prefix:** `/fluent-cart/v2/options/attr` | **Policy:** `ProductPolicy`
130
+
131
+ ### List Attribute Groups
132
+
133
+ `GET /fluent-cart/v2/options/attr/groups`
134
+
135
+ #### Permission
136
+
137
+ `products/view`
138
+
139
+ #### Parameters
140
+
141
+ | Parameter | Type | Location | Required | Description |
142
+ |-----------|------|----------|----------|-------------|
143
+ | `search` | object | query | No | Column search criteria (`title`, `slug`) |
144
+ | `filters` | object | query | No | Filter criteria (e.g., `terms_count`) |
145
+ | `with` | array | query | No | Eager load relations (e.g., `["terms"]`) |
146
+ | `order_by` | string | query | No | Sort column (`title`, `id`, `slug`, `created_at`). Default: `title` |
147
+ | `order_type` | string | query | No | Sort direction (`ASC` or `DESC`). Default: `ASC` |
148
+ | `per_page` | integer | query | No | Items per page (default: 10) |
149
+ | `page` | integer | query | No | Page number |
150
+
151
+ #### Response
152
+
153
+ ```json
154
+ {
155
+ "groups": {
156
+ "total": 3,
157
+ "per_page": 10,
158
+ "current_page": 1,
159
+ "last_page": 1,
160
+ "data": [
161
+ {
162
+ "id": 1,
163
+ "title": "Color",
164
+ "slug": "color",
165
+ "description": "Product color options",
166
+ "settings": null,
167
+ "created_at": "2025-01-10 08:30:00",
168
+ "updated_at": "2025-01-10 08:30:00",
169
+ "terms_count": 5
170
+ }
171
+ ]
172
+ }
173
+ }
174
+ ```
175
+
176
+ ---
177
+
178
+ ### Create Attribute Group
179
+
180
+ `POST /fluent-cart/v2/options/attr/group`
181
+
182
+ #### Permission
183
+
184
+ `products/create` | **Request Class:** `AttrGroupRequest`
185
+
186
+ #### Parameters
187
+
188
+ | Parameter | Type | Location | Required | Description |
189
+ |-----------|------|----------|----------|-------------|
190
+ | `title` | string | body | Yes | Group title (max 50 chars). Must be unique in `fct_atts_groups` |
191
+ | `slug` | string | body | Yes | Group slug (max 50 chars). Must be unique in `fct_atts_groups` |
192
+ | `description` | string | body | No | Group description |
193
+ | `settings` | object | body | No | Additional settings object |
194
+
195
+ ---
196
+
197
+ ### Get Attribute Group
198
+
199
+ `GET /fluent-cart/v2/options/attr/group/{group_id}`
200
+
201
+ #### Parameters
202
+
203
+ | Parameter | Type | Location | Required | Description |
204
+ |-----------|------|----------|----------|-------------|
205
+ | `group_id` | integer | path | Yes | Attribute Group ID |
206
+ | `with` | array | query | No | Eager load relations (e.g., `["terms"]`) |
207
+
208
+ ---
209
+
210
+ ### Update Attribute Group
211
+
212
+ `PUT /fluent-cart/v2/options/attr/group/{group_id}`
213
+
214
+ #### Permission
215
+
216
+ `products/edit` | **Request Class:** `AttrGroupRequest`
217
+
218
+ ---
219
+
220
+ ### Delete Attribute Group
221
+
222
+ `DELETE /fluent-cart/v2/options/attr/group/{group_id}`
223
+
224
+ #### Permission
225
+
226
+ `products/delete`
227
+
228
+ > **Delete Guard:** A group cannot be deleted if any of its terms are currently assigned to product variations. Attempting to delete an active group returns HTTP `403`: `"This group is already in use, can not be deleted."`.
229
+
230
+ ---
231
+
232
+ ## Attribute Terms
233
+
234
+ Individual variation values within an attribute group (e.g., "Red", "Blue", "Green").
235
+
236
+ **Prefix:** `/fluent-cart/v2/options/attr/group/{group_id}` | **Policy:** `ProductPolicy`
237
+
238
+ ### List Attribute Terms
239
+
240
+ `GET /fluent-cart/v2/options/attr/group/{group_id}/terms`
241
+
242
+ #### Parameters
243
+
244
+ | Parameter | Type | Location | Required | Description |
245
+ |-----------|------|----------|----------|-------------|
246
+ | `group_id` | integer | path | Yes | Parent attribute group ID |
247
+ | `search` | object | query | No | Column search (`title`, `slug`) |
248
+ | `order_by` | string | query | No | Sort column (`serial`, `title`, `id`). Default: `serial` |
249
+ | `order_type` | string | query | No | Sort direction (`ASC` or `DESC`). Default: `ASC` |
250
+ | `per_page` | integer | query | No | Items per page (default: 15) |
251
+
252
+ ---
253
+
254
+ ### Create Attribute Term
255
+
256
+ `POST /fluent-cart/v2/options/attr/group/{group_id}/term`
257
+
258
+ #### Permission
259
+
260
+ `products/create` | **Request Class:** `AttrTermRequest`
261
+
262
+ #### Parameters
263
+
264
+ | Parameter | Type | Location | Required | Description |
265
+ |-----------|------|----------|----------|-------------|
266
+ | `group_id` | integer | path | Yes | Parent attribute group ID |
267
+ | `title` | string | body | Yes | Term title (max 50 chars). Must be unique in `fct_atts_terms` |
268
+ | `slug` | string | body | Yes | Term slug (max 50 chars). Must be unique in `fct_atts_terms` |
269
+ | `description` | string | body | No | Term description |
270
+ | `serial` | integer | body | No | Sort order index (default: `10`) |
271
+
272
+ ---
273
+
274
+ ### Update Attribute Term
275
+
276
+ `POST /fluent-cart/v2/options/attr/group/{group_id}/term/{term_id}`
277
+
278
+ #### Permission
279
+
280
+ `products/edit` | **Request Class:** `AttrTermRequest`
281
+
282
+ ---
283
+
284
+ ### Delete Attribute Term
285
+
286
+ `DELETE /fluent-cart/v2/options/attr/group/{group_id}/term/{term_id}`
287
+
288
+ #### Permission
289
+
290
+ `products/delete`
291
+
292
+ > **Delete Guard:** Terms assigned to product variations return HTTP `403`: `"This term is already in use, can not be deleted."`.
293
+
294
+ ---
295
+
296
+ ### Change Term Sort Order (Serial Shift)
297
+
298
+ `POST /fluent-cart/v2/options/attr/group/{group_id}/term/{term_id}/serial`
299
+
300
+ Increments or decrements the sort order `serial` value of a term.
301
+
302
+ #### Permission
303
+
304
+ `products/edit`
305
+
306
+ #### Parameters
307
+
308
+ | Parameter | Type | Location | Required | Description |
309
+ |-----------|------|----------|----------|-------------|
310
+ | `group_id` | integer | path | Yes | Attribute group ID |
311
+ | `term_id` | integer | path | Yes | Term ID to reorder |
312
+ | `direction` | string | body | No | `up` (decrements serial, min 0) or `down` (increments serial). Default: `up` |
313
+
314
+ #### Response
315
+
316
+ ```json
317
+ {
318
+ "data": 2,
319
+ "message": "Serial updated."
320
+ }
321
+ ```