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,2563 +1,2563 @@
1
- # Products API
2
-
3
- Manage your product catalog including creating products, managing variations, downloadable files, bundles, upgrade paths, tax/shipping classes, stock management, and product integrations.
4
-
5
- **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/products`
6
-
7
- **Policy:** `ProductPolicy`
8
-
9
- > All monetary values are in cents (e.g., `$10.00` = `1000`).
10
-
11
- ---
12
-
13
- ## Endpoints Overview
14
-
15
- | Method | Endpoint | Description |
16
- |--------|----------|-------------|
17
- | **Product CRUD** | | |
18
- | GET | `/products` | List Products |
19
- | GET | `/products/{product}` | Get Product |
20
- | POST | `/products` | Create Product |
21
- | DELETE | `/products/{product}` | Delete Product |
22
- | GET | `/products/{productId}/pricing` | Get Product Pricing |
23
- | POST | `/products/{postId}/pricing` | Update Product Pricing |
24
- | **Search & Lookup** | | |
25
- | GET | `/products/searchProductByName` | Search Products by Name |
26
- | GET | `/products/searchVariantByName` | Search Variants by Name |
27
- | GET | `/products/search-product-variant-options` | Search Product Variant Options |
28
- | GET | `/products/findSubscriptionVariants` | Find Subscription Variants |
29
- | GET | `/products/fetchProductsByIds` | Fetch Products by IDs |
30
- | GET | `/products/fetchVariationsByIds` | Fetch Variations by IDs |
31
- | GET | `/products/suggest-sku` | Suggest SKU |
32
- | GET | `/products/get-max-excerpt-word-count` | Get Max Excerpt Word Count |
33
- | GET | `/products/fetch-term` | Fetch Taxonomy Terms |
34
- | POST | `/products/fetch-term-by-parent` | Fetch Terms by Parent |
35
- | **Bulk Operations** | | |
36
- | POST | `/products/bulk-insert` | Bulk Insert Products |
37
- | GET | `/products/bulk-edit-data` | Bulk Edit Fetch |
38
- | POST | `/products/bulk-update` | Bulk Update Products |
39
- | POST | `/products/do-bulk-action` | Do Bulk Action |
40
- | POST | `/products/create-dummy` | Create Dummy Products |
41
- | **Product Details** | | |
42
- | POST | `/products/{productId}/duplicate` | Duplicate Product |
43
- | GET | `/products/{productId}/related-products` | Get Related Products |
44
- | POST | `/products/{postId}/update-long-desc-editor-mode` | Update Long Description Editor Mode |
45
- | POST | `/products/{postId}/update-variant-option` | Update Variant Option |
46
- | POST | `/products/detail/{detailId}` | Update Product Detail |
47
- | POST | `/products/add-product-terms` | Add Product Terms |
48
- | POST | `/products/sync-taxonomy-term/{postId}` | Sync Taxonomy Terms |
49
- | POST | `/products/delete-taxonomy-term/{postId}` | Delete Taxonomy Term |
50
- | GET | `/products/{productId}/pricing-widgets` | Get Pricing Widgets |
51
- | **Bundles** | | |
52
- | GET | `/products/get-bundle-info/{productId}` | Get Bundle Info |
53
- | POST | `/products/save-bundle-info/{variationId}` | Save Bundle Info |
54
- | **Upgrade Paths** | | |
55
- | GET | `/products/{id}/upgrade-paths` | Get Upgrade Settings |
56
- | POST | `/products/{id}/upgrade-path` | Save Upgrade Path |
57
- | POST | `/products/upgrade-path/{id}/update` | Update Upgrade Path |
58
- | DELETE | `/products/upgrade-path/{id}/delete` | Delete Upgrade Path |
59
- | GET | `/products/variation/{variantId}/upgrade-paths` | Get Variation Upgrade Paths |
60
- | **Tax & Shipping Classes** | | |
61
- | POST | `/products/{postId}/tax-class` | Update Tax Class |
62
- | POST | `/products/{postId}/tax-class/remove` | Remove Tax Class |
63
- | POST | `/products/{postId}/shipping-class` | Update Shipping Class |
64
- | POST | `/products/{postId}/shipping-class/remove` | Remove Shipping Class |
65
- | **Stock Management** | | |
66
- | PUT | `/products/{postId}/update-inventory/{variantId}` | Update Inventory |
67
- | PUT | `/products/{postId}/update-manage-stock` | Update Manage Stock Setting |
68
- | **Downloadables** | | |
69
- | POST | `/products/{postId}/sync-downloadable-files` | Sync Downloadable Files |
70
- | PUT | `/products/{downloadableId}/update` | Update Downloadable File |
71
- | DELETE | `/products/{downloadableId}/delete` | Delete Downloadable File |
72
- | GET | `/products/getDownloadableUrl/{downloadableId}` | Get Downloadable URL |
73
- | **Variations** | | |
74
- | GET | `/products/variants` | List Product Variations |
75
- | POST | `/products/variants` | Create Variation |
76
- | POST | `/products/variants/{variantId}` | Update Variation |
77
- | DELETE | `/products/variants/{variantId}` | Delete Variation |
78
- | POST | `/products/variants/{variantId}/setMedia` | Set Variation Media |
79
- | PUT | `/products/variants/{variantId}/pricing-table` | Update Variation Pricing Table |
80
- | GET | `/variants` | List All Variants |
81
- | **Integrations** | | |
82
- | GET | `/products/{productId}/integrations` | Get Product Integration Feeds |
83
- | GET | `/products/{product_id}/integrations/{integration_name}/settings` | Get Product Integration Settings |
84
- | POST | `/products/{product_id}/integrations` | Save Product Integration |
85
- | PUT | `/products/{product_id}/integrations/{integration_id}` | Update Product Integration |
86
- | DELETE | `/products/{product_id}/integrations/{integration_id}` | Delete Product Integration |
87
-
88
- ---
89
-
90
- ## Product CRUD & Listing
91
-
92
- ### List Products
93
-
94
- `GET /fluent-cart/v2/products`
95
-
96
- Retrieve a paginated list of products with filtering, sorting, and search capabilities.
97
-
98
- **Permission:** `products/view`
99
-
100
- #### Parameters
101
-
102
- | Parameter | Type | Location | Required | Description |
103
- |-----------|------|----------|----------|-------------|
104
- | `search` | string | query | No | Search by product title, ID, or variation title |
105
- | `per_page` | integer | query | No | Number of results per page (default: 10) |
106
- | `page` | integer | query | No | Page number for pagination |
107
- | `sort_by` | string | query | No | Column to sort by (default: `ID`) |
108
- | `sort_type` | string | query | No | Sort direction: `asc` or `desc` (default: `desc`) |
109
- | `active_view` | string | query | No | Filter tab: `publish`, `draft`, `physical`, `digital`, `subscribable`, `not_subscribable`, `bundle`, `non_bundle` |
110
- | `filter_type` | string | query | No | `simple` or `advanced` |
111
- | `with` | array | query | No | Relations to eager load |
112
- | `search_groups` | array | query | No | Advanced filter groups for complex queries |
113
-
114
- #### Response
115
-
116
- ```json
117
- {
118
- "products": {
119
- "total": 50,
120
- "per_page": 10,
121
- "current_page": 1,
122
- "last_page": 5,
123
- "data": [
124
- {
125
- "ID": 123,
126
- "post_title": "Example Product",
127
- "post_status": "publish",
128
- "post_date": "2025-01-15 12:00:00",
129
- "view_url": "https://example.com/product/example-product",
130
- "edit_url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/products/123"
131
- }
132
- ]
133
- }
134
- }
135
- ```
136
-
137
- #### Example
138
-
139
- ```bash
140
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products?search=widget&per_page=20&active_view=publish" \
141
- -u "username:app_password"
142
- ```
143
-
144
- ---
145
-
146
- ### Get Product
147
-
148
- `GET /fluent-cart/v2/products/{product}`
149
-
150
- Retrieve a single product by ID.
151
-
152
- **Permission:** `products/view`
153
-
154
- #### Parameters
155
-
156
- | Parameter | Type | Location | Required | Description |
157
- |-----------|------|----------|----------|-------------|
158
- | `product` | integer | path | Yes | The product ID |
159
- | `with` | array | query | No | Relations to eager load (e.g., `["detail", "variants", "product_menu"]`) |
160
-
161
- #### Response
162
-
163
- ```json
164
- {
165
- "product": {
166
- "ID": 123,
167
- "post_title": "Example Product",
168
- "post_status": "publish",
169
- "post_excerpt": "Short description",
170
- "post_content": "Full description"
171
- },
172
- "product_menu": []
173
- }
174
- ```
175
-
176
- #### Example
177
-
178
- ```bash
179
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123?with[]=detail&with[]=variants" \
180
- -u "username:app_password"
181
- ```
182
-
183
- ---
184
-
185
- ### Create Product
186
-
187
- `POST /fluent-cart/v2/products`
188
-
189
- Create a new product. A default variation is automatically created with the product.
190
-
191
- **Permission:** `products/create`
192
-
193
- **Request Class:** `ProductCreateRequest`
194
-
195
- #### Parameters
196
-
197
- | Parameter | Type | Location | Required | Description |
198
- |-----------|------|----------|----------|-------------|
199
- | `post_title` | string | body | Yes | Product title (max 200 characters) |
200
- | `post_status` | string | body | No | Post status (e.g., `draft`, `publish`) |
201
- | `detail.fulfillment_type` | string | body | No | `physical` or `digital` (default: `digital`) |
202
- | `detail.other_info.is_bundle_product` | string | body | No | `yes` or `no` (default: `no`) |
203
-
204
- #### Response
205
-
206
- ```json
207
- {
208
- "data": {
209
- "ID": 124,
210
- "variant": {
211
- "id": 456,
212
- "post_id": 124,
213
- "variation_title": "Example Product",
214
- "stock_status": "in-stock",
215
- "payment_type": "onetime",
216
- "total_stock": 1,
217
- "available": 1,
218
- "fulfillment_type": "digital"
219
- },
220
- "product_details": { ... }
221
- },
222
- "message": "Product has been created successfully"
223
- }
224
- ```
225
-
226
- #### Example
227
-
228
- ```bash
229
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products" \
230
- -u "username:app_password" \
231
- -H "Content-Type: application/json" \
232
- -d '{
233
- "post_title": "New Digital Product",
234
- "post_status": "draft",
235
- "detail": {
236
- "fulfillment_type": "digital"
237
- }
238
- }'
239
- ```
240
-
241
- ---
242
-
243
- ### Delete Product
244
-
245
- `DELETE /fluent-cart/v2/products/{product}`
246
-
247
- Delete a product and all associated data.
248
-
249
- **Permission:** `products/delete`
250
-
251
- #### Parameters
252
-
253
- | Parameter | Type | Location | Required | Description |
254
- |-----------|------|----------|----------|-------------|
255
- | `product` | integer | path | Yes | The product ID to delete |
256
-
257
- #### Response
258
-
259
- ```json
260
- {
261
- "message": "Product deleted successfully"
262
- }
263
- ```
264
-
265
- #### Example
266
-
267
- ```bash
268
- curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/123" \
269
- -u "username:app_password"
270
- ```
271
-
272
- ---
273
-
274
- ### Get Product Pricing
275
-
276
- `GET /fluent-cart/v2/products/{productId}/pricing`
277
-
278
- Retrieve the full product details including pricing, variants, downloadable files, and taxonomy information.
279
-
280
- **Permission:** `products/view`
281
-
282
- #### Parameters
283
-
284
- | Parameter | Type | Location | Required | Description |
285
- |-----------|------|----------|----------|-------------|
286
- | `productId` | integer | path | Yes | The product ID |
287
- | `with` | array | query | No | Additional relations (e.g., `["product_menu"]`) |
288
-
289
- #### Response
290
-
291
- ```json
292
- {
293
- "product": {
294
- "ID": 123,
295
- "post_title": "Example Product",
296
- "post_status": "publish",
297
- "post_excerpt": "Short description",
298
- "featured_image_id": 456,
299
- "view_url": "https://example.com/product/example",
300
- "edit_url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/products/123",
301
- "detail": {
302
- "id": 1,
303
- "post_id": 123,
304
- "fulfillment_type": "digital",
305
- "variation_type": "simple",
306
- "manage_stock": 0,
307
- "manage_downloadable": 0,
308
- "other_info": { ... }
309
- },
310
- "variants": [
311
- {
312
- "id": 789,
313
- "post_id": 123,
314
- "variation_title": "Default Plan",
315
- "item_price": 1000,
316
- "compare_price": 0,
317
- "stock_status": "in-stock",
318
- "other_info": { ... },
319
- "media": []
320
- }
321
- ],
322
- "downloadable_files": []
323
- },
324
- "product_menu": "",
325
- "taxonomies": [
326
- {
327
- "name": "product-categories",
328
- "label": "Product Categories",
329
- "terms": [],
330
- "labels": { ... }
331
- }
332
- ]
333
- }
334
- ```
335
-
336
- #### Example
337
-
338
- ```bash
339
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/pricing?with[]=product_menu" \
340
- -u "username:app_password"
341
- ```
342
-
343
- ---
344
-
345
- ### Update Product Pricing
346
-
347
- `POST /fluent-cart/v2/products/{postId}/pricing`
348
-
349
- Update a product's pricing, details, variants, and other metadata.
350
-
351
- **Permission:** `products/edit`
352
-
353
- **Request Class:** `ProductUpdateRequest`
354
-
355
- #### Parameters
356
-
357
- | Parameter | Type | Location | Required | Description |
358
- |-----------|------|----------|----------|-------------|
359
- | `postId` | integer | path | Yes | The product post ID |
360
- | `post_title` | string | body | Yes | Product title (max 200 characters) |
361
- | `post_status` | string | body | Yes | Status: `draft`, `publish`, `future` |
362
- | `post_date` | string | body | Conditional | Required when `post_status` is `future`. Must be a future date (GMT) |
363
- | `post_excerpt` | string | body | No | Product short description (limited by `excerpt_length` filter, default 55 words) |
364
- | `post_content` | string | body | No | Product long description (HTML allowed) |
365
- | `post_name` | string | body | No | Product URL slug |
366
- | `comment_status` | string | body | No | Comment status (max 100 chars) |
367
- | `detail.fulfillment_type` | string | body | Yes | `physical` or `digital` |
368
- | `detail.variation_type` | string | body | Yes | `simple` or `simple_variations` |
369
- | `detail.manage_stock` | integer | body | No | `0` or `1` |
370
- | `detail.manage_downloadable` | integer | body | No | `0` or `1` |
371
- | `detail.default_variation_id` | integer | body | No | Default variation ID |
372
- | `detail.stock_availability` | string | body | No | Stock availability status |
373
- | `detail.other_info.group_pricing_by` | string | body | No | `payment_type`, `repeat_interval`, or `none` |
374
- | `detail.other_info.sold_individually` | string | body | No | `yes` or `no` |
375
- | `detail.other_info.use_pricing_table` | string | body | No | Enable pricing table display |
376
- | `detail.other_info.shipping_class` | integer | body | No | Shipping class ID (validated) |
377
- | `detail.other_info.tax_class` | integer | body | No | Tax class ID (validated) |
378
- | `detail.other_info.active_editor` | string | body | No | Active editor mode |
379
- | `variants` | array | body | Conditional | Array of variant objects (required for simple type when publishing) |
380
- | `variants.*.variation_title` | string | body | Yes | Variation title (max 200 chars) |
381
- | `variants.*.post_id` | integer | body | Yes | Parent product post ID |
382
- | `variants.*.item_price` | number | body | No | Price in cents (min: 0) |
383
- | `variants.*.compare_price` | number | body | No | Compare-at price in cents (must be >= `item_price`) |
384
- | `variants.*.manage_cost` | string | body | No | Enable cost tracking |
385
- | `variants.*.item_cost` | number | body | Conditional | Required if `manage_cost` is `true` |
386
- | `variants.*.serial_index` | integer | body | No | Display order index |
387
- | `variants.*.sku` | string | body | No | SKU (max 30 chars, must be unique) |
388
- | `variants.*.fulfillment_type` | string | body | No | `physical` or `digital` |
389
- | `variants.*.other_info.payment_type` | string | body | Yes | `onetime` or `subscription` |
390
- | `variants.*.other_info.description` | string | body | No | Variant description (max 255 chars) |
391
- | `variants.*.other_info.repeat_interval` | string | body | Conditional | Required for subscriptions. e.g., `monthly`, `yearly` |
392
- | `variants.*.other_info.times` | string | body | No | Number of billing cycles |
393
- | `variants.*.other_info.trial_days` | string | body | No | Trial period in days (max 365) |
394
- | `variants.*.other_info.billing_summary` | string | body | No | Billing summary text (max 255 chars) |
395
- | `variants.*.other_info.manage_setup_fee` | string | body | Conditional | Required for subscriptions: `yes` or `no` |
396
- | `variants.*.other_info.signup_fee` | number | body | Conditional | Setup fee in cents. Required if `manage_setup_fee` is `yes` |
397
- | `variants.*.other_info.signup_fee_name` | string | body | Conditional | Setup fee label (max 100 chars). Required if `manage_setup_fee` is `yes` |
398
- | `variants.*.other_info.installment` | string | body | No | Enable installment: `yes` or `no` |
399
- | `product_terms` | object | body | No | Taxonomy term IDs (e.g., `{"product-categories": [1, 2]}`) |
400
- | `gallery` | array | body | No | Gallery images array with `id`, `url`, `title` |
401
- | `metaValue` | mixed | body | No | Additional metadata |
402
-
403
- #### Response
404
-
405
- ```json
406
- {
407
- "data": { ... },
408
- "message": "Product updated successfully"
409
- }
410
- ```
411
-
412
- #### Example
413
-
414
- ```bash
415
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/pricing" \
416
- -u "username:app_password" \
417
- -H "Content-Type: application/json" \
418
- -d '{
419
- "post_title": "Updated Product",
420
- "post_status": "publish",
421
- "detail": {
422
- "fulfillment_type": "digital",
423
- "variation_type": "simple"
424
- },
425
- "variants": [
426
- {
427
- "id": 789,
428
- "post_id": 123,
429
- "variation_title": "Default Plan",
430
- "item_price": 1999,
431
- "other_info": {
432
- "payment_type": "onetime"
433
- }
434
- }
435
- ]
436
- }'
437
- ```
438
-
439
- ---
440
-
441
- ## Product Search & Lookup
442
-
443
- ### Search Products by Name
444
-
445
- `GET /fluent-cart/v2/products/searchProductByName`
446
-
447
- Search for published products by name. Returns products formatted for select dropdowns.
448
-
449
- **Permission:** `products/view`
450
-
451
- #### Parameters
452
-
453
- | Parameter | Type | Location | Required | Description |
454
- |-----------|------|----------|----------|-------------|
455
- | `name` | string | query | No | Product name to search for |
456
- | `url_mode` | string | query | No | URL mode flag |
457
- | `termId` | integer | query | No | Filter by taxonomy term ID (`product-categories`) |
458
-
459
- #### Response
460
-
461
- ```json
462
- {
463
- "products": [
464
- {
465
- "ID": 123,
466
- "post_title": "Example Product",
467
- "wpTerms": [...]
468
- }
469
- ]
470
- }
471
- ```
472
-
473
- #### Example
474
-
475
- ```bash
476
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/searchProductByName?name=widget" \
477
- -u "username:app_password"
478
- ```
479
-
480
- ---
481
-
482
- ### Search Variants by Name
483
-
484
- `GET /fluent-cart/v2/products/searchVariantByName`
485
-
486
- Search for published product variants by name. Returns a hierarchical product > variants structure.
487
-
488
- **Permission:** `products/view`
489
-
490
- #### Parameters
491
-
492
- | Parameter | Type | Location | Required | Description |
493
- |-----------|------|----------|----------|-------------|
494
- | `name` | string | query | No | Product/variant name to search |
495
- | `search` | string | query | No | Alternative search parameter (used if `name` is empty) |
496
- | `ids` | array | query | No | Array of product IDs to include |
497
-
498
- #### Response
499
-
500
- ```json
501
- [
502
- {
503
- "value": 123,
504
- "label": "Example Product",
505
- "children": [
506
- {
507
- "value": 456,
508
- "label": "Monthly Plan"
509
- },
510
- {
511
- "value": 457,
512
- "label": "Yearly Plan"
513
- }
514
- ]
515
- }
516
- ]
517
- ```
518
-
519
- #### Example
520
-
521
- ```bash
522
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/searchVariantByName?name=pro" \
523
- -u "username:app_password"
524
- ```
525
-
526
- ---
527
-
528
- ### Search Product Variant Options
529
-
530
- `GET /fluent-cart/v2/products/search-product-variant-options`
531
-
532
- Search for product variants suitable for selection (e.g., in order creation). Filters out out-of-stock items.
533
-
534
- **Permission:** `products/view`
535
-
536
- #### Parameters
537
-
538
- | Parameter | Type | Location | Required | Description |
539
- |-----------|------|----------|----------|-------------|
540
- | `search` | string | query | No | Search term for product/variant title |
541
- | `include_ids` | array | query | No | Variation IDs to always include in results |
542
- | `scopes` | array | query | No | Model scopes to apply |
543
- | `subscription_status` | string | query | No | `not_subscribable` to exclude subscription variants |
544
-
545
- #### Response
546
-
547
- ```json
548
- {
549
- "products": [
550
- {
551
- "value": "product_123",
552
- "label": "Example Product",
553
- "children": [
554
- {
555
- "value": 456,
556
- "label": "Monthly Plan"
557
- }
558
- ]
559
- }
560
- ]
561
- }
562
- ```
563
-
564
- #### Example
565
-
566
- ```bash
567
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/search-product-variant-options?search=pro&subscription_status=not_subscribable" \
568
- -u "username:app_password"
569
- ```
570
-
571
- ---
572
-
573
- ### Find Subscription Variants
574
-
575
- `GET /fluent-cart/v2/products/findSubscriptionVariants`
576
-
577
- Search for product variants that have a subscription payment type.
578
-
579
- **Permission:** `products/view`
580
-
581
- #### Parameters
582
-
583
- | Parameter | Type | Location | Required | Description |
584
- |-----------|------|----------|----------|-------------|
585
- | `name` | string | query | No | Variant title to search |
586
-
587
- #### Response
588
-
589
- ```json
590
- [
591
- {
592
- "id": 456,
593
- "title": "Monthly Subscription"
594
- },
595
- {
596
- "id": 457,
597
- "title": "Yearly Subscription"
598
- }
599
- ]
600
- ```
601
-
602
- #### Example
603
-
604
- ```bash
605
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/findSubscriptionVariants?name=monthly" \
606
- -u "username:app_password"
607
- ```
608
-
609
- ---
610
-
611
- ### Fetch Products by IDs
612
-
613
- `GET /fluent-cart/v2/products/fetchProductsByIds`
614
-
615
- Retrieve products by an array of IDs. Returns products with their detail relation.
616
-
617
- **Permission:** `products/view`
618
-
619
- #### Parameters
620
-
621
- | Parameter | Type | Location | Required | Description |
622
- |-----------|------|----------|----------|-------------|
623
- | `productIds` | array | query | Yes | Array of product IDs to fetch |
624
-
625
- #### Response
626
-
627
- ```json
628
- {
629
- "products": [
630
- {
631
- "ID": 123,
632
- "post_title": "Example Product",
633
- "detail": { ... }
634
- }
635
- ]
636
- }
637
- ```
638
-
639
- #### Example
640
-
641
- ```bash
642
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/fetchProductsByIds?productIds[]=123&productIds[]=456" \
643
- -u "username:app_password"
644
- ```
645
-
646
- ---
647
-
648
- ### Fetch Variations by IDs
649
-
650
- `GET /fluent-cart/v2/products/fetchVariationsByIds`
651
-
652
- Retrieve variations by an array of IDs. Returns simplified label/value pairs.
653
-
654
- **Permission:** `products/view`
655
-
656
- #### Parameters
657
-
658
- | Parameter | Type | Location | Required | Description |
659
- |-----------|------|----------|----------|-------------|
660
- | `productIds` | array | query | Yes | Array of variation IDs to fetch |
661
-
662
- #### Response
663
-
664
- ```json
665
- {
666
- "products": [
667
- {
668
- "value": 456,
669
- "label": "Monthly Plan"
670
- },
671
- {
672
- "value": 457,
673
- "label": "Yearly Plan"
674
- }
675
- ]
676
- }
677
- ```
678
-
679
- #### Example
680
-
681
- ```bash
682
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/fetchVariationsByIds?productIds[]=456&productIds[]=457" \
683
- -u "username:app_password"
684
- ```
685
-
686
- ---
687
-
688
- ### Suggest SKU
689
-
690
- `GET /fluent-cart/v2/products/suggest-sku`
691
-
692
- Generate a unique SKU suggestion based on product and variant titles.
693
-
694
- **Permission:** `products/view`
695
-
696
- #### Parameters
697
-
698
- | Parameter | Type | Location | Required | Description |
699
- |-----------|------|----------|----------|-------------|
700
- | `title` | string | query | Yes | Product title to base SKU on |
701
- | `variant_title` | string | query | No | Variant title to include in SKU |
702
- | `exclude_id` | integer | query | No | Variation ID to exclude from uniqueness check |
703
-
704
- #### Response
705
-
706
- ```json
707
- {
708
- "sku": "EXA-PRO-MON"
709
- }
710
- ```
711
-
712
- #### Example
713
-
714
- ```bash
715
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/suggest-sku?title=Example%20Product&variant_title=Monthly" \
716
- -u "username:app_password"
717
- ```
718
-
719
- ---
720
-
721
- ### Get Max Excerpt Word Count
722
-
723
- `GET /fluent-cart/v2/products/get-max-excerpt-word-count`
724
-
725
- Returns the maximum allowed word count for product excerpts (controlled by the WordPress `excerpt_length` filter).
726
-
727
- **Permission:** `products/view`
728
-
729
- #### Response
730
-
731
- ```json
732
- {
733
- "count": 55
734
- }
735
- ```
736
-
737
- #### Example
738
-
739
- ```bash
740
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/get-max-excerpt-word-count" \
741
- -u "username:app_password"
742
- ```
743
-
744
- ---
745
-
746
- ### Fetch Taxonomy Terms
747
-
748
- `GET /fluent-cart/v2/products/fetch-term`
749
-
750
- Retrieve all registered taxonomies and their terms for product categorization.
751
-
752
- **Permission:** `products/view`
753
-
754
- #### Response
755
-
756
- ```json
757
- {
758
- "taxonomies": [
759
- {
760
- "name": "product-categories",
761
- "label": "Product Categories",
762
- "terms": [
763
- {
764
- "value": 1,
765
- "label": "Software",
766
- "children": []
767
- }
768
- ]
769
- },
770
- {
771
- "name": "product-brands",
772
- "label": "Product Brands",
773
- "terms": []
774
- }
775
- ]
776
- }
777
- ```
778
-
779
- #### Example
780
-
781
- ```bash
782
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/fetch-term" \
783
- -u "username:app_password"
784
- ```
785
-
786
- ---
787
-
788
- ### Fetch Terms by Parent
789
-
790
- `POST /fluent-cart/v2/products/fetch-term-by-parent`
791
-
792
- Retrieve taxonomy terms filtered by parent term IDs.
793
-
794
- **Permission:** `products/view`
795
-
796
- #### Parameters
797
-
798
- | Parameter | Type | Location | Required | Description |
799
- |-----------|------|----------|----------|-------------|
800
- | `parents` | array | body | Yes | Array of parent term IDs |
801
- | `listeners` | array | body | Yes | Array of taxonomy names to retrieve terms for |
802
-
803
- #### Response
804
-
805
- ```json
806
- {
807
- "data": {
808
- "product-categories": [
809
- {
810
- "value": 5,
811
- "label": "Sub Category"
812
- }
813
- ]
814
- }
815
- }
816
- ```
817
-
818
- #### Example
819
-
820
- ```bash
821
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/fetch-term-by-parent" \
822
- -u "username:app_password" \
823
- -H "Content-Type: application/json" \
824
- -d '{
825
- "parents": [1, 2],
826
- "listeners": ["product-categories"]
827
- }'
828
- ```
829
-
830
- ---
831
-
832
- ## Bulk Operations
833
-
834
- ### Bulk Insert Products
835
-
836
- `POST /fluent-cart/v2/products/bulk-insert`
837
-
838
- Insert multiple products at once. Maximum 10 products per request.
839
-
840
- **Permission:** `products/create`
841
-
842
- #### Parameters
843
-
844
- | Parameter | Type | Location | Required | Description |
845
- |-----------|------|----------|----------|-------------|
846
- | `products` | array | body | Yes | Array of product data objects (max 10) |
847
-
848
- #### Response
849
-
850
- ```json
851
- {
852
- "message": "3 product(s) created successfully",
853
- "created": [ ... ],
854
- "errors": []
855
- }
856
- ```
857
-
858
- #### Example
859
-
860
- ```bash
861
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/bulk-insert" \
862
- -u "username:app_password" \
863
- -H "Content-Type: application/json" \
864
- -d '{
865
- "products": [
866
- {
867
- "post_title": "Product A",
868
- "detail": { "fulfillment_type": "digital" }
869
- },
870
- {
871
- "post_title": "Product B",
872
- "detail": { "fulfillment_type": "physical" }
873
- }
874
- ]
875
- }'
876
- ```
877
-
878
- ---
879
-
880
- ### Bulk Edit Fetch
881
-
882
- `GET /fluent-cart/v2/products/bulk-edit-data`
883
-
884
- Fetch products formatted for the bulk editing spreadsheet view.
885
-
886
- **Permission:** `products/edit`
887
-
888
- #### Parameters
889
-
890
- Standard filter parameters (see List Products).
891
-
892
- #### Response
893
-
894
- ```json
895
- {
896
- "products": [ ... ],
897
- "columns": [ ... ]
898
- }
899
- ```
900
-
901
- #### Example
902
-
903
- ```bash
904
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/bulk-edit-data" \
905
- -u "username:app_password"
906
- ```
907
-
908
- ---
909
-
910
- ### Bulk Update Products
911
-
912
- `POST /fluent-cart/v2/products/bulk-update`
913
-
914
- Update multiple products at once from the bulk edit view. Maximum 10 products per request.
915
-
916
- **Permission:** `products/edit`
917
-
918
- #### Parameters
919
-
920
- | Parameter | Type | Location | Required | Description |
921
- |-----------|------|----------|----------|-------------|
922
- | `products` | array | body | Yes | Array of product data objects to update (max 10) |
923
-
924
- #### Response
925
-
926
- ```json
927
- {
928
- "message": "3 product(s) updated successfully",
929
- "updated": [ ... ],
930
- "errors": []
931
- }
932
- ```
933
-
934
- #### Example
935
-
936
- ```bash
937
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/bulk-update" \
938
- -u "username:app_password" \
939
- -H "Content-Type: application/json" \
940
- -d '{
941
- "products": [
942
- {
943
- "ID": 123,
944
- "post_title": "Updated Title A"
945
- }
946
- ]
947
- }'
948
- ```
949
-
950
- ---
951
-
952
- ### Do Bulk Action
953
-
954
- `POST /fluent-cart/v2/products/do-bulk-action`
955
-
956
- Perform bulk actions on selected products (e.g., publish, draft, delete).
957
-
958
- **Permission:** `products/edit`
959
-
960
- #### Parameters
961
-
962
- | Parameter | Type | Location | Required | Description |
963
- |-----------|------|----------|----------|-------------|
964
- | `action` | string | body | Yes | The bulk action to perform |
965
- | `product_ids` | array | body | Yes | Array of product IDs to act on |
966
-
967
- #### Response
968
-
969
- ```json
970
- {
971
- "message": "Bulk action completed successfully"
972
- }
973
- ```
974
-
975
- #### Example
976
-
977
- ```bash
978
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/do-bulk-action" \
979
- -u "username:app_password" \
980
- -H "Content-Type: application/json" \
981
- -d '{
982
- "action": "publish",
983
- "product_ids": [123, 456, 789]
984
- }'
985
- ```
986
-
987
- ---
988
-
989
- ### Create Dummy Products
990
-
991
- `POST /fluent-cart/v2/products/create-dummy`
992
-
993
- Create sample/demo products for testing or onboarding purposes.
994
-
995
- **Permission:** `products/create`
996
-
997
- #### Parameters
998
-
999
- | Parameter | Type | Location | Required | Description |
1000
- |-----------|------|----------|----------|-------------|
1001
- | `category` | string | body | No | Product category for dummy products |
1002
- | `index` | integer | body | No | Index for dummy product generation |
1003
-
1004
- #### Response
1005
-
1006
- Returns the created dummy product data.
1007
-
1008
- #### Example
1009
-
1010
- ```bash
1011
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/create-dummy" \
1012
- -u "username:app_password" \
1013
- -H "Content-Type: application/json" \
1014
- -d '{
1015
- "category": "digital",
1016
- "index": 1
1017
- }'
1018
- ```
1019
-
1020
- ---
1021
-
1022
- ## Product Details & Configuration
1023
-
1024
- ### Duplicate Product
1025
-
1026
- `POST /fluent-cart/v2/products/{productId}/duplicate`
1027
-
1028
- Duplicate a product with options to include or exclude certain settings. The new product is saved as a draft.
1029
-
1030
- **Permission:** `products/create`
1031
-
1032
- #### Parameters
1033
-
1034
- | Parameter | Type | Location | Required | Description |
1035
- |-----------|------|----------|----------|-------------|
1036
- | `productId` | integer | path | Yes | The product ID to duplicate |
1037
- | `import_stock_management` | string | body | No | Include stock management settings (`true`/`false`) |
1038
- | `import_license_settings` | string | body | No | Include license settings (`true`/`false`) |
1039
- | `import_downloadable_files` | string | body | No | Include downloadable files (`true`/`false`) |
1040
-
1041
- #### Response
1042
-
1043
- ```json
1044
- {
1045
- "product_id": 125,
1046
- "message": "Product duplicated successfully. The new product has been saved as a draft."
1047
- }
1048
- ```
1049
-
1050
- #### Example
1051
-
1052
- ```bash
1053
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/duplicate" \
1054
- -u "username:app_password" \
1055
- -H "Content-Type: application/json" \
1056
- -d '{
1057
- "import_stock_management": "true",
1058
- "import_license_settings": "true",
1059
- "import_downloadable_files": "false"
1060
- }'
1061
- ```
1062
-
1063
- ---
1064
-
1065
- ### Get Related Products
1066
-
1067
- `GET /fluent-cart/v2/products/{productId}/related-products`
1068
-
1069
- Retrieve products related to a given product based on shared categories or brands.
1070
-
1071
- **Permission:** `products/view`
1072
-
1073
- #### Parameters
1074
-
1075
- | Parameter | Type | Location | Required | Description |
1076
- |-----------|------|----------|----------|-------------|
1077
- | `productId` | integer | path | Yes | The product ID |
1078
- | `related_by_categories` | boolean | query | No | Include products from same categories |
1079
- | `related_by_brands` | boolean | query | No | Include products from same brands |
1080
- | `order_by` | string | query | No | Sort order (default: `title_asc`) |
1081
- | `posts_per_page` | integer | query | No | Number of related products to return (default: 6) |
1082
-
1083
- #### Response
1084
-
1085
- ```json
1086
- {
1087
- "products": [
1088
- {
1089
- "ID": 456,
1090
- "post_title": "Related Product",
1091
- "post_status": "publish"
1092
- }
1093
- ]
1094
- }
1095
- ```
1096
-
1097
- #### Example
1098
-
1099
- ```bash
1100
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/related-products?related_by_categories=true&posts_per_page=4" \
1101
- -u "username:app_password"
1102
- ```
1103
-
1104
- ---
1105
-
1106
- ### Update Long Description Editor Mode
1107
-
1108
- `POST /fluent-cart/v2/products/{postId}/update-long-desc-editor-mode`
1109
-
1110
- Switch the long description editor between modes (e.g., visual, code).
1111
-
1112
- **Permission:** `products/edit`
1113
-
1114
- #### Parameters
1115
-
1116
- | Parameter | Type | Location | Required | Description |
1117
- |-----------|------|----------|----------|-------------|
1118
- | `postId` | integer | path | Yes | The product post ID |
1119
- | `active_editor` | string | body | Yes | The editor mode to set |
1120
-
1121
- #### Response
1122
-
1123
- ```json
1124
- {
1125
- "message": "Editor mode updated successfully"
1126
- }
1127
- ```
1128
-
1129
- #### Example
1130
-
1131
- ```bash
1132
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/update-long-desc-editor-mode" \
1133
- -u "username:app_password" \
1134
- -H "Content-Type: application/json" \
1135
- -d '{"active_editor": "visual"}'
1136
- ```
1137
-
1138
- ---
1139
-
1140
- ### Update Variant Option
1141
-
1142
- `POST /fluent-cart/v2/products/{postId}/update-variant-option`
1143
-
1144
- Sync variant options for a product (used when managing product attribute variations).
1145
-
1146
- **Permission:** `products/edit`
1147
-
1148
- #### Parameters
1149
-
1150
- | Parameter | Type | Location | Required | Description |
1151
- |-----------|------|----------|----------|-------------|
1152
- | `postId` | integer | path | Yes | The product post ID |
1153
- | `variation_type` | string | body | Yes | The variation type |
1154
- | `product_id` | integer | body | Yes | The product ID |
1155
- | `options` | array | body | Yes | Array of option objects with `id` and `variants` |
1156
-
1157
- #### Response
1158
-
1159
- ```json
1160
- {
1161
- "message": "Variant options synced successfully"
1162
- }
1163
- ```
1164
-
1165
- #### Example
1166
-
1167
- ```bash
1168
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/update-variant-option" \
1169
- -u "username:app_password" \
1170
- -H "Content-Type: application/json" \
1171
- -d '{
1172
- "variation_type": "simple_variations",
1173
- "product_id": 123,
1174
- "options": []
1175
- }'
1176
- ```
1177
-
1178
- ---
1179
-
1180
- ### Update Product Detail
1181
-
1182
- `POST /fluent-cart/v2/products/detail/{detailId}`
1183
-
1184
- Update a product detail record (e.g., change variation type).
1185
-
1186
- **Permission:** `products/edit`
1187
-
1188
- #### Parameters
1189
-
1190
- | Parameter | Type | Location | Required | Description |
1191
- |-----------|------|----------|----------|-------------|
1192
- | `detailId` | integer | path | Yes | The product detail ID |
1193
- | `variation_type` | string | body | No | New variation type (e.g., `simple`, `simple_variations`) |
1194
- | `variation_ids` | array | body | No | Array of variation IDs |
1195
- | `action` | string | body | No | Action to perform (default: `change_variation_type`) |
1196
-
1197
- #### Response
1198
-
1199
- ```json
1200
- {
1201
- "message": "Product detail updated successfully"
1202
- }
1203
- ```
1204
-
1205
- #### Example
1206
-
1207
- ```bash
1208
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/detail/456" \
1209
- -u "username:app_password" \
1210
- -H "Content-Type: application/json" \
1211
- -d '{
1212
- "variation_type": "simple_variations",
1213
- "action": "change_variation_type"
1214
- }'
1215
- ```
1216
-
1217
- ---
1218
-
1219
- ### Add Product Terms
1220
-
1221
- `POST /fluent-cart/v2/products/add-product-terms`
1222
-
1223
- Create new taxonomy terms for products (categories, brands, etc.).
1224
-
1225
- **Permission:** `products/edit`
1226
-
1227
- #### Parameters
1228
-
1229
- | Parameter | Type | Location | Required | Description |
1230
- |-----------|------|----------|----------|-------------|
1231
- | `term.name` | string | body | Yes | Term name(s), comma-separated for multiple |
1232
- | `term.taxonomy` | string | body | Yes | Taxonomy name (e.g., `product-categories`, `product-brands`) |
1233
- | `term.parent` | integer | body | No | Parent term ID for hierarchical terms |
1234
-
1235
- #### Response
1236
-
1237
- ```json
1238
- {
1239
- "term_ids": [10, 11],
1240
- "names": ["Category A", "Category B"]
1241
- }
1242
- ```
1243
-
1244
- #### Example
1245
-
1246
- ```bash
1247
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/add-product-terms" \
1248
- -u "username:app_password" \
1249
- -H "Content-Type: application/json" \
1250
- -d '{
1251
- "term": {
1252
- "name": "New Category,Another Category",
1253
- "taxonomy": "product-categories",
1254
- "parent": 0
1255
- }
1256
- }'
1257
- ```
1258
-
1259
- ---
1260
-
1261
- ### Sync Taxonomy Terms
1262
-
1263
- `POST /fluent-cart/v2/products/sync-taxonomy-term/{postId}`
1264
-
1265
- Sync (replace) taxonomy terms for a product.
1266
-
1267
- **Permission:** `products/edit`
1268
-
1269
- #### Parameters
1270
-
1271
- | Parameter | Type | Location | Required | Description |
1272
- |-----------|------|----------|----------|-------------|
1273
- | `postId` | integer | path | Yes | The product post ID |
1274
- | `taxonomy` | string | body | Yes | Taxonomy name (e.g., `product-categories`) |
1275
- | `terms` | array | body | No | Array of term IDs to sync |
1276
-
1277
- #### Response
1278
-
1279
- ```json
1280
- {
1281
- "message": "Taxonomy terms synced successfully"
1282
- }
1283
- ```
1284
-
1285
- #### Example
1286
-
1287
- ```bash
1288
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/sync-taxonomy-term/123" \
1289
- -u "username:app_password" \
1290
- -H "Content-Type: application/json" \
1291
- -d '{
1292
- "taxonomy": "product-categories",
1293
- "terms": [1, 5, 10]
1294
- }'
1295
- ```
1296
-
1297
- ---
1298
-
1299
- ### Delete Taxonomy Term
1300
-
1301
- `POST /fluent-cart/v2/products/delete-taxonomy-term/{postId}`
1302
-
1303
- Remove a specific taxonomy term from a product.
1304
-
1305
- **Permission:** `products/edit`
1306
-
1307
- #### Parameters
1308
-
1309
- | Parameter | Type | Location | Required | Description |
1310
- |-----------|------|----------|----------|-------------|
1311
- | `postId` | integer | path | Yes | The product post ID |
1312
- | `taxonomy` | string | body | Yes | Taxonomy name (e.g., `product-categories`) |
1313
- | `term` | integer | body | Yes | Term ID to remove |
1314
-
1315
- #### Response
1316
-
1317
- ```json
1318
- {
1319
- "message": "Taxonomy term removed successfully"
1320
- }
1321
- ```
1322
-
1323
- #### Example
1324
-
1325
- ```bash
1326
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/delete-taxonomy-term/123" \
1327
- -u "username:app_password" \
1328
- -H "Content-Type: application/json" \
1329
- -d '{
1330
- "taxonomy": "product-categories",
1331
- "term": 5
1332
- }'
1333
- ```
1334
-
1335
- ---
1336
-
1337
- ### Get Pricing Widgets
1338
-
1339
- `GET /fluent-cart/v2/products/{productId}/pricing-widgets`
1340
-
1341
- Retrieve sales overview widgets for a product (all-time, last 30 days, this month).
1342
-
1343
- **Permission:** `products/view`
1344
-
1345
- #### Parameters
1346
-
1347
- | Parameter | Type | Location | Required | Description |
1348
- |-----------|------|----------|----------|-------------|
1349
- | `productId` | integer | path | Yes | The product ID |
1350
-
1351
- #### Response
1352
-
1353
- ```json
1354
- {
1355
- "widgets": [
1356
- {
1357
- "title": "Quick Sales Overview",
1358
- "body": "<ul class=\"fct-lists\"><li><span>All time (5)</span><span>$50.00</span></li>...</ul>"
1359
- }
1360
- ]
1361
- }
1362
- ```
1363
-
1364
- #### Example
1365
-
1366
- ```bash
1367
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/pricing-widgets" \
1368
- -u "username:app_password"
1369
- ```
1370
-
1371
- ---
1372
-
1373
- ## Bundle Products
1374
-
1375
- ### Get Bundle Info
1376
-
1377
- `GET /fluent-cart/v2/products/get-bundle-info/{productId}`
1378
-
1379
- Retrieve bundle configuration information for a product, including child variant mappings.
1380
-
1381
- **Permission:** `products/view`
1382
-
1383
- #### Parameters
1384
-
1385
- | Parameter | Type | Location | Required | Description |
1386
- |-----------|------|----------|----------|-------------|
1387
- | `productId` | integer | path | Yes | The product ID |
1388
-
1389
- #### Response
1390
-
1391
- ```json
1392
- [
1393
- {
1394
- "id": 789,
1395
- "variation_title": "Bundle Plan",
1396
- "other_info": {
1397
- "bundle_child_ids": [101, 102, 103]
1398
- }
1399
- }
1400
- ]
1401
- ```
1402
-
1403
- #### Example
1404
-
1405
- ```bash
1406
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/get-bundle-info/123" \
1407
- -u "username:app_password"
1408
- ```
1409
-
1410
- ---
1411
-
1412
- ### Save Bundle Info
1413
-
1414
- `POST /fluent-cart/v2/products/save-bundle-info/{variationId}`
1415
-
1416
- Save bundle child variant IDs for a variation. Bundle products cannot be added as children of other bundles.
1417
-
1418
- **Permission:** `products/edit`
1419
-
1420
- #### Parameters
1421
-
1422
- | Parameter | Type | Location | Required | Description |
1423
- |-----------|------|----------|----------|-------------|
1424
- | `variationId` | integer | path | Yes | The variation ID to configure as a bundle |
1425
- | `bundle_child_ids` | array | body | Yes | Array of child variation IDs |
1426
-
1427
- #### Response
1428
-
1429
- ```json
1430
- [true]
1431
- ```
1432
-
1433
- #### Example
1434
-
1435
- ```bash
1436
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/save-bundle-info/789" \
1437
- -u "username:app_password" \
1438
- -H "Content-Type: application/json" \
1439
- -d '{
1440
- "bundle_child_ids": [101, 102, 103]
1441
- }'
1442
- ```
1443
-
1444
- ---
1445
-
1446
- ## Upgrade Paths
1447
-
1448
- ### Get Upgrade Settings
1449
-
1450
- `GET /fluent-cart/v2/products/{id}/upgrade-paths`
1451
-
1452
- Retrieve all upgrade path configurations for a product.
1453
-
1454
- **Permission:** `products/view`
1455
-
1456
- #### Parameters
1457
-
1458
- | Parameter | Type | Location | Required | Description |
1459
- |-----------|------|----------|----------|-------------|
1460
- | `id` | integer | path | Yes | The product ID |
1461
-
1462
- #### Response
1463
-
1464
- ```json
1465
- {
1466
- "data": [ ... ]
1467
- }
1468
- ```
1469
-
1470
- #### Example
1471
-
1472
- ```bash
1473
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/upgrade-paths" \
1474
- -u "username:app_password"
1475
- ```
1476
-
1477
- ---
1478
-
1479
- ### Save Upgrade Path
1480
-
1481
- `POST /fluent-cart/v2/products/{id}/upgrade-path`
1482
-
1483
- Create a new upgrade path for a product.
1484
-
1485
- **Permission:** `products/edit`
1486
-
1487
- **Request Class:** `UpgradePathSettingRequest`
1488
-
1489
- #### Parameters
1490
-
1491
- | Parameter | Type | Location | Required | Description |
1492
- |-----------|------|----------|----------|-------------|
1493
- | `id` | integer | path | Yes | The product ID |
1494
- | `from_variant` | integer | body | Yes | Source variation ID (must exist in `fct_product_variations`) |
1495
- | `to_variants` | array | body | Yes | Array of target variation IDs (each must exist in `fct_product_variations`) |
1496
- | `discount_amount` | number | body | No | Discount amount for the upgrade |
1497
- | `title` | string | body | No | Upgrade path title |
1498
- | `description` | string | body | No | Upgrade path description |
1499
- | `slug` | string | body | No | Upgrade path slug |
1500
-
1501
- #### Response
1502
-
1503
- ```json
1504
- {
1505
- "message": "Settings saved successfully"
1506
- }
1507
- ```
1508
-
1509
- #### Example
1510
-
1511
- ```bash
1512
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/upgrade-path" \
1513
- -u "username:app_password" \
1514
- -H "Content-Type: application/json" \
1515
- -d '{
1516
- "from_variant": 456,
1517
- "to_variants": [457, 458],
1518
- "discount_amount": 500
1519
- }'
1520
- ```
1521
-
1522
- ---
1523
-
1524
- ### Update Upgrade Path
1525
-
1526
- `POST /fluent-cart/v2/products/upgrade-path/{id}/update`
1527
-
1528
- Update an existing upgrade path.
1529
-
1530
- **Permission:** `products/edit`
1531
-
1532
- **Request Class:** `UpgradePathSettingRequest`
1533
-
1534
- #### Parameters
1535
-
1536
- | Parameter | Type | Location | Required | Description |
1537
- |-----------|------|----------|----------|-------------|
1538
- | `id` | integer | path | Yes | The upgrade path ID |
1539
- | `from_variant` | integer | body | Yes | Source variation ID |
1540
- | `to_variants` | array | body | Yes | Array of target variation IDs |
1541
- | `discount_amount` | number | body | No | Discount amount |
1542
- | `title` | string | body | No | Upgrade path title |
1543
- | `description` | string | body | No | Upgrade path description |
1544
- | `slug` | string | body | No | Upgrade path slug |
1545
-
1546
- #### Response
1547
-
1548
- ```json
1549
- {
1550
- "message": "Settings updated successfully"
1551
- }
1552
- ```
1553
-
1554
- #### Example
1555
-
1556
- ```bash
1557
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/upgrade-path/10/update" \
1558
- -u "username:app_password" \
1559
- -H "Content-Type: application/json" \
1560
- -d '{
1561
- "from_variant": 456,
1562
- "to_variants": [458, 459],
1563
- "discount_amount": 1000
1564
- }'
1565
- ```
1566
-
1567
- ---
1568
-
1569
- ### Delete Upgrade Path
1570
-
1571
- `DELETE /fluent-cart/v2/products/upgrade-path/{id}/delete`
1572
-
1573
- Delete an upgrade path.
1574
-
1575
- **Permission:** `products/delete`
1576
-
1577
- #### Parameters
1578
-
1579
- | Parameter | Type | Location | Required | Description |
1580
- |-----------|------|----------|----------|-------------|
1581
- | `id` | integer | path | Yes | The upgrade path ID |
1582
-
1583
- #### Response
1584
-
1585
- ```json
1586
- {
1587
- "message": "Path deleted successfully"
1588
- }
1589
- ```
1590
-
1591
- #### Example
1592
-
1593
- ```bash
1594
- curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/upgrade-path/10/delete" \
1595
- -u "username:app_password"
1596
- ```
1597
-
1598
- ---
1599
-
1600
- ### Get Variation Upgrade Paths
1601
-
1602
- `GET /fluent-cart/v2/products/variation/{variantId}/upgrade-paths`
1603
-
1604
- Retrieve available upgrade paths for a specific variation (used in customer-facing upgrade flows).
1605
-
1606
- **Permission:** `products/view`
1607
-
1608
- #### Parameters
1609
-
1610
- | Parameter | Type | Location | Required | Description |
1611
- |-----------|------|----------|----------|-------------|
1612
- | `variantId` | integer | path | Yes | The variation ID |
1613
- | `params.order_hash` | string | query | Yes | The order hash to determine applicable upgrades |
1614
-
1615
- #### Response
1616
-
1617
- ```json
1618
- {
1619
- "upgradePaths": [ ... ]
1620
- }
1621
- ```
1622
-
1623
- #### Example
1624
-
1625
- ```bash
1626
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/variation/456/upgrade-paths?params[order_hash]=abc123" \
1627
- -u "username:app_password"
1628
- ```
1629
-
1630
- ---
1631
-
1632
- ## Tax & Shipping Classes
1633
-
1634
- ### Update Tax Class
1635
-
1636
- `POST /fluent-cart/v2/products/{postId}/tax-class`
1637
-
1638
- Assign a tax class to a product.
1639
-
1640
- **Permission:** `products/edit`
1641
-
1642
- #### Parameters
1643
-
1644
- | Parameter | Type | Location | Required | Description |
1645
- |-----------|------|----------|----------|-------------|
1646
- | `postId` | integer | path | Yes | The product post ID |
1647
- | `tax_class` | integer | body | Yes | Tax class ID |
1648
-
1649
- #### Response
1650
-
1651
- ```json
1652
- {
1653
- "message": "Tax Class updated successfully"
1654
- }
1655
- ```
1656
-
1657
- #### Example
1658
-
1659
- ```bash
1660
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/tax-class" \
1661
- -u "username:app_password" \
1662
- -H "Content-Type: application/json" \
1663
- -d '{"tax_class": 5}'
1664
- ```
1665
-
1666
- ---
1667
-
1668
- ### Remove Tax Class
1669
-
1670
- `POST /fluent-cart/v2/products/{postId}/tax-class/remove`
1671
-
1672
- Remove the assigned tax class from a product.
1673
-
1674
- **Permission:** `products/edit`
1675
-
1676
- #### Parameters
1677
-
1678
- | Parameter | Type | Location | Required | Description |
1679
- |-----------|------|----------|----------|-------------|
1680
- | `postId` | integer | path | Yes | The product post ID |
1681
-
1682
- #### Response
1683
-
1684
- ```json
1685
- {
1686
- "message": "Tax Class removed successfully"
1687
- }
1688
- ```
1689
-
1690
- #### Example
1691
-
1692
- ```bash
1693
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/tax-class/remove" \
1694
- -u "username:app_password"
1695
- ```
1696
-
1697
- ---
1698
-
1699
- ### Update Shipping Class
1700
-
1701
- `POST /fluent-cart/v2/products/{postId}/shipping-class`
1702
-
1703
- Assign a shipping class to a product.
1704
-
1705
- **Permission:** `products/edit`
1706
-
1707
- #### Parameters
1708
-
1709
- | Parameter | Type | Location | Required | Description |
1710
- |-----------|------|----------|----------|-------------|
1711
- | `postId` | integer | path | Yes | The product post ID |
1712
- | `shipping_class` | integer | body | Yes | Shipping class ID |
1713
-
1714
- #### Response
1715
-
1716
- ```json
1717
- {
1718
- "message": "Shipping Class updated successfully"
1719
- }
1720
- ```
1721
-
1722
- #### Example
1723
-
1724
- ```bash
1725
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/shipping-class" \
1726
- -u "username:app_password" \
1727
- -H "Content-Type: application/json" \
1728
- -d '{"shipping_class": 3}'
1729
- ```
1730
-
1731
- ---
1732
-
1733
- ### Remove Shipping Class
1734
-
1735
- `POST /fluent-cart/v2/products/{postId}/shipping-class/remove`
1736
-
1737
- Remove the assigned shipping class from a product.
1738
-
1739
- **Permission:** `products/edit`
1740
-
1741
- #### Parameters
1742
-
1743
- | Parameter | Type | Location | Required | Description |
1744
- |-----------|------|----------|----------|-------------|
1745
- | `postId` | integer | path | Yes | The product post ID |
1746
-
1747
- #### Response
1748
-
1749
- ```json
1750
- {
1751
- "message": "Shipping Class removed successfully"
1752
- }
1753
- ```
1754
-
1755
- #### Example
1756
-
1757
- ```bash
1758
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/shipping-class/remove" \
1759
- -u "username:app_password"
1760
- ```
1761
-
1762
- ---
1763
-
1764
- ## Stock Management
1765
-
1766
- ### Update Inventory
1767
-
1768
- `PUT /fluent-cart/v2/products/{postId}/update-inventory/{variantId}`
1769
-
1770
- Update stock levels for a specific variant. Automatically updates stock status and product-level availability.
1771
-
1772
- **Permission:** `products/edit`
1773
-
1774
- #### Parameters
1775
-
1776
- | Parameter | Type | Location | Required | Description |
1777
- |-----------|------|----------|----------|-------------|
1778
- | `postId` | integer | path | Yes | The product post ID |
1779
- | `variantId` | integer | path | Yes | The variant ID to update |
1780
- | `total_stock` | integer | body | Yes | Total stock quantity |
1781
- | `available` | integer | body | Yes | Available stock quantity |
1782
-
1783
- #### Response
1784
-
1785
- ```json
1786
- {
1787
- "message": "Inventory updated successfully"
1788
- }
1789
- ```
1790
-
1791
- #### Example
1792
-
1793
- ```bash
1794
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/123/update-inventory/456" \
1795
- -u "username:app_password" \
1796
- -H "Content-Type: application/json" \
1797
- -d '{
1798
- "total_stock": 100,
1799
- "available": 80
1800
- }'
1801
- ```
1802
-
1803
- ---
1804
-
1805
- ### Update Manage Stock Setting
1806
-
1807
- `PUT /fluent-cart/v2/products/{postId}/update-manage-stock`
1808
-
1809
- Enable or disable stock management for a product and all its variants.
1810
-
1811
- **Permission:** `products/edit`
1812
-
1813
- #### Parameters
1814
-
1815
- | Parameter | Type | Location | Required | Description |
1816
- |-----------|------|----------|----------|-------------|
1817
- | `postId` | integer | path | Yes | The product post ID |
1818
- | `manage_stock` | integer | body | Yes | `1` to enable, `0` to disable stock management |
1819
-
1820
- #### Response
1821
-
1822
- ```json
1823
- {
1824
- "message": "Manage stock updated successfully"
1825
- }
1826
- ```
1827
-
1828
- #### Example
1829
-
1830
- ```bash
1831
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/123/update-manage-stock" \
1832
- -u "username:app_password" \
1833
- -H "Content-Type: application/json" \
1834
- -d '{"manage_stock": 1}'
1835
- ```
1836
-
1837
- ---
1838
-
1839
- ## Downloadables
1840
-
1841
- ### Sync Downloadable Files
1842
-
1843
- `POST /fluent-cart/v2/products/{postId}/sync-downloadable-files`
1844
-
1845
- Attach multiple downloadable files to a product. Automatically enables the `manage_downloadable` flag.
1846
-
1847
- **Permission:** `products/edit`
1848
-
1849
- **Validation Class:** `ProductDownloadableBulkFileRequest`
1850
-
1851
- #### Parameters
1852
-
1853
- | Parameter | Type | Location | Required | Description |
1854
- |-----------|------|----------|----------|-------------|
1855
- | `postId` | integer | path | Yes | The product post ID |
1856
- | `downloadable_files` | array | body | Yes | Array of downloadable file objects |
1857
- | `downloadable_files.*.title` | string | body | Yes | File title (max 160 chars) |
1858
- | `downloadable_files.*.type` | string | body | Yes | File type (max 100 chars) |
1859
- | `downloadable_files.*.driver` | string | body | Yes | Storage driver (max 60 chars, e.g., `local`, `s3`) |
1860
- | `downloadable_files.*.file_name` | string | body | Yes | File name (max 185 chars) |
1861
- | `downloadable_files.*.file_path` | string | body | Yes | File path (max 185 chars) |
1862
- | `downloadable_files.*.file_url` | string | body | Yes | File URL (max 200 chars) |
1863
- | `downloadable_files.*.bucket` | string | body | No | Storage bucket name |
1864
- | `downloadable_files.*.file_size` | string | body | No | File size |
1865
- | `downloadable_files.*.serial` | integer | body | No | Display order serial |
1866
- | `downloadable_files.*.product_variation_id` | array | body | No | Array of variation IDs this file is associated with |
1867
- | `downloadable_files.*.settings.download_limit` | integer | body | No | Maximum number of downloads allowed |
1868
- | `downloadable_files.*.settings.download_expiry` | integer | body | No | Download expiry in days |
1869
-
1870
- #### Response
1871
-
1872
- ```json
1873
- {
1874
- "downloadable_files": [
1875
- {
1876
- "id": 1,
1877
- "post_id": 123,
1878
- "title": "Software v1.0",
1879
- "type": "zip",
1880
- "driver": "local",
1881
- "file_name": "software-v1.zip",
1882
- "download_identifier": "a1b2c3d4-..."
1883
- }
1884
- ]
1885
- }
1886
- ```
1887
-
1888
- #### Example
1889
-
1890
- ```bash
1891
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/sync-downloadable-files" \
1892
- -u "username:app_password" \
1893
- -H "Content-Type: application/json" \
1894
- -d '{
1895
- "postId": 123,
1896
- "downloadable_files": [
1897
- {
1898
- "title": "Software v1.0",
1899
- "type": "zip",
1900
- "driver": "local",
1901
- "file_name": "software-v1.zip",
1902
- "file_path": "software-v1.zip",
1903
- "file_url": "software-v1.zip",
1904
- "product_variation_id": [456],
1905
- "settings": {
1906
- "download_limit": 5,
1907
- "download_expiry": 365
1908
- }
1909
- }
1910
- ]
1911
- }'
1912
- ```
1913
-
1914
- ---
1915
-
1916
- ### Update Downloadable File
1917
-
1918
- `PUT /fluent-cart/v2/products/{downloadableId}/update`
1919
-
1920
- Update an existing downloadable file record.
1921
-
1922
- **Permission:** `products/edit`
1923
-
1924
- **Validation Class:** `ProductDownloadableFileRequest`
1925
-
1926
- #### Parameters
1927
-
1928
- | Parameter | Type | Location | Required | Description |
1929
- |-----------|------|----------|----------|-------------|
1930
- | `downloadableId` | integer | path | Yes | The downloadable file ID |
1931
- | `title` | string | body | Yes | File title (max 100 chars) |
1932
- | `type` | string | body | Yes | File type (max 100 chars) |
1933
- | `driver` | string | body | Yes | Storage driver (max 100 chars) |
1934
- | `file_name` | string | body | Yes | File name (max 100 chars) |
1935
- | `product_variation_id` | array | body | No | Array of variation IDs |
1936
- | `serial` | integer | body | No | Display order serial |
1937
- | `settings` | object | body | No | File settings |
1938
- | `settings.download_limit` | integer | body | No | Maximum downloads allowed |
1939
- | `settings.download_expiry` | integer | body | No | Download expiry in days |
1940
-
1941
- #### Response
1942
-
1943
- ```json
1944
- {
1945
- "message": "Product downloadable files updated successfully"
1946
- }
1947
- ```
1948
-
1949
- #### Example
1950
-
1951
- ```bash
1952
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/789/update" \
1953
- -u "username:app_password" \
1954
- -H "Content-Type: application/json" \
1955
- -d '{
1956
- "title": "Software v2.0",
1957
- "type": "zip",
1958
- "driver": "local",
1959
- "file_name": "software-v2.zip",
1960
- "product_variation_id": [456, 457],
1961
- "settings": {
1962
- "download_limit": 10
1963
- }
1964
- }'
1965
- ```
1966
-
1967
- ---
1968
-
1969
- ### Delete Downloadable File
1970
-
1971
- `DELETE /fluent-cart/v2/products/{downloadableId}/delete`
1972
-
1973
- Delete a downloadable file record.
1974
-
1975
- **Permission:** `products/delete`
1976
-
1977
- #### Parameters
1978
-
1979
- | Parameter | Type | Location | Required | Description |
1980
- |-----------|------|----------|----------|-------------|
1981
- | `downloadableId` | integer | path | Yes | The downloadable file ID |
1982
-
1983
- #### Response
1984
-
1985
- ```json
1986
- {
1987
- "message": "File deleted successfully"
1988
- }
1989
- ```
1990
-
1991
- #### Example
1992
-
1993
- ```bash
1994
- curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/789/delete" \
1995
- -u "username:app_password"
1996
- ```
1997
-
1998
- ---
1999
-
2000
- ### Get Downloadable URL
2001
-
2002
- `GET /fluent-cart/v2/products/getDownloadableUrl/{downloadableId}`
2003
-
2004
- Generate a temporary download URL for a downloadable file (valid for 7 days).
2005
-
2006
- **Permission:** `products/view`
2007
-
2008
- #### Parameters
2009
-
2010
- | Parameter | Type | Location | Required | Description |
2011
- |-----------|------|----------|----------|-------------|
2012
- | `downloadableId` | integer | path | Yes | The downloadable file ID |
2013
-
2014
- #### Response
2015
-
2016
- ```json
2017
- {
2018
- "url": "https://example.com/fluent-cart/download?token=..."
2019
- }
2020
- ```
2021
-
2022
- #### Example
2023
-
2024
- ```bash
2025
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/getDownloadableUrl/789" \
2026
- -u "username:app_password"
2027
- ```
2028
-
2029
- ---
2030
-
2031
- ## Variations
2032
-
2033
- ### List Product Variations
2034
-
2035
- `GET /fluent-cart/v2/products/variants`
2036
-
2037
- Retrieve a list of product variations.
2038
-
2039
- **Permission:** `products/view`
2040
-
2041
- #### Parameters
2042
-
2043
- | Parameter | Type | Location | Required | Description |
2044
- |-----------|------|----------|----------|-------------|
2045
- | `params` | object | query | No | Query parameters for filtering variations |
2046
-
2047
- #### Response
2048
-
2049
- ```json
2050
- {
2051
- "variants": [ ... ]
2052
- }
2053
- ```
2054
-
2055
- #### Example
2056
-
2057
- ```bash
2058
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/variants" \
2059
- -u "username:app_password"
2060
- ```
2061
-
2062
- ---
2063
-
2064
- ### Create Variation
2065
-
2066
- `POST /fluent-cart/v2/products/variants`
2067
-
2068
- Create a new product variation.
2069
-
2070
- **Permission:** `products/create`
2071
-
2072
- **Request Class:** `ProductVariationRequest`
2073
-
2074
- #### Parameters
2075
-
2076
- | Parameter | Type | Location | Required | Description |
2077
- |-----------|------|----------|----------|-------------|
2078
- | `variants.post_id` | integer | body | Yes | Parent product ID |
2079
- | `variants.variation_title` | string | body | Yes | Variation title (max 200 chars) |
2080
- | `variants.sku` | string | body | No | SKU (max 30 chars, must be unique) |
2081
- | `variants.item_price` | number | body | No | Price in cents (min: 0) |
2082
- | `variants.compare_price` | number | body | No | Compare-at price in cents (must be >= `item_price`) |
2083
- | `variants.manage_cost` | string | body | No | Enable cost tracking |
2084
- | `variants.item_cost` | number | body | Conditional | Required if `manage_cost` is `true` |
2085
- | `variants.fulfillment_type` | string | body | Yes | `physical` or `digital` |
2086
- | `variants.manage_stock` | integer | body | No | `0` or `1` |
2087
- | `variants.stock_status` | string | body | Conditional | Required if `manage_stock` is `1`. Values: `in-stock`, `out-of-stock` |
2088
- | `variants.total_stock` | integer | body | Yes | Total stock quantity |
2089
- | `variants.available` | integer | body | Yes | Available stock |
2090
- | `variants.committed` | integer | body | Yes | Committed stock |
2091
- | `variants.on_hold` | integer | body | Yes | Stock on hold |
2092
- | `variants.serial_index` | integer | body | No | Display order index |
2093
- | `variants.downloadable` | string | body | No | Downloadable flag |
2094
- | `variants.other_info.payment_type` | string | body | Yes | `onetime` or `subscription` |
2095
- | `variants.other_info.description` | string | body | No | Description (max 255 chars) |
2096
- | `variants.other_info.repeat_interval` | string | body | Conditional | Required for subscriptions (e.g., `monthly`, `yearly`) |
2097
- | `variants.other_info.times` | number | body | No | Number of billing cycles |
2098
- | `variants.other_info.trial_days` | number | body | No | Trial days (max 365) |
2099
- | `variants.other_info.billing_summary` | string | body | No | Billing summary (max 255 chars) |
2100
- | `variants.other_info.manage_setup_fee` | string | body | Conditional | Required for subscriptions: `yes` or `no` |
2101
- | `variants.other_info.signup_fee` | number | body | Conditional | Setup fee in cents. Required if `manage_setup_fee` is `yes` |
2102
- | `variants.other_info.signup_fee_name` | string | body | Conditional | Setup fee label (max 100 chars). Required if `manage_setup_fee` is `yes` |
2103
- | `variants.media` | array | body | No | Media images array with `id`, `url`, `title` |
2104
-
2105
- #### Response
2106
-
2107
- ```json
2108
- {
2109
- "variant": {
2110
- "id": 460,
2111
- "post_id": 123,
2112
- "variation_title": "Pro Plan",
2113
- "item_price": 2999,
2114
- "sku": "PRO-PLN",
2115
- "stock_status": "in-stock"
2116
- },
2117
- "message": "Variation created successfully"
2118
- }
2119
- ```
2120
-
2121
- #### Example
2122
-
2123
- ```bash
2124
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/variants" \
2125
- -u "username:app_password" \
2126
- -H "Content-Type: application/json" \
2127
- -d '{
2128
- "variants": {
2129
- "post_id": 123,
2130
- "variation_title": "Pro Plan",
2131
- "item_price": 2999,
2132
- "sku": "PRO-PLN",
2133
- "fulfillment_type": "digital",
2134
- "total_stock": 1,
2135
- "available": 1,
2136
- "committed": 0,
2137
- "on_hold": 0,
2138
- "other_info": {
2139
- "payment_type": "onetime"
2140
- }
2141
- }
2142
- }'
2143
- ```
2144
-
2145
- ---
2146
-
2147
- ### Update Variation
2148
-
2149
- `POST /fluent-cart/v2/products/variants/{variantId}`
2150
-
2151
- Update an existing product variation.
2152
-
2153
- **Permission:** `products/edit`
2154
-
2155
- **Request Class:** `ProductVariationRequest`
2156
-
2157
- #### Parameters
2158
-
2159
- | Parameter | Type | Location | Required | Description |
2160
- |-----------|------|----------|----------|-------------|
2161
- | `variantId` | integer | path | Yes | The variation ID to update |
2162
-
2163
- All body parameters are the same as Create Variation.
2164
-
2165
- #### Response
2166
-
2167
- ```json
2168
- {
2169
- "variant": { ... },
2170
- "message": "Variation updated successfully"
2171
- }
2172
- ```
2173
-
2174
- #### Example
2175
-
2176
- ```bash
2177
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/variants/460" \
2178
- -u "username:app_password" \
2179
- -H "Content-Type: application/json" \
2180
- -d '{
2181
- "variants": {
2182
- "id": 460,
2183
- "post_id": 123,
2184
- "variation_title": "Pro Plan - Updated",
2185
- "item_price": 3999,
2186
- "fulfillment_type": "digital",
2187
- "total_stock": 1,
2188
- "available": 1,
2189
- "committed": 0,
2190
- "on_hold": 0,
2191
- "other_info": {
2192
- "payment_type": "onetime"
2193
- }
2194
- }
2195
- }'
2196
- ```
2197
-
2198
- ---
2199
-
2200
- ### Delete Variation
2201
-
2202
- `DELETE /fluent-cart/v2/products/variants/{variantId}`
2203
-
2204
- Delete a product variation.
2205
-
2206
- **Permission:** `products/delete`
2207
-
2208
- #### Parameters
2209
-
2210
- | Parameter | Type | Location | Required | Description |
2211
- |-----------|------|----------|----------|-------------|
2212
- | `variantId` | integer | path | Yes | The variation ID to delete |
2213
-
2214
- #### Response
2215
-
2216
- ```json
2217
- {
2218
- "message": "Variation deleted successfully"
2219
- }
2220
- ```
2221
-
2222
- #### Example
2223
-
2224
- ```bash
2225
- curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/variants/460" \
2226
- -u "username:app_password"
2227
- ```
2228
-
2229
- ---
2230
-
2231
- ### Set Variation Media
2232
-
2233
- `POST /fluent-cart/v2/products/variants/{variantId}/setMedia`
2234
-
2235
- Set media/images for a variation.
2236
-
2237
- **Permission:** `products/edit`
2238
-
2239
- #### Parameters
2240
-
2241
- | Parameter | Type | Location | Required | Description |
2242
- |-----------|------|----------|----------|-------------|
2243
- | `variantId` | integer | path | Yes | The variation ID |
2244
- | `media` | array | body | Yes | Array of media objects |
2245
- | `media.*.id` | integer | body | Yes | WordPress attachment ID |
2246
- | `media.*.title` | string | body | No | Image title |
2247
- | `media.*.url` | string | body | No | Image URL |
2248
-
2249
- #### Response
2250
-
2251
- ```json
2252
- {
2253
- "message": "Media set successfully"
2254
- }
2255
- ```
2256
-
2257
- #### Example
2258
-
2259
- ```bash
2260
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/variants/460/setMedia" \
2261
- -u "username:app_password" \
2262
- -H "Content-Type: application/json" \
2263
- -d '{
2264
- "media": [
2265
- {
2266
- "id": 101,
2267
- "title": "Product Image",
2268
- "url": "https://example.com/wp-content/uploads/product.jpg"
2269
- }
2270
- ]
2271
- }'
2272
- ```
2273
-
2274
- ---
2275
-
2276
- ### Update Variation Pricing Table
2277
-
2278
- `PUT /fluent-cart/v2/products/variants/{variantId}/pricing-table`
2279
-
2280
- Update the pricing table description for a variation.
2281
-
2282
- **Permission:** `products/edit`
2283
-
2284
- #### Parameters
2285
-
2286
- | Parameter | Type | Location | Required | Description |
2287
- |-----------|------|----------|----------|-------------|
2288
- | `variantId` | integer | path | Yes | The variation ID |
2289
- | `description` | string | body | Yes | Pricing table description text (newlines preserved) |
2290
-
2291
- #### Response
2292
-
2293
- ```json
2294
- {
2295
- "message": "Pricing table updated successfully"
2296
- }
2297
- ```
2298
-
2299
- #### Example
2300
-
2301
- ```bash
2302
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/variants/460/pricing-table" \
2303
- -u "username:app_password" \
2304
- -H "Content-Type: application/json" \
2305
- -d '{
2306
- "description": "Includes:\n- Feature A\n- Feature B\n- Priority Support"
2307
- }'
2308
- ```
2309
-
2310
- ---
2311
-
2312
- ## Variants (VariantController)
2313
-
2314
- ### List All Variants
2315
-
2316
- `GET /fluent-cart/v2/variants`
2317
-
2318
- Retrieve all product variations across all products (separate route group using `VariantController`).
2319
-
2320
- **Permission:** `products/view`
2321
-
2322
- **Policy:** `ProductPolicy`
2323
-
2324
- #### Parameters
2325
-
2326
- | Parameter | Type | Location | Required | Description |
2327
- |-----------|------|----------|----------|-------------|
2328
- | `params` | object | query | No | Query parameters for filtering |
2329
-
2330
- #### Response
2331
-
2332
- ```json
2333
- [
2334
- {
2335
- "id": 456,
2336
- "post_id": 123,
2337
- "variation_title": "Default Plan",
2338
- "item_price": 1000,
2339
- "sku": null,
2340
- "stock_status": "in-stock",
2341
- "payment_type": "onetime",
2342
- "other_info": { ... }
2343
- }
2344
- ]
2345
- ```
2346
-
2347
- #### Example
2348
-
2349
- ```bash
2350
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/variants" \
2351
- -u "username:app_password"
2352
- ```
2353
-
2354
- ---
2355
-
2356
- ## Product Integrations
2357
-
2358
- ### Get Product Integration Feeds
2359
-
2360
- `GET /fluent-cart/v2/products/{productId}/integrations`
2361
-
2362
- Retrieve all integration feeds configured for a product, along with available integrations.
2363
-
2364
- **Permission:** `products/view`
2365
-
2366
- #### Parameters
2367
-
2368
- | Parameter | Type | Location | Required | Description |
2369
- |-----------|------|----------|----------|-------------|
2370
- | `productId` | integer | path | Yes | The product ID |
2371
-
2372
- #### Response
2373
-
2374
- ```json
2375
- {
2376
- "feeds": [
2377
- {
2378
- "id": 10,
2379
- "name": "Add to FluentCRM List",
2380
- "enabled": "yes",
2381
- "provider": "fluentcrm",
2382
- "feed": { ... },
2383
- "scope": "product"
2384
- }
2385
- ],
2386
- "available_integrations": {
2387
- "fluentcrm": {
2388
- "title": "FluentCRM",
2389
- "logo": "...",
2390
- "enabled": true,
2391
- "scopes": ["product", "order"]
2392
- }
2393
- },
2394
- "all_module_config_url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/integrations"
2395
- }
2396
- ```
2397
-
2398
- #### Example
2399
-
2400
- ```bash
2401
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/integrations" \
2402
- -u "username:app_password"
2403
- ```
2404
-
2405
- ---
2406
-
2407
- ### Get Product Integration Settings
2408
-
2409
- `GET /fluent-cart/v2/products/{product_id}/integrations/{integration_name}/settings`
2410
-
2411
- Retrieve settings for a specific integration type on a product. Returns the integration form configuration, existing settings, and product variations.
2412
-
2413
- **Permission:** `products/view`
2414
-
2415
- #### Parameters
2416
-
2417
- | Parameter | Type | Location | Required | Description |
2418
- |-----------|------|----------|----------|-------------|
2419
- | `product_id` | integer | path | Yes | The product ID |
2420
- | `integration_name` | string | path | Yes | Integration provider name (e.g., `fluentcrm`) |
2421
- | `integration_id` | integer | query | No | Existing integration feed ID to load for editing |
2422
-
2423
- #### Response
2424
-
2425
- ```json
2426
- {
2427
- "settings": {
2428
- "conditional_variation_ids": [],
2429
- ...
2430
- },
2431
- "fields": [ ... ],
2432
- "product_variations": [
2433
- {
2434
- "id": 456,
2435
- "title": "Monthly Plan"
2436
- }
2437
- ],
2438
- "scope": "product"
2439
- }
2440
- ```
2441
-
2442
- #### Example
2443
-
2444
- ```bash
2445
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/integrations/fluentcrm/settings" \
2446
- -u "username:app_password"
2447
- ```
2448
-
2449
- ---
2450
-
2451
- ### Save Product Integration
2452
-
2453
- `POST /fluent-cart/v2/products/{product_id}/integrations`
2454
-
2455
- Create or update an integration feed for a product.
2456
-
2457
- **Permission:** `products/edit`
2458
-
2459
- #### Parameters
2460
-
2461
- | Parameter | Type | Location | Required | Description |
2462
- |-----------|------|----------|----------|-------------|
2463
- | `product_id` | integer | path | Yes | The product ID |
2464
- | `integration_name` | string | body | Yes | Integration provider name |
2465
- | `integration_id` | integer | body | No | Existing feed ID (for updates) |
2466
- | `integration` | string (JSON) | body | Yes | JSON-encoded integration settings object |
2467
-
2468
- #### Response
2469
-
2470
- ```json
2471
- {
2472
- "message": "Integration has been successfully saved",
2473
- "integration": { ... }
2474
- }
2475
- ```
2476
-
2477
- #### Example
2478
-
2479
- ```bash
2480
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/integrations" \
2481
- -u "username:app_password" \
2482
- -H "Content-Type: application/json" \
2483
- -d '{
2484
- "integration_name": "fluentcrm",
2485
- "integration": "{\"list_id\": 1, \"tags\": [5, 10]}"
2486
- }'
2487
- ```
2488
-
2489
- ---
2490
-
2491
- ### Update Product Integration
2492
-
2493
- `PUT /fluent-cart/v2/products/{product_id}/integrations/{integration_id}`
2494
-
2495
- Update an existing product integration feed.
2496
-
2497
- **Permission:** `products/edit`
2498
-
2499
- #### Parameters
2500
-
2501
- | Parameter | Type | Location | Required | Description |
2502
- |-----------|------|----------|----------|-------------|
2503
- | `product_id` | integer | path | Yes | The product ID |
2504
- | `integration_id` | integer | path | Yes | The integration feed ID |
2505
- | `integration_name` | string | body | Yes | Integration provider name |
2506
- | `integration` | string (JSON) | body | Yes | JSON-encoded integration settings |
2507
- | `enabled` | string | body | No | `yes` or `no` |
2508
- | `name` | string | body | No | Feed display name |
2509
-
2510
- #### Response
2511
-
2512
- ```json
2513
- {
2514
- "message": "Integration has been successfully updated",
2515
- "integration": { ... }
2516
- }
2517
- ```
2518
-
2519
- #### Example
2520
-
2521
- ```bash
2522
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/123/integrations/10" \
2523
- -u "username:app_password" \
2524
- -H "Content-Type: application/json" \
2525
- -d '{
2526
- "integration_name": "fluentcrm",
2527
- "integration": "{\"list_id\": 2, \"tags\": [5, 15]}",
2528
- "enabled": "yes",
2529
- "name": "Updated FluentCRM Feed"
2530
- }'
2531
- ```
2532
-
2533
- ---
2534
-
2535
- ### Delete Product Integration
2536
-
2537
- `DELETE /fluent-cart/v2/products/{product_id}/integrations/{integration_id}`
2538
-
2539
- Delete a product integration feed.
2540
-
2541
- **Permission:** `products/delete`
2542
-
2543
- #### Parameters
2544
-
2545
- | Parameter | Type | Location | Required | Description |
2546
- |-----------|------|----------|----------|-------------|
2547
- | `product_id` | integer | path | Yes | The product ID |
2548
- | `integration_id` | integer | path | Yes | The integration feed ID |
2549
-
2550
- #### Response
2551
-
2552
- ```json
2553
- {
2554
- "message": "Integration has been deleted successfully"
2555
- }
2556
- ```
2557
-
2558
- #### Example
2559
-
2560
- ```bash
2561
- curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/123/integrations/10" \
2562
- -u "username:app_password"
2563
- ```
1
+ # Products API
2
+
3
+ Manage your product catalog including creating products, managing variations, downloadable files, bundles, upgrade paths, tax/shipping classes, stock management, and product integrations.
4
+
5
+ **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/products`
6
+
7
+ **Policy:** `ProductPolicy`
8
+
9
+ > All monetary values are in cents (e.g., `$10.00` = `1000`).
10
+
11
+ ---
12
+
13
+ ## Endpoints Overview
14
+
15
+ | Method | Endpoint | Description |
16
+ |--------|----------|-------------|
17
+ | **Product CRUD** | | |
18
+ | GET | `/products` | List Products |
19
+ | GET | `/products/{product}` | Get Product |
20
+ | POST | `/products` | Create Product |
21
+ | DELETE | `/products/{product}` | Delete Product |
22
+ | GET | `/products/{productId}/pricing` | Get Product Pricing |
23
+ | POST | `/products/{postId}/pricing` | Update Product Pricing |
24
+ | **Search & Lookup** | | |
25
+ | GET | `/products/searchProductByName` | Search Products by Name |
26
+ | GET | `/products/searchVariantByName` | Search Variants by Name |
27
+ | GET | `/products/search-product-variant-options` | Search Product Variant Options |
28
+ | GET | `/products/findSubscriptionVariants` | Find Subscription Variants |
29
+ | GET | `/products/fetchProductsByIds` | Fetch Products by IDs |
30
+ | GET | `/products/fetchVariationsByIds` | Fetch Variations by IDs |
31
+ | GET | `/products/suggest-sku` | Suggest SKU |
32
+ | GET | `/products/get-max-excerpt-word-count` | Get Max Excerpt Word Count |
33
+ | GET | `/products/fetch-term` | Fetch Taxonomy Terms |
34
+ | POST | `/products/fetch-term-by-parent` | Fetch Terms by Parent |
35
+ | **Bulk Operations** | | |
36
+ | POST | `/products/bulk-insert` | Bulk Insert Products |
37
+ | GET | `/products/bulk-edit-data` | Bulk Edit Fetch |
38
+ | POST | `/products/bulk-update` | Bulk Update Products |
39
+ | POST | `/products/do-bulk-action` | Do Bulk Action |
40
+ | POST | `/products/create-dummy` | Create Dummy Products |
41
+ | **Product Details** | | |
42
+ | POST | `/products/{productId}/duplicate` | Duplicate Product |
43
+ | GET | `/products/{productId}/related-products` | Get Related Products |
44
+ | POST | `/products/{postId}/update-long-desc-editor-mode` | Update Long Description Editor Mode |
45
+ | POST | `/products/{postId}/update-variant-option` | Update Variant Option |
46
+ | POST | `/products/detail/{detailId}` | Update Product Detail |
47
+ | POST | `/products/add-product-terms` | Add Product Terms |
48
+ | POST | `/products/sync-taxonomy-term/{postId}` | Sync Taxonomy Terms |
49
+ | POST | `/products/delete-taxonomy-term/{postId}` | Delete Taxonomy Term |
50
+ | GET | `/products/{productId}/pricing-widgets` | Get Pricing Widgets |
51
+ | **Bundles** | | |
52
+ | GET | `/products/get-bundle-info/{productId}` | Get Bundle Info |
53
+ | POST | `/products/save-bundle-info/{variationId}` | Save Bundle Info |
54
+ | **Upgrade Paths** | | |
55
+ | GET | `/products/{id}/upgrade-paths` | Get Upgrade Settings |
56
+ | POST | `/products/{id}/upgrade-path` | Save Upgrade Path |
57
+ | POST | `/products/upgrade-path/{id}/update` | Update Upgrade Path |
58
+ | DELETE | `/products/upgrade-path/{id}/delete` | Delete Upgrade Path |
59
+ | GET | `/products/variation/{variantId}/upgrade-paths` | Get Variation Upgrade Paths |
60
+ | **Tax & Shipping Classes** | | |
61
+ | POST | `/products/{postId}/tax-class` | Update Tax Class |
62
+ | POST | `/products/{postId}/tax-class/remove` | Remove Tax Class |
63
+ | POST | `/products/{postId}/shipping-class` | Update Shipping Class |
64
+ | POST | `/products/{postId}/shipping-class/remove` | Remove Shipping Class |
65
+ | **Stock Management** | | |
66
+ | PUT | `/products/{postId}/update-inventory/{variantId}` | Update Inventory |
67
+ | PUT | `/products/{postId}/update-manage-stock` | Update Manage Stock Setting |
68
+ | **Downloadables** | | |
69
+ | POST | `/products/{postId}/sync-downloadable-files` | Sync Downloadable Files |
70
+ | PUT | `/products/{downloadableId}/update` | Update Downloadable File |
71
+ | DELETE | `/products/{downloadableId}/delete` | Delete Downloadable File |
72
+ | GET | `/products/getDownloadableUrl/{downloadableId}` | Get Downloadable URL |
73
+ | **Variations** | | |
74
+ | GET | `/products/variants` | List Product Variations |
75
+ | POST | `/products/variants` | Create Variation |
76
+ | POST | `/products/variants/{variantId}` | Update Variation |
77
+ | DELETE | `/products/variants/{variantId}` | Delete Variation |
78
+ | POST | `/products/variants/{variantId}/setMedia` | Set Variation Media |
79
+ | PUT | `/products/variants/{variantId}/pricing-table` | Update Variation Pricing Table |
80
+ | GET | `/variants` | List All Variants |
81
+ | **Integrations** | | |
82
+ | GET | `/products/{productId}/integrations` | Get Product Integration Feeds |
83
+ | GET | `/products/{product_id}/integrations/{integration_name}/settings` | Get Product Integration Settings |
84
+ | POST | `/products/{product_id}/integrations` | Save Product Integration |
85
+ | PUT | `/products/{product_id}/integrations/{integration_id}` | Update Product Integration |
86
+ | DELETE | `/products/{product_id}/integrations/{integration_id}` | Delete Product Integration |
87
+
88
+ ---
89
+
90
+ ## Product CRUD & Listing
91
+
92
+ ### List Products
93
+
94
+ `GET /fluent-cart/v2/products`
95
+
96
+ Retrieve a paginated list of products with filtering, sorting, and search capabilities.
97
+
98
+ **Permission:** `products/view`
99
+
100
+ #### Parameters
101
+
102
+ | Parameter | Type | Location | Required | Description |
103
+ |-----------|------|----------|----------|-------------|
104
+ | `search` | string | query | No | Search by product title, ID, or variation title |
105
+ | `per_page` | integer | query | No | Number of results per page (default: 10) |
106
+ | `page` | integer | query | No | Page number for pagination |
107
+ | `sort_by` | string | query | No | Column to sort by (default: `ID`) |
108
+ | `sort_type` | string | query | No | Sort direction: `asc` or `desc` (default: `desc`) |
109
+ | `active_view` | string | query | No | Filter tab: `publish`, `draft`, `physical`, `digital`, `subscribable`, `not_subscribable`, `bundle`, `non_bundle` |
110
+ | `filter_type` | string | query | No | `simple` or `advanced` |
111
+ | `with` | array | query | No | Relations to eager load |
112
+ | `search_groups` | array | query | No | Advanced filter groups for complex queries |
113
+
114
+ #### Response
115
+
116
+ ```json
117
+ {
118
+ "products": {
119
+ "total": 50,
120
+ "per_page": 10,
121
+ "current_page": 1,
122
+ "last_page": 5,
123
+ "data": [
124
+ {
125
+ "ID": 123,
126
+ "post_title": "Example Product",
127
+ "post_status": "publish",
128
+ "post_date": "2025-01-15 12:00:00",
129
+ "view_url": "https://example.com/product/example-product",
130
+ "edit_url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/products/123"
131
+ }
132
+ ]
133
+ }
134
+ }
135
+ ```
136
+
137
+ #### Example
138
+
139
+ ```bash
140
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products?search=widget&per_page=20&active_view=publish" \
141
+ -u "username:app_password"
142
+ ```
143
+
144
+ ---
145
+
146
+ ### Get Product
147
+
148
+ `GET /fluent-cart/v2/products/{product}`
149
+
150
+ Retrieve a single product by ID.
151
+
152
+ **Permission:** `products/view`
153
+
154
+ #### Parameters
155
+
156
+ | Parameter | Type | Location | Required | Description |
157
+ |-----------|------|----------|----------|-------------|
158
+ | `product` | integer | path | Yes | The product ID |
159
+ | `with` | array | query | No | Relations to eager load (e.g., `["detail", "variants", "product_menu"]`) |
160
+
161
+ #### Response
162
+
163
+ ```json
164
+ {
165
+ "product": {
166
+ "ID": 123,
167
+ "post_title": "Example Product",
168
+ "post_status": "publish",
169
+ "post_excerpt": "Short description",
170
+ "post_content": "Full description"
171
+ },
172
+ "product_menu": []
173
+ }
174
+ ```
175
+
176
+ #### Example
177
+
178
+ ```bash
179
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123?with[]=detail&with[]=variants" \
180
+ -u "username:app_password"
181
+ ```
182
+
183
+ ---
184
+
185
+ ### Create Product
186
+
187
+ `POST /fluent-cart/v2/products`
188
+
189
+ Create a new product. A default variation is automatically created with the product.
190
+
191
+ **Permission:** `products/create`
192
+
193
+ **Request Class:** `ProductCreateRequest`
194
+
195
+ #### Parameters
196
+
197
+ | Parameter | Type | Location | Required | Description |
198
+ |-----------|------|----------|----------|-------------|
199
+ | `post_title` | string | body | Yes | Product title (max 200 characters) |
200
+ | `post_status` | string | body | No | Post status (e.g., `draft`, `publish`) |
201
+ | `detail.fulfillment_type` | string | body | No | `physical` or `digital` (default: `digital`) |
202
+ | `detail.other_info.is_bundle_product` | string | body | No | `yes` or `no` (default: `no`) |
203
+
204
+ #### Response
205
+
206
+ ```json
207
+ {
208
+ "data": {
209
+ "ID": 124,
210
+ "variant": {
211
+ "id": 456,
212
+ "post_id": 124,
213
+ "variation_title": "Example Product",
214
+ "stock_status": "in-stock",
215
+ "payment_type": "onetime",
216
+ "total_stock": 1,
217
+ "available": 1,
218
+ "fulfillment_type": "digital"
219
+ },
220
+ "product_details": { ... }
221
+ },
222
+ "message": "Product has been created successfully"
223
+ }
224
+ ```
225
+
226
+ #### Example
227
+
228
+ ```bash
229
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products" \
230
+ -u "username:app_password" \
231
+ -H "Content-Type: application/json" \
232
+ -d '{
233
+ "post_title": "New Digital Product",
234
+ "post_status": "draft",
235
+ "detail": {
236
+ "fulfillment_type": "digital"
237
+ }
238
+ }'
239
+ ```
240
+
241
+ ---
242
+
243
+ ### Delete Product
244
+
245
+ `DELETE /fluent-cart/v2/products/{product}`
246
+
247
+ Delete a product and all associated data.
248
+
249
+ **Permission:** `products/delete`
250
+
251
+ #### Parameters
252
+
253
+ | Parameter | Type | Location | Required | Description |
254
+ |-----------|------|----------|----------|-------------|
255
+ | `product` | integer | path | Yes | The product ID to delete |
256
+
257
+ #### Response
258
+
259
+ ```json
260
+ {
261
+ "message": "Product deleted successfully"
262
+ }
263
+ ```
264
+
265
+ #### Example
266
+
267
+ ```bash
268
+ curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/123" \
269
+ -u "username:app_password"
270
+ ```
271
+
272
+ ---
273
+
274
+ ### Get Product Pricing
275
+
276
+ `GET /fluent-cart/v2/products/{productId}/pricing`
277
+
278
+ Retrieve the full product details including pricing, variants, downloadable files, and taxonomy information.
279
+
280
+ **Permission:** `products/view`
281
+
282
+ #### Parameters
283
+
284
+ | Parameter | Type | Location | Required | Description |
285
+ |-----------|------|----------|----------|-------------|
286
+ | `productId` | integer | path | Yes | The product ID |
287
+ | `with` | array | query | No | Additional relations (e.g., `["product_menu"]`) |
288
+
289
+ #### Response
290
+
291
+ ```json
292
+ {
293
+ "product": {
294
+ "ID": 123,
295
+ "post_title": "Example Product",
296
+ "post_status": "publish",
297
+ "post_excerpt": "Short description",
298
+ "featured_image_id": 456,
299
+ "view_url": "https://example.com/product/example",
300
+ "edit_url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/products/123",
301
+ "detail": {
302
+ "id": 1,
303
+ "post_id": 123,
304
+ "fulfillment_type": "digital",
305
+ "variation_type": "simple",
306
+ "manage_stock": 0,
307
+ "manage_downloadable": 0,
308
+ "other_info": { ... }
309
+ },
310
+ "variants": [
311
+ {
312
+ "id": 789,
313
+ "post_id": 123,
314
+ "variation_title": "Default Plan",
315
+ "item_price": 1000,
316
+ "compare_price": 0,
317
+ "stock_status": "in-stock",
318
+ "other_info": { ... },
319
+ "media": []
320
+ }
321
+ ],
322
+ "downloadable_files": []
323
+ },
324
+ "product_menu": "",
325
+ "taxonomies": [
326
+ {
327
+ "name": "product-categories",
328
+ "label": "Product Categories",
329
+ "terms": [],
330
+ "labels": { ... }
331
+ }
332
+ ]
333
+ }
334
+ ```
335
+
336
+ #### Example
337
+
338
+ ```bash
339
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/pricing?with[]=product_menu" \
340
+ -u "username:app_password"
341
+ ```
342
+
343
+ ---
344
+
345
+ ### Update Product Pricing
346
+
347
+ `POST /fluent-cart/v2/products/{postId}/pricing`
348
+
349
+ Update a product's pricing, details, variants, and other metadata.
350
+
351
+ **Permission:** `products/edit`
352
+
353
+ **Request Class:** `ProductUpdateRequest`
354
+
355
+ #### Parameters
356
+
357
+ | Parameter | Type | Location | Required | Description |
358
+ |-----------|------|----------|----------|-------------|
359
+ | `postId` | integer | path | Yes | The product post ID |
360
+ | `post_title` | string | body | Yes | Product title (max 200 characters) |
361
+ | `post_status` | string | body | Yes | Status: `draft`, `publish`, `future` |
362
+ | `post_date` | string | body | Conditional | Required when `post_status` is `future`. Must be a future date (GMT) |
363
+ | `post_excerpt` | string | body | No | Product short description (limited by `excerpt_length` filter, default 55 words) |
364
+ | `post_content` | string | body | No | Product long description (HTML allowed) |
365
+ | `post_name` | string | body | No | Product URL slug |
366
+ | `comment_status` | string | body | No | Comment status (max 100 chars) |
367
+ | `detail.fulfillment_type` | string | body | Yes | `physical` or `digital` |
368
+ | `detail.variation_type` | string | body | Yes | `simple` or `simple_variations` |
369
+ | `detail.manage_stock` | integer | body | No | `0` or `1` |
370
+ | `detail.manage_downloadable` | integer | body | No | `0` or `1` |
371
+ | `detail.default_variation_id` | integer | body | No | Default variation ID |
372
+ | `detail.stock_availability` | string | body | No | Stock availability status |
373
+ | `detail.other_info.group_pricing_by` | string | body | No | `payment_type`, `repeat_interval`, or `none` |
374
+ | `detail.other_info.sold_individually` | string | body | No | `yes` or `no` |
375
+ | `detail.other_info.use_pricing_table` | string | body | No | Enable pricing table display |
376
+ | `detail.other_info.shipping_class` | integer | body | No | Shipping class ID (validated) |
377
+ | `detail.other_info.tax_class` | integer | body | No | Tax class ID (validated) |
378
+ | `detail.other_info.active_editor` | string | body | No | Active editor mode |
379
+ | `variants` | array | body | Conditional | Array of variant objects (required for simple type when publishing) |
380
+ | `variants.*.variation_title` | string | body | Yes | Variation title (max 200 chars) |
381
+ | `variants.*.post_id` | integer | body | Yes | Parent product post ID |
382
+ | `variants.*.item_price` | number | body | No | Price in cents (min: 0) |
383
+ | `variants.*.compare_price` | number | body | No | Compare-at price in cents (must be >= `item_price`) |
384
+ | `variants.*.manage_cost` | string | body | No | Enable cost tracking |
385
+ | `variants.*.item_cost` | number | body | Conditional | Required if `manage_cost` is `true` |
386
+ | `variants.*.serial_index` | integer | body | No | Display order index |
387
+ | `variants.*.sku` | string | body | No | SKU (max 30 chars, must be unique) |
388
+ | `variants.*.fulfillment_type` | string | body | No | `physical` or `digital` |
389
+ | `variants.*.other_info.payment_type` | string | body | Yes | `onetime` or `subscription` |
390
+ | `variants.*.other_info.description` | string | body | No | Variant description (max 255 chars) |
391
+ | `variants.*.other_info.repeat_interval` | string | body | Conditional | Required for subscriptions. e.g., `monthly`, `yearly` |
392
+ | `variants.*.other_info.times` | string | body | No | Number of billing cycles |
393
+ | `variants.*.other_info.trial_days` | string | body | No | Trial period in days (max 365) |
394
+ | `variants.*.other_info.billing_summary` | string | body | No | Billing summary text (max 255 chars) |
395
+ | `variants.*.other_info.manage_setup_fee` | string | body | Conditional | Required for subscriptions: `yes` or `no` |
396
+ | `variants.*.other_info.signup_fee` | number | body | Conditional | Setup fee in cents. Required if `manage_setup_fee` is `yes` |
397
+ | `variants.*.other_info.signup_fee_name` | string | body | Conditional | Setup fee label (max 100 chars). Required if `manage_setup_fee` is `yes` |
398
+ | `variants.*.other_info.installment` | string | body | No | Enable installment: `yes` or `no` |
399
+ | `product_terms` | object | body | No | Taxonomy term IDs (e.g., `{"product-categories": [1, 2]}`) |
400
+ | `gallery` | array | body | No | Gallery images array with `id`, `url`, `title` |
401
+ | `metaValue` | mixed | body | No | Additional metadata |
402
+
403
+ #### Response
404
+
405
+ ```json
406
+ {
407
+ "data": { ... },
408
+ "message": "Product updated successfully"
409
+ }
410
+ ```
411
+
412
+ #### Example
413
+
414
+ ```bash
415
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/pricing" \
416
+ -u "username:app_password" \
417
+ -H "Content-Type: application/json" \
418
+ -d '{
419
+ "post_title": "Updated Product",
420
+ "post_status": "publish",
421
+ "detail": {
422
+ "fulfillment_type": "digital",
423
+ "variation_type": "simple"
424
+ },
425
+ "variants": [
426
+ {
427
+ "id": 789,
428
+ "post_id": 123,
429
+ "variation_title": "Default Plan",
430
+ "item_price": 1999,
431
+ "other_info": {
432
+ "payment_type": "onetime"
433
+ }
434
+ }
435
+ ]
436
+ }'
437
+ ```
438
+
439
+ ---
440
+
441
+ ## Product Search & Lookup
442
+
443
+ ### Search Products by Name
444
+
445
+ `GET /fluent-cart/v2/products/searchProductByName`
446
+
447
+ Search for published products by name. Returns products formatted for select dropdowns.
448
+
449
+ **Permission:** `products/view`
450
+
451
+ #### Parameters
452
+
453
+ | Parameter | Type | Location | Required | Description |
454
+ |-----------|------|----------|----------|-------------|
455
+ | `name` | string | query | No | Product name to search for |
456
+ | `url_mode` | string | query | No | URL mode flag |
457
+ | `termId` | integer | query | No | Filter by taxonomy term ID (`product-categories`) |
458
+
459
+ #### Response
460
+
461
+ ```json
462
+ {
463
+ "products": [
464
+ {
465
+ "ID": 123,
466
+ "post_title": "Example Product",
467
+ "wpTerms": [...]
468
+ }
469
+ ]
470
+ }
471
+ ```
472
+
473
+ #### Example
474
+
475
+ ```bash
476
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/searchProductByName?name=widget" \
477
+ -u "username:app_password"
478
+ ```
479
+
480
+ ---
481
+
482
+ ### Search Variants by Name
483
+
484
+ `GET /fluent-cart/v2/products/searchVariantByName`
485
+
486
+ Search for published product variants by name. Returns a hierarchical product > variants structure.
487
+
488
+ **Permission:** `products/view`
489
+
490
+ #### Parameters
491
+
492
+ | Parameter | Type | Location | Required | Description |
493
+ |-----------|------|----------|----------|-------------|
494
+ | `name` | string | query | No | Product/variant name to search |
495
+ | `search` | string | query | No | Alternative search parameter (used if `name` is empty) |
496
+ | `ids` | array | query | No | Array of product IDs to include |
497
+
498
+ #### Response
499
+
500
+ ```json
501
+ [
502
+ {
503
+ "value": 123,
504
+ "label": "Example Product",
505
+ "children": [
506
+ {
507
+ "value": 456,
508
+ "label": "Monthly Plan"
509
+ },
510
+ {
511
+ "value": 457,
512
+ "label": "Yearly Plan"
513
+ }
514
+ ]
515
+ }
516
+ ]
517
+ ```
518
+
519
+ #### Example
520
+
521
+ ```bash
522
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/searchVariantByName?name=pro" \
523
+ -u "username:app_password"
524
+ ```
525
+
526
+ ---
527
+
528
+ ### Search Product Variant Options
529
+
530
+ `GET /fluent-cart/v2/products/search-product-variant-options`
531
+
532
+ Search for product variants suitable for selection (e.g., in order creation). Filters out out-of-stock items.
533
+
534
+ **Permission:** `products/view`
535
+
536
+ #### Parameters
537
+
538
+ | Parameter | Type | Location | Required | Description |
539
+ |-----------|------|----------|----------|-------------|
540
+ | `search` | string | query | No | Search term for product/variant title |
541
+ | `include_ids` | array | query | No | Variation IDs to always include in results |
542
+ | `scopes` | array | query | No | Model scopes to apply |
543
+ | `subscription_status` | string | query | No | `not_subscribable` to exclude subscription variants |
544
+
545
+ #### Response
546
+
547
+ ```json
548
+ {
549
+ "products": [
550
+ {
551
+ "value": "product_123",
552
+ "label": "Example Product",
553
+ "children": [
554
+ {
555
+ "value": 456,
556
+ "label": "Monthly Plan"
557
+ }
558
+ ]
559
+ }
560
+ ]
561
+ }
562
+ ```
563
+
564
+ #### Example
565
+
566
+ ```bash
567
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/search-product-variant-options?search=pro&subscription_status=not_subscribable" \
568
+ -u "username:app_password"
569
+ ```
570
+
571
+ ---
572
+
573
+ ### Find Subscription Variants
574
+
575
+ `GET /fluent-cart/v2/products/findSubscriptionVariants`
576
+
577
+ Search for product variants that have a subscription payment type.
578
+
579
+ **Permission:** `products/view`
580
+
581
+ #### Parameters
582
+
583
+ | Parameter | Type | Location | Required | Description |
584
+ |-----------|------|----------|----------|-------------|
585
+ | `name` | string | query | No | Variant title to search |
586
+
587
+ #### Response
588
+
589
+ ```json
590
+ [
591
+ {
592
+ "id": 456,
593
+ "title": "Monthly Subscription"
594
+ },
595
+ {
596
+ "id": 457,
597
+ "title": "Yearly Subscription"
598
+ }
599
+ ]
600
+ ```
601
+
602
+ #### Example
603
+
604
+ ```bash
605
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/findSubscriptionVariants?name=monthly" \
606
+ -u "username:app_password"
607
+ ```
608
+
609
+ ---
610
+
611
+ ### Fetch Products by IDs
612
+
613
+ `GET /fluent-cart/v2/products/fetchProductsByIds`
614
+
615
+ Retrieve products by an array of IDs. Returns products with their detail relation.
616
+
617
+ **Permission:** `products/view`
618
+
619
+ #### Parameters
620
+
621
+ | Parameter | Type | Location | Required | Description |
622
+ |-----------|------|----------|----------|-------------|
623
+ | `productIds` | array | query | Yes | Array of product IDs to fetch |
624
+
625
+ #### Response
626
+
627
+ ```json
628
+ {
629
+ "products": [
630
+ {
631
+ "ID": 123,
632
+ "post_title": "Example Product",
633
+ "detail": { ... }
634
+ }
635
+ ]
636
+ }
637
+ ```
638
+
639
+ #### Example
640
+
641
+ ```bash
642
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/fetchProductsByIds?productIds[]=123&productIds[]=456" \
643
+ -u "username:app_password"
644
+ ```
645
+
646
+ ---
647
+
648
+ ### Fetch Variations by IDs
649
+
650
+ `GET /fluent-cart/v2/products/fetchVariationsByIds`
651
+
652
+ Retrieve variations by an array of IDs. Returns simplified label/value pairs.
653
+
654
+ **Permission:** `products/view`
655
+
656
+ #### Parameters
657
+
658
+ | Parameter | Type | Location | Required | Description |
659
+ |-----------|------|----------|----------|-------------|
660
+ | `productIds` | array | query | Yes | Array of variation IDs to fetch |
661
+
662
+ #### Response
663
+
664
+ ```json
665
+ {
666
+ "products": [
667
+ {
668
+ "value": 456,
669
+ "label": "Monthly Plan"
670
+ },
671
+ {
672
+ "value": 457,
673
+ "label": "Yearly Plan"
674
+ }
675
+ ]
676
+ }
677
+ ```
678
+
679
+ #### Example
680
+
681
+ ```bash
682
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/fetchVariationsByIds?productIds[]=456&productIds[]=457" \
683
+ -u "username:app_password"
684
+ ```
685
+
686
+ ---
687
+
688
+ ### Suggest SKU
689
+
690
+ `GET /fluent-cart/v2/products/suggest-sku`
691
+
692
+ Generate a unique SKU suggestion based on product and variant titles.
693
+
694
+ **Permission:** `products/view`
695
+
696
+ #### Parameters
697
+
698
+ | Parameter | Type | Location | Required | Description |
699
+ |-----------|------|----------|----------|-------------|
700
+ | `title` | string | query | Yes | Product title to base SKU on |
701
+ | `variant_title` | string | query | No | Variant title to include in SKU |
702
+ | `exclude_id` | integer | query | No | Variation ID to exclude from uniqueness check |
703
+
704
+ #### Response
705
+
706
+ ```json
707
+ {
708
+ "sku": "EXA-PRO-MON"
709
+ }
710
+ ```
711
+
712
+ #### Example
713
+
714
+ ```bash
715
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/suggest-sku?title=Example%20Product&variant_title=Monthly" \
716
+ -u "username:app_password"
717
+ ```
718
+
719
+ ---
720
+
721
+ ### Get Max Excerpt Word Count
722
+
723
+ `GET /fluent-cart/v2/products/get-max-excerpt-word-count`
724
+
725
+ Returns the maximum allowed word count for product excerpts (controlled by the WordPress `excerpt_length` filter).
726
+
727
+ **Permission:** `products/view`
728
+
729
+ #### Response
730
+
731
+ ```json
732
+ {
733
+ "count": 55
734
+ }
735
+ ```
736
+
737
+ #### Example
738
+
739
+ ```bash
740
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/get-max-excerpt-word-count" \
741
+ -u "username:app_password"
742
+ ```
743
+
744
+ ---
745
+
746
+ ### Fetch Taxonomy Terms
747
+
748
+ `GET /fluent-cart/v2/products/fetch-term`
749
+
750
+ Retrieve all registered taxonomies and their terms for product categorization.
751
+
752
+ **Permission:** `products/view`
753
+
754
+ #### Response
755
+
756
+ ```json
757
+ {
758
+ "taxonomies": [
759
+ {
760
+ "name": "product-categories",
761
+ "label": "Product Categories",
762
+ "terms": [
763
+ {
764
+ "value": 1,
765
+ "label": "Software",
766
+ "children": []
767
+ }
768
+ ]
769
+ },
770
+ {
771
+ "name": "product-brands",
772
+ "label": "Product Brands",
773
+ "terms": []
774
+ }
775
+ ]
776
+ }
777
+ ```
778
+
779
+ #### Example
780
+
781
+ ```bash
782
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/fetch-term" \
783
+ -u "username:app_password"
784
+ ```
785
+
786
+ ---
787
+
788
+ ### Fetch Terms by Parent
789
+
790
+ `POST /fluent-cart/v2/products/fetch-term-by-parent`
791
+
792
+ Retrieve taxonomy terms filtered by parent term IDs.
793
+
794
+ **Permission:** `products/view`
795
+
796
+ #### Parameters
797
+
798
+ | Parameter | Type | Location | Required | Description |
799
+ |-----------|------|----------|----------|-------------|
800
+ | `parents` | array | body | Yes | Array of parent term IDs |
801
+ | `listeners` | array | body | Yes | Array of taxonomy names to retrieve terms for |
802
+
803
+ #### Response
804
+
805
+ ```json
806
+ {
807
+ "data": {
808
+ "product-categories": [
809
+ {
810
+ "value": 5,
811
+ "label": "Sub Category"
812
+ }
813
+ ]
814
+ }
815
+ }
816
+ ```
817
+
818
+ #### Example
819
+
820
+ ```bash
821
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/fetch-term-by-parent" \
822
+ -u "username:app_password" \
823
+ -H "Content-Type: application/json" \
824
+ -d '{
825
+ "parents": [1, 2],
826
+ "listeners": ["product-categories"]
827
+ }'
828
+ ```
829
+
830
+ ---
831
+
832
+ ## Bulk Operations
833
+
834
+ ### Bulk Insert Products
835
+
836
+ `POST /fluent-cart/v2/products/bulk-insert`
837
+
838
+ Insert multiple products at once. Maximum 10 products per request.
839
+
840
+ **Permission:** `products/create`
841
+
842
+ #### Parameters
843
+
844
+ | Parameter | Type | Location | Required | Description |
845
+ |-----------|------|----------|----------|-------------|
846
+ | `products` | array | body | Yes | Array of product data objects (max 10) |
847
+
848
+ #### Response
849
+
850
+ ```json
851
+ {
852
+ "message": "3 product(s) created successfully",
853
+ "created": [ ... ],
854
+ "errors": []
855
+ }
856
+ ```
857
+
858
+ #### Example
859
+
860
+ ```bash
861
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/bulk-insert" \
862
+ -u "username:app_password" \
863
+ -H "Content-Type: application/json" \
864
+ -d '{
865
+ "products": [
866
+ {
867
+ "post_title": "Product A",
868
+ "detail": { "fulfillment_type": "digital" }
869
+ },
870
+ {
871
+ "post_title": "Product B",
872
+ "detail": { "fulfillment_type": "physical" }
873
+ }
874
+ ]
875
+ }'
876
+ ```
877
+
878
+ ---
879
+
880
+ ### Bulk Edit Fetch
881
+
882
+ `GET /fluent-cart/v2/products/bulk-edit-data`
883
+
884
+ Fetch products formatted for the bulk editing spreadsheet view.
885
+
886
+ **Permission:** `products/edit`
887
+
888
+ #### Parameters
889
+
890
+ Standard filter parameters (see List Products).
891
+
892
+ #### Response
893
+
894
+ ```json
895
+ {
896
+ "products": [ ... ],
897
+ "columns": [ ... ]
898
+ }
899
+ ```
900
+
901
+ #### Example
902
+
903
+ ```bash
904
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/bulk-edit-data" \
905
+ -u "username:app_password"
906
+ ```
907
+
908
+ ---
909
+
910
+ ### Bulk Update Products
911
+
912
+ `POST /fluent-cart/v2/products/bulk-update`
913
+
914
+ Update multiple products at once from the bulk edit view. Maximum 10 products per request.
915
+
916
+ **Permission:** `products/edit`
917
+
918
+ #### Parameters
919
+
920
+ | Parameter | Type | Location | Required | Description |
921
+ |-----------|------|----------|----------|-------------|
922
+ | `products` | array | body | Yes | Array of product data objects to update (max 10) |
923
+
924
+ #### Response
925
+
926
+ ```json
927
+ {
928
+ "message": "3 product(s) updated successfully",
929
+ "updated": [ ... ],
930
+ "errors": []
931
+ }
932
+ ```
933
+
934
+ #### Example
935
+
936
+ ```bash
937
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/bulk-update" \
938
+ -u "username:app_password" \
939
+ -H "Content-Type: application/json" \
940
+ -d '{
941
+ "products": [
942
+ {
943
+ "ID": 123,
944
+ "post_title": "Updated Title A"
945
+ }
946
+ ]
947
+ }'
948
+ ```
949
+
950
+ ---
951
+
952
+ ### Do Bulk Action
953
+
954
+ `POST /fluent-cart/v2/products/do-bulk-action`
955
+
956
+ Perform bulk actions on selected products (e.g., publish, draft, delete).
957
+
958
+ **Permission:** `products/edit`
959
+
960
+ #### Parameters
961
+
962
+ | Parameter | Type | Location | Required | Description |
963
+ |-----------|------|----------|----------|-------------|
964
+ | `action` | string | body | Yes | The bulk action to perform |
965
+ | `product_ids` | array | body | Yes | Array of product IDs to act on |
966
+
967
+ #### Response
968
+
969
+ ```json
970
+ {
971
+ "message": "Bulk action completed successfully"
972
+ }
973
+ ```
974
+
975
+ #### Example
976
+
977
+ ```bash
978
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/do-bulk-action" \
979
+ -u "username:app_password" \
980
+ -H "Content-Type: application/json" \
981
+ -d '{
982
+ "action": "publish",
983
+ "product_ids": [123, 456, 789]
984
+ }'
985
+ ```
986
+
987
+ ---
988
+
989
+ ### Create Dummy Products
990
+
991
+ `POST /fluent-cart/v2/products/create-dummy`
992
+
993
+ Create sample/demo products for testing or onboarding purposes.
994
+
995
+ **Permission:** `products/create`
996
+
997
+ #### Parameters
998
+
999
+ | Parameter | Type | Location | Required | Description |
1000
+ |-----------|------|----------|----------|-------------|
1001
+ | `category` | string | body | No | Product category for dummy products |
1002
+ | `index` | integer | body | No | Index for dummy product generation |
1003
+
1004
+ #### Response
1005
+
1006
+ Returns the created dummy product data.
1007
+
1008
+ #### Example
1009
+
1010
+ ```bash
1011
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/create-dummy" \
1012
+ -u "username:app_password" \
1013
+ -H "Content-Type: application/json" \
1014
+ -d '{
1015
+ "category": "digital",
1016
+ "index": 1
1017
+ }'
1018
+ ```
1019
+
1020
+ ---
1021
+
1022
+ ## Product Details & Configuration
1023
+
1024
+ ### Duplicate Product
1025
+
1026
+ `POST /fluent-cart/v2/products/{productId}/duplicate`
1027
+
1028
+ Duplicate a product with options to include or exclude certain settings. The new product is saved as a draft.
1029
+
1030
+ **Permission:** `products/create`
1031
+
1032
+ #### Parameters
1033
+
1034
+ | Parameter | Type | Location | Required | Description |
1035
+ |-----------|------|----------|----------|-------------|
1036
+ | `productId` | integer | path | Yes | The product ID to duplicate |
1037
+ | `import_stock_management` | string | body | No | Include stock management settings (`true`/`false`) |
1038
+ | `import_license_settings` | string | body | No | Include license settings (`true`/`false`) |
1039
+ | `import_downloadable_files` | string | body | No | Include downloadable files (`true`/`false`) |
1040
+
1041
+ #### Response
1042
+
1043
+ ```json
1044
+ {
1045
+ "product_id": 125,
1046
+ "message": "Product duplicated successfully. The new product has been saved as a draft."
1047
+ }
1048
+ ```
1049
+
1050
+ #### Example
1051
+
1052
+ ```bash
1053
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/duplicate" \
1054
+ -u "username:app_password" \
1055
+ -H "Content-Type: application/json" \
1056
+ -d '{
1057
+ "import_stock_management": "true",
1058
+ "import_license_settings": "true",
1059
+ "import_downloadable_files": "false"
1060
+ }'
1061
+ ```
1062
+
1063
+ ---
1064
+
1065
+ ### Get Related Products
1066
+
1067
+ `GET /fluent-cart/v2/products/{productId}/related-products`
1068
+
1069
+ Retrieve products related to a given product based on shared categories or brands.
1070
+
1071
+ **Permission:** `products/view`
1072
+
1073
+ #### Parameters
1074
+
1075
+ | Parameter | Type | Location | Required | Description |
1076
+ |-----------|------|----------|----------|-------------|
1077
+ | `productId` | integer | path | Yes | The product ID |
1078
+ | `related_by_categories` | boolean | query | No | Include products from same categories |
1079
+ | `related_by_brands` | boolean | query | No | Include products from same brands |
1080
+ | `order_by` | string | query | No | Sort order (default: `title_asc`) |
1081
+ | `posts_per_page` | integer | query | No | Number of related products to return (default: 6) |
1082
+
1083
+ #### Response
1084
+
1085
+ ```json
1086
+ {
1087
+ "products": [
1088
+ {
1089
+ "ID": 456,
1090
+ "post_title": "Related Product",
1091
+ "post_status": "publish"
1092
+ }
1093
+ ]
1094
+ }
1095
+ ```
1096
+
1097
+ #### Example
1098
+
1099
+ ```bash
1100
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/related-products?related_by_categories=true&posts_per_page=4" \
1101
+ -u "username:app_password"
1102
+ ```
1103
+
1104
+ ---
1105
+
1106
+ ### Update Long Description Editor Mode
1107
+
1108
+ `POST /fluent-cart/v2/products/{postId}/update-long-desc-editor-mode`
1109
+
1110
+ Switch the long description editor between modes (e.g., visual, code).
1111
+
1112
+ **Permission:** `products/edit`
1113
+
1114
+ #### Parameters
1115
+
1116
+ | Parameter | Type | Location | Required | Description |
1117
+ |-----------|------|----------|----------|-------------|
1118
+ | `postId` | integer | path | Yes | The product post ID |
1119
+ | `active_editor` | string | body | Yes | The editor mode to set |
1120
+
1121
+ #### Response
1122
+
1123
+ ```json
1124
+ {
1125
+ "message": "Editor mode updated successfully"
1126
+ }
1127
+ ```
1128
+
1129
+ #### Example
1130
+
1131
+ ```bash
1132
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/update-long-desc-editor-mode" \
1133
+ -u "username:app_password" \
1134
+ -H "Content-Type: application/json" \
1135
+ -d '{"active_editor": "visual"}'
1136
+ ```
1137
+
1138
+ ---
1139
+
1140
+ ### Update Variant Option
1141
+
1142
+ `POST /fluent-cart/v2/products/{postId}/update-variant-option`
1143
+
1144
+ Sync variant options for a product (used when managing product attribute variations).
1145
+
1146
+ **Permission:** `products/edit`
1147
+
1148
+ #### Parameters
1149
+
1150
+ | Parameter | Type | Location | Required | Description |
1151
+ |-----------|------|----------|----------|-------------|
1152
+ | `postId` | integer | path | Yes | The product post ID |
1153
+ | `variation_type` | string | body | Yes | The variation type |
1154
+ | `product_id` | integer | body | Yes | The product ID |
1155
+ | `options` | array | body | Yes | Array of option objects with `id` and `variants` |
1156
+
1157
+ #### Response
1158
+
1159
+ ```json
1160
+ {
1161
+ "message": "Variant options synced successfully"
1162
+ }
1163
+ ```
1164
+
1165
+ #### Example
1166
+
1167
+ ```bash
1168
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/update-variant-option" \
1169
+ -u "username:app_password" \
1170
+ -H "Content-Type: application/json" \
1171
+ -d '{
1172
+ "variation_type": "simple_variations",
1173
+ "product_id": 123,
1174
+ "options": []
1175
+ }'
1176
+ ```
1177
+
1178
+ ---
1179
+
1180
+ ### Update Product Detail
1181
+
1182
+ `POST /fluent-cart/v2/products/detail/{detailId}`
1183
+
1184
+ Update a product detail record (e.g., change variation type).
1185
+
1186
+ **Permission:** `products/edit`
1187
+
1188
+ #### Parameters
1189
+
1190
+ | Parameter | Type | Location | Required | Description |
1191
+ |-----------|------|----------|----------|-------------|
1192
+ | `detailId` | integer | path | Yes | The product detail ID |
1193
+ | `variation_type` | string | body | No | New variation type (e.g., `simple`, `simple_variations`) |
1194
+ | `variation_ids` | array | body | No | Array of variation IDs |
1195
+ | `action` | string | body | No | Action to perform (default: `change_variation_type`) |
1196
+
1197
+ #### Response
1198
+
1199
+ ```json
1200
+ {
1201
+ "message": "Product detail updated successfully"
1202
+ }
1203
+ ```
1204
+
1205
+ #### Example
1206
+
1207
+ ```bash
1208
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/detail/456" \
1209
+ -u "username:app_password" \
1210
+ -H "Content-Type: application/json" \
1211
+ -d '{
1212
+ "variation_type": "simple_variations",
1213
+ "action": "change_variation_type"
1214
+ }'
1215
+ ```
1216
+
1217
+ ---
1218
+
1219
+ ### Add Product Terms
1220
+
1221
+ `POST /fluent-cart/v2/products/add-product-terms`
1222
+
1223
+ Create new taxonomy terms for products (categories, brands, etc.).
1224
+
1225
+ **Permission:** `products/edit`
1226
+
1227
+ #### Parameters
1228
+
1229
+ | Parameter | Type | Location | Required | Description |
1230
+ |-----------|------|----------|----------|-------------|
1231
+ | `term.name` | string | body | Yes | Term name(s), comma-separated for multiple |
1232
+ | `term.taxonomy` | string | body | Yes | Taxonomy name (e.g., `product-categories`, `product-brands`) |
1233
+ | `term.parent` | integer | body | No | Parent term ID for hierarchical terms |
1234
+
1235
+ #### Response
1236
+
1237
+ ```json
1238
+ {
1239
+ "term_ids": [10, 11],
1240
+ "names": ["Category A", "Category B"]
1241
+ }
1242
+ ```
1243
+
1244
+ #### Example
1245
+
1246
+ ```bash
1247
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/add-product-terms" \
1248
+ -u "username:app_password" \
1249
+ -H "Content-Type: application/json" \
1250
+ -d '{
1251
+ "term": {
1252
+ "name": "New Category,Another Category",
1253
+ "taxonomy": "product-categories",
1254
+ "parent": 0
1255
+ }
1256
+ }'
1257
+ ```
1258
+
1259
+ ---
1260
+
1261
+ ### Sync Taxonomy Terms
1262
+
1263
+ `POST /fluent-cart/v2/products/sync-taxonomy-term/{postId}`
1264
+
1265
+ Sync (replace) taxonomy terms for a product.
1266
+
1267
+ **Permission:** `products/edit`
1268
+
1269
+ #### Parameters
1270
+
1271
+ | Parameter | Type | Location | Required | Description |
1272
+ |-----------|------|----------|----------|-------------|
1273
+ | `postId` | integer | path | Yes | The product post ID |
1274
+ | `taxonomy` | string | body | Yes | Taxonomy name (e.g., `product-categories`) |
1275
+ | `terms` | array | body | No | Array of term IDs to sync |
1276
+
1277
+ #### Response
1278
+
1279
+ ```json
1280
+ {
1281
+ "message": "Taxonomy terms synced successfully"
1282
+ }
1283
+ ```
1284
+
1285
+ #### Example
1286
+
1287
+ ```bash
1288
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/sync-taxonomy-term/123" \
1289
+ -u "username:app_password" \
1290
+ -H "Content-Type: application/json" \
1291
+ -d '{
1292
+ "taxonomy": "product-categories",
1293
+ "terms": [1, 5, 10]
1294
+ }'
1295
+ ```
1296
+
1297
+ ---
1298
+
1299
+ ### Delete Taxonomy Term
1300
+
1301
+ `POST /fluent-cart/v2/products/delete-taxonomy-term/{postId}`
1302
+
1303
+ Remove a specific taxonomy term from a product.
1304
+
1305
+ **Permission:** `products/edit`
1306
+
1307
+ #### Parameters
1308
+
1309
+ | Parameter | Type | Location | Required | Description |
1310
+ |-----------|------|----------|----------|-------------|
1311
+ | `postId` | integer | path | Yes | The product post ID |
1312
+ | `taxonomy` | string | body | Yes | Taxonomy name (e.g., `product-categories`) |
1313
+ | `term` | integer | body | Yes | Term ID to remove |
1314
+
1315
+ #### Response
1316
+
1317
+ ```json
1318
+ {
1319
+ "message": "Taxonomy term removed successfully"
1320
+ }
1321
+ ```
1322
+
1323
+ #### Example
1324
+
1325
+ ```bash
1326
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/delete-taxonomy-term/123" \
1327
+ -u "username:app_password" \
1328
+ -H "Content-Type: application/json" \
1329
+ -d '{
1330
+ "taxonomy": "product-categories",
1331
+ "term": 5
1332
+ }'
1333
+ ```
1334
+
1335
+ ---
1336
+
1337
+ ### Get Pricing Widgets
1338
+
1339
+ `GET /fluent-cart/v2/products/{productId}/pricing-widgets`
1340
+
1341
+ Retrieve sales overview widgets for a product (all-time, last 30 days, this month).
1342
+
1343
+ **Permission:** `products/view`
1344
+
1345
+ #### Parameters
1346
+
1347
+ | Parameter | Type | Location | Required | Description |
1348
+ |-----------|------|----------|----------|-------------|
1349
+ | `productId` | integer | path | Yes | The product ID |
1350
+
1351
+ #### Response
1352
+
1353
+ ```json
1354
+ {
1355
+ "widgets": [
1356
+ {
1357
+ "title": "Quick Sales Overview",
1358
+ "body": "<ul class=\"fct-lists\"><li><span>All time (5)</span><span>$50.00</span></li>...</ul>"
1359
+ }
1360
+ ]
1361
+ }
1362
+ ```
1363
+
1364
+ #### Example
1365
+
1366
+ ```bash
1367
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/pricing-widgets" \
1368
+ -u "username:app_password"
1369
+ ```
1370
+
1371
+ ---
1372
+
1373
+ ## Bundle Products
1374
+
1375
+ ### Get Bundle Info
1376
+
1377
+ `GET /fluent-cart/v2/products/get-bundle-info/{productId}`
1378
+
1379
+ Retrieve bundle configuration information for a product, including child variant mappings.
1380
+
1381
+ **Permission:** `products/view`
1382
+
1383
+ #### Parameters
1384
+
1385
+ | Parameter | Type | Location | Required | Description |
1386
+ |-----------|------|----------|----------|-------------|
1387
+ | `productId` | integer | path | Yes | The product ID |
1388
+
1389
+ #### Response
1390
+
1391
+ ```json
1392
+ [
1393
+ {
1394
+ "id": 789,
1395
+ "variation_title": "Bundle Plan",
1396
+ "other_info": {
1397
+ "bundle_child_ids": [101, 102, 103]
1398
+ }
1399
+ }
1400
+ ]
1401
+ ```
1402
+
1403
+ #### Example
1404
+
1405
+ ```bash
1406
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/get-bundle-info/123" \
1407
+ -u "username:app_password"
1408
+ ```
1409
+
1410
+ ---
1411
+
1412
+ ### Save Bundle Info
1413
+
1414
+ `POST /fluent-cart/v2/products/save-bundle-info/{variationId}`
1415
+
1416
+ Save bundle child variant IDs for a variation. Bundle products cannot be added as children of other bundles.
1417
+
1418
+ **Permission:** `products/edit`
1419
+
1420
+ #### Parameters
1421
+
1422
+ | Parameter | Type | Location | Required | Description |
1423
+ |-----------|------|----------|----------|-------------|
1424
+ | `variationId` | integer | path | Yes | The variation ID to configure as a bundle |
1425
+ | `bundle_child_ids` | array | body | Yes | Array of child variation IDs |
1426
+
1427
+ #### Response
1428
+
1429
+ ```json
1430
+ [true]
1431
+ ```
1432
+
1433
+ #### Example
1434
+
1435
+ ```bash
1436
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/save-bundle-info/789" \
1437
+ -u "username:app_password" \
1438
+ -H "Content-Type: application/json" \
1439
+ -d '{
1440
+ "bundle_child_ids": [101, 102, 103]
1441
+ }'
1442
+ ```
1443
+
1444
+ ---
1445
+
1446
+ ## Upgrade Paths
1447
+
1448
+ ### Get Upgrade Settings
1449
+
1450
+ `GET /fluent-cart/v2/products/{id}/upgrade-paths`
1451
+
1452
+ Retrieve all upgrade path configurations for a product.
1453
+
1454
+ **Permission:** `products/view`
1455
+
1456
+ #### Parameters
1457
+
1458
+ | Parameter | Type | Location | Required | Description |
1459
+ |-----------|------|----------|----------|-------------|
1460
+ | `id` | integer | path | Yes | The product ID |
1461
+
1462
+ #### Response
1463
+
1464
+ ```json
1465
+ {
1466
+ "data": [ ... ]
1467
+ }
1468
+ ```
1469
+
1470
+ #### Example
1471
+
1472
+ ```bash
1473
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/upgrade-paths" \
1474
+ -u "username:app_password"
1475
+ ```
1476
+
1477
+ ---
1478
+
1479
+ ### Save Upgrade Path
1480
+
1481
+ `POST /fluent-cart/v2/products/{id}/upgrade-path`
1482
+
1483
+ Create a new upgrade path for a product.
1484
+
1485
+ **Permission:** `products/edit`
1486
+
1487
+ **Request Class:** `UpgradePathSettingRequest`
1488
+
1489
+ #### Parameters
1490
+
1491
+ | Parameter | Type | Location | Required | Description |
1492
+ |-----------|------|----------|----------|-------------|
1493
+ | `id` | integer | path | Yes | The product ID |
1494
+ | `from_variant` | integer | body | Yes | Source variation ID (must exist in `fct_product_variations`) |
1495
+ | `to_variants` | array | body | Yes | Array of target variation IDs (each must exist in `fct_product_variations`) |
1496
+ | `discount_amount` | number | body | No | Discount amount for the upgrade |
1497
+ | `title` | string | body | No | Upgrade path title |
1498
+ | `description` | string | body | No | Upgrade path description |
1499
+ | `slug` | string | body | No | Upgrade path slug |
1500
+
1501
+ #### Response
1502
+
1503
+ ```json
1504
+ {
1505
+ "message": "Settings saved successfully"
1506
+ }
1507
+ ```
1508
+
1509
+ #### Example
1510
+
1511
+ ```bash
1512
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/upgrade-path" \
1513
+ -u "username:app_password" \
1514
+ -H "Content-Type: application/json" \
1515
+ -d '{
1516
+ "from_variant": 456,
1517
+ "to_variants": [457, 458],
1518
+ "discount_amount": 500
1519
+ }'
1520
+ ```
1521
+
1522
+ ---
1523
+
1524
+ ### Update Upgrade Path
1525
+
1526
+ `POST /fluent-cart/v2/products/upgrade-path/{id}/update`
1527
+
1528
+ Update an existing upgrade path.
1529
+
1530
+ **Permission:** `products/edit`
1531
+
1532
+ **Request Class:** `UpgradePathSettingRequest`
1533
+
1534
+ #### Parameters
1535
+
1536
+ | Parameter | Type | Location | Required | Description |
1537
+ |-----------|------|----------|----------|-------------|
1538
+ | `id` | integer | path | Yes | The upgrade path ID |
1539
+ | `from_variant` | integer | body | Yes | Source variation ID |
1540
+ | `to_variants` | array | body | Yes | Array of target variation IDs |
1541
+ | `discount_amount` | number | body | No | Discount amount |
1542
+ | `title` | string | body | No | Upgrade path title |
1543
+ | `description` | string | body | No | Upgrade path description |
1544
+ | `slug` | string | body | No | Upgrade path slug |
1545
+
1546
+ #### Response
1547
+
1548
+ ```json
1549
+ {
1550
+ "message": "Settings updated successfully"
1551
+ }
1552
+ ```
1553
+
1554
+ #### Example
1555
+
1556
+ ```bash
1557
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/upgrade-path/10/update" \
1558
+ -u "username:app_password" \
1559
+ -H "Content-Type: application/json" \
1560
+ -d '{
1561
+ "from_variant": 456,
1562
+ "to_variants": [458, 459],
1563
+ "discount_amount": 1000
1564
+ }'
1565
+ ```
1566
+
1567
+ ---
1568
+
1569
+ ### Delete Upgrade Path
1570
+
1571
+ `DELETE /fluent-cart/v2/products/upgrade-path/{id}/delete`
1572
+
1573
+ Delete an upgrade path.
1574
+
1575
+ **Permission:** `products/delete`
1576
+
1577
+ #### Parameters
1578
+
1579
+ | Parameter | Type | Location | Required | Description |
1580
+ |-----------|------|----------|----------|-------------|
1581
+ | `id` | integer | path | Yes | The upgrade path ID |
1582
+
1583
+ #### Response
1584
+
1585
+ ```json
1586
+ {
1587
+ "message": "Path deleted successfully"
1588
+ }
1589
+ ```
1590
+
1591
+ #### Example
1592
+
1593
+ ```bash
1594
+ curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/upgrade-path/10/delete" \
1595
+ -u "username:app_password"
1596
+ ```
1597
+
1598
+ ---
1599
+
1600
+ ### Get Variation Upgrade Paths
1601
+
1602
+ `GET /fluent-cart/v2/products/variation/{variantId}/upgrade-paths`
1603
+
1604
+ Retrieve available upgrade paths for a specific variation (used in customer-facing upgrade flows).
1605
+
1606
+ **Permission:** `products/view`
1607
+
1608
+ #### Parameters
1609
+
1610
+ | Parameter | Type | Location | Required | Description |
1611
+ |-----------|------|----------|----------|-------------|
1612
+ | `variantId` | integer | path | Yes | The variation ID |
1613
+ | `params.order_hash` | string | query | Yes | The order hash to determine applicable upgrades |
1614
+
1615
+ #### Response
1616
+
1617
+ ```json
1618
+ {
1619
+ "upgradePaths": [ ... ]
1620
+ }
1621
+ ```
1622
+
1623
+ #### Example
1624
+
1625
+ ```bash
1626
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/variation/456/upgrade-paths?params[order_hash]=abc123" \
1627
+ -u "username:app_password"
1628
+ ```
1629
+
1630
+ ---
1631
+
1632
+ ## Tax & Shipping Classes
1633
+
1634
+ ### Update Tax Class
1635
+
1636
+ `POST /fluent-cart/v2/products/{postId}/tax-class`
1637
+
1638
+ Assign a tax class to a product.
1639
+
1640
+ **Permission:** `products/edit`
1641
+
1642
+ #### Parameters
1643
+
1644
+ | Parameter | Type | Location | Required | Description |
1645
+ |-----------|------|----------|----------|-------------|
1646
+ | `postId` | integer | path | Yes | The product post ID |
1647
+ | `tax_class` | integer | body | Yes | Tax class ID |
1648
+
1649
+ #### Response
1650
+
1651
+ ```json
1652
+ {
1653
+ "message": "Tax Class updated successfully"
1654
+ }
1655
+ ```
1656
+
1657
+ #### Example
1658
+
1659
+ ```bash
1660
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/tax-class" \
1661
+ -u "username:app_password" \
1662
+ -H "Content-Type: application/json" \
1663
+ -d '{"tax_class": 5}'
1664
+ ```
1665
+
1666
+ ---
1667
+
1668
+ ### Remove Tax Class
1669
+
1670
+ `POST /fluent-cart/v2/products/{postId}/tax-class/remove`
1671
+
1672
+ Remove the assigned tax class from a product.
1673
+
1674
+ **Permission:** `products/edit`
1675
+
1676
+ #### Parameters
1677
+
1678
+ | Parameter | Type | Location | Required | Description |
1679
+ |-----------|------|----------|----------|-------------|
1680
+ | `postId` | integer | path | Yes | The product post ID |
1681
+
1682
+ #### Response
1683
+
1684
+ ```json
1685
+ {
1686
+ "message": "Tax Class removed successfully"
1687
+ }
1688
+ ```
1689
+
1690
+ #### Example
1691
+
1692
+ ```bash
1693
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/tax-class/remove" \
1694
+ -u "username:app_password"
1695
+ ```
1696
+
1697
+ ---
1698
+
1699
+ ### Update Shipping Class
1700
+
1701
+ `POST /fluent-cart/v2/products/{postId}/shipping-class`
1702
+
1703
+ Assign a shipping class to a product.
1704
+
1705
+ **Permission:** `products/edit`
1706
+
1707
+ #### Parameters
1708
+
1709
+ | Parameter | Type | Location | Required | Description |
1710
+ |-----------|------|----------|----------|-------------|
1711
+ | `postId` | integer | path | Yes | The product post ID |
1712
+ | `shipping_class` | integer | body | Yes | Shipping class ID |
1713
+
1714
+ #### Response
1715
+
1716
+ ```json
1717
+ {
1718
+ "message": "Shipping Class updated successfully"
1719
+ }
1720
+ ```
1721
+
1722
+ #### Example
1723
+
1724
+ ```bash
1725
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/shipping-class" \
1726
+ -u "username:app_password" \
1727
+ -H "Content-Type: application/json" \
1728
+ -d '{"shipping_class": 3}'
1729
+ ```
1730
+
1731
+ ---
1732
+
1733
+ ### Remove Shipping Class
1734
+
1735
+ `POST /fluent-cart/v2/products/{postId}/shipping-class/remove`
1736
+
1737
+ Remove the assigned shipping class from a product.
1738
+
1739
+ **Permission:** `products/edit`
1740
+
1741
+ #### Parameters
1742
+
1743
+ | Parameter | Type | Location | Required | Description |
1744
+ |-----------|------|----------|----------|-------------|
1745
+ | `postId` | integer | path | Yes | The product post ID |
1746
+
1747
+ #### Response
1748
+
1749
+ ```json
1750
+ {
1751
+ "message": "Shipping Class removed successfully"
1752
+ }
1753
+ ```
1754
+
1755
+ #### Example
1756
+
1757
+ ```bash
1758
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/shipping-class/remove" \
1759
+ -u "username:app_password"
1760
+ ```
1761
+
1762
+ ---
1763
+
1764
+ ## Stock Management
1765
+
1766
+ ### Update Inventory
1767
+
1768
+ `PUT /fluent-cart/v2/products/{postId}/update-inventory/{variantId}`
1769
+
1770
+ Update stock levels for a specific variant. Automatically updates stock status and product-level availability.
1771
+
1772
+ **Permission:** `products/edit`
1773
+
1774
+ #### Parameters
1775
+
1776
+ | Parameter | Type | Location | Required | Description |
1777
+ |-----------|------|----------|----------|-------------|
1778
+ | `postId` | integer | path | Yes | The product post ID |
1779
+ | `variantId` | integer | path | Yes | The variant ID to update |
1780
+ | `total_stock` | integer | body | Yes | Total stock quantity |
1781
+ | `available` | integer | body | Yes | Available stock quantity |
1782
+
1783
+ #### Response
1784
+
1785
+ ```json
1786
+ {
1787
+ "message": "Inventory updated successfully"
1788
+ }
1789
+ ```
1790
+
1791
+ #### Example
1792
+
1793
+ ```bash
1794
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/123/update-inventory/456" \
1795
+ -u "username:app_password" \
1796
+ -H "Content-Type: application/json" \
1797
+ -d '{
1798
+ "total_stock": 100,
1799
+ "available": 80
1800
+ }'
1801
+ ```
1802
+
1803
+ ---
1804
+
1805
+ ### Update Manage Stock Setting
1806
+
1807
+ `PUT /fluent-cart/v2/products/{postId}/update-manage-stock`
1808
+
1809
+ Enable or disable stock management for a product and all its variants.
1810
+
1811
+ **Permission:** `products/edit`
1812
+
1813
+ #### Parameters
1814
+
1815
+ | Parameter | Type | Location | Required | Description |
1816
+ |-----------|------|----------|----------|-------------|
1817
+ | `postId` | integer | path | Yes | The product post ID |
1818
+ | `manage_stock` | integer | body | Yes | `1` to enable, `0` to disable stock management |
1819
+
1820
+ #### Response
1821
+
1822
+ ```json
1823
+ {
1824
+ "message": "Manage stock updated successfully"
1825
+ }
1826
+ ```
1827
+
1828
+ #### Example
1829
+
1830
+ ```bash
1831
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/123/update-manage-stock" \
1832
+ -u "username:app_password" \
1833
+ -H "Content-Type: application/json" \
1834
+ -d '{"manage_stock": 1}'
1835
+ ```
1836
+
1837
+ ---
1838
+
1839
+ ## Downloadables
1840
+
1841
+ ### Sync Downloadable Files
1842
+
1843
+ `POST /fluent-cart/v2/products/{postId}/sync-downloadable-files`
1844
+
1845
+ Attach multiple downloadable files to a product. Automatically enables the `manage_downloadable` flag.
1846
+
1847
+ **Permission:** `products/edit`
1848
+
1849
+ **Validation Class:** `ProductDownloadableBulkFileRequest`
1850
+
1851
+ #### Parameters
1852
+
1853
+ | Parameter | Type | Location | Required | Description |
1854
+ |-----------|------|----------|----------|-------------|
1855
+ | `postId` | integer | path | Yes | The product post ID |
1856
+ | `downloadable_files` | array | body | Yes | Array of downloadable file objects |
1857
+ | `downloadable_files.*.title` | string | body | Yes | File title (max 160 chars) |
1858
+ | `downloadable_files.*.type` | string | body | Yes | File type (max 100 chars) |
1859
+ | `downloadable_files.*.driver` | string | body | Yes | Storage driver (max 60 chars, e.g., `local`, `s3`) |
1860
+ | `downloadable_files.*.file_name` | string | body | Yes | File name (max 185 chars) |
1861
+ | `downloadable_files.*.file_path` | string | body | Yes | File path (max 185 chars) |
1862
+ | `downloadable_files.*.file_url` | string | body | Yes | File URL (max 200 chars) |
1863
+ | `downloadable_files.*.bucket` | string | body | No | Storage bucket name |
1864
+ | `downloadable_files.*.file_size` | string | body | No | File size |
1865
+ | `downloadable_files.*.serial` | integer | body | No | Display order serial |
1866
+ | `downloadable_files.*.product_variation_id` | array | body | No | Array of variation IDs this file is associated with |
1867
+ | `downloadable_files.*.settings.download_limit` | integer | body | No | Maximum number of downloads allowed |
1868
+ | `downloadable_files.*.settings.download_expiry` | integer | body | No | Download expiry in days |
1869
+
1870
+ #### Response
1871
+
1872
+ ```json
1873
+ {
1874
+ "downloadable_files": [
1875
+ {
1876
+ "id": 1,
1877
+ "post_id": 123,
1878
+ "title": "Software v1.0",
1879
+ "type": "zip",
1880
+ "driver": "local",
1881
+ "file_name": "software-v1.zip",
1882
+ "download_identifier": "a1b2c3d4-..."
1883
+ }
1884
+ ]
1885
+ }
1886
+ ```
1887
+
1888
+ #### Example
1889
+
1890
+ ```bash
1891
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/sync-downloadable-files" \
1892
+ -u "username:app_password" \
1893
+ -H "Content-Type: application/json" \
1894
+ -d '{
1895
+ "postId": 123,
1896
+ "downloadable_files": [
1897
+ {
1898
+ "title": "Software v1.0",
1899
+ "type": "zip",
1900
+ "driver": "local",
1901
+ "file_name": "software-v1.zip",
1902
+ "file_path": "software-v1.zip",
1903
+ "file_url": "software-v1.zip",
1904
+ "product_variation_id": [456],
1905
+ "settings": {
1906
+ "download_limit": 5,
1907
+ "download_expiry": 365
1908
+ }
1909
+ }
1910
+ ]
1911
+ }'
1912
+ ```
1913
+
1914
+ ---
1915
+
1916
+ ### Update Downloadable File
1917
+
1918
+ `PUT /fluent-cart/v2/products/{downloadableId}/update`
1919
+
1920
+ Update an existing downloadable file record.
1921
+
1922
+ **Permission:** `products/edit`
1923
+
1924
+ **Validation Class:** `ProductDownloadableFileRequest`
1925
+
1926
+ #### Parameters
1927
+
1928
+ | Parameter | Type | Location | Required | Description |
1929
+ |-----------|------|----------|----------|-------------|
1930
+ | `downloadableId` | integer | path | Yes | The downloadable file ID |
1931
+ | `title` | string | body | Yes | File title (max 100 chars) |
1932
+ | `type` | string | body | Yes | File type (max 100 chars) |
1933
+ | `driver` | string | body | Yes | Storage driver (max 100 chars) |
1934
+ | `file_name` | string | body | Yes | File name (max 100 chars) |
1935
+ | `product_variation_id` | array | body | No | Array of variation IDs |
1936
+ | `serial` | integer | body | No | Display order serial |
1937
+ | `settings` | object | body | No | File settings |
1938
+ | `settings.download_limit` | integer | body | No | Maximum downloads allowed |
1939
+ | `settings.download_expiry` | integer | body | No | Download expiry in days |
1940
+
1941
+ #### Response
1942
+
1943
+ ```json
1944
+ {
1945
+ "message": "Product downloadable files updated successfully"
1946
+ }
1947
+ ```
1948
+
1949
+ #### Example
1950
+
1951
+ ```bash
1952
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/789/update" \
1953
+ -u "username:app_password" \
1954
+ -H "Content-Type: application/json" \
1955
+ -d '{
1956
+ "title": "Software v2.0",
1957
+ "type": "zip",
1958
+ "driver": "local",
1959
+ "file_name": "software-v2.zip",
1960
+ "product_variation_id": [456, 457],
1961
+ "settings": {
1962
+ "download_limit": 10
1963
+ }
1964
+ }'
1965
+ ```
1966
+
1967
+ ---
1968
+
1969
+ ### Delete Downloadable File
1970
+
1971
+ `DELETE /fluent-cart/v2/products/{downloadableId}/delete`
1972
+
1973
+ Delete a downloadable file record.
1974
+
1975
+ **Permission:** `products/delete`
1976
+
1977
+ #### Parameters
1978
+
1979
+ | Parameter | Type | Location | Required | Description |
1980
+ |-----------|------|----------|----------|-------------|
1981
+ | `downloadableId` | integer | path | Yes | The downloadable file ID |
1982
+
1983
+ #### Response
1984
+
1985
+ ```json
1986
+ {
1987
+ "message": "File deleted successfully"
1988
+ }
1989
+ ```
1990
+
1991
+ #### Example
1992
+
1993
+ ```bash
1994
+ curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/789/delete" \
1995
+ -u "username:app_password"
1996
+ ```
1997
+
1998
+ ---
1999
+
2000
+ ### Get Downloadable URL
2001
+
2002
+ `GET /fluent-cart/v2/products/getDownloadableUrl/{downloadableId}`
2003
+
2004
+ Generate a temporary download URL for a downloadable file (valid for 7 days).
2005
+
2006
+ **Permission:** `products/view`
2007
+
2008
+ #### Parameters
2009
+
2010
+ | Parameter | Type | Location | Required | Description |
2011
+ |-----------|------|----------|----------|-------------|
2012
+ | `downloadableId` | integer | path | Yes | The downloadable file ID |
2013
+
2014
+ #### Response
2015
+
2016
+ ```json
2017
+ {
2018
+ "url": "https://example.com/fluent-cart/download?token=..."
2019
+ }
2020
+ ```
2021
+
2022
+ #### Example
2023
+
2024
+ ```bash
2025
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/getDownloadableUrl/789" \
2026
+ -u "username:app_password"
2027
+ ```
2028
+
2029
+ ---
2030
+
2031
+ ## Variations
2032
+
2033
+ ### List Product Variations
2034
+
2035
+ `GET /fluent-cart/v2/products/variants`
2036
+
2037
+ Retrieve a list of product variations.
2038
+
2039
+ **Permission:** `products/view`
2040
+
2041
+ #### Parameters
2042
+
2043
+ | Parameter | Type | Location | Required | Description |
2044
+ |-----------|------|----------|----------|-------------|
2045
+ | `params` | object | query | No | Query parameters for filtering variations |
2046
+
2047
+ #### Response
2048
+
2049
+ ```json
2050
+ {
2051
+ "variants": [ ... ]
2052
+ }
2053
+ ```
2054
+
2055
+ #### Example
2056
+
2057
+ ```bash
2058
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/variants" \
2059
+ -u "username:app_password"
2060
+ ```
2061
+
2062
+ ---
2063
+
2064
+ ### Create Variation
2065
+
2066
+ `POST /fluent-cart/v2/products/variants`
2067
+
2068
+ Create a new product variation.
2069
+
2070
+ **Permission:** `products/create`
2071
+
2072
+ **Request Class:** `ProductVariationRequest`
2073
+
2074
+ #### Parameters
2075
+
2076
+ | Parameter | Type | Location | Required | Description |
2077
+ |-----------|------|----------|----------|-------------|
2078
+ | `variants.post_id` | integer | body | Yes | Parent product ID |
2079
+ | `variants.variation_title` | string | body | Yes | Variation title (max 200 chars) |
2080
+ | `variants.sku` | string | body | No | SKU (max 30 chars, must be unique) |
2081
+ | `variants.item_price` | number | body | No | Price in cents (min: 0) |
2082
+ | `variants.compare_price` | number | body | No | Compare-at price in cents (must be >= `item_price`) |
2083
+ | `variants.manage_cost` | string | body | No | Enable cost tracking |
2084
+ | `variants.item_cost` | number | body | Conditional | Required if `manage_cost` is `true` |
2085
+ | `variants.fulfillment_type` | string | body | Yes | `physical` or `digital` |
2086
+ | `variants.manage_stock` | integer | body | No | `0` or `1` |
2087
+ | `variants.stock_status` | string | body | Conditional | Required if `manage_stock` is `1`. Values: `in-stock`, `out-of-stock` |
2088
+ | `variants.total_stock` | integer | body | Yes | Total stock quantity |
2089
+ | `variants.available` | integer | body | Yes | Available stock |
2090
+ | `variants.committed` | integer | body | Yes | Committed stock |
2091
+ | `variants.on_hold` | integer | body | Yes | Stock on hold |
2092
+ | `variants.serial_index` | integer | body | No | Display order index |
2093
+ | `variants.downloadable` | string | body | No | Downloadable flag |
2094
+ | `variants.other_info.payment_type` | string | body | Yes | `onetime` or `subscription` |
2095
+ | `variants.other_info.description` | string | body | No | Description (max 255 chars) |
2096
+ | `variants.other_info.repeat_interval` | string | body | Conditional | Required for subscriptions (e.g., `monthly`, `yearly`) |
2097
+ | `variants.other_info.times` | number | body | No | Number of billing cycles |
2098
+ | `variants.other_info.trial_days` | number | body | No | Trial days (max 365) |
2099
+ | `variants.other_info.billing_summary` | string | body | No | Billing summary (max 255 chars) |
2100
+ | `variants.other_info.manage_setup_fee` | string | body | Conditional | Required for subscriptions: `yes` or `no` |
2101
+ | `variants.other_info.signup_fee` | number | body | Conditional | Setup fee in cents. Required if `manage_setup_fee` is `yes` |
2102
+ | `variants.other_info.signup_fee_name` | string | body | Conditional | Setup fee label (max 100 chars). Required if `manage_setup_fee` is `yes` |
2103
+ | `variants.media` | array | body | No | Media images array with `id`, `url`, `title` |
2104
+
2105
+ #### Response
2106
+
2107
+ ```json
2108
+ {
2109
+ "variant": {
2110
+ "id": 460,
2111
+ "post_id": 123,
2112
+ "variation_title": "Pro Plan",
2113
+ "item_price": 2999,
2114
+ "sku": "PRO-PLN",
2115
+ "stock_status": "in-stock"
2116
+ },
2117
+ "message": "Variation created successfully"
2118
+ }
2119
+ ```
2120
+
2121
+ #### Example
2122
+
2123
+ ```bash
2124
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/variants" \
2125
+ -u "username:app_password" \
2126
+ -H "Content-Type: application/json" \
2127
+ -d '{
2128
+ "variants": {
2129
+ "post_id": 123,
2130
+ "variation_title": "Pro Plan",
2131
+ "item_price": 2999,
2132
+ "sku": "PRO-PLN",
2133
+ "fulfillment_type": "digital",
2134
+ "total_stock": 1,
2135
+ "available": 1,
2136
+ "committed": 0,
2137
+ "on_hold": 0,
2138
+ "other_info": {
2139
+ "payment_type": "onetime"
2140
+ }
2141
+ }
2142
+ }'
2143
+ ```
2144
+
2145
+ ---
2146
+
2147
+ ### Update Variation
2148
+
2149
+ `POST /fluent-cart/v2/products/variants/{variantId}`
2150
+
2151
+ Update an existing product variation.
2152
+
2153
+ **Permission:** `products/edit`
2154
+
2155
+ **Request Class:** `ProductVariationRequest`
2156
+
2157
+ #### Parameters
2158
+
2159
+ | Parameter | Type | Location | Required | Description |
2160
+ |-----------|------|----------|----------|-------------|
2161
+ | `variantId` | integer | path | Yes | The variation ID to update |
2162
+
2163
+ All body parameters are the same as Create Variation.
2164
+
2165
+ #### Response
2166
+
2167
+ ```json
2168
+ {
2169
+ "variant": { ... },
2170
+ "message": "Variation updated successfully"
2171
+ }
2172
+ ```
2173
+
2174
+ #### Example
2175
+
2176
+ ```bash
2177
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/variants/460" \
2178
+ -u "username:app_password" \
2179
+ -H "Content-Type: application/json" \
2180
+ -d '{
2181
+ "variants": {
2182
+ "id": 460,
2183
+ "post_id": 123,
2184
+ "variation_title": "Pro Plan - Updated",
2185
+ "item_price": 3999,
2186
+ "fulfillment_type": "digital",
2187
+ "total_stock": 1,
2188
+ "available": 1,
2189
+ "committed": 0,
2190
+ "on_hold": 0,
2191
+ "other_info": {
2192
+ "payment_type": "onetime"
2193
+ }
2194
+ }
2195
+ }'
2196
+ ```
2197
+
2198
+ ---
2199
+
2200
+ ### Delete Variation
2201
+
2202
+ `DELETE /fluent-cart/v2/products/variants/{variantId}`
2203
+
2204
+ Delete a product variation.
2205
+
2206
+ **Permission:** `products/delete`
2207
+
2208
+ #### Parameters
2209
+
2210
+ | Parameter | Type | Location | Required | Description |
2211
+ |-----------|------|----------|----------|-------------|
2212
+ | `variantId` | integer | path | Yes | The variation ID to delete |
2213
+
2214
+ #### Response
2215
+
2216
+ ```json
2217
+ {
2218
+ "message": "Variation deleted successfully"
2219
+ }
2220
+ ```
2221
+
2222
+ #### Example
2223
+
2224
+ ```bash
2225
+ curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/variants/460" \
2226
+ -u "username:app_password"
2227
+ ```
2228
+
2229
+ ---
2230
+
2231
+ ### Set Variation Media
2232
+
2233
+ `POST /fluent-cart/v2/products/variants/{variantId}/setMedia`
2234
+
2235
+ Set media/images for a variation.
2236
+
2237
+ **Permission:** `products/edit`
2238
+
2239
+ #### Parameters
2240
+
2241
+ | Parameter | Type | Location | Required | Description |
2242
+ |-----------|------|----------|----------|-------------|
2243
+ | `variantId` | integer | path | Yes | The variation ID |
2244
+ | `media` | array | body | Yes | Array of media objects |
2245
+ | `media.*.id` | integer | body | Yes | WordPress attachment ID |
2246
+ | `media.*.title` | string | body | No | Image title |
2247
+ | `media.*.url` | string | body | No | Image URL |
2248
+
2249
+ #### Response
2250
+
2251
+ ```json
2252
+ {
2253
+ "message": "Media set successfully"
2254
+ }
2255
+ ```
2256
+
2257
+ #### Example
2258
+
2259
+ ```bash
2260
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/variants/460/setMedia" \
2261
+ -u "username:app_password" \
2262
+ -H "Content-Type: application/json" \
2263
+ -d '{
2264
+ "media": [
2265
+ {
2266
+ "id": 101,
2267
+ "title": "Product Image",
2268
+ "url": "https://example.com/wp-content/uploads/product.jpg"
2269
+ }
2270
+ ]
2271
+ }'
2272
+ ```
2273
+
2274
+ ---
2275
+
2276
+ ### Update Variation Pricing Table
2277
+
2278
+ `PUT /fluent-cart/v2/products/variants/{variantId}/pricing-table`
2279
+
2280
+ Update the pricing table description for a variation.
2281
+
2282
+ **Permission:** `products/edit`
2283
+
2284
+ #### Parameters
2285
+
2286
+ | Parameter | Type | Location | Required | Description |
2287
+ |-----------|------|----------|----------|-------------|
2288
+ | `variantId` | integer | path | Yes | The variation ID |
2289
+ | `description` | string | body | Yes | Pricing table description text (newlines preserved) |
2290
+
2291
+ #### Response
2292
+
2293
+ ```json
2294
+ {
2295
+ "message": "Pricing table updated successfully"
2296
+ }
2297
+ ```
2298
+
2299
+ #### Example
2300
+
2301
+ ```bash
2302
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/variants/460/pricing-table" \
2303
+ -u "username:app_password" \
2304
+ -H "Content-Type: application/json" \
2305
+ -d '{
2306
+ "description": "Includes:\n- Feature A\n- Feature B\n- Priority Support"
2307
+ }'
2308
+ ```
2309
+
2310
+ ---
2311
+
2312
+ ## Variants (VariantController)
2313
+
2314
+ ### List All Variants
2315
+
2316
+ `GET /fluent-cart/v2/variants`
2317
+
2318
+ Retrieve all product variations across all products (separate route group using `VariantController`).
2319
+
2320
+ **Permission:** `products/view`
2321
+
2322
+ **Policy:** `ProductPolicy`
2323
+
2324
+ #### Parameters
2325
+
2326
+ | Parameter | Type | Location | Required | Description |
2327
+ |-----------|------|----------|----------|-------------|
2328
+ | `params` | object | query | No | Query parameters for filtering |
2329
+
2330
+ #### Response
2331
+
2332
+ ```json
2333
+ [
2334
+ {
2335
+ "id": 456,
2336
+ "post_id": 123,
2337
+ "variation_title": "Default Plan",
2338
+ "item_price": 1000,
2339
+ "sku": null,
2340
+ "stock_status": "in-stock",
2341
+ "payment_type": "onetime",
2342
+ "other_info": { ... }
2343
+ }
2344
+ ]
2345
+ ```
2346
+
2347
+ #### Example
2348
+
2349
+ ```bash
2350
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/variants" \
2351
+ -u "username:app_password"
2352
+ ```
2353
+
2354
+ ---
2355
+
2356
+ ## Product Integrations
2357
+
2358
+ ### Get Product Integration Feeds
2359
+
2360
+ `GET /fluent-cart/v2/products/{productId}/integrations`
2361
+
2362
+ Retrieve all integration feeds configured for a product, along with available integrations.
2363
+
2364
+ **Permission:** `products/view`
2365
+
2366
+ #### Parameters
2367
+
2368
+ | Parameter | Type | Location | Required | Description |
2369
+ |-----------|------|----------|----------|-------------|
2370
+ | `productId` | integer | path | Yes | The product ID |
2371
+
2372
+ #### Response
2373
+
2374
+ ```json
2375
+ {
2376
+ "feeds": [
2377
+ {
2378
+ "id": 10,
2379
+ "name": "Add to FluentCRM List",
2380
+ "enabled": "yes",
2381
+ "provider": "fluentcrm",
2382
+ "feed": { ... },
2383
+ "scope": "product"
2384
+ }
2385
+ ],
2386
+ "available_integrations": {
2387
+ "fluentcrm": {
2388
+ "title": "FluentCRM",
2389
+ "logo": "...",
2390
+ "enabled": true,
2391
+ "scopes": ["product", "order"]
2392
+ }
2393
+ },
2394
+ "all_module_config_url": "https://example.com/wp-admin/admin.php?page=fluent-cart#/integrations"
2395
+ }
2396
+ ```
2397
+
2398
+ #### Example
2399
+
2400
+ ```bash
2401
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/integrations" \
2402
+ -u "username:app_password"
2403
+ ```
2404
+
2405
+ ---
2406
+
2407
+ ### Get Product Integration Settings
2408
+
2409
+ `GET /fluent-cart/v2/products/{product_id}/integrations/{integration_name}/settings`
2410
+
2411
+ Retrieve settings for a specific integration type on a product. Returns the integration form configuration, existing settings, and product variations.
2412
+
2413
+ **Permission:** `products/view`
2414
+
2415
+ #### Parameters
2416
+
2417
+ | Parameter | Type | Location | Required | Description |
2418
+ |-----------|------|----------|----------|-------------|
2419
+ | `product_id` | integer | path | Yes | The product ID |
2420
+ | `integration_name` | string | path | Yes | Integration provider name (e.g., `fluentcrm`) |
2421
+ | `integration_id` | integer | query | No | Existing integration feed ID to load for editing |
2422
+
2423
+ #### Response
2424
+
2425
+ ```json
2426
+ {
2427
+ "settings": {
2428
+ "conditional_variation_ids": [],
2429
+ ...
2430
+ },
2431
+ "fields": [ ... ],
2432
+ "product_variations": [
2433
+ {
2434
+ "id": 456,
2435
+ "title": "Monthly Plan"
2436
+ }
2437
+ ],
2438
+ "scope": "product"
2439
+ }
2440
+ ```
2441
+
2442
+ #### Example
2443
+
2444
+ ```bash
2445
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/products/123/integrations/fluentcrm/settings" \
2446
+ -u "username:app_password"
2447
+ ```
2448
+
2449
+ ---
2450
+
2451
+ ### Save Product Integration
2452
+
2453
+ `POST /fluent-cart/v2/products/{product_id}/integrations`
2454
+
2455
+ Create or update an integration feed for a product.
2456
+
2457
+ **Permission:** `products/edit`
2458
+
2459
+ #### Parameters
2460
+
2461
+ | Parameter | Type | Location | Required | Description |
2462
+ |-----------|------|----------|----------|-------------|
2463
+ | `product_id` | integer | path | Yes | The product ID |
2464
+ | `integration_name` | string | body | Yes | Integration provider name |
2465
+ | `integration_id` | integer | body | No | Existing feed ID (for updates) |
2466
+ | `integration` | string (JSON) | body | Yes | JSON-encoded integration settings object |
2467
+
2468
+ #### Response
2469
+
2470
+ ```json
2471
+ {
2472
+ "message": "Integration has been successfully saved",
2473
+ "integration": { ... }
2474
+ }
2475
+ ```
2476
+
2477
+ #### Example
2478
+
2479
+ ```bash
2480
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/products/123/integrations" \
2481
+ -u "username:app_password" \
2482
+ -H "Content-Type: application/json" \
2483
+ -d '{
2484
+ "integration_name": "fluentcrm",
2485
+ "integration": "{\"list_id\": 1, \"tags\": [5, 10]}"
2486
+ }'
2487
+ ```
2488
+
2489
+ ---
2490
+
2491
+ ### Update Product Integration
2492
+
2493
+ `PUT /fluent-cart/v2/products/{product_id}/integrations/{integration_id}`
2494
+
2495
+ Update an existing product integration feed.
2496
+
2497
+ **Permission:** `products/edit`
2498
+
2499
+ #### Parameters
2500
+
2501
+ | Parameter | Type | Location | Required | Description |
2502
+ |-----------|------|----------|----------|-------------|
2503
+ | `product_id` | integer | path | Yes | The product ID |
2504
+ | `integration_id` | integer | path | Yes | The integration feed ID |
2505
+ | `integration_name` | string | body | Yes | Integration provider name |
2506
+ | `integration` | string (JSON) | body | Yes | JSON-encoded integration settings |
2507
+ | `enabled` | string | body | No | `yes` or `no` |
2508
+ | `name` | string | body | No | Feed display name |
2509
+
2510
+ #### Response
2511
+
2512
+ ```json
2513
+ {
2514
+ "message": "Integration has been successfully updated",
2515
+ "integration": { ... }
2516
+ }
2517
+ ```
2518
+
2519
+ #### Example
2520
+
2521
+ ```bash
2522
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/products/123/integrations/10" \
2523
+ -u "username:app_password" \
2524
+ -H "Content-Type: application/json" \
2525
+ -d '{
2526
+ "integration_name": "fluentcrm",
2527
+ "integration": "{\"list_id\": 2, \"tags\": [5, 15]}",
2528
+ "enabled": "yes",
2529
+ "name": "Updated FluentCRM Feed"
2530
+ }'
2531
+ ```
2532
+
2533
+ ---
2534
+
2535
+ ### Delete Product Integration
2536
+
2537
+ `DELETE /fluent-cart/v2/products/{product_id}/integrations/{integration_id}`
2538
+
2539
+ Delete a product integration feed.
2540
+
2541
+ **Permission:** `products/delete`
2542
+
2543
+ #### Parameters
2544
+
2545
+ | Parameter | Type | Location | Required | Description |
2546
+ |-----------|------|----------|----------|-------------|
2547
+ | `product_id` | integer | path | Yes | The product ID |
2548
+ | `integration_id` | integer | path | Yes | The integration feed ID |
2549
+
2550
+ #### Response
2551
+
2552
+ ```json
2553
+ {
2554
+ "message": "Integration has been deleted successfully"
2555
+ }
2556
+ ```
2557
+
2558
+ #### Example
2559
+
2560
+ ```bash
2561
+ curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/products/123/integrations/10" \
2562
+ -u "username:app_password"
2563
+ ```