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,528 +1,528 @@
1
- # Settings API
2
-
3
- Configure store settings, payment gateways, feature modules, file storage drivers, checkout fields, permissions, confirmation pages, and PayPal onboarding in FluentCart.
4
-
5
- **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/settings`
6
- **Policy:** `StoreSettingsPolicy` (most endpoints require `is_super_admin` or `store/settings`) / `StoreSensitivePolicy` (for checkout fields)
7
-
8
- ---
9
-
10
- ## Endpoints Overview
11
-
12
- | Group | Method | Endpoint | Permission / Policy | Description |
13
- |-------|--------|----------|--------------------|-------------|
14
- | **Payment Methods** | GET | `/settings/payment-methods` | `is_super_admin` | Retrieve gateway configuration (Stripe, PayPal, etc.) |
15
- | | POST | `/settings/payment-methods` | `is_super_admin` | Create/update gateway configuration |
16
- | | GET | `/settings/payment-methods/all` | `is_super_admin` | List all registered payment method gateways |
17
- | | POST | `/settings/payment-methods/reorder` | `is_super_admin` | Set display order of payment methods at checkout |
18
- | | GET | `/settings/payment-methods/connect/info` | `is_super_admin` | Retrieve OAuth / connect info for gateway |
19
- | | POST | `/settings/payment-methods/disconnect` | `is_super_admin` | Disconnect gateway account (test/live mode) |
20
- | | POST | `/settings/payment-methods/design` | `is_super_admin` | Save checkout label, logo, & instructions |
21
- | | POST | `/settings/payment-methods/install-addon` | `is_super_admin` | Install payment gateway addon plugin |
22
- | | POST | `/settings/payment-methods/activate-addon` | `is_super_admin` | Activate payment gateway addon plugin |
23
- | **PayPal Config** | POST | `/settings/payment-methods/paypal/seller-auth-token` | `super_admin` | Exchange PayPal OAuth code for seller token |
24
- | | POST | `/settings/payment-methods/paypal/webhook/setup` | `super_admin` | Register PayPal payment webhook |
25
- | | GET | `/settings/payment-methods/paypal/webhook/check` | `super_admin` | Verify PayPal webhook registration status |
26
- | **Permissions** | GET | `/settings/permissions` | `is_super_admin` | Retrieve role-to-capability permission mappings |
27
- | | POST | `/settings/permissions` | `is_super_admin` | Update role-to-capability permission mappings |
28
- | **Store Settings** | GET | `/settings/store` | `store/settings` | Retrieve store configuration & field schema |
29
- | | POST | `/settings/store` | `store/settings` (`FluentMetaRequest`) | Update store configuration settings |
30
- | **Modules** | GET | `/settings/modules/plugin-addons` | `is_super_admin` | List registered plugin addons (Elementor, etc.) |
31
- | | POST | `/settings/modules/plugin-addons/install` | `is_super_admin` | Install plugin addon |
32
- | | POST | `/settings/modules/plugin-addons/activate` | `is_super_admin` | Activate plugin addon |
33
- | | GET | `/settings/modules` | `is_super_admin` | List feature toggles & field schema |
34
- | | POST | `/settings/modules` | `is_super_admin` | Enable/disable modules & update settings |
35
- | **Confirmation** | POST | `/settings/confirmation` | `is_super_admin` | Update receipt/confirmation page settings |
36
- | | GET | `/settings/confirmation/shortcode` | `is_super_admin` | Get available shortcodes / merge tags |
37
- | **Storage Drivers** | GET | `/settings/storage-drivers` | `is_super_admin` | List all file storage drivers (Local, S3, CDN) |
38
- | | POST | `/settings/storage-drivers` | `is_super_admin` | Save storage driver configuration |
39
- | | GET | `/settings/storage-drivers/active-drivers` | `is_super_admin` | List active/enabled storage drivers |
40
- | | GET | `/settings/storage-drivers/{driver}` | `is_super_admin` | Get configuration for specific driver |
41
- | | POST | `/settings/storage-drivers/verify-info` | `is_super_admin` | Test storage driver credentials connection |
42
- | **Checkout Fields** | GET | `/checkout-fields/get-fields` | `store/sensitive` | Get checkout field schema & settings |
43
- | | POST | `/checkout-fields/save-fields` | `store/sensitive` | Update checkout field visibility & required rules |
44
-
45
- ---
46
-
47
- ## Payment Methods
48
-
49
- Configure payment gateways (Stripe, PayPal, Cash on Delivery, etc.), gateway reordering, designs, and addon plugins.
50
-
51
- **Prefix:** `/fluent-cart/v2/settings/payment-methods` | **Permission:** `is_super_admin`
52
-
53
- ### Get Payment Method Settings
54
-
55
- `GET /fluent-cart/v2/settings/payment-methods`
56
-
57
- Retrieve configuration settings for a specific payment method.
58
-
59
- #### Parameters
60
-
61
- | Parameter | Type | Location | Required | Description |
62
- |-----------|------|----------|----------|-------------|
63
- | `method` | string | query | Yes | Payment method key (e.g., `stripe`, `paypal`, `cod`) |
64
-
65
- #### Response
66
-
67
- ```json
68
- {
69
- "settings": {
70
- "is_active": "yes",
71
- "payment_mode": "live",
72
- "checkout_label": "Pay with Stripe",
73
- "checkout_logo": "https://example.com/stripe-logo.png",
74
- "checkout_instructions": "",
75
- "thank_you_page_instructions": ""
76
- },
77
- "fields": {}
78
- }
79
- ```
80
-
81
- #### Example
82
-
83
- ```bash
84
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/settings/payment-methods?method=stripe" \
85
- -u "username:app_password"
86
- ```
87
-
88
- ---
89
-
90
- ### Save Payment Method Settings
91
-
92
- `POST /fluent-cart/v2/settings/payment-methods`
93
-
94
- Create or update gateway configuration.
95
-
96
- #### Parameters
97
-
98
- | Parameter | Type | Location | Required | Description |
99
- |-----------|------|----------|----------|-------------|
100
- | `method` | string | body | Yes | Payment method key (e.g., `stripe`, `paypal`, `cod`) |
101
- | `settings` | object | body | Yes | Key-value object of gateway-specific settings to save |
102
-
103
- #### Request Example
104
-
105
- ```json
106
- {
107
- "method": "cod",
108
- "settings": {
109
- "is_active": "yes",
110
- "checkout_label": "Cash on Delivery"
111
- }
112
- }
113
- ```
114
-
115
- #### Response
116
-
117
- ```json
118
- {
119
- "settings": {
120
- "is_active": "yes",
121
- "checkout_label": "Cash on Delivery"
122
- },
123
- "message": "Settings saved successfully"
124
- }
125
- ```
126
-
127
- ---
128
-
129
- ### List All Payment Methods
130
-
131
- `GET /fluent-cart/v2/settings/payment-methods/all`
132
-
133
- Retrieve all registered payment method gateways categorized by availability status (available first, then Pro required, then upcoming).
134
-
135
- #### Response
136
-
137
- ```json
138
- {
139
- "gateways": [
140
- {
141
- "method_key": "stripe",
142
- "title": "Stripe",
143
- "is_active": "yes",
144
- "description": "Accept payments via Stripe",
145
- "logo": "https://...",
146
- "upcoming": false
147
- },
148
- {
149
- "method_key": "paypal",
150
- "title": "PayPal",
151
- "is_active": "no",
152
- "requires_pro": true
153
- }
154
- ]
155
- }
156
- ```
157
-
158
- ---
159
-
160
- ### Reorder Payment Methods
161
-
162
- `POST /fluent-cart/v2/settings/payment-methods/reorder`
163
-
164
- Set the display order of payment methods on the checkout page.
165
-
166
- #### Parameters
167
-
168
- | Parameter | Type | Location | Required | Description |
169
- |-----------|------|----------|----------|-------------|
170
- | `order` | array | body | Yes | Ordered array of payment method keys (e.g. `["stripe", "paypal", "cod"]`) |
171
-
172
- #### Request Example
173
-
174
- ```json
175
- {
176
- "order": ["stripe", "paypal", "cod"]
177
- }
178
- ```
179
-
180
- #### Response
181
-
182
- ```json
183
- {
184
- "message": "Payment methods order saved successfully",
185
- "order": ["stripe", "paypal", "cod"]
186
- }
187
- ```
188
-
189
- ---
190
-
191
- ### Get Payment Method Connection Info
192
-
193
- `GET /fluent-cart/v2/settings/payment-methods/connect/info`
194
-
195
- Retrieve connection info (OAuth URLs, account status) for OAuth-based payment gateways (Stripe Connect, PayPal Connect).
196
-
197
- #### Parameters
198
-
199
- | Parameter | Type | Location | Required | Description |
200
- |-----------|------|----------|----------|-------------|
201
- | `method` | string | query | Yes | Payment method key (e.g. `stripe`, `paypal`) |
202
-
203
- #### Response
204
-
205
- ```json
206
- {
207
- "connect_config": {
208
- "test_redirect": "https://example.com/wp-admin/?fluent-cart=...",
209
- "live_redirect": "https://example.com/wp-admin/?fluent-cart=...",
210
- "disconnect_note": "Disconnecting will prevent..."
211
- },
212
- "test_account": {},
213
- "live_account": {},
214
- "settings": {}
215
- }
216
- ```
217
-
218
- ---
219
-
220
- ### Disconnect Payment Method
221
-
222
- `POST /fluent-cart/v2/settings/payment-methods/disconnect`
223
-
224
- Disconnect a connected gateway account.
225
-
226
- #### Parameters
227
-
228
- | Parameter | Type | Location | Required | Description |
229
- |-----------|------|----------|----------|-------------|
230
- | `method` | string | body | Yes | Payment method key (e.g., `stripe`, `paypal`) |
231
- | `mode` | string | body | Yes | Environment mode: `test` or `live` |
232
-
233
- #### Response
234
-
235
- ```json
236
- {
237
- "message": "PayPal settings has been disconnected",
238
- "settings": {}
239
- }
240
- ```
241
-
242
- ---
243
-
244
- ### Save Payment Method Design
245
-
246
- `POST /fluent-cart/v2/settings/payment-methods/design`
247
-
248
- Customize checkout label, logo, and instructions for a gateway.
249
-
250
- #### Parameters
251
-
252
- | Parameter | Type | Location | Required | Description |
253
- |-----------|------|----------|----------|-------------|
254
- | `method` | string | body | Yes | Payment method key |
255
- | `checkout_label` | string | body | No | Custom label displayed on checkout form |
256
- | `checkout_logo` | string | body | No | URL to custom logo image |
257
- | `checkout_instructions` | string | body | No | HTML instructions shown on checkout form when selected |
258
- | `thank_you_page_instructions` | string | body | No | HTML instructions shown on thank-you receipt page |
259
-
260
- ---
261
-
262
- ### Install & Activate Payment Addons
263
-
264
- - `POST /fluent-cart/v2/settings/payment-methods/install-addon` — Install gateway addon (`plugin_slug`, `source_type`: `wordpress` | `github`, `source_link`).
265
- - `POST /fluent-cart/v2/settings/payment-methods/activate-addon` — Activate installed gateway addon (`plugin_file`: `fluent-cart-pro/fluent-cart-pro.php`).
266
-
267
- ---
268
-
269
- ## PayPal Configuration
270
-
271
- Endpoints for PayPal Connect OAuth onboarding and webhook registration.
272
-
273
- **Policy:** `AdminPolicy` | **Permission:** `super_admin`
274
-
275
- - `POST /fluent-cart/v2/settings/payment-methods/paypal/seller-auth-token` — Exchange OAuth auth code (`authCode`, `sharedId`, `mode`: `test` | `live`). Saves credentials & auto-registers webhooks.
276
- - `POST /fluent-cart/v2/settings/payment-methods/paypal/webhook/setup` — Register webhook endpoint with PayPal (`mode`).
277
- - `GET /fluent-cart/v2/settings/payment-methods/paypal/webhook/check` — Verify PayPal webhook status (`mode`).
278
-
279
- ---
280
-
281
- ## Permissions
282
-
283
- Manage role-to-capability permission assignments for FluentCart administrative access.
284
-
285
- **Prefix:** `/fluent-cart/v2/settings/permissions` | **Permission:** `is_super_admin`
286
-
287
- ### Get Permissions
288
-
289
- `GET /fluent-cart/v2/settings/permissions`
290
-
291
- #### Response
292
-
293
- ```json
294
- {
295
- "roles": {
296
- "administrator": {
297
- "name": "Administrator",
298
- "capabilities": {
299
- "orders/view": true,
300
- "orders/manage": true,
301
- "customers/view": true,
302
- "products/manage": true
303
- }
304
- },
305
- "shop_manager": {
306
- "name": "Shop Manager",
307
- "capabilities": {}
308
- }
309
- }
310
- }
311
- ```
312
-
313
- ---
314
-
315
- ### Save Permissions
316
-
317
- `POST /fluent-cart/v2/settings/permissions`
318
-
319
- #### Parameters
320
-
321
- | Parameter | Type | Location | Required | Description |
322
- |-----------|------|----------|----------|-------------|
323
- | `capability` | object | body | Yes | Object mapping WordPress role slugs to capability assignments |
324
-
325
- #### Request Example
326
-
327
- ```json
328
- {
329
- "capability": {
330
- "shop_manager": {
331
- "orders/view": true,
332
- "orders/manage": true,
333
- "customers/view": true,
334
- "products/manage": false
335
- }
336
- }
337
- }
338
- ```
339
-
340
- #### Response
341
-
342
- ```json
343
- {
344
- "message": "Permissions saved successfully"
345
- }
346
- ```
347
-
348
- ---
349
-
350
- ## Store Settings
351
-
352
- Manage global store configuration (currency, store details, pages, button labels, checkout style, invoice prefixes, themes).
353
-
354
- **Prefix:** `/fluent-cart/v2/settings/store` | **Policy:** `StoreSettingsPolicy` (`store/settings`)
355
-
356
- ### Get Store Settings
357
-
358
- `GET /fluent-cart/v2/settings/store`
359
-
360
- #### Parameters
361
-
362
- | Parameter | Type | Location | Required | Description |
363
- |-----------|------|----------|----------|-------------|
364
- | `settings_name` | string | query | No | Settings tab identifier (e.g. `store_setup`, `checkout`, `pages`) |
365
-
366
- ---
367
-
368
- ### Save Store Settings
369
-
370
- `POST /fluent-cart/v2/settings/store`
371
-
372
- **Request Class:** `FluentMetaRequest` (validates input parameters)
373
-
374
- #### Parameters
375
-
376
- | Parameter | Type | Location | Required | Description |
377
- |-----------|------|----------|----------|-------------|
378
- | `settings_name` | string | body | Conditional | Tab identifier (`store_setup` enforces `store_name` & `store_country`) |
379
- | `store_name` | string | body | Conditional | Store name (max 200 chars). Required when `settings_name` is `store_setup` |
380
- | `store_country` | string | body | Conditional | ISO country code. Required when `settings_name` is `store_setup` |
381
- | `store_logo` | object | body | No | Store logo (`id`, `url`, `title`) |
382
- | `currency` | string | body | No | Store currency code (e.g., `USD`, `EUR`, `GBP`) |
383
- | `currency_position` | string | body | No | Symbol position: `before` or `after` |
384
- | `decimal_separator` | string | body | No | Decimal separator: `dot` or `comma` |
385
- | `checkout_button_text` | string | body | No | Custom text for checkout button |
386
- | `view_cart_button_text` | string | body | No | Custom text for view cart button |
387
- | `cart_button_text` | string | body | No | Custom text for add-to-cart button |
388
- | `popup_button_text` | string | body | No | Custom text for product popup button |
389
- | `out_of_stock_button_text` | string | body | No | Custom text for out-of-stock button |
390
- | `checkout_method_style` | string | body | No | Payment method display on checkout (`logo` or other) |
391
- | `enable_modal_checkout` | string | body | No | Enable modal checkout: `yes` or `no` |
392
- | `show_cart_icon_in_nav` | string | body | No | Show cart icon in navigation: `yes` or `no` |
393
- | `show_cart_icon_in_body` | string | body | No | Show floating cart icon: `yes` or `no` |
394
- | `additional_address_field` | string | body | No | Show additional address field: `yes` or `no` |
395
- | `hide_coupon_field` | string | body | No | Hide coupon input on checkout: `yes` or `no` |
396
- | `user_account_creation_mode` | string | body | No | Account creation mode: `all`, `optional`, or `disabled` |
397
- | `force_ssl` | string | body | No | Force SSL on checkout: `yes` or `no` |
398
- | `checkout_page_id` | integer | body | No | WP page ID for checkout |
399
- | `cart_page_id` | integer | body | No | WP page ID for cart |
400
- | `receipt_page_id` | integer | body | No | WP page ID for receipt |
401
- | `shop_page_id` | integer | body | No | WP page ID for shop |
402
- | `customer_profile_page_id` | integer | body | No | WP page ID for customer profile |
403
- | `customer_profile_page_slug` | string | body | No | Custom slug for customer profile page |
404
- | `registration_page_id` | integer | body | No | WP page ID for registration |
405
- | `login_page_id` | integer | body | No | WP page ID for login |
406
- | `store_address1` | string | body | No | Store address line 1 |
407
- | `store_address2` | string | body | No | Store address line 2 |
408
- | `store_city` | string | body | No | Store city |
409
- | `store_postcode` | string | body | No | Store zip/postal code |
410
- | `store_state` | string | body | No | Store state/province code |
411
- | `order_mode` | string | body | No | Order/payment mode: `test` or `live` |
412
- | `variation_view` | string | body | No | Product variation display: `both`, `grid`, `list` |
413
- | `variation_columns` | string | body | No | Variation layout: `masonry` or standard |
414
- | `enable_early_payment_for_installment` | string | body | No | Allow early installment payments: `yes` or `no` |
415
- | `product_slug` | string | body | No | Custom product URL slug |
416
- | `min_receipt_number` | string | body | No | Minimum receipt number |
417
- | `inv_prefix` | string | body | No | Invoice number prefix (e.g. `INV-`) |
418
- | `frontend_theme` | object | body | No | Theme color overrides object (hex values) |
419
-
420
- #### Example
421
-
422
- ```bash
423
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/settings/store" \
424
- -u "username:app_password" \
425
- -H "Content-Type: application/json" \
426
- -d '{
427
- "settings_name": "store_setup",
428
- "store_name": "My Awesome Store",
429
- "store_country": "US",
430
- "currency": "USD",
431
- "order_mode": "live"
432
- }'
433
- ```
434
-
435
- ---
436
-
437
- ## Feature Modules & Addons
438
-
439
- Enable/disable core modules (shipping, tax, coupons, subscriptions) and manage plugin addons (e.g. Elementor Blocks).
440
-
441
- **Prefix:** `/fluent-cart/v2/settings/modules` | **Permission:** `is_super_admin`
442
-
443
- - `GET /settings/modules/plugin-addons` — Get list of registered plugin addons.
444
- - `POST /settings/modules/plugin-addons/install` — Install plugin addon (`plugin_slug`, `source_type`: `wordpress` | `github` | `cdn`, `source_link`, `asset_path`).
445
- - `POST /settings/modules/plugin-addons/activate` — Activate plugin addon (`plugin_file`).
446
- - `GET /settings/modules` — Retrieve all module feature toggles & field schemas (filtered via `fluent_cart/module_setting/fields`).
447
- - `POST /settings/modules` — Enable or disable modules. Fires `fluent_cart/module/activated/{key}` or `fluent_cart/module/deactivated/{key}` action hooks.
448
-
449
- ---
450
-
451
- ## Confirmation Pages & Shortcodes
452
-
453
- Configure receipt page behavior and view merge tags for emails/confirmations.
454
-
455
- - `POST /fluent-cart/v2/settings/confirmation` — Update receipt page configuration (`settings.confirmation_type`: `same_page` | `custom_page`, `message_to_show` [sanitized via `wp_kses_post`], `confirmation_page_id`).
456
- - `GET /fluent-cart/v2/settings/confirmation/shortcode` — List available email & confirmation merge tags (`{{order.id}}`, `{{order.total}}`, `{{customer.email}}`, `{{store.name}}`).
457
-
458
- ---
459
-
460
- ## Storage Drivers
461
-
462
- Configure file storage providers for digital product downloads (Local server, Amazon S3, Bunny CDN, Cloudflare R2).
463
-
464
- **Prefix:** `/fluent-cart/v2/settings/storage-drivers` | **Permission:** `is_super_admin`
465
-
466
- - `GET /settings/storage-drivers` — List all registered storage drivers.
467
- - `POST /settings/storage-drivers` — Save storage driver settings (`driver`, `settings`).
468
- - `GET /settings/storage-drivers/active-drivers` — List active/enabled storage drivers.
469
- - `GET /settings/storage-drivers/{driver}` — Get settings & schema for specific driver.
470
- - `POST /settings/storage-drivers/verify-info` — Test credentials connection to storage provider without saving.
471
-
472
- ---
473
-
474
- ## Checkout Fields
475
-
476
- Manage checkout form field visibility and required rules.
477
-
478
- **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/checkout-fields`
479
- **Policy:** `StoreSensitivePolicy` (`store/sensitive`)
480
-
481
- ### Get Checkout Fields
482
-
483
- `GET /fluent-cart/v2/checkout-fields/get-fields`
484
-
485
- Retrieve field schema and current settings for basic info, billing address, and shipping address.
486
-
487
- ---
488
-
489
- ### Save Checkout Fields
490
-
491
- `POST /fluent-cart/v2/checkout-fields/save-fields`
492
-
493
- Update checkout field visibility and required flags.
494
-
495
- > **Automatic Field Logic Rules Enforced:**
496
- > - If `first_name` or `last_name` is enabled, `full_name` is automatically disabled.
497
- > - If neither `first_name` nor `last_name` is enabled, `full_name` is automatically enabled and forced to required.
498
- > - If `first_name` is enabled, it is forced to required. Same for `last_name`.
499
-
500
- #### Parameters
501
-
502
- | Parameter | Type | Location | Required | Description |
503
- |-----------|------|----------|----------|-------------|
504
- | `settings` | object | body | Yes | Field settings object (`basic_info`, `billing_address`, `shipping_address`) |
505
- | `settings.basic_info.{field}.enabled` | string | body | No | Show field: `yes` or `no` |
506
- | `settings.basic_info.{field}.required` | string | body | No | Require field: `yes` or `no` |
507
-
508
- #### Request Example
509
-
510
- ```json
511
- {
512
- "settings": {
513
- "basic_info": {
514
- "full_name": { "enabled": "no", "required": "no" },
515
- "first_name": { "enabled": "yes", "required": "yes" },
516
- "last_name": { "enabled": "yes", "required": "no" }
517
- }
518
- }
519
- }
520
- ```
521
-
522
- #### Response
523
-
524
- ```json
525
- {
526
- "message": "Checkout fields has been updated successfully."
527
- }
528
- ```
1
+ # Settings API
2
+
3
+ Configure store settings, payment gateways, feature modules, file storage drivers, checkout fields, permissions, confirmation pages, and PayPal onboarding in FluentCart.
4
+
5
+ **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/settings`
6
+ **Policy:** `StoreSettingsPolicy` (most endpoints require `is_super_admin` or `store/settings`) / `StoreSensitivePolicy` (for checkout fields)
7
+
8
+ ---
9
+
10
+ ## Endpoints Overview
11
+
12
+ | Group | Method | Endpoint | Permission / Policy | Description |
13
+ |-------|--------|----------|--------------------|-------------|
14
+ | **Payment Methods** | GET | `/settings/payment-methods` | `is_super_admin` | Retrieve gateway configuration (Stripe, PayPal, etc.) |
15
+ | | POST | `/settings/payment-methods` | `is_super_admin` | Create/update gateway configuration |
16
+ | | GET | `/settings/payment-methods/all` | `is_super_admin` | List all registered payment method gateways |
17
+ | | POST | `/settings/payment-methods/reorder` | `is_super_admin` | Set display order of payment methods at checkout |
18
+ | | GET | `/settings/payment-methods/connect/info` | `is_super_admin` | Retrieve OAuth / connect info for gateway |
19
+ | | POST | `/settings/payment-methods/disconnect` | `is_super_admin` | Disconnect gateway account (test/live mode) |
20
+ | | POST | `/settings/payment-methods/design` | `is_super_admin` | Save checkout label, logo, & instructions |
21
+ | | POST | `/settings/payment-methods/install-addon` | `is_super_admin` | Install payment gateway addon plugin |
22
+ | | POST | `/settings/payment-methods/activate-addon` | `is_super_admin` | Activate payment gateway addon plugin |
23
+ | **PayPal Config** | POST | `/settings/payment-methods/paypal/seller-auth-token` | `super_admin` | Exchange PayPal OAuth code for seller token |
24
+ | | POST | `/settings/payment-methods/paypal/webhook/setup` | `super_admin` | Register PayPal payment webhook |
25
+ | | GET | `/settings/payment-methods/paypal/webhook/check` | `super_admin` | Verify PayPal webhook registration status |
26
+ | **Permissions** | GET | `/settings/permissions` | `is_super_admin` | Retrieve role-to-capability permission mappings |
27
+ | | POST | `/settings/permissions` | `is_super_admin` | Update role-to-capability permission mappings |
28
+ | **Store Settings** | GET | `/settings/store` | `store/settings` | Retrieve store configuration & field schema |
29
+ | | POST | `/settings/store` | `store/settings` (`FluentMetaRequest`) | Update store configuration settings |
30
+ | **Modules** | GET | `/settings/modules/plugin-addons` | `is_super_admin` | List registered plugin addons (Elementor, etc.) |
31
+ | | POST | `/settings/modules/plugin-addons/install` | `is_super_admin` | Install plugin addon |
32
+ | | POST | `/settings/modules/plugin-addons/activate` | `is_super_admin` | Activate plugin addon |
33
+ | | GET | `/settings/modules` | `is_super_admin` | List feature toggles & field schema |
34
+ | | POST | `/settings/modules` | `is_super_admin` | Enable/disable modules & update settings |
35
+ | **Confirmation** | POST | `/settings/confirmation` | `is_super_admin` | Update receipt/confirmation page settings |
36
+ | | GET | `/settings/confirmation/shortcode` | `is_super_admin` | Get available shortcodes / merge tags |
37
+ | **Storage Drivers** | GET | `/settings/storage-drivers` | `is_super_admin` | List all file storage drivers (Local, S3, CDN) |
38
+ | | POST | `/settings/storage-drivers` | `is_super_admin` | Save storage driver configuration |
39
+ | | GET | `/settings/storage-drivers/active-drivers` | `is_super_admin` | List active/enabled storage drivers |
40
+ | | GET | `/settings/storage-drivers/{driver}` | `is_super_admin` | Get configuration for specific driver |
41
+ | | POST | `/settings/storage-drivers/verify-info` | `is_super_admin` | Test storage driver credentials connection |
42
+ | **Checkout Fields** | GET | `/checkout-fields/get-fields` | `store/sensitive` | Get checkout field schema & settings |
43
+ | | POST | `/checkout-fields/save-fields` | `store/sensitive` | Update checkout field visibility & required rules |
44
+
45
+ ---
46
+
47
+ ## Payment Methods
48
+
49
+ Configure payment gateways (Stripe, PayPal, Cash on Delivery, etc.), gateway reordering, designs, and addon plugins.
50
+
51
+ **Prefix:** `/fluent-cart/v2/settings/payment-methods` | **Permission:** `is_super_admin`
52
+
53
+ ### Get Payment Method Settings
54
+
55
+ `GET /fluent-cart/v2/settings/payment-methods`
56
+
57
+ Retrieve configuration settings for a specific payment method.
58
+
59
+ #### Parameters
60
+
61
+ | Parameter | Type | Location | Required | Description |
62
+ |-----------|------|----------|----------|-------------|
63
+ | `method` | string | query | Yes | Payment method key (e.g., `stripe`, `paypal`, `cod`) |
64
+
65
+ #### Response
66
+
67
+ ```json
68
+ {
69
+ "settings": {
70
+ "is_active": "yes",
71
+ "payment_mode": "live",
72
+ "checkout_label": "Pay with Stripe",
73
+ "checkout_logo": "https://example.com/stripe-logo.png",
74
+ "checkout_instructions": "",
75
+ "thank_you_page_instructions": ""
76
+ },
77
+ "fields": {}
78
+ }
79
+ ```
80
+
81
+ #### Example
82
+
83
+ ```bash
84
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/settings/payment-methods?method=stripe" \
85
+ -u "username:app_password"
86
+ ```
87
+
88
+ ---
89
+
90
+ ### Save Payment Method Settings
91
+
92
+ `POST /fluent-cart/v2/settings/payment-methods`
93
+
94
+ Create or update gateway configuration.
95
+
96
+ #### Parameters
97
+
98
+ | Parameter | Type | Location | Required | Description |
99
+ |-----------|------|----------|----------|-------------|
100
+ | `method` | string | body | Yes | Payment method key (e.g., `stripe`, `paypal`, `cod`) |
101
+ | `settings` | object | body | Yes | Key-value object of gateway-specific settings to save |
102
+
103
+ #### Request Example
104
+
105
+ ```json
106
+ {
107
+ "method": "cod",
108
+ "settings": {
109
+ "is_active": "yes",
110
+ "checkout_label": "Cash on Delivery"
111
+ }
112
+ }
113
+ ```
114
+
115
+ #### Response
116
+
117
+ ```json
118
+ {
119
+ "settings": {
120
+ "is_active": "yes",
121
+ "checkout_label": "Cash on Delivery"
122
+ },
123
+ "message": "Settings saved successfully"
124
+ }
125
+ ```
126
+
127
+ ---
128
+
129
+ ### List All Payment Methods
130
+
131
+ `GET /fluent-cart/v2/settings/payment-methods/all`
132
+
133
+ Retrieve all registered payment method gateways categorized by availability status (available first, then Pro required, then upcoming).
134
+
135
+ #### Response
136
+
137
+ ```json
138
+ {
139
+ "gateways": [
140
+ {
141
+ "method_key": "stripe",
142
+ "title": "Stripe",
143
+ "is_active": "yes",
144
+ "description": "Accept payments via Stripe",
145
+ "logo": "https://...",
146
+ "upcoming": false
147
+ },
148
+ {
149
+ "method_key": "paypal",
150
+ "title": "PayPal",
151
+ "is_active": "no",
152
+ "requires_pro": true
153
+ }
154
+ ]
155
+ }
156
+ ```
157
+
158
+ ---
159
+
160
+ ### Reorder Payment Methods
161
+
162
+ `POST /fluent-cart/v2/settings/payment-methods/reorder`
163
+
164
+ Set the display order of payment methods on the checkout page.
165
+
166
+ #### Parameters
167
+
168
+ | Parameter | Type | Location | Required | Description |
169
+ |-----------|------|----------|----------|-------------|
170
+ | `order` | array | body | Yes | Ordered array of payment method keys (e.g. `["stripe", "paypal", "cod"]`) |
171
+
172
+ #### Request Example
173
+
174
+ ```json
175
+ {
176
+ "order": ["stripe", "paypal", "cod"]
177
+ }
178
+ ```
179
+
180
+ #### Response
181
+
182
+ ```json
183
+ {
184
+ "message": "Payment methods order saved successfully",
185
+ "order": ["stripe", "paypal", "cod"]
186
+ }
187
+ ```
188
+
189
+ ---
190
+
191
+ ### Get Payment Method Connection Info
192
+
193
+ `GET /fluent-cart/v2/settings/payment-methods/connect/info`
194
+
195
+ Retrieve connection info (OAuth URLs, account status) for OAuth-based payment gateways (Stripe Connect, PayPal Connect).
196
+
197
+ #### Parameters
198
+
199
+ | Parameter | Type | Location | Required | Description |
200
+ |-----------|------|----------|----------|-------------|
201
+ | `method` | string | query | Yes | Payment method key (e.g. `stripe`, `paypal`) |
202
+
203
+ #### Response
204
+
205
+ ```json
206
+ {
207
+ "connect_config": {
208
+ "test_redirect": "https://example.com/wp-admin/?fluent-cart=...",
209
+ "live_redirect": "https://example.com/wp-admin/?fluent-cart=...",
210
+ "disconnect_note": "Disconnecting will prevent..."
211
+ },
212
+ "test_account": {},
213
+ "live_account": {},
214
+ "settings": {}
215
+ }
216
+ ```
217
+
218
+ ---
219
+
220
+ ### Disconnect Payment Method
221
+
222
+ `POST /fluent-cart/v2/settings/payment-methods/disconnect`
223
+
224
+ Disconnect a connected gateway account.
225
+
226
+ #### Parameters
227
+
228
+ | Parameter | Type | Location | Required | Description |
229
+ |-----------|------|----------|----------|-------------|
230
+ | `method` | string | body | Yes | Payment method key (e.g., `stripe`, `paypal`) |
231
+ | `mode` | string | body | Yes | Environment mode: `test` or `live` |
232
+
233
+ #### Response
234
+
235
+ ```json
236
+ {
237
+ "message": "PayPal settings has been disconnected",
238
+ "settings": {}
239
+ }
240
+ ```
241
+
242
+ ---
243
+
244
+ ### Save Payment Method Design
245
+
246
+ `POST /fluent-cart/v2/settings/payment-methods/design`
247
+
248
+ Customize checkout label, logo, and instructions for a gateway.
249
+
250
+ #### Parameters
251
+
252
+ | Parameter | Type | Location | Required | Description |
253
+ |-----------|------|----------|----------|-------------|
254
+ | `method` | string | body | Yes | Payment method key |
255
+ | `checkout_label` | string | body | No | Custom label displayed on checkout form |
256
+ | `checkout_logo` | string | body | No | URL to custom logo image |
257
+ | `checkout_instructions` | string | body | No | HTML instructions shown on checkout form when selected |
258
+ | `thank_you_page_instructions` | string | body | No | HTML instructions shown on thank-you receipt page |
259
+
260
+ ---
261
+
262
+ ### Install & Activate Payment Addons
263
+
264
+ - `POST /fluent-cart/v2/settings/payment-methods/install-addon` — Install gateway addon (`plugin_slug`, `source_type`: `wordpress` | `github`, `source_link`).
265
+ - `POST /fluent-cart/v2/settings/payment-methods/activate-addon` — Activate installed gateway addon (`plugin_file`: `fluent-cart-pro/fluent-cart-pro.php`).
266
+
267
+ ---
268
+
269
+ ## PayPal Configuration
270
+
271
+ Endpoints for PayPal Connect OAuth onboarding and webhook registration.
272
+
273
+ **Policy:** `AdminPolicy` | **Permission:** `super_admin`
274
+
275
+ - `POST /fluent-cart/v2/settings/payment-methods/paypal/seller-auth-token` — Exchange OAuth auth code (`authCode`, `sharedId`, `mode`: `test` | `live`). Saves credentials & auto-registers webhooks.
276
+ - `POST /fluent-cart/v2/settings/payment-methods/paypal/webhook/setup` — Register webhook endpoint with PayPal (`mode`).
277
+ - `GET /fluent-cart/v2/settings/payment-methods/paypal/webhook/check` — Verify PayPal webhook status (`mode`).
278
+
279
+ ---
280
+
281
+ ## Permissions
282
+
283
+ Manage role-to-capability permission assignments for FluentCart administrative access.
284
+
285
+ **Prefix:** `/fluent-cart/v2/settings/permissions` | **Permission:** `is_super_admin`
286
+
287
+ ### Get Permissions
288
+
289
+ `GET /fluent-cart/v2/settings/permissions`
290
+
291
+ #### Response
292
+
293
+ ```json
294
+ {
295
+ "roles": {
296
+ "administrator": {
297
+ "name": "Administrator",
298
+ "capabilities": {
299
+ "orders/view": true,
300
+ "orders/manage": true,
301
+ "customers/view": true,
302
+ "products/manage": true
303
+ }
304
+ },
305
+ "shop_manager": {
306
+ "name": "Shop Manager",
307
+ "capabilities": {}
308
+ }
309
+ }
310
+ }
311
+ ```
312
+
313
+ ---
314
+
315
+ ### Save Permissions
316
+
317
+ `POST /fluent-cart/v2/settings/permissions`
318
+
319
+ #### Parameters
320
+
321
+ | Parameter | Type | Location | Required | Description |
322
+ |-----------|------|----------|----------|-------------|
323
+ | `capability` | object | body | Yes | Object mapping WordPress role slugs to capability assignments |
324
+
325
+ #### Request Example
326
+
327
+ ```json
328
+ {
329
+ "capability": {
330
+ "shop_manager": {
331
+ "orders/view": true,
332
+ "orders/manage": true,
333
+ "customers/view": true,
334
+ "products/manage": false
335
+ }
336
+ }
337
+ }
338
+ ```
339
+
340
+ #### Response
341
+
342
+ ```json
343
+ {
344
+ "message": "Permissions saved successfully"
345
+ }
346
+ ```
347
+
348
+ ---
349
+
350
+ ## Store Settings
351
+
352
+ Manage global store configuration (currency, store details, pages, button labels, checkout style, invoice prefixes, themes).
353
+
354
+ **Prefix:** `/fluent-cart/v2/settings/store` | **Policy:** `StoreSettingsPolicy` (`store/settings`)
355
+
356
+ ### Get Store Settings
357
+
358
+ `GET /fluent-cart/v2/settings/store`
359
+
360
+ #### Parameters
361
+
362
+ | Parameter | Type | Location | Required | Description |
363
+ |-----------|------|----------|----------|-------------|
364
+ | `settings_name` | string | query | No | Settings tab identifier (e.g. `store_setup`, `checkout`, `pages`) |
365
+
366
+ ---
367
+
368
+ ### Save Store Settings
369
+
370
+ `POST /fluent-cart/v2/settings/store`
371
+
372
+ **Request Class:** `FluentMetaRequest` (validates input parameters)
373
+
374
+ #### Parameters
375
+
376
+ | Parameter | Type | Location | Required | Description |
377
+ |-----------|------|----------|----------|-------------|
378
+ | `settings_name` | string | body | Conditional | Tab identifier (`store_setup` enforces `store_name` & `store_country`) |
379
+ | `store_name` | string | body | Conditional | Store name (max 200 chars). Required when `settings_name` is `store_setup` |
380
+ | `store_country` | string | body | Conditional | ISO country code. Required when `settings_name` is `store_setup` |
381
+ | `store_logo` | object | body | No | Store logo (`id`, `url`, `title`) |
382
+ | `currency` | string | body | No | Store currency code (e.g., `USD`, `EUR`, `GBP`) |
383
+ | `currency_position` | string | body | No | Symbol position: `before` or `after` |
384
+ | `decimal_separator` | string | body | No | Decimal separator: `dot` or `comma` |
385
+ | `checkout_button_text` | string | body | No | Custom text for checkout button |
386
+ | `view_cart_button_text` | string | body | No | Custom text for view cart button |
387
+ | `cart_button_text` | string | body | No | Custom text for add-to-cart button |
388
+ | `popup_button_text` | string | body | No | Custom text for product popup button |
389
+ | `out_of_stock_button_text` | string | body | No | Custom text for out-of-stock button |
390
+ | `checkout_method_style` | string | body | No | Payment method display on checkout (`logo` or other) |
391
+ | `enable_modal_checkout` | string | body | No | Enable modal checkout: `yes` or `no` |
392
+ | `show_cart_icon_in_nav` | string | body | No | Show cart icon in navigation: `yes` or `no` |
393
+ | `show_cart_icon_in_body` | string | body | No | Show floating cart icon: `yes` or `no` |
394
+ | `additional_address_field` | string | body | No | Show additional address field: `yes` or `no` |
395
+ | `hide_coupon_field` | string | body | No | Hide coupon input on checkout: `yes` or `no` |
396
+ | `user_account_creation_mode` | string | body | No | Account creation mode: `all`, `optional`, or `disabled` |
397
+ | `force_ssl` | string | body | No | Force SSL on checkout: `yes` or `no` |
398
+ | `checkout_page_id` | integer | body | No | WP page ID for checkout |
399
+ | `cart_page_id` | integer | body | No | WP page ID for cart |
400
+ | `receipt_page_id` | integer | body | No | WP page ID for receipt |
401
+ | `shop_page_id` | integer | body | No | WP page ID for shop |
402
+ | `customer_profile_page_id` | integer | body | No | WP page ID for customer profile |
403
+ | `customer_profile_page_slug` | string | body | No | Custom slug for customer profile page |
404
+ | `registration_page_id` | integer | body | No | WP page ID for registration |
405
+ | `login_page_id` | integer | body | No | WP page ID for login |
406
+ | `store_address1` | string | body | No | Store address line 1 |
407
+ | `store_address2` | string | body | No | Store address line 2 |
408
+ | `store_city` | string | body | No | Store city |
409
+ | `store_postcode` | string | body | No | Store zip/postal code |
410
+ | `store_state` | string | body | No | Store state/province code |
411
+ | `order_mode` | string | body | No | Order/payment mode: `test` or `live` |
412
+ | `variation_view` | string | body | No | Product variation display: `both`, `grid`, `list` |
413
+ | `variation_columns` | string | body | No | Variation layout: `masonry` or standard |
414
+ | `enable_early_payment_for_installment` | string | body | No | Allow early installment payments: `yes` or `no` |
415
+ | `product_slug` | string | body | No | Custom product URL slug |
416
+ | `min_receipt_number` | string | body | No | Minimum receipt number |
417
+ | `inv_prefix` | string | body | No | Invoice number prefix (e.g. `INV-`) |
418
+ | `frontend_theme` | object | body | No | Theme color overrides object (hex values) |
419
+
420
+ #### Example
421
+
422
+ ```bash
423
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/settings/store" \
424
+ -u "username:app_password" \
425
+ -H "Content-Type: application/json" \
426
+ -d '{
427
+ "settings_name": "store_setup",
428
+ "store_name": "My Awesome Store",
429
+ "store_country": "US",
430
+ "currency": "USD",
431
+ "order_mode": "live"
432
+ }'
433
+ ```
434
+
435
+ ---
436
+
437
+ ## Feature Modules & Addons
438
+
439
+ Enable/disable core modules (shipping, tax, coupons, subscriptions) and manage plugin addons (e.g. Elementor Blocks).
440
+
441
+ **Prefix:** `/fluent-cart/v2/settings/modules` | **Permission:** `is_super_admin`
442
+
443
+ - `GET /settings/modules/plugin-addons` — Get list of registered plugin addons.
444
+ - `POST /settings/modules/plugin-addons/install` — Install plugin addon (`plugin_slug`, `source_type`: `wordpress` | `github` | `cdn`, `source_link`, `asset_path`).
445
+ - `POST /settings/modules/plugin-addons/activate` — Activate plugin addon (`plugin_file`).
446
+ - `GET /settings/modules` — Retrieve all module feature toggles & field schemas (filtered via `fluent_cart/module_setting/fields`).
447
+ - `POST /settings/modules` — Enable or disable modules. Fires `fluent_cart/module/activated/{key}` or `fluent_cart/module/deactivated/{key}` action hooks.
448
+
449
+ ---
450
+
451
+ ## Confirmation Pages & Shortcodes
452
+
453
+ Configure receipt page behavior and view merge tags for emails/confirmations.
454
+
455
+ - `POST /fluent-cart/v2/settings/confirmation` — Update receipt page configuration (`settings.confirmation_type`: `same_page` | `custom_page`, `message_to_show` [sanitized via `wp_kses_post`], `confirmation_page_id`).
456
+ - `GET /fluent-cart/v2/settings/confirmation/shortcode` — List available email & confirmation merge tags (`{{order.id}}`, `{{order.total}}`, `{{customer.email}}`, `{{store.name}}`).
457
+
458
+ ---
459
+
460
+ ## Storage Drivers
461
+
462
+ Configure file storage providers for digital product downloads (Local server, Amazon S3, Bunny CDN, Cloudflare R2).
463
+
464
+ **Prefix:** `/fluent-cart/v2/settings/storage-drivers` | **Permission:** `is_super_admin`
465
+
466
+ - `GET /settings/storage-drivers` — List all registered storage drivers.
467
+ - `POST /settings/storage-drivers` — Save storage driver settings (`driver`, `settings`).
468
+ - `GET /settings/storage-drivers/active-drivers` — List active/enabled storage drivers.
469
+ - `GET /settings/storage-drivers/{driver}` — Get settings & schema for specific driver.
470
+ - `POST /settings/storage-drivers/verify-info` — Test credentials connection to storage provider without saving.
471
+
472
+ ---
473
+
474
+ ## Checkout Fields
475
+
476
+ Manage checkout form field visibility and required rules.
477
+
478
+ **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/checkout-fields`
479
+ **Policy:** `StoreSensitivePolicy` (`store/sensitive`)
480
+
481
+ ### Get Checkout Fields
482
+
483
+ `GET /fluent-cart/v2/checkout-fields/get-fields`
484
+
485
+ Retrieve field schema and current settings for basic info, billing address, and shipping address.
486
+
487
+ ---
488
+
489
+ ### Save Checkout Fields
490
+
491
+ `POST /fluent-cart/v2/checkout-fields/save-fields`
492
+
493
+ Update checkout field visibility and required flags.
494
+
495
+ > **Automatic Field Logic Rules Enforced:**
496
+ > - If `first_name` or `last_name` is enabled, `full_name` is automatically disabled.
497
+ > - If neither `first_name` nor `last_name` is enabled, `full_name` is automatically enabled and forced to required.
498
+ > - If `first_name` is enabled, it is forced to required. Same for `last_name`.
499
+
500
+ #### Parameters
501
+
502
+ | Parameter | Type | Location | Required | Description |
503
+ |-----------|------|----------|----------|-------------|
504
+ | `settings` | object | body | Yes | Field settings object (`basic_info`, `billing_address`, `shipping_address`) |
505
+ | `settings.basic_info.{field}.enabled` | string | body | No | Show field: `yes` or `no` |
506
+ | `settings.basic_info.{field}.required` | string | body | No | Require field: `yes` or `no` |
507
+
508
+ #### Request Example
509
+
510
+ ```json
511
+ {
512
+ "settings": {
513
+ "basic_info": {
514
+ "full_name": { "enabled": "no", "required": "no" },
515
+ "first_name": { "enabled": "yes", "required": "yes" },
516
+ "last_name": { "enabled": "yes", "required": "no" }
517
+ }
518
+ }
519
+ }
520
+ ```
521
+
522
+ #### Response
523
+
524
+ ```json
525
+ {
526
+ "message": "Checkout fields has been updated successfully."
527
+ }
528
+ ```