fluentcart-developer 3.0.0 → 3.0.2

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 (612) hide show
  1. package/LICENSE.md +26 -26
  2. package/README.md +59 -59
  3. package/dist/cards/fluentcart/templates-native.js +1087 -1087
  4. package/dist/cards/fluentcart/tools.js +2309 -2309
  5. package/dist/server.d.ts.map +1 -1
  6. package/dist/server.js +37 -1
  7. package/dist/server.js.map +1 -1
  8. package/dist/skills/fluentcart-developer/SKILL.md +108 -108
  9. package/dist/skills/fluentcart-developer/examples/README.md +30 -30
  10. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
  11. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
  12. package/dist/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +113 -113
  13. package/dist/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +148 -148
  14. package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
  15. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/README.md +22 -22
  16. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/sample-plugin-with-licensing-sdk.php +79 -79
  17. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/FluentLicensing.php +303 -303
  18. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/LicenseSettings.php +566 -566
  19. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/PluginUpdater.php +304 -304
  20. package/dist/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +61 -61
  21. package/dist/skills/fluentcart-developer/references/api/authentication.md +452 -452
  22. package/dist/skills/fluentcart-developer/references/api/coupons.md +786 -786
  23. package/dist/skills/fluentcart-developer/references/api/customers.md +889 -889
  24. package/dist/skills/fluentcart-developer/references/api/files.md +609 -609
  25. package/dist/skills/fluentcart-developer/references/api/index.md +432 -432
  26. package/dist/skills/fluentcart-developer/references/api/licensing.md +633 -633
  27. package/dist/skills/fluentcart-developer/references/api/order-bump.md +384 -384
  28. package/dist/skills/fluentcart-developer/references/api/orders.md +814 -814
  29. package/dist/skills/fluentcart-developer/references/api/products.md +866 -866
  30. package/dist/skills/fluentcart-developer/references/api/roles-permissions.md +536 -536
  31. package/dist/skills/fluentcart-developer/references/api/subscriptions.md +827 -827
  32. package/dist/skills/fluentcart-developer/references/database/index.md +44 -44
  33. package/dist/skills/fluentcart-developer/references/database/models/activity.md +178 -178
  34. package/dist/skills/fluentcart-developer/references/database/models/applied-coupon.md +291 -291
  35. package/dist/skills/fluentcart-developer/references/database/models/attribute-group.md +239 -239
  36. package/dist/skills/fluentcart-developer/references/database/models/attribute-relation.md +181 -181
  37. package/dist/skills/fluentcart-developer/references/database/models/attribute-term.md +219 -219
  38. package/dist/skills/fluentcart-developer/references/database/models/cart.md +645 -645
  39. package/dist/skills/fluentcart-developer/references/database/models/coupon.md +427 -427
  40. package/dist/skills/fluentcart-developer/references/database/models/customer-addresses.md +348 -348
  41. package/dist/skills/fluentcart-developer/references/database/models/customer-meta.md +156 -156
  42. package/dist/skills/fluentcart-developer/references/database/models/customer.md +584 -584
  43. package/dist/skills/fluentcart-developer/references/database/models/dynamic-model.md +163 -163
  44. package/dist/skills/fluentcart-developer/references/database/models/label-relationship.md +155 -155
  45. package/dist/skills/fluentcart-developer/references/database/models/label.md +153 -153
  46. package/dist/skills/fluentcart-developer/references/database/models/license-activation.md +182 -182
  47. package/dist/skills/fluentcart-developer/references/database/models/license-meta.md +163 -163
  48. package/dist/skills/fluentcart-developer/references/database/models/license-site.md +208 -208
  49. package/dist/skills/fluentcart-developer/references/database/models/license.md +640 -640
  50. package/dist/skills/fluentcart-developer/references/database/models/meta.md +233 -233
  51. package/dist/skills/fluentcart-developer/references/database/models/order-address.md +391 -391
  52. package/dist/skills/fluentcart-developer/references/database/models/order-download-permission.md +144 -144
  53. package/dist/skills/fluentcart-developer/references/database/models/order-item.md +383 -383
  54. package/dist/skills/fluentcart-developer/references/database/models/order-meta.md +303 -303
  55. package/dist/skills/fluentcart-developer/references/database/models/order-operation.md +158 -158
  56. package/dist/skills/fluentcart-developer/references/database/models/order-promotion-stat.md +175 -175
  57. package/dist/skills/fluentcart-developer/references/database/models/order-promotion.md +250 -250
  58. package/dist/skills/fluentcart-developer/references/database/models/order-tax-rate.md +172 -172
  59. package/dist/skills/fluentcart-developer/references/database/models/order-transaction.md +440 -440
  60. package/dist/skills/fluentcart-developer/references/database/models/order.md +727 -727
  61. package/dist/skills/fluentcart-developer/references/database/models/product-detail.md +397 -397
  62. package/dist/skills/fluentcart-developer/references/database/models/product-download.md +258 -258
  63. package/dist/skills/fluentcart-developer/references/database/models/product-meta.md +153 -153
  64. package/dist/skills/fluentcart-developer/references/database/models/product-variation.md +556 -556
  65. package/dist/skills/fluentcart-developer/references/database/models/product.md +580 -580
  66. package/dist/skills/fluentcart-developer/references/database/models/relationships.md +427 -427
  67. package/dist/skills/fluentcart-developer/references/database/models/scheduled-action.md +175 -175
  68. package/dist/skills/fluentcart-developer/references/database/models/shipping-class.md +148 -148
  69. package/dist/skills/fluentcart-developer/references/database/models/shipping-method.md +280 -280
  70. package/dist/skills/fluentcart-developer/references/database/models/shipping-zone.md +205 -205
  71. package/dist/skills/fluentcart-developer/references/database/models/subscription-meta.md +173 -173
  72. package/dist/skills/fluentcart-developer/references/database/models/subscription.md +528 -528
  73. package/dist/skills/fluentcart-developer/references/database/models/tax-class.md +195 -195
  74. package/dist/skills/fluentcart-developer/references/database/models/tax-rate.md +225 -225
  75. package/dist/skills/fluentcart-developer/references/database/models/user-meta.md +166 -166
  76. package/dist/skills/fluentcart-developer/references/database/models/user.md +220 -220
  77. package/dist/skills/fluentcart-developer/references/database/models.md +404 -404
  78. package/dist/skills/fluentcart-developer/references/database/query-builder.md +860 -860
  79. package/dist/skills/fluentcart-developer/references/database/readme.md +276 -276
  80. package/dist/skills/fluentcart-developer/references/database/schema.md +1002 -1002
  81. package/dist/skills/fluentcart-developer/references/engineering/adding-custom-pages-to-the-customer-dashboard.md +395 -395
  82. package/dist/skills/fluentcart-developer/references/engineering/index.md +4 -4
  83. package/dist/skills/fluentcart-developer/references/engineering.md +4 -4
  84. package/dist/skills/fluentcart-developer/references/getting-started.md +249 -249
  85. package/dist/skills/fluentcart-developer/references/guides/frontend.md +519 -519
  86. package/dist/skills/fluentcart-developer/references/guides/index.md +107 -107
  87. package/dist/skills/fluentcart-developer/references/guides/integrations.md +600 -600
  88. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/index.md +237 -237
  89. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/labels-and-tracking.md +481 -481
  90. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/live-rates.md +269 -269
  91. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/reference.md +223 -223
  92. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/settings.md +370 -370
  93. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier.md +237 -237
  94. package/dist/skills/fluentcart-developer/references/guides/subscriptions.md +217 -217
  95. package/dist/skills/fluentcart-developer/references/hooks/actions/admin-and-templates.md +1079 -1079
  96. package/dist/skills/fluentcart-developer/references/hooks/actions/cart-and-checkout.md +1795 -1795
  97. package/dist/skills/fluentcart-developer/references/hooks/actions/customers-and-users.md +327 -327
  98. package/dist/skills/fluentcart-developer/references/hooks/actions/licenses.md +829 -829
  99. package/dist/skills/fluentcart-developer/references/hooks/actions/modules.md +81 -81
  100. package/dist/skills/fluentcart-developer/references/hooks/actions/orders.md +757 -757
  101. package/dist/skills/fluentcart-developer/references/hooks/actions/payments-and-integrations.md +1163 -1163
  102. package/dist/skills/fluentcart-developer/references/hooks/actions/pro-modules.md +219 -219
  103. package/dist/skills/fluentcart-developer/references/hooks/actions/products-and-coupons.md +1019 -1019
  104. package/dist/skills/fluentcart-developer/references/hooks/actions/subscriptions.md +1290 -1290
  105. package/dist/skills/fluentcart-developer/references/hooks/actions.md +16 -16
  106. package/dist/skills/fluentcart-developer/references/hooks/deprecated.md +60 -60
  107. package/dist/skills/fluentcart-developer/references/hooks/filters/cart-and-checkout.md +2032 -2032
  108. package/dist/skills/fluentcart-developer/references/hooks/filters/customers-and-subscriptions.md +1746 -1746
  109. package/dist/skills/fluentcart-developer/references/hooks/filters/integrations-and-advanced.md +2439 -2439
  110. package/dist/skills/fluentcart-developer/references/hooks/filters/modules.md +464 -464
  111. package/dist/skills/fluentcart-developer/references/hooks/filters/orders-and-payments.md +2658 -2658
  112. package/dist/skills/fluentcart-developer/references/hooks/filters/pro-modules.md +502 -502
  113. package/dist/skills/fluentcart-developer/references/hooks/filters/products-and-pricing.md +1785 -1785
  114. package/dist/skills/fluentcart-developer/references/hooks/filters/settings-and-configuration.md +2966 -2966
  115. package/dist/skills/fluentcart-developer/references/hooks/filters.md +14 -14
  116. package/dist/skills/fluentcart-developer/references/hooks/index.md +35 -35
  117. package/dist/skills/fluentcart-developer/references/index.md +625 -625
  118. package/dist/skills/fluentcart-developer/references/modules/fee-system.md +427 -427
  119. package/dist/skills/fluentcart-developer/references/modules/ghost-product-selling.md +440 -440
  120. package/dist/skills/fluentcart-developer/references/modules/index.md +484 -484
  121. package/dist/skills/fluentcart-developer/references/modules/licensing.md +342 -342
  122. package/dist/skills/fluentcart-developer/references/modules/order-bump.md +433 -433
  123. package/dist/skills/fluentcart-developer/references/modules/payment-methods.md +129 -129
  124. package/dist/skills/fluentcart-developer/references/modules/refunds.md +170 -170
  125. package/dist/skills/fluentcart-developer/references/modules/shipping.md +846 -846
  126. package/dist/skills/fluentcart-developer/references/modules/storage.md +986 -986
  127. package/dist/skills/fluentcart-developer/references/modules/subscription-vendor-ids.md +186 -186
  128. package/dist/skills/fluentcart-developer/references/modules/subscriptions.md +678 -678
  129. package/dist/skills/fluentcart-developer/references/payment-methods-integration/index.md +164 -164
  130. package/dist/skills/fluentcart-developer/references/payment-methods-integration/paddle-example.md +1648 -1648
  131. package/dist/skills/fluentcart-developer/references/payment-methods-integration/payment/setting/fields.md +353 -353
  132. package/dist/skills/fluentcart-developer/references/payment-methods-integration/quick-implementation.md +1079 -1079
  133. package/dist/skills/fluentcart-developer/references/payment-methods-integration.md +164 -164
  134. package/dist/skills/fluentcart-developer/references/restapi/checkout.md +573 -573
  135. package/dist/skills/fluentcart-developer/references/restapi/coupons.md +958 -958
  136. package/dist/skills/fluentcart-developer/references/restapi/customer-profile.md +1423 -1423
  137. package/dist/skills/fluentcart-developer/references/restapi/customers.md +1103 -1103
  138. package/dist/skills/fluentcart-developer/references/restapi/dashboard.md +1083 -1083
  139. package/dist/skills/fluentcart-developer/references/restapi/data-export.md +132 -132
  140. package/dist/skills/fluentcart-developer/references/restapi/email-notifications.md +846 -846
  141. package/dist/skills/fluentcart-developer/references/restapi/files.md +313 -313
  142. package/dist/skills/fluentcart-developer/references/restapi/index.md +127 -127
  143. package/dist/skills/fluentcart-developer/references/restapi/integrations.md +1000 -1000
  144. package/dist/skills/fluentcart-developer/references/restapi/inventory.md +192 -192
  145. package/dist/skills/fluentcart-developer/references/restapi/labels-and-attributes.md +797 -797
  146. package/dist/skills/fluentcart-developer/references/restapi/licensing.md +1733 -1733
  147. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-available-shipping-methods.md +30 -30
  148. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-checkout-summary.md +28 -28
  149. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-country-info.md +29 -29
  150. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-order-info.md +28 -28
  151. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-shipping-methods-list-view.md +30 -30
  152. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/login.md +66 -66
  153. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/place-order.md +179 -179
  154. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/apply-coupon.md +83 -83
  155. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/cancel-coupon.md +87 -87
  156. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/check-product-eligibility.md +59 -59
  157. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/create-coupon.md +230 -230
  158. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/delete-coupon.md +29 -29
  159. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon-settings.md +20 -20
  160. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon.md +27 -27
  161. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupon-codes.md +20 -20
  162. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupons.md +37 -37
  163. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/re-apply-coupons.md +75 -75
  164. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/store-coupon-settings.md +40 -40
  165. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/update-coupon.md +133 -133
  166. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-address-checkout.md +138 -138
  167. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-profile-address.md +119 -119
  168. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/dashboard-overview.md +22 -22
  169. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/delete-profile-address.md +46 -46
  170. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-order-details.md +30 -30
  171. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-portal-sections.md +29 -29
  172. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-profile-details.md +22 -22
  173. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-transaction-billing-address.md +30 -30
  174. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-upgrade-paths.md +31 -31
  175. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-downloads.md +29 -29
  176. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-orders.md +28 -28
  177. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/make-profile-address-primary.md +55 -55
  178. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/pause-subscription.md +29 -29
  179. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/resume-subscription.md +29 -29
  180. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/save-transaction-billing-address.md +92 -92
  181. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/select-address-for-checkout.md +32 -32
  182. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-address.md +115 -115
  183. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-details.md +69 -69
  184. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/attach-user.md +50 -50
  185. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/bulk-actions.md +65 -65
  186. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-address.md +135 -135
  187. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-customer.md +108 -108
  188. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/delete-address.md +62 -62
  189. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/detach-user.md +28 -28
  190. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/find-customer-order.md +27 -27
  191. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-attachable-users.md +20 -20
  192. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-addresses.md +28 -28
  193. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-orders.md +37 -37
  194. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-stats.md +27 -27
  195. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer.md +32 -32
  196. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/list-customers.md +37 -37
  197. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/recalculate-ltv.md +28 -28
  198. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/set-primary-address.md +72 -72
  199. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-additional-info.md +55 -55
  200. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-address.md +144 -144
  201. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-customer.md +123 -123
  202. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/attach-note-to-order.md +49 -49
  203. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-all-pages.md +21 -21
  204. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-single-page.md +55 -55
  205. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/delete-activity.md +28 -28
  206. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-country-info.md +29 -29
  207. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-dashboard-stats.md +22 -22
  208. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-filter-options.md +31 -31
  209. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-data.md +20 -20
  210. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-settings.md +20 -20
  211. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-print-templates.md +20 -20
  212. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-search-options.md +27 -27
  213. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-widgets.md +28 -28
  214. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/initialize-app.md +20 -20
  215. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-activities.md +33 -33
  216. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-attachments.md +21 -21
  217. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-countries.md +20 -20
  218. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/mark-activity-read.md +53 -53
  219. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/run-data-backfills.md +21 -21
  220. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-settings.md +54 -54
  221. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-tax-settings.md +73 -73
  222. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-print-templates.md +64 -64
  223. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/upload-attachment.md +42 -42
  224. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-customers-batch.md +129 -129
  225. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-licenses-batch.md +133 -133
  226. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-orders-batch.md +129 -129
  227. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-subscriptions-batch.md +129 -129
  228. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-customers-export-schema.md +21 -21
  229. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-licenses-export-schema.md +26 -26
  230. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-orders-export-schema.md +21 -21
  231. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-subscriptions-export-schema.md +21 -21
  232. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/enable-notification.md +57 -57
  233. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-digest-settings.md +22 -22
  234. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-notification.md +30 -30
  235. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-reminders.md +22 -22
  236. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-settings.md +22 -22
  237. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-shortcodes.md +22 -22
  238. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/list-notifications.md +20 -20
  239. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-default-template.md +66 -66
  240. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-notification.md +50 -50
  241. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-digest-settings.md +101 -101
  242. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-reminders.md +162 -162
  243. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-settings.md +99 -99
  244. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-digest-test.md +47 -47
  245. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-manual-reminder.md +51 -51
  246. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/update-notification.md +93 -93
  247. package/dist/skills/fluentcart-developer/references/restapi/operations/files/delete-file.md +31 -31
  248. package/dist/skills/fluentcart-developer/references/restapi/operations/files/get-bucket-list.md +28 -28
  249. package/dist/skills/fluentcart-developer/references/restapi/operations/files/list-files.md +30 -30
  250. package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-editor-file.md +32 -32
  251. package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-file.md +34 -34
  252. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/chained-data-request.md +46 -46
  253. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/change-feed-status.md +51 -51
  254. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/delete-feed.md +27 -27
  255. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-dynamic-options.md +29 -29
  256. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-lists.md +27 -27
  257. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-settings.md +27 -27
  258. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-feeds.md +20 -20
  259. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-settings.md +26 -26
  260. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/install-addon-plugin.md +49 -49
  261. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/list-addons.md +20 -20
  262. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/save-feed-settings.md +52 -52
  263. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/set-global-settings.md +50 -50
  264. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/bulk-update-stock.md +94 -94
  265. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/export-inventory.md +81 -81
  266. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-adjustment-history.md +26 -26
  267. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-inventory-stats.md +21 -21
  268. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/list-inventory.md +33 -33
  269. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/update-stock.md +75 -75
  270. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-attribute-group.md +31 -31
  271. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-label.md +31 -31
  272. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-terms.md +90 -90
  273. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-group.md +28 -28
  274. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-term.md +29 -29
  275. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-group.md +28 -28
  276. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-library.md +20 -20
  277. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-groups.md +32 -32
  278. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-terms.md +33 -33
  279. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-labels.md +20 -20
  280. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-groups.md +51 -51
  281. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-terms.md +56 -56
  282. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-group.md +37 -37
  283. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-term.md +39 -39
  284. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-label-selections.md +32 -32
  285. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-plugin-license.md +41 -41
  286. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-site-admin.md +60 -60
  287. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-plugin-license.md +18 -18
  288. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-admin.md +67 -67
  289. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-customer.md +47 -47
  290. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/delete-license.md +24 -24
  291. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/extend-license-validity.md +47 -47
  292. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-license-details.md +25 -25
  293. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-licenses-admin.md +26 -26
  294. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-activations.md +25 -25
  295. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-details.md +25 -25
  296. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-site.md +30 -30
  297. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-plugin-license-status.md +18 -18
  298. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-product-license-settings.md +24 -24
  299. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-customer-licenses.md +25 -25
  300. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-license-sites.md +33 -33
  301. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-licenses.md +38 -38
  302. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-activate-license.md +54 -54
  303. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-check-license.md +26 -26
  304. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-deactivate-license.md +46 -46
  305. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-download-license-package.md +23 -23
  306. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-get-license-version.md +26 -26
  307. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/regenerate-license-key.md +24 -24
  308. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/save-product-license-settings.md +193 -193
  309. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-activation-limit.md +53 -53
  310. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-status.md +52 -52
  311. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/create-order-bump.md +47 -47
  312. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/delete-order-bump.md +25 -25
  313. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/get-order-bump.md +25 -25
  314. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/list-order-bumps.md +29 -29
  315. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/update-order-bump.md +141 -141
  316. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/accept-dispute.md +47 -47
  317. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/bulk-actions.md +72 -72
  318. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-shipping.md +67 -67
  319. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-tax.md +98 -98
  320. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/change-customer.md +50 -50
  321. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/charge-now.md +29 -29
  322. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-and-change-customer.md +92 -92
  323. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-custom-order-item.md +68 -68
  324. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-order.md +351 -351
  325. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-renewal-now.md +29 -29
  326. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/delete-order.md +28 -28
  327. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/generate-missing-licenses.md +29 -29
  328. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order-transactions.md +27 -27
  329. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order.md +27 -27
  330. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-renewal.md +28 -28
  331. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-shipping-methods.md +28 -28
  332. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-single-transaction.md +28 -28
  333. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-order-currencies.md +22 -22
  334. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-orders.md +42 -42
  335. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-renewals.md +28 -28
  336. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/mark-as-paid.md +61 -61
  337. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/price-order.md +135 -135
  338. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/refund-order.md +72 -72
  339. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/resend-renewal-invoice.md +29 -29
  340. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/skip-renewal.md +48 -48
  341. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-order-statuses.md +28 -28
  342. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-pending-transaction.md +29 -29
  343. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address-id.md +60 -60
  344. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address.md +98 -98
  345. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order.md +172 -172
  346. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-statuses.md +77 -77
  347. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-subscription-details.md +84 -84
  348. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-transaction-status.md +51 -51
  349. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/void-renewal.md +30 -30
  350. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/create-pdf-template.md +42 -42
  351. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/delete-pdf-template.md +26 -26
  352. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/download-pdf-preview.md +44 -44
  353. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-factory-default-templates.md +19 -19
  354. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-status.md +21 -21
  355. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-template.md +26 -26
  356. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-saved-templates.md +21 -21
  357. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-seller-details.md +19 -19
  358. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/list-pdf-templates.md +19 -19
  359. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-pdf-template.md +53 -53
  360. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-seller-details.md +97 -97
  361. package/dist/skills/fluentcart-developer/references/restapi/operations/products/add-product-terms.md +64 -64
  362. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-edit-fetch.md +30 -30
  363. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-insert-products.md +62 -62
  364. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-products.md +59 -59
  365. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-variants.md +83 -83
  366. package/dist/skills/fluentcart-developer/references/restapi/operations/products/change-integration-status.md +64 -64
  367. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-dummy-products.md +45 -45
  368. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-product.md +81 -81
  369. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-variation.md +181 -181
  370. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-downloadable-file.md +27 -27
  371. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product-integration.md +30 -30
  372. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product.md +27 -27
  373. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-taxonomy-term.md +55 -55
  374. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-upgrade-path.md +27 -27
  375. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-variation.md +27 -27
  376. package/dist/skills/fluentcart-developer/references/restapi/operations/products/do-bulk-action.md +56 -56
  377. package/dist/skills/fluentcart-developer/references/restapi/operations/products/duplicate-product.md +56 -56
  378. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-products-by-ids.md +26 -26
  379. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-taxonomy-terms.md +20 -20
  380. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-terms-by-parent.md +60 -60
  381. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-variations-by-ids.md +26 -26
  382. package/dist/skills/fluentcart-developer/references/restapi/operations/products/find-subscription-variants.md +26 -26
  383. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-bundle-info.md +27 -27
  384. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-downloadable-url.md +27 -27
  385. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-max-excerpt-word-count.md +20 -20
  386. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-pricing-widgets.md +27 -27
  387. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-feeds.md +29 -29
  388. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-settings.md +31 -31
  389. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-pricing.md +28 -28
  390. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product.md +28 -28
  391. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-related-products.md +31 -31
  392. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-upgrade-settings.md +27 -27
  393. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-variation-upgrade-paths.md +28 -28
  394. package/dist/skills/fluentcart-developer/references/restapi/operations/products/group-bulk-update-variants.md +103 -103
  395. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-all-variants.md +26 -26
  396. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-product-variations.md +26 -26
  397. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-products.md +34 -34
  398. package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-shipping-class.md +27 -27
  399. package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-tax-class.md +27 -27
  400. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-bundle-info.md +56 -56
  401. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-product-integration.md +62 -62
  402. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-upgrade-path.md +78 -78
  403. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-product-variant-options.md +29 -29
  404. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-products-by-name.md +28 -28
  405. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-variants-by-name.md +28 -28
  406. package/dist/skills/fluentcart-developer/references/restapi/operations/products/set-variation-media.md +74 -74
  407. package/dist/skills/fluentcart-developer/references/restapi/operations/products/suggest-sku.md +28 -28
  408. package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-downloadable-files.md +134 -134
  409. package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-taxonomy-terms.md +61 -61
  410. package/dist/skills/fluentcart-developer/references/restapi/operations/products/toggle-product-tax-exemption.md +56 -56
  411. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-downloadable-file.md +98 -98
  412. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-inventory.md +56 -56
  413. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-long-desc-editor-mode.md +49 -49
  414. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-manage-stock.md +53 -53
  415. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-detail.md +58 -58
  416. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-pricing.md +225 -225
  417. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-shipping-class.md +49 -49
  418. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-tax-class.md +49 -49
  419. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-upgrade-path.md +78 -78
  420. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-option.md +79 -79
  421. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-tax-exemption.md +56 -56
  422. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation-pricing-table.md +49 -49
  423. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation.md +105 -105
  424. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/get-product-views.md +34 -34
  425. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/list-products.md +42 -42
  426. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/search-products.md +30 -30
  427. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/channel-rules.md +24 -24
  428. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/country-heat-map.md +22 -22
  429. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupon-overview.md +37 -37
  430. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupons.md +36 -36
  431. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-insights.md +31 -31
  432. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-overview.md +36 -36
  433. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-repeat.md +35 -35
  434. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segment-customers.md +36 -36
  435. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segments.md +30 -30
  436. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-value.md +34 -34
  437. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/dashboard-stats.md +30 -30
  438. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/failed-orders.md +34 -34
  439. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-new-vs-returning-customer.md +34 -34
  440. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-by-day-and-hour.md +34 -34
  441. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-meta.md +29 -29
  442. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-top-sold-products.md +34 -34
  443. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/future-renewals.md +31 -31
  444. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/generate-retention-snapshots.md +24 -24
  445. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-overview.md +30 -30
  446. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-activities.md +26 -26
  447. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-orders.md +20 -20
  448. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-revenue.md +37 -37
  449. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-at-risk.md +35 -35
  450. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-variations.md +33 -33
  451. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments.md +33 -33
  452. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/item-count-distribution.md +34 -34
  453. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-chart.md +30 -30
  454. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-pie-chart.md +22 -22
  455. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-summary.md +22 -22
  456. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/locations.md +43 -43
  457. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-chart.md +37 -37
  458. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-completion-time.md +34 -34
  459. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-mix.md +34 -34
  460. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-value-distribution.md +34 -34
  461. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-disputes.md +38 -38
  462. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-methods.md +36 -36
  463. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods.md +37 -37
  464. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison-launch.md +33 -33
  465. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison.md +40 -40
  466. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-detail.md +37 -37
  467. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-sales.md +37 -37
  468. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/refunds-overview.md +37 -37
  469. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/retention-snapshots-step.md +45 -45
  470. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sales-growth-chart.md +35 -35
  471. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/save-channel-rules.md +73 -73
  472. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/source-channels.md +37 -37
  473. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sources.md +49 -49
  474. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-cohorts.md +33 -33
  475. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-health.md +30 -30
  476. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-rebuys.md +37 -37
  477. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-retention.md +34 -34
  478. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-variations.md +22 -22
  479. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscriptions-overview.md +37 -37
  480. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/weeks-between-refund.md +34 -34
  481. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/assign-role.md +48 -48
  482. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/delete-role-assignment.md +47 -47
  483. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/get-role.md +25 -25
  484. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-managers.md +18 -18
  485. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-roles.md +18 -18
  486. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/search-users.md +25 -25
  487. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/update-role.md +43 -43
  488. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/create-saved-view.md +106 -106
  489. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/delete-saved-view.md +26 -26
  490. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/list-saved-views.md +25 -25
  491. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/update-saved-view.md +83 -83
  492. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-payment-addon.md +44 -44
  493. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-plugin-addon.md +44 -44
  494. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/change-storage-driver-status.md +56 -56
  495. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/check-paypal-webhook.md +26 -26
  496. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/create-storage-bucket.md +63 -63
  497. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/disconnect-payment-method.md +55 -55
  498. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/exchange-paypal-seller-auth-token.md +62 -62
  499. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-active-storage-drivers.md +20 -20
  500. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-checkout-fields.md +22 -22
  501. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-email-shortcodes.md +20 -20
  502. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-config-snippets.md +26 -26
  503. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-status.md +20 -20
  504. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-module-settings.md +20 -20
  505. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-connection-info.md +26 -26
  506. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-settings.md +26 -26
  507. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-permissions.md +22 -22
  508. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-plugin-addons.md +20 -20
  509. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-storage-driver-settings.md +27 -27
  510. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-store-settings.md +26 -26
  511. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-mcp-adapter.md +21 -21
  512. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-payment-addon.md +60 -60
  513. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-plugin-addon.md +64 -64
  514. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-payment-methods.md +20 -20
  515. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-storage-drivers.md +20 -20
  516. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-storage-buckets.md +67 -67
  517. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reorder-payment-methods.md +55 -55
  518. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reset-storage-driver-settings.md +45 -45
  519. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-checkout-fields.md +133 -133
  520. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-confirmation-settings.md +68 -68
  521. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-module-settings.md +68 -68
  522. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-design.md +67 -67
  523. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-settings.md +58 -58
  524. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-permissions.md +68 -68
  525. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-storage-driver-settings.md +62 -62
  526. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-store-settings.md +239 -239
  527. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/setup-paypal-webhook.md +48 -48
  528. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/toggle-mcp.md +40 -40
  529. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-storage-driver-connection.md +62 -62
  530. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-turnstile-keys.md +55 -55
  531. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-class.md +73 -73
  532. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-method.md +110 -110
  533. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-zone.md +56 -56
  534. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-class.md +29 -29
  535. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-method.md +29 -29
  536. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-zone.md +29 -29
  537. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class-profile.md +30 -30
  538. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class.md +29 -29
  539. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-packages.md +22 -22
  540. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-zone.md +27 -27
  541. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-countries.md +22 -22
  542. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-states.md +28 -28
  543. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-classes.md +31 -31
  544. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-zones.md +31 -31
  545. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/save-shipping-packages.md +112 -112
  546. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-class.md +79 -79
  547. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-method.md +113 -113
  548. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-zone.md +62 -62
  549. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-zone-order.md +52 -52
  550. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-auto-renew.md +30 -30
  551. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-subscription.md +52 -52
  552. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/confirm-subscription-switch.md +70 -70
  553. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/fetch-subscription-remote.md +28 -28
  554. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/generate-early-payment-link.md +29 -29
  555. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-customer-subscription.md +27 -27
  556. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-or-create-plan.md +69 -69
  557. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-setup-intent-attempts.md +30 -30
  558. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-subscription.md +28 -28
  559. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/initiate-early-payment.md +31 -31
  560. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-customer-subscriptions.md +27 -27
  561. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-subscriptions.md +39 -39
  562. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/pause-subscription.md +28 -28
  563. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/reactivate-subscription.md +28 -28
  564. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/resume-subscription.md +28 -28
  565. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/switch-payment-method.md +70 -70
  566. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-payment-method.md +69 -69
  567. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-vendor-ids.md +56 -56
  568. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/verify-vendor-ids.md +56 -56
  569. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-class.md +51 -51
  570. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-rate.md +117 -117
  571. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-product-override.md +27 -27
  572. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-shipping-tax-override.md +27 -27
  573. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-class.md +28 -28
  574. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-rate.md +27 -27
  575. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-id.md +27 -27
  576. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-rates.md +28 -28
  577. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-eu-vat-product-overrides.md +20 -20
  578. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-oss-country-rates.md +20 -20
  579. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-preconfigured-tax-rates.md +20 -20
  580. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-product-overrides.md +27 -27
  581. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-tax-settings.md +20 -20
  582. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-all-tax-rates.md +20 -20
  583. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-classes.md +20 -20
  584. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-records.md +37 -37
  585. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/mark-taxes-as-filed.md +58 -58
  586. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/reset-eu-vat-rates.md +21 -21
  587. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-configured-countries.md +57 -57
  588. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-country-tax-id.md +50 -50
  589. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-eu-vat-cross-border-settings.md +127 -127
  590. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-oss-country-rates.md +100 -100
  591. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-product-override.md +110 -110
  592. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-shipping-tax-override.md +52 -52
  593. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-tax-settings.md +166 -166
  594. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-country-status.md +54 -54
  595. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-tax-rate.md +116 -116
  596. package/dist/skills/fluentcart-developer/references/restapi/order-bumps.md +433 -433
  597. package/dist/skills/fluentcart-developer/references/restapi/orders.md +1212 -1212
  598. package/dist/skills/fluentcart-developer/references/restapi/pdf-templates.md +212 -212
  599. package/dist/skills/fluentcart-developer/references/restapi/products.md +2485 -2485
  600. package/dist/skills/fluentcart-developer/references/restapi/public-shop.md +191 -191
  601. package/dist/skills/fluentcart-developer/references/restapi/reports.md +3773 -3773
  602. package/dist/skills/fluentcart-developer/references/restapi/roles.md +403 -403
  603. package/dist/skills/fluentcart-developer/references/restapi/saved-views.md +136 -136
  604. package/dist/skills/fluentcart-developer/references/restapi/settings.md +1423 -1423
  605. package/dist/skills/fluentcart-developer/references/restapi/shipping.md +905 -905
  606. package/dist/skills/fluentcart-developer/references/restapi/subscriptions.md +1169 -1169
  607. package/dist/skills/fluentcart-developer/references/restapi/tax.md +1551 -1551
  608. package/dist/skills/fluentcart-developer/references/restapi.md +127 -127
  609. package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
  610. package/dist/version.d.ts +1 -1
  611. package/dist/version.js +1 -1
  612. package/package.json +66 -65
@@ -1,958 +1,958 @@
1
- # Coupons API
2
-
3
- Create and manage discount coupons, apply coupons to orders, and configure coupon settings.
4
-
5
- **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/coupons`
6
-
7
- **Policy:** `CouponPolicy`
8
-
9
- > All monetary values are in **cents** (e.g., `$10.00` = `1000`).
10
-
11
- ---
12
-
13
- ## List Coupon Codes
14
-
15
- GET `/fluent-cart/v2/coupons/listCoupons`
16
-
17
- Retrieve a simple array of active coupon codes. This lightweight endpoint is designed for use in order creation forms and quick coupon lookups.
18
-
19
- - **Permission:** `orders/create` or `orders/manage` or `coupons/view`
20
-
21
- ### Response
22
-
23
- ```
24
- {
25
- "coupons": [
26
- "SAVE10",
27
- "WELCOME20",
28
- "FREESHIP"
29
- ]
30
- }
31
- ```
32
-
33
- The response returns only the `code` values of coupons with `active` status.
34
-
35
- ### Example
36
-
37
- ```
38
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/coupons/listCoupons" \
39
- -u "username:app_password"
40
- ```
41
-
42
- ---
43
-
44
- ## List Coupons (Paginated)
45
-
46
- GET `/fluent-cart/v2/coupons`
47
-
48
- Retrieve a paginated list of coupons with optional filtering, sorting, and search. Coupon statuses are automatically updated based on their start/end dates before the response is returned.
49
-
50
- - **Permission:** `coupons/view`
51
-
52
- ### Parameters
53
-
54
- | Parameter | Type | Location | Required | Description |
55
- | --- | --- | --- | --- | --- |
56
- | `page` | integer | query | No | Page number for pagination |
57
- | `per_page` | integer | query | No | Number of records per page (1-199, default: 10) |
58
- | `search` | string | query | No | Search by coupon title, code, or ID. If the search string contains `%`, it searches percentage-type coupons by amount. Numeric values also match the `amount` field (auto-converted to cents). Supports operator syntax (e.g., `status = active`, `id > 5`) |
59
- | `sort_by` | string | query | No | Column to sort by (default: `id`). Must be a fillable column on the Coupon model |
60
- | `sort_type` | string | query | No | Sort direction: `asc` or `desc` (default: `desc`) |
61
- | `active_view` | string | query | No | Tab filter. One of: `active`, `expired` |
62
- | `filter_type` | string | query | No | Filter mode: `simple` (default) or `advanced` |
63
- | `advanced_filters` | string (JSON) | query | No | JSON-encoded array of advanced filter groups (requires Pro) |
64
- | `with` | array/string | query | No | Eager-load relations |
65
- | `select` | array/string | query | No | Comma-separated list of columns to select |
66
- | `include_ids` | array/string | query | No | Comma-separated IDs that must always be included in results |
67
- | `user_tz` | string | query | No | User timezone for date filtering (e.g., `America/New_York`) |
68
-
69
- ### Active View Filters
70
-
71
- | View | Behavior |
72
- | --- | --- |
73
- | `active` | Coupons where `status = 'active'` |
74
- | `expired` | Coupons where the `end_date` has passed (and is not null/empty), or where `status != 'active'` |
75
-
76
- ### Response
77
-
78
- ```
79
- {
80
- "coupons": {
81
- "total": 25,
82
- "per_page": 10,
83
- "current_page": 1,
84
- "last_page": 3,
85
- "data": [
86
- {
87
- "id": 1,
88
- "parent": null,
89
- "title": "10% Off Everything",
90
- "code": "SAVE10",
91
- "status": "active",
92
- "type": "percentage",
93
- "conditions": {
94
- "min_purchase_amount": 5000,
95
- "max_discount_amount": 10000,
96
- "max_purchase_amount": 0,
97
- "apply_to_whole_cart": "no",
98
- "apply_to_quantity": "no",
99
- "max_uses": 100,
100
- "max_per_customer": 1,
101
- "excluded_categories": [],
102
- "included_categories": [],
103
- "excluded_products": [],
104
- "included_products": [],
105
- "email_restrictions": "",
106
- "is_recurring": "no"
107
- },
108
- "amount": 10,
109
- "stackable": "yes",
110
- "priority": 1,
111
- "use_count": 12,
112
- "notes": "",
113
- "show_on_checkout": "yes",
114
- "start_date": "2025-01-01 00:00:00",
115
- "end_date": "2025-12-31 23:59:59",
116
- "created_at": "2025-01-01 10:00:00",
117
- "updated_at": "2025-06-15 14:30:00",
118
- "total_items": 12
119
- }
120
- ]
121
- }
122
- }
123
- ```
124
-
125
- **Notes:**
126
-
127
- - `total_items` is an aggregate count of how many times this coupon has been applied (from the `fct_applied_coupons` table).
128
- - For `percentage` type coupons, `amount` represents the percentage value (e.g., `10` = 10%).
129
- - For `fixed` type coupons, `amount` is stored in **cents** (e.g., `1000` = $10.00).
130
-
131
- ### Example
132
-
133
- ```
134
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/coupons?page=1&per_page=20&search=SAVE&active_view=active" \
135
- -u "username:app_password"
136
- ```
137
-
138
- ---
139
-
140
- ## Get Coupon Settings
141
-
142
- GET `/fluent-cart/v2/coupons/getSettings`
143
-
144
- Retrieve the global coupon settings (currently, whether coupon input is shown on the checkout page).
145
-
146
- - **Permission:** `coupons/view`
147
-
148
- ### Response
149
-
150
- ```
151
- {
152
- "show_on_checkout": 1
153
- }
154
- ```
155
-
156
- | Field | Type | Description |
157
- | --- | --- | --- |
158
- | `show_on_checkout` | integer/boolean | Whether the coupon code input is displayed on the checkout page. `1` or `true` for yes, `0`, `false`, or `null` for no. |
159
-
160
- ### Example
161
-
162
- ```
163
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/coupons/getSettings" \
164
- -u "username:app_password"
165
- ```
166
-
167
- ---
168
-
169
- ## View Coupon Details
170
-
171
- GET `/fluent-cart/v2/coupons/{id}`
172
-
173
- Retrieve detailed information about a specific coupon, including its activity log. The coupon status is automatically updated to `expired` if its `end_date` has passed.
174
-
175
- - **Permission:** `coupons/view`
176
-
177
- ### Parameters
178
-
179
- | Parameter | Type | Location | Required | Description |
180
- | --- | --- | --- | --- | --- |
181
- | `id` | integer | path | Yes | The coupon ID |
182
-
183
- ### Response
184
-
185
- ```
186
- {
187
- "coupon": {
188
- "id": 1,
189
- "parent": null,
190
- "title": "10% Off Everything",
191
- "code": "SAVE10",
192
- "status": "active",
193
- "type": "percentage",
194
- "conditions": {
195
- "min_purchase_amount": 5000,
196
- "max_discount_amount": 10000,
197
- "max_purchase_amount": 0,
198
- "apply_to_whole_cart": "no",
199
- "apply_to_quantity": "no",
200
- "max_uses": 100,
201
- "max_per_customer": 1,
202
- "excluded_categories": [],
203
- "included_categories": [],
204
- "excluded_products": [],
205
- "included_products": [],
206
- "email_restrictions": "",
207
- "is_recurring": "no"
208
- },
209
- "amount": 10,
210
- "stackable": "yes",
211
- "priority": 1,
212
- "use_count": 12,
213
- "notes": "Internal note about this coupon",
214
- "show_on_checkout": "yes",
215
- "start_date": "2025-01-01 00:00:00",
216
- "end_date": "2025-12-31 23:59:59",
217
- "created_at": "2025-01-01 10:00:00",
218
- "updated_at": "2025-06-15 14:30:00",
219
- "activities": [
220
- {
221
- "id": 1,
222
- "title": "Coupon Created",
223
- "content": "Coupon \"SAVE10\" created by Admin",
224
- "status": "success",
225
- "user_id": 1,
226
- "created_at": "2025-01-01 10:00:00",
227
- "user": {
228
- "ID": 1,
229
- "display_name": "Admin"
230
- }
231
- }
232
- ]
233
- }
234
- }
235
- ```
236
-
237
- ### Example
238
-
239
- ```
240
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/coupons/1" \
241
- -u "username:app_password"
242
- ```
243
-
244
- ---
245
-
246
- ## Create Coupon
247
-
248
- POST `/fluent-cart/v2/coupons`
249
-
250
- Create a new discount coupon.
251
-
252
- - **Permission:** `coupons/manage`
253
-
254
- ### Parameters
255
-
256
- | Parameter | Type | Location | Required | Description |
257
- | --- | --- | --- | --- | --- |
258
- | `title` | string | body | Yes | Coupon display name. Max 200 characters. |
259
- | `code` | string | body | Yes | Unique coupon code. Max 50 characters. Must be unique across all coupons. |
260
- | `type` | string | body | Yes | Discount type. One of: `fixed`, `percentage`, `free_shipping`, `buy_x_get_y` |
261
- | `amount` | number | body | Yes | Discount amount. For `percentage` type: value between 0-100 (e.g., `10` for 10%). For `fixed` type: amount in store currency (e.g., `10.00` for $10). Automatically converted to cents for `fixed` type. |
262
- | `status` | string | body | Yes | Coupon status. One of: `active`, `expired`, `disabled`, `scheduled` |
263
- | `stackable` | string | body | Yes | Whether coupon can be combined with others. `yes` or `no`. Max 50 characters. |
264
- | `show_on_checkout` | string | body | Yes | Whether to display the coupon on checkout. `yes` or `no`. Max 50 characters. |
265
- | `priority` | integer | body | No | Sort priority for discount calculation order. Lower numbers are applied first. Min: 0. |
266
- | `notes` | string | body | No | Internal notes about the coupon. |
267
- | `start_date` | string | body | Conditional | Start date in any parseable datetime format. Required if `end_date` is provided. Automatically converted to GMT. |
268
- | `end_date` | string | body | No | End date in any parseable datetime format. Must be after `start_date` if provided. Automatically converted to GMT. |
269
- | `conditions` | object | body | No | Coupon conditions and restrictions (see below). |
270
-
271
- ### Conditions Object
272
-
273
- | Field | Type | Description |
274
- | --- | --- | --- |
275
- | `min_purchase_amount` | number | Minimum purchase amount in store currency (e.g., `10.00`). Automatically converted to cents. |
276
- | `max_discount_amount` | number | Maximum discount cap in store currency. Automatically converted to cents. Useful for percentage coupons. |
277
- | `max_purchase_amount` | number | Maximum purchase amount allowed. |
278
- | `apply_to_whole_cart` | string | Apply discount to the entire cart. `yes` or `no`. |
279
- | `apply_to_quantity` | string | Apply discount per quantity. `yes` or `no`. |
280
- | `max_uses` | integer | Maximum total uses across all customers. Must be greater than or equal to `max_per_customer`. |
281
- | `max_per_customer` | integer | Maximum uses per individual customer. |
282
- | `included_products` | array | Array of product IDs the coupon is limited to. |
283
- | `excluded_products` | array | Array of product IDs excluded from the coupon. |
284
- | `included_categories` | array | Array of category (term taxonomy) IDs the coupon is limited to. |
285
- | `excluded_categories` | array | Array of category (term taxonomy) IDs excluded from the coupon. |
286
- | `email_restrictions` | string | Email-based restriction. |
287
- | `is_recurring` | string | Whether the coupon applies to subscription renewals. `yes` or `no`. |
288
- | `buy_products` | array | Product IDs for the "buy" part of buy-x-get-y coupons. |
289
- | `get_products` | array | Product IDs for the "get" part of buy-x-get-y coupons. |
290
-
291
- ### Response
292
-
293
- ```
294
- {
295
- "message": "Coupon created successfully!",
296
- "data": {
297
- "id": 5,
298
- "parent": null,
299
- "title": "Summer Sale 20%",
300
- "code": "SUMMER20",
301
- "status": "active",
302
- "type": "percentage",
303
- "conditions": {
304
- "min_purchase_amount": 2000,
305
- "max_discount_amount": 5000,
306
- "max_purchase_amount": 0,
307
- "apply_to_whole_cart": "yes",
308
- "apply_to_quantity": "no",
309
- "max_uses": 500,
310
- "max_per_customer": 2,
311
- "excluded_categories": [],
312
- "included_categories": [],
313
- "excluded_products": [],
314
- "included_products": [],
315
- "email_restrictions": "",
316
- "is_recurring": "no"
317
- },
318
- "amount": 20,
319
- "stackable": "yes",
320
- "priority": 1,
321
- "use_count": 0,
322
- "notes": "",
323
- "show_on_checkout": "yes",
324
- "start_date": "2025-06-01 00:00:00",
325
- "end_date": "2025-08-31 23:59:59",
326
- "created_at": "2025-05-25 10:00:00",
327
- "updated_at": "2025-05-25 10:00:00"
328
- }
329
- }
330
- ```
331
-
332
- ### Validation Errors
333
-
334
- | Field | Rule | Message |
335
- | --- | --- | --- |
336
- | `title` | required | Title is required. |
337
- | `code` | required, unique | Code is required. / This coupon code is already in use. |
338
- | `type` | required, in:fixed,percentage,free_shipping,buy_x_get_y | Type is required. |
339
- | `amount` | required, numeric, min:0, max:100 (percentage only) | Amount is required. / For percentage type, the amount should not be greater than 100. |
340
- | `status` | required, in:active,expired,disabled,scheduled | Status is required. |
341
- | `stackable` | required | Stackable is required. |
342
- | `show_on_checkout` | required | Show on checkout is required. |
343
- | `start_date` | required_if:end_date | Start date is required. |
344
- | `end_date` | after start_date | The end date must be after the start date. |
345
- | `conditions.max_uses` | >= max_per_customer | Max uses must be greater than or equal to max per customer. |
346
-
347
- ### Hooks
348
-
349
- - `fluent_cart/coupon_created` -- Fired after a coupon is successfully created.
350
-
351
- ### Example
352
-
353
- ```
354
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons" \
355
- -u "username:app_password" \
356
- -H "Content-Type: application/json" \
357
- -d '{
358
- "title": "Summer Sale 20%",
359
- "code": "SUMMER20",
360
- "type": "percentage",
361
- "amount": 20,
362
- "status": "active",
363
- "stackable": "yes",
364
- "show_on_checkout": "yes",
365
- "priority": 1,
366
- "start_date": "2025-06-01 00:00:00",
367
- "end_date": "2025-08-31 23:59:59",
368
- "conditions": {
369
- "min_purchase_amount": 20.00,
370
- "max_discount_amount": 50.00,
371
- "max_uses": 500,
372
- "max_per_customer": 2,
373
- "apply_to_whole_cart": "yes",
374
- "is_recurring": "no"
375
- }
376
- }'
377
- ```
378
-
379
- ---
380
-
381
- ## Update Coupon
382
-
383
- PUT `/fluent-cart/v2/coupons/{id}`
384
-
385
- Update an existing coupon. Accepts the same fields as Create Coupon.
386
-
387
- - **Permission:** `coupons/manage`
388
-
389
- ### Parameters
390
-
391
- | Parameter | Type | Location | Required | Description |
392
- | --- | --- | --- | --- | --- |
393
- | `id` | integer | path | Yes | The coupon ID |
394
-
395
- The request body accepts the same fields as [Create Coupon](#create-coupon). All validation rules apply identically. The `code` uniqueness check excludes the current coupon (allowing you to keep the same code).
396
-
397
- Empty string values for `max_uses`, `max_per_customer`, `max_discount_amount`, and `min_purchase_amount` are automatically converted to `null`.
398
-
399
- ### Response
400
-
401
- ```
402
- {
403
- "message": "Coupon updated successfully!",
404
- "data": {
405
- "id": 5,
406
- "title": "Summer Sale 25%",
407
- "code": "SUMMER25",
408
- "status": "active",
409
- "type": "percentage",
410
- "amount": 25,
411
- "conditions": { ... },
412
- "stackable": "yes",
413
- "priority": 1,
414
- "use_count": 12,
415
- "notes": "",
416
- "show_on_checkout": "yes",
417
- "start_date": "2025-06-01 00:00:00",
418
- "end_date": "2025-08-31 23:59:59",
419
- "created_at": "2025-05-25 10:00:00",
420
- "updated_at": "2025-06-20 11:00:00"
421
- }
422
- }
423
- ```
424
-
425
- ### Error Responses
426
-
427
- | Code | Message |
428
- | --- | --- |
429
- | 403 | Please edit a valid coupon! |
430
- | 404 | Coupon not found, please reload the page and try again! |
431
- | 400 | Coupon update failed. |
432
-
433
- ### Hooks
434
-
435
- - `fluent_cart/coupon_updated` -- Fired after a coupon is successfully updated.
436
-
437
- ### Example
438
-
439
- ```
440
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/coupons/5" \
441
- -u "username:app_password" \
442
- -H "Content-Type: application/json" \
443
- -d '{
444
- "title": "Summer Sale 25%",
445
- "code": "SUMMER25",
446
- "type": "percentage",
447
- "amount": 25,
448
- "status": "active",
449
- "stackable": "yes",
450
- "show_on_checkout": "yes"
451
- }'
452
- ```
453
-
454
- ---
455
-
456
- ## Delete Coupon
457
-
458
- DELETE `/fluent-cart/v2/coupons/{id}`
459
-
460
- Permanently delete a coupon.
461
-
462
- - **Permission:** `coupons/delete`
463
-
464
- ### Parameters
465
-
466
- | Parameter | Type | Location | Required | Description |
467
- | --- | --- | --- | --- | --- |
468
- | `id` | integer | path/body | Yes | The coupon ID. Passed as a URL segment, but read from the request body internally. |
469
-
470
- ### Response
471
-
472
- ```
473
- {
474
- "message": "Coupon successfully deleted.",
475
- "data": ""
476
- }
477
- ```
478
-
479
- ### Error Responses
480
-
481
- | Code | Message |
482
- | --- | --- |
483
- | 403 | Please use a valid coupon ID! |
484
- | 404 | Coupon not found in database, failed to remove. |
485
- | 400 | Coupon deletion failed! |
486
-
487
- ### Example
488
-
489
- ```
490
- curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/coupons/5" \
491
- -u "username:app_password"
492
- ```
493
-
494
- ---
495
-
496
- ## Apply Coupon
497
-
498
- POST `/fluent-cart/v2/coupons/apply`
499
-
500
- Apply a coupon code to a set of order line items. This endpoint validates the coupon, checks eligibility for each line item, and returns the recalculated discount breakdown.
501
-
502
- - **Permission:** `orders/create` or `orders/manage`
503
-
504
- ### Parameters
505
-
506
- | Parameter | Type | Location | Required | Description |
507
- | --- | --- | --- | --- | --- |
508
- | `coupon_code` | string | body | Yes | The coupon code to apply. |
509
- | `order_items` | array | body | Yes | Array of order line item objects. |
510
- | `order_uuid` | string | body | No | UUID of an existing order to apply the coupon to. When provided, previously applied coupons from the order are included. Max 100 characters. |
511
- | `applied_coupons` | array | body | No | Array of coupon IDs that are already applied (but not yet persisted to the order). |
512
- | `customer_email` | string | body | No | Customer email for email-based coupon restrictions. |
513
-
514
- ### Order Item Object
515
-
516
- | Field | Type | Required | Description |
517
- | --- | --- | --- | --- |
518
- | `id` | integer | No | Line item ID (for existing orders). Min: 1. |
519
- | `order_id` | integer | No | Parent order ID. Min: 1. |
520
- | `post_id` | integer | No | Product post ID. Min: 1. |
521
- | `variation_id` | integer | No | Variation ID. Min: 1. |
522
- | `type` | string | No | Item type. Max 100 characters. |
523
- | `quantity` | integer | No | Item quantity. Min: 1. |
524
- | `title` | string | No | Item title. Max 100 characters. |
525
- | `price` | number | No | Item price in cents. |
526
- | `unit_price` | number | No | Unit price in cents. |
527
- | `item_cost` | number | No | Item cost in cents. |
528
- | `item_total` | number | No | Item total in cents. |
529
- | `tax_amount` | number | No | Tax amount in cents. |
530
- | `discount_total` | number | No | Discount total in cents. |
531
- | `total` | number | No | Total in cents. |
532
- | `line_total` | number | No | Line total in cents. |
533
- | `cart_index` | integer | No | Position in cart. |
534
- | `rate` | number | No | Tax rate. |
535
- | `line_meta` | string | No | Line item metadata. |
536
- | `other_info` | object | No | Additional item info (e.g., `payment_type`, `manage_setup_fee`, `signup_fee`). |
537
-
538
- ### Response
539
-
540
- ```
541
- {
542
- "applied_coupons": {
543
- "SAVE10": {
544
- "id": 1,
545
- "title": "10% Off",
546
- "code": "SAVE10",
547
- "type": "percentage",
548
- "amount": 10,
549
- "discount_amount": 500,
550
- "stackable": "yes",
551
- "priority": 1
552
- }
553
- },
554
- "calculated_items": [
555
- {
556
- "post_id": 42,
557
- "quantity": 2,
558
- "price": 2500,
559
- "discounted_price": 2250,
560
- "discount_total": 500
561
- }
562
- ]
563
- }
564
- ```
565
-
566
- ### Error Responses
567
-
568
- The coupon application may fail with a `WP_Error` for reasons including:
569
-
570
- - Coupon code not found
571
- - Coupon is expired or inactive
572
- - Coupon usage limit reached
573
- - Minimum purchase amount not met
574
- - Product/category not eligible
575
- - Coupon is not stackable with already-applied coupons
576
-
577
- ### Example
578
-
579
- ```
580
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/apply" \
581
- -u "username:app_password" \
582
- -H "Content-Type: application/json" \
583
- -d '{
584
- "coupon_code": "SAVE10",
585
- "order_items": [
586
- {
587
- "post_id": 42,
588
- "quantity": 2,
589
- "price": 2500,
590
- "unit_price": 2500,
591
- "item_total": 5000,
592
- "line_total": 5000,
593
- "other_info": {
594
- "payment_type": "onetime"
595
- }
596
- }
597
- ],
598
- "applied_coupons": []
599
- }'
600
- ```
601
-
602
- ---
603
-
604
- ## Cancel Coupon
605
-
606
- POST `/fluent-cart/v2/coupons/cancel`
607
-
608
- Remove a coupon from an order and recalculate the remaining discounts. If an `order_uuid` is provided and the coupon was already persisted to the order, it is deleted from the `fct_applied_coupons` table and the coupon's `use_count` is decremented.
609
-
610
- - **Permission:** `orders/create` or `orders/manage`
611
-
612
- ### Parameters
613
-
614
- | Parameter | Type | Location | Required | Description |
615
- | --- | --- | --- | --- | --- |
616
- | `coupon_code` | string | body | Yes | The coupon code to cancel. |
617
- | `order_items` | array | body | Yes | Array of current order line item objects (same structure as Apply Coupon). |
618
- | `id` | integer | body | No | The applied coupon record ID (from `fct_applied_coupons`). Required to delete the persisted record from an existing order. |
619
- | `order_uuid` | string | body | No | UUID of the existing order. Max 100 characters. |
620
- | `applied_coupons` | array | body | No | Array of remaining coupon IDs that should stay applied. |
621
- | `customer_email` | string | body | No | Customer email address. |
622
-
623
- ### Response
624
-
625
- ```
626
- {
627
- "applied_coupons": {
628
- "WELCOME5": {
629
- "id": 2,
630
- "title": "Welcome $5 Off",
631
- "code": "WELCOME5",
632
- "type": "fixed",
633
- "amount": 500,
634
- "discount_amount": 500,
635
- "stackable": "yes",
636
- "priority": 2
637
- }
638
- },
639
- "calculated_items": [
640
- {
641
- "post_id": 42,
642
- "quantity": 2,
643
- "price": 2500,
644
- "discounted_price": 2250,
645
- "discount_total": 500
646
- }
647
- ]
648
- }
649
- ```
650
-
651
- If all coupons are cancelled, `applied_coupons` will be an empty object and `calculated_items` will reflect the original prices.
652
-
653
- ### Example
654
-
655
- ```
656
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/cancel" \
657
- -u "username:app_password" \
658
- -H "Content-Type: application/json" \
659
- -d '{
660
- "coupon_code": "SAVE10",
661
- "id": 15,
662
- "order_uuid": "abc123-def456",
663
- "order_items": [
664
- {
665
- "post_id": 42,
666
- "quantity": 2,
667
- "price": 2500,
668
- "unit_price": 2500,
669
- "item_total": 5000,
670
- "line_total": 5000
671
- }
672
- ],
673
- "applied_coupons": [2]
674
- }'
675
- ```
676
-
677
- ---
678
-
679
- ## Re-apply Coupons
680
-
681
- POST `/fluent-cart/v2/coupons/re-apply`
682
-
683
- Recalculate all previously applied coupons against the current order items. This is used when order items change (e.g., quantity update, item added/removed) and discounts need to be recalculated. If `order_items` is empty, all applied coupons on the order are deleted.
684
-
685
- - **Permission:** `orders/create` or `orders/manage`
686
-
687
- ### Parameters
688
-
689
- | Parameter | Type | Location | Required | Description |
690
- | --- | --- | --- | --- | --- |
691
- | `order_uuid` | string | body | No | UUID of the existing order whose applied coupons should be reapplied. |
692
- | `order_items` | array | body | No | Array of current order line item objects. If empty, all applied coupons on the order are removed. Each item key is sanitized as text. |
693
- | `applied_coupons` | array | body | No | Array of coupon IDs to include (in addition to those already on the order). Values are cast to integers. |
694
-
695
- ### Response
696
-
697
- ```
698
- {
699
- "applied_coupons": {
700
- "SAVE10": {
701
- "id": 1,
702
- "title": "10% Off",
703
- "code": "SAVE10",
704
- "type": "percentage",
705
- "amount": 10,
706
- "discount_amount": 450,
707
- "stackable": "yes",
708
- "priority": 1
709
- }
710
- },
711
- "calculated_items": [
712
- {
713
- "post_id": 42,
714
- "quantity": 1,
715
- "price": 2500,
716
- "discounted_price": 2250,
717
- "discount_total": 250
718
- },
719
- {
720
- "post_id": 55,
721
- "quantity": 1,
722
- "price": 2000,
723
- "discounted_price": 1800,
724
- "discount_total": 200
725
- }
726
- ]
727
- }
728
- ```
729
-
730
- ### Example
731
-
732
- ```
733
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/re-apply" \
734
- -u "username:app_password" \
735
- -H "Content-Type: application/json" \
736
- -d '{
737
- "order_uuid": "abc123-def456",
738
- "order_items": [
739
- {
740
- "post_id": 42,
741
- "quantity": 1,
742
- "price": 2500,
743
- "unit_price": 2500,
744
- "item_total": 2500,
745
- "line_total": 2500
746
- },
747
- {
748
- "post_id": 55,
749
- "quantity": 1,
750
- "price": 2000,
751
- "unit_price": 2000,
752
- "item_total": 2000,
753
- "line_total": 2000
754
- }
755
- ],
756
- "applied_coupons": [1]
757
- }'
758
- ```
759
-
760
- ---
761
-
762
- ## Check Product Eligibility
763
-
764
- POST `/fluent-cart/v2/coupons/checkProductEligibility`
765
-
766
- Check whether a product is eligible for a set of applied coupons. This is used in the order form to validate that adding a product does not conflict with currently applied coupons.
767
-
768
- - **Permission:** `orders/create` or `orders/manage`
769
-
770
- ### Parameters
771
-
772
- | Parameter | Type | Location | Required | Description |
773
- | --- | --- | --- | --- | --- |
774
- | `productId` | integer | body | Yes | The product (post) ID to check eligibility for. |
775
- | `appliedCoupons` | array | body | No | Array of coupon codes currently applied. Each code is checked against the product's categories and the coupon's inclusion/exclusion rules. |
776
- | `origin` | string | body | No | The context where the check originates (e.g., `checkout`). |
777
-
778
- ### Response (Eligible)
779
-
780
- ```
781
- {
782
- "isApplicable": true
783
- }
784
- ```
785
-
786
- ### Response (Not Eligible)
787
-
788
- ```
789
- {
790
- "isApplicable": false,
791
- "message": "Product A conflicts with SAVE10 coupon. Remove the coupon first."
792
- }
793
- ```
794
-
795
- ### Eligibility Rules
796
-
797
- The eligibility check evaluates these rules in order:
798
-
799
- 1. If the coupon has `included_products` and the product is not in the list, check `included_categories` as a fallback.
800
- 2. If no restrictions are set (no included/excluded products or categories), the product is eligible.
801
- 3. If the product is in `excluded_products`, it is not eligible.
802
- 4. If the product is in `included_products`, it is eligible.
803
- 5. If the product's categories overlap with `excluded_categories`, it is not eligible.
804
- 6. If `included_categories` is set and the product's categories do not overlap, it is not eligible.
805
-
806
- ### Example
807
-
808
- ```
809
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/checkProductEligibility" \
810
- -u "username:app_password" \
811
- -H "Content-Type: application/json" \
812
- -d '{
813
- "productId": 42,
814
- "appliedCoupons": ["SAVE10", "WELCOME5"],
815
- "origin": "admin_order"
816
- }'
817
- ```
818
-
819
- ---
820
-
821
- ## Store Coupon Settings
822
-
823
- POST `/fluent-cart/v2/coupons/storeCouponSettings`
824
-
825
- Update the global coupon settings. Currently controls whether the coupon input field is displayed on the checkout page.
826
-
827
- - **Permission:** `coupons/manage`
828
-
829
- ### Parameters
830
-
831
- | Parameter | Type | Location | Required | Description |
832
- | --- | --- | --- | --- | --- |
833
- | `show_on_checkout` | boolean | body | No | Whether to show the coupon input on the checkout page. Any truthy value sets it to `1`, falsy sets to `0`. |
834
-
835
- ### Response
836
-
837
- The response varies based on whether the setting already existed:
838
-
839
- **If updating an existing setting:**
840
-
841
- ```
842
- true
843
- ```
844
-
845
- **If creating the setting for the first time:**
846
-
847
- ```
848
- {
849
- "id": 1,
850
- "meta_key": "fluent_cart_coupon_settings",
851
- "meta_value": 1,
852
- "object_id": 0,
853
- "object_type": ""
854
- }
855
- ```
856
-
857
- ### Example
858
-
859
- ```
860
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/storeCouponSettings" \
861
- -u "username:app_password" \
862
- -H "Content-Type: application/json" \
863
- -d '{
864
- "show_on_checkout": true
865
- }'
866
- ```
867
-
868
- ---
869
-
870
- ## Coupon Model Reference
871
-
872
- ### Coupon Types
873
-
874
- | Type | Description | Amount Handling |
875
- | --- | --- | --- |
876
- | `fixed` | Fixed amount discount | Stored in **cents** (e.g., `1000` = $10.00) |
877
- | `percentage` | Percentage discount | Stored as percentage (e.g., `10` = 10%). Max: 100. |
878
- | `free_shipping` | Free shipping coupon | Amount is typically `0` |
879
- | `buy_x_get_y` | Buy X Get Y promotion | Uses `conditions.buy_products` and `conditions.get_products` |
880
-
881
- ### Coupon Statuses
882
-
883
- | Status | Description |
884
- | --- | --- |
885
- | `active` | Coupon is available for use |
886
- | `expired` | Coupon has passed its end date (automatically set) |
887
- | `disabled` | Coupon has been manually disabled |
888
- | `scheduled` | Coupon start date is in the future (automatically set) |
889
-
890
- ### Status Auto-Update Rules
891
-
892
- Coupon statuses are automatically updated when retrieved:
893
-
894
- - If `end_date` has passed and status is not `expired`, it is set to `expired`.
895
- - If `start_date` is in the future and status is not `disabled` or `scheduled`, it is set to `scheduled`.
896
- - If `start_date` has passed and status is not `disabled` or `active`, it is set to `active`.
897
-
898
- ### Stackability
899
-
900
- | Value | Behavior |
901
- | --- | --- |
902
- | `yes` | Coupon can be combined with other stackable coupons |
903
- | `no` | Coupon cannot be used alongside any other coupon |
904
-
905
- If a non-stackable coupon is already applied, no additional coupons can be added. If a non-stackable coupon is being applied while other coupons are already present, the application is rejected.
906
-
907
- ### Database Table
908
-
909
- Coupons are stored in the `fct_coupons` table with the following columns:
910
-
911
- | Column | Type | Description |
912
- | --- | --- | --- |
913
- | `id` | BIGINT (PK) | Auto-increment ID |
914
- | `parent` | BIGINT | Parent coupon ID (for variations) |
915
- | `title` | VARCHAR(200) | Display name |
916
- | `code` | VARCHAR(50) | Unique coupon code |
917
- | `status` | VARCHAR(20) | Coupon status |
918
- | `type` | VARCHAR(20) | Discount type |
919
- | `conditions` | TEXT (JSON) | JSON-encoded conditions object |
920
- | `amount` | BIGINT | Discount amount (cents for fixed, percentage for percentage type) |
921
- | `stackable` | VARCHAR(10) | Stackability flag |
922
- | `priority` | INT | Sort priority |
923
- | `use_count` | INT | Current usage count |
924
- | `notes` | TEXT | Internal notes |
925
- | `show_on_checkout` | VARCHAR(10) | Display on checkout flag |
926
- | `start_date` | DATETIME | Start date (GMT) |
927
- | `end_date` | DATETIME | End date (GMT) |
928
- | `created_at` | DATETIME | Creation timestamp |
929
- | `updated_at` | DATETIME | Last update timestamp |
930
-
931
- ---
932
-
933
- ## Permissions Reference
934
-
935
- | Endpoint | Permission(s) |
936
- | --- | --- |
937
- | `GET /coupons/listCoupons` | `orders/create` or `orders/manage` or `coupons/view` |
938
- | `GET /coupons` | `coupons/view` |
939
- | `GET /coupons/getSettings` | `coupons/view` |
940
- | `GET /coupons/{id}` | `coupons/view` |
941
- | `POST /coupons` | `coupons/manage` |
942
- | `PUT /coupons/{id}` | `coupons/manage` |
943
- | `DELETE /coupons/{id}` | `coupons/delete` |
944
- | `POST /coupons/apply` | `orders/create` or `orders/manage` |
945
- | `POST /coupons/cancel` | `orders/create` or `orders/manage` |
946
- | `POST /coupons/re-apply` | `orders/create` or `orders/manage` |
947
- | `POST /coupons/checkProductEligibility` | `orders/create` or `orders/manage` |
948
- | `POST /coupons/storeCouponSettings` | `coupons/manage` |
949
-
950
- ---
951
-
952
- ## Related Hooks
953
-
954
- | Hook | Type | Description |
955
- | --- | --- | --- |
956
- | `fluent_cart/coupon_created` | Action | Fired after a coupon is created. Receives array with `data` and `coupon`. |
957
- | `fluent_cart/coupon_updated` | Action | Fired after a coupon is updated. Receives array with `data` and `coupon`. |
958
- | `fluent_cart/coupons_list_filter_query` | Filter | Modify the coupon list query before execution. |
1
+ # Coupons API
2
+
3
+ Create and manage discount coupons, apply coupons to orders, and configure coupon settings.
4
+
5
+ **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/coupons`
6
+
7
+ **Policy:** `CouponPolicy`
8
+
9
+ > All monetary values are in **cents** (e.g., `$10.00` = `1000`).
10
+
11
+ ---
12
+
13
+ ## List Coupon Codes
14
+
15
+ GET `/fluent-cart/v2/coupons/listCoupons`
16
+
17
+ Retrieve a simple array of active coupon codes. This lightweight endpoint is designed for use in order creation forms and quick coupon lookups.
18
+
19
+ - **Permission:** `orders/create` or `orders/manage` or `coupons/view`
20
+
21
+ ### Response
22
+
23
+ ```
24
+ {
25
+ "coupons": [
26
+ "SAVE10",
27
+ "WELCOME20",
28
+ "FREESHIP"
29
+ ]
30
+ }
31
+ ```
32
+
33
+ The response returns only the `code` values of coupons with `active` status.
34
+
35
+ ### Example
36
+
37
+ ```
38
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/coupons/listCoupons" \
39
+ -u "username:app_password"
40
+ ```
41
+
42
+ ---
43
+
44
+ ## List Coupons (Paginated)
45
+
46
+ GET `/fluent-cart/v2/coupons`
47
+
48
+ Retrieve a paginated list of coupons with optional filtering, sorting, and search. Coupon statuses are automatically updated based on their start/end dates before the response is returned.
49
+
50
+ - **Permission:** `coupons/view`
51
+
52
+ ### Parameters
53
+
54
+ | Parameter | Type | Location | Required | Description |
55
+ | --- | --- | --- | --- | --- |
56
+ | `page` | integer | query | No | Page number for pagination |
57
+ | `per_page` | integer | query | No | Number of records per page (1-199, default: 10) |
58
+ | `search` | string | query | No | Search by coupon title, code, or ID. If the search string contains `%`, it searches percentage-type coupons by amount. Numeric values also match the `amount` field (auto-converted to cents). Supports operator syntax (e.g., `status = active`, `id > 5`) |
59
+ | `sort_by` | string | query | No | Column to sort by (default: `id`). Must be a fillable column on the Coupon model |
60
+ | `sort_type` | string | query | No | Sort direction: `asc` or `desc` (default: `desc`) |
61
+ | `active_view` | string | query | No | Tab filter. One of: `active`, `expired` |
62
+ | `filter_type` | string | query | No | Filter mode: `simple` (default) or `advanced` |
63
+ | `advanced_filters` | string (JSON) | query | No | JSON-encoded array of advanced filter groups (requires Pro) |
64
+ | `with` | array/string | query | No | Eager-load relations |
65
+ | `select` | array/string | query | No | Comma-separated list of columns to select |
66
+ | `include_ids` | array/string | query | No | Comma-separated IDs that must always be included in results |
67
+ | `user_tz` | string | query | No | User timezone for date filtering (e.g., `America/New_York`) |
68
+
69
+ ### Active View Filters
70
+
71
+ | View | Behavior |
72
+ | --- | --- |
73
+ | `active` | Coupons where `status = 'active'` |
74
+ | `expired` | Coupons where the `end_date` has passed (and is not null/empty), or where `status != 'active'` |
75
+
76
+ ### Response
77
+
78
+ ```
79
+ {
80
+ "coupons": {
81
+ "total": 25,
82
+ "per_page": 10,
83
+ "current_page": 1,
84
+ "last_page": 3,
85
+ "data": [
86
+ {
87
+ "id": 1,
88
+ "parent": null,
89
+ "title": "10% Off Everything",
90
+ "code": "SAVE10",
91
+ "status": "active",
92
+ "type": "percentage",
93
+ "conditions": {
94
+ "min_purchase_amount": 5000,
95
+ "max_discount_amount": 10000,
96
+ "max_purchase_amount": 0,
97
+ "apply_to_whole_cart": "no",
98
+ "apply_to_quantity": "no",
99
+ "max_uses": 100,
100
+ "max_per_customer": 1,
101
+ "excluded_categories": [],
102
+ "included_categories": [],
103
+ "excluded_products": [],
104
+ "included_products": [],
105
+ "email_restrictions": "",
106
+ "is_recurring": "no"
107
+ },
108
+ "amount": 10,
109
+ "stackable": "yes",
110
+ "priority": 1,
111
+ "use_count": 12,
112
+ "notes": "",
113
+ "show_on_checkout": "yes",
114
+ "start_date": "2025-01-01 00:00:00",
115
+ "end_date": "2025-12-31 23:59:59",
116
+ "created_at": "2025-01-01 10:00:00",
117
+ "updated_at": "2025-06-15 14:30:00",
118
+ "total_items": 12
119
+ }
120
+ ]
121
+ }
122
+ }
123
+ ```
124
+
125
+ **Notes:**
126
+
127
+ - `total_items` is an aggregate count of how many times this coupon has been applied (from the `fct_applied_coupons` table).
128
+ - For `percentage` type coupons, `amount` represents the percentage value (e.g., `10` = 10%).
129
+ - For `fixed` type coupons, `amount` is stored in **cents** (e.g., `1000` = $10.00).
130
+
131
+ ### Example
132
+
133
+ ```
134
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/coupons?page=1&per_page=20&search=SAVE&active_view=active" \
135
+ -u "username:app_password"
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Get Coupon Settings
141
+
142
+ GET `/fluent-cart/v2/coupons/getSettings`
143
+
144
+ Retrieve the global coupon settings (currently, whether coupon input is shown on the checkout page).
145
+
146
+ - **Permission:** `coupons/view`
147
+
148
+ ### Response
149
+
150
+ ```
151
+ {
152
+ "show_on_checkout": 1
153
+ }
154
+ ```
155
+
156
+ | Field | Type | Description |
157
+ | --- | --- | --- |
158
+ | `show_on_checkout` | integer/boolean | Whether the coupon code input is displayed on the checkout page. `1` or `true` for yes, `0`, `false`, or `null` for no. |
159
+
160
+ ### Example
161
+
162
+ ```
163
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/coupons/getSettings" \
164
+ -u "username:app_password"
165
+ ```
166
+
167
+ ---
168
+
169
+ ## View Coupon Details
170
+
171
+ GET `/fluent-cart/v2/coupons/{id}`
172
+
173
+ Retrieve detailed information about a specific coupon, including its activity log. The coupon status is automatically updated to `expired` if its `end_date` has passed.
174
+
175
+ - **Permission:** `coupons/view`
176
+
177
+ ### Parameters
178
+
179
+ | Parameter | Type | Location | Required | Description |
180
+ | --- | --- | --- | --- | --- |
181
+ | `id` | integer | path | Yes | The coupon ID |
182
+
183
+ ### Response
184
+
185
+ ```
186
+ {
187
+ "coupon": {
188
+ "id": 1,
189
+ "parent": null,
190
+ "title": "10% Off Everything",
191
+ "code": "SAVE10",
192
+ "status": "active",
193
+ "type": "percentage",
194
+ "conditions": {
195
+ "min_purchase_amount": 5000,
196
+ "max_discount_amount": 10000,
197
+ "max_purchase_amount": 0,
198
+ "apply_to_whole_cart": "no",
199
+ "apply_to_quantity": "no",
200
+ "max_uses": 100,
201
+ "max_per_customer": 1,
202
+ "excluded_categories": [],
203
+ "included_categories": [],
204
+ "excluded_products": [],
205
+ "included_products": [],
206
+ "email_restrictions": "",
207
+ "is_recurring": "no"
208
+ },
209
+ "amount": 10,
210
+ "stackable": "yes",
211
+ "priority": 1,
212
+ "use_count": 12,
213
+ "notes": "Internal note about this coupon",
214
+ "show_on_checkout": "yes",
215
+ "start_date": "2025-01-01 00:00:00",
216
+ "end_date": "2025-12-31 23:59:59",
217
+ "created_at": "2025-01-01 10:00:00",
218
+ "updated_at": "2025-06-15 14:30:00",
219
+ "activities": [
220
+ {
221
+ "id": 1,
222
+ "title": "Coupon Created",
223
+ "content": "Coupon \"SAVE10\" created by Admin",
224
+ "status": "success",
225
+ "user_id": 1,
226
+ "created_at": "2025-01-01 10:00:00",
227
+ "user": {
228
+ "ID": 1,
229
+ "display_name": "Admin"
230
+ }
231
+ }
232
+ ]
233
+ }
234
+ }
235
+ ```
236
+
237
+ ### Example
238
+
239
+ ```
240
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/coupons/1" \
241
+ -u "username:app_password"
242
+ ```
243
+
244
+ ---
245
+
246
+ ## Create Coupon
247
+
248
+ POST `/fluent-cart/v2/coupons`
249
+
250
+ Create a new discount coupon.
251
+
252
+ - **Permission:** `coupons/manage`
253
+
254
+ ### Parameters
255
+
256
+ | Parameter | Type | Location | Required | Description |
257
+ | --- | --- | --- | --- | --- |
258
+ | `title` | string | body | Yes | Coupon display name. Max 200 characters. |
259
+ | `code` | string | body | Yes | Unique coupon code. Max 50 characters. Must be unique across all coupons. |
260
+ | `type` | string | body | Yes | Discount type. One of: `fixed`, `percentage`, `free_shipping`, `buy_x_get_y` |
261
+ | `amount` | number | body | Yes | Discount amount. For `percentage` type: value between 0-100 (e.g., `10` for 10%). For `fixed` type: amount in store currency (e.g., `10.00` for $10). Automatically converted to cents for `fixed` type. |
262
+ | `status` | string | body | Yes | Coupon status. One of: `active`, `expired`, `disabled`, `scheduled` |
263
+ | `stackable` | string | body | Yes | Whether coupon can be combined with others. `yes` or `no`. Max 50 characters. |
264
+ | `show_on_checkout` | string | body | Yes | Whether to display the coupon on checkout. `yes` or `no`. Max 50 characters. |
265
+ | `priority` | integer | body | No | Sort priority for discount calculation order. Lower numbers are applied first. Min: 0. |
266
+ | `notes` | string | body | No | Internal notes about the coupon. |
267
+ | `start_date` | string | body | Conditional | Start date in any parseable datetime format. Required if `end_date` is provided. Automatically converted to GMT. |
268
+ | `end_date` | string | body | No | End date in any parseable datetime format. Must be after `start_date` if provided. Automatically converted to GMT. |
269
+ | `conditions` | object | body | No | Coupon conditions and restrictions (see below). |
270
+
271
+ ### Conditions Object
272
+
273
+ | Field | Type | Description |
274
+ | --- | --- | --- |
275
+ | `min_purchase_amount` | number | Minimum purchase amount in store currency (e.g., `10.00`). Automatically converted to cents. |
276
+ | `max_discount_amount` | number | Maximum discount cap in store currency. Automatically converted to cents. Useful for percentage coupons. |
277
+ | `max_purchase_amount` | number | Maximum purchase amount allowed. |
278
+ | `apply_to_whole_cart` | string | Apply discount to the entire cart. `yes` or `no`. |
279
+ | `apply_to_quantity` | string | Apply discount per quantity. `yes` or `no`. |
280
+ | `max_uses` | integer | Maximum total uses across all customers. Must be greater than or equal to `max_per_customer`. |
281
+ | `max_per_customer` | integer | Maximum uses per individual customer. |
282
+ | `included_products` | array | Array of product IDs the coupon is limited to. |
283
+ | `excluded_products` | array | Array of product IDs excluded from the coupon. |
284
+ | `included_categories` | array | Array of category (term taxonomy) IDs the coupon is limited to. |
285
+ | `excluded_categories` | array | Array of category (term taxonomy) IDs excluded from the coupon. |
286
+ | `email_restrictions` | string | Email-based restriction. |
287
+ | `is_recurring` | string | Whether the coupon applies to subscription renewals. `yes` or `no`. |
288
+ | `buy_products` | array | Product IDs for the "buy" part of buy-x-get-y coupons. |
289
+ | `get_products` | array | Product IDs for the "get" part of buy-x-get-y coupons. |
290
+
291
+ ### Response
292
+
293
+ ```
294
+ {
295
+ "message": "Coupon created successfully!",
296
+ "data": {
297
+ "id": 5,
298
+ "parent": null,
299
+ "title": "Summer Sale 20%",
300
+ "code": "SUMMER20",
301
+ "status": "active",
302
+ "type": "percentage",
303
+ "conditions": {
304
+ "min_purchase_amount": 2000,
305
+ "max_discount_amount": 5000,
306
+ "max_purchase_amount": 0,
307
+ "apply_to_whole_cart": "yes",
308
+ "apply_to_quantity": "no",
309
+ "max_uses": 500,
310
+ "max_per_customer": 2,
311
+ "excluded_categories": [],
312
+ "included_categories": [],
313
+ "excluded_products": [],
314
+ "included_products": [],
315
+ "email_restrictions": "",
316
+ "is_recurring": "no"
317
+ },
318
+ "amount": 20,
319
+ "stackable": "yes",
320
+ "priority": 1,
321
+ "use_count": 0,
322
+ "notes": "",
323
+ "show_on_checkout": "yes",
324
+ "start_date": "2025-06-01 00:00:00",
325
+ "end_date": "2025-08-31 23:59:59",
326
+ "created_at": "2025-05-25 10:00:00",
327
+ "updated_at": "2025-05-25 10:00:00"
328
+ }
329
+ }
330
+ ```
331
+
332
+ ### Validation Errors
333
+
334
+ | Field | Rule | Message |
335
+ | --- | --- | --- |
336
+ | `title` | required | Title is required. |
337
+ | `code` | required, unique | Code is required. / This coupon code is already in use. |
338
+ | `type` | required, in:fixed,percentage,free_shipping,buy_x_get_y | Type is required. |
339
+ | `amount` | required, numeric, min:0, max:100 (percentage only) | Amount is required. / For percentage type, the amount should not be greater than 100. |
340
+ | `status` | required, in:active,expired,disabled,scheduled | Status is required. |
341
+ | `stackable` | required | Stackable is required. |
342
+ | `show_on_checkout` | required | Show on checkout is required. |
343
+ | `start_date` | required_if:end_date | Start date is required. |
344
+ | `end_date` | after start_date | The end date must be after the start date. |
345
+ | `conditions.max_uses` | >= max_per_customer | Max uses must be greater than or equal to max per customer. |
346
+
347
+ ### Hooks
348
+
349
+ - `fluent_cart/coupon_created` -- Fired after a coupon is successfully created.
350
+
351
+ ### Example
352
+
353
+ ```
354
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons" \
355
+ -u "username:app_password" \
356
+ -H "Content-Type: application/json" \
357
+ -d '{
358
+ "title": "Summer Sale 20%",
359
+ "code": "SUMMER20",
360
+ "type": "percentage",
361
+ "amount": 20,
362
+ "status": "active",
363
+ "stackable": "yes",
364
+ "show_on_checkout": "yes",
365
+ "priority": 1,
366
+ "start_date": "2025-06-01 00:00:00",
367
+ "end_date": "2025-08-31 23:59:59",
368
+ "conditions": {
369
+ "min_purchase_amount": 20.00,
370
+ "max_discount_amount": 50.00,
371
+ "max_uses": 500,
372
+ "max_per_customer": 2,
373
+ "apply_to_whole_cart": "yes",
374
+ "is_recurring": "no"
375
+ }
376
+ }'
377
+ ```
378
+
379
+ ---
380
+
381
+ ## Update Coupon
382
+
383
+ PUT `/fluent-cart/v2/coupons/{id}`
384
+
385
+ Update an existing coupon. Accepts the same fields as Create Coupon.
386
+
387
+ - **Permission:** `coupons/manage`
388
+
389
+ ### Parameters
390
+
391
+ | Parameter | Type | Location | Required | Description |
392
+ | --- | --- | --- | --- | --- |
393
+ | `id` | integer | path | Yes | The coupon ID |
394
+
395
+ The request body accepts the same fields as [Create Coupon](#create-coupon). All validation rules apply identically. The `code` uniqueness check excludes the current coupon (allowing you to keep the same code).
396
+
397
+ Empty string values for `max_uses`, `max_per_customer`, `max_discount_amount`, and `min_purchase_amount` are automatically converted to `null`.
398
+
399
+ ### Response
400
+
401
+ ```
402
+ {
403
+ "message": "Coupon updated successfully!",
404
+ "data": {
405
+ "id": 5,
406
+ "title": "Summer Sale 25%",
407
+ "code": "SUMMER25",
408
+ "status": "active",
409
+ "type": "percentage",
410
+ "amount": 25,
411
+ "conditions": { ... },
412
+ "stackable": "yes",
413
+ "priority": 1,
414
+ "use_count": 12,
415
+ "notes": "",
416
+ "show_on_checkout": "yes",
417
+ "start_date": "2025-06-01 00:00:00",
418
+ "end_date": "2025-08-31 23:59:59",
419
+ "created_at": "2025-05-25 10:00:00",
420
+ "updated_at": "2025-06-20 11:00:00"
421
+ }
422
+ }
423
+ ```
424
+
425
+ ### Error Responses
426
+
427
+ | Code | Message |
428
+ | --- | --- |
429
+ | 403 | Please edit a valid coupon! |
430
+ | 404 | Coupon not found, please reload the page and try again! |
431
+ | 400 | Coupon update failed. |
432
+
433
+ ### Hooks
434
+
435
+ - `fluent_cart/coupon_updated` -- Fired after a coupon is successfully updated.
436
+
437
+ ### Example
438
+
439
+ ```
440
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/coupons/5" \
441
+ -u "username:app_password" \
442
+ -H "Content-Type: application/json" \
443
+ -d '{
444
+ "title": "Summer Sale 25%",
445
+ "code": "SUMMER25",
446
+ "type": "percentage",
447
+ "amount": 25,
448
+ "status": "active",
449
+ "stackable": "yes",
450
+ "show_on_checkout": "yes"
451
+ }'
452
+ ```
453
+
454
+ ---
455
+
456
+ ## Delete Coupon
457
+
458
+ DELETE `/fluent-cart/v2/coupons/{id}`
459
+
460
+ Permanently delete a coupon.
461
+
462
+ - **Permission:** `coupons/delete`
463
+
464
+ ### Parameters
465
+
466
+ | Parameter | Type | Location | Required | Description |
467
+ | --- | --- | --- | --- | --- |
468
+ | `id` | integer | path/body | Yes | The coupon ID. Passed as a URL segment, but read from the request body internally. |
469
+
470
+ ### Response
471
+
472
+ ```
473
+ {
474
+ "message": "Coupon successfully deleted.",
475
+ "data": ""
476
+ }
477
+ ```
478
+
479
+ ### Error Responses
480
+
481
+ | Code | Message |
482
+ | --- | --- |
483
+ | 403 | Please use a valid coupon ID! |
484
+ | 404 | Coupon not found in database, failed to remove. |
485
+ | 400 | Coupon deletion failed! |
486
+
487
+ ### Example
488
+
489
+ ```
490
+ curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/coupons/5" \
491
+ -u "username:app_password"
492
+ ```
493
+
494
+ ---
495
+
496
+ ## Apply Coupon
497
+
498
+ POST `/fluent-cart/v2/coupons/apply`
499
+
500
+ Apply a coupon code to a set of order line items. This endpoint validates the coupon, checks eligibility for each line item, and returns the recalculated discount breakdown.
501
+
502
+ - **Permission:** `orders/create` or `orders/manage`
503
+
504
+ ### Parameters
505
+
506
+ | Parameter | Type | Location | Required | Description |
507
+ | --- | --- | --- | --- | --- |
508
+ | `coupon_code` | string | body | Yes | The coupon code to apply. |
509
+ | `order_items` | array | body | Yes | Array of order line item objects. |
510
+ | `order_uuid` | string | body | No | UUID of an existing order to apply the coupon to. When provided, previously applied coupons from the order are included. Max 100 characters. |
511
+ | `applied_coupons` | array | body | No | Array of coupon IDs that are already applied (but not yet persisted to the order). |
512
+ | `customer_email` | string | body | No | Customer email for email-based coupon restrictions. |
513
+
514
+ ### Order Item Object
515
+
516
+ | Field | Type | Required | Description |
517
+ | --- | --- | --- | --- |
518
+ | `id` | integer | No | Line item ID (for existing orders). Min: 1. |
519
+ | `order_id` | integer | No | Parent order ID. Min: 1. |
520
+ | `post_id` | integer | No | Product post ID. Min: 1. |
521
+ | `variation_id` | integer | No | Variation ID. Min: 1. |
522
+ | `type` | string | No | Item type. Max 100 characters. |
523
+ | `quantity` | integer | No | Item quantity. Min: 1. |
524
+ | `title` | string | No | Item title. Max 100 characters. |
525
+ | `price` | number | No | Item price in cents. |
526
+ | `unit_price` | number | No | Unit price in cents. |
527
+ | `item_cost` | number | No | Item cost in cents. |
528
+ | `item_total` | number | No | Item total in cents. |
529
+ | `tax_amount` | number | No | Tax amount in cents. |
530
+ | `discount_total` | number | No | Discount total in cents. |
531
+ | `total` | number | No | Total in cents. |
532
+ | `line_total` | number | No | Line total in cents. |
533
+ | `cart_index` | integer | No | Position in cart. |
534
+ | `rate` | number | No | Tax rate. |
535
+ | `line_meta` | string | No | Line item metadata. |
536
+ | `other_info` | object | No | Additional item info (e.g., `payment_type`, `manage_setup_fee`, `signup_fee`). |
537
+
538
+ ### Response
539
+
540
+ ```
541
+ {
542
+ "applied_coupons": {
543
+ "SAVE10": {
544
+ "id": 1,
545
+ "title": "10% Off",
546
+ "code": "SAVE10",
547
+ "type": "percentage",
548
+ "amount": 10,
549
+ "discount_amount": 500,
550
+ "stackable": "yes",
551
+ "priority": 1
552
+ }
553
+ },
554
+ "calculated_items": [
555
+ {
556
+ "post_id": 42,
557
+ "quantity": 2,
558
+ "price": 2500,
559
+ "discounted_price": 2250,
560
+ "discount_total": 500
561
+ }
562
+ ]
563
+ }
564
+ ```
565
+
566
+ ### Error Responses
567
+
568
+ The coupon application may fail with a `WP_Error` for reasons including:
569
+
570
+ - Coupon code not found
571
+ - Coupon is expired or inactive
572
+ - Coupon usage limit reached
573
+ - Minimum purchase amount not met
574
+ - Product/category not eligible
575
+ - Coupon is not stackable with already-applied coupons
576
+
577
+ ### Example
578
+
579
+ ```
580
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/apply" \
581
+ -u "username:app_password" \
582
+ -H "Content-Type: application/json" \
583
+ -d '{
584
+ "coupon_code": "SAVE10",
585
+ "order_items": [
586
+ {
587
+ "post_id": 42,
588
+ "quantity": 2,
589
+ "price": 2500,
590
+ "unit_price": 2500,
591
+ "item_total": 5000,
592
+ "line_total": 5000,
593
+ "other_info": {
594
+ "payment_type": "onetime"
595
+ }
596
+ }
597
+ ],
598
+ "applied_coupons": []
599
+ }'
600
+ ```
601
+
602
+ ---
603
+
604
+ ## Cancel Coupon
605
+
606
+ POST `/fluent-cart/v2/coupons/cancel`
607
+
608
+ Remove a coupon from an order and recalculate the remaining discounts. If an `order_uuid` is provided and the coupon was already persisted to the order, it is deleted from the `fct_applied_coupons` table and the coupon's `use_count` is decremented.
609
+
610
+ - **Permission:** `orders/create` or `orders/manage`
611
+
612
+ ### Parameters
613
+
614
+ | Parameter | Type | Location | Required | Description |
615
+ | --- | --- | --- | --- | --- |
616
+ | `coupon_code` | string | body | Yes | The coupon code to cancel. |
617
+ | `order_items` | array | body | Yes | Array of current order line item objects (same structure as Apply Coupon). |
618
+ | `id` | integer | body | No | The applied coupon record ID (from `fct_applied_coupons`). Required to delete the persisted record from an existing order. |
619
+ | `order_uuid` | string | body | No | UUID of the existing order. Max 100 characters. |
620
+ | `applied_coupons` | array | body | No | Array of remaining coupon IDs that should stay applied. |
621
+ | `customer_email` | string | body | No | Customer email address. |
622
+
623
+ ### Response
624
+
625
+ ```
626
+ {
627
+ "applied_coupons": {
628
+ "WELCOME5": {
629
+ "id": 2,
630
+ "title": "Welcome $5 Off",
631
+ "code": "WELCOME5",
632
+ "type": "fixed",
633
+ "amount": 500,
634
+ "discount_amount": 500,
635
+ "stackable": "yes",
636
+ "priority": 2
637
+ }
638
+ },
639
+ "calculated_items": [
640
+ {
641
+ "post_id": 42,
642
+ "quantity": 2,
643
+ "price": 2500,
644
+ "discounted_price": 2250,
645
+ "discount_total": 500
646
+ }
647
+ ]
648
+ }
649
+ ```
650
+
651
+ If all coupons are cancelled, `applied_coupons` will be an empty object and `calculated_items` will reflect the original prices.
652
+
653
+ ### Example
654
+
655
+ ```
656
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/cancel" \
657
+ -u "username:app_password" \
658
+ -H "Content-Type: application/json" \
659
+ -d '{
660
+ "coupon_code": "SAVE10",
661
+ "id": 15,
662
+ "order_uuid": "abc123-def456",
663
+ "order_items": [
664
+ {
665
+ "post_id": 42,
666
+ "quantity": 2,
667
+ "price": 2500,
668
+ "unit_price": 2500,
669
+ "item_total": 5000,
670
+ "line_total": 5000
671
+ }
672
+ ],
673
+ "applied_coupons": [2]
674
+ }'
675
+ ```
676
+
677
+ ---
678
+
679
+ ## Re-apply Coupons
680
+
681
+ POST `/fluent-cart/v2/coupons/re-apply`
682
+
683
+ Recalculate all previously applied coupons against the current order items. This is used when order items change (e.g., quantity update, item added/removed) and discounts need to be recalculated. If `order_items` is empty, all applied coupons on the order are deleted.
684
+
685
+ - **Permission:** `orders/create` or `orders/manage`
686
+
687
+ ### Parameters
688
+
689
+ | Parameter | Type | Location | Required | Description |
690
+ | --- | --- | --- | --- | --- |
691
+ | `order_uuid` | string | body | No | UUID of the existing order whose applied coupons should be reapplied. |
692
+ | `order_items` | array | body | No | Array of current order line item objects. If empty, all applied coupons on the order are removed. Each item key is sanitized as text. |
693
+ | `applied_coupons` | array | body | No | Array of coupon IDs to include (in addition to those already on the order). Values are cast to integers. |
694
+
695
+ ### Response
696
+
697
+ ```
698
+ {
699
+ "applied_coupons": {
700
+ "SAVE10": {
701
+ "id": 1,
702
+ "title": "10% Off",
703
+ "code": "SAVE10",
704
+ "type": "percentage",
705
+ "amount": 10,
706
+ "discount_amount": 450,
707
+ "stackable": "yes",
708
+ "priority": 1
709
+ }
710
+ },
711
+ "calculated_items": [
712
+ {
713
+ "post_id": 42,
714
+ "quantity": 1,
715
+ "price": 2500,
716
+ "discounted_price": 2250,
717
+ "discount_total": 250
718
+ },
719
+ {
720
+ "post_id": 55,
721
+ "quantity": 1,
722
+ "price": 2000,
723
+ "discounted_price": 1800,
724
+ "discount_total": 200
725
+ }
726
+ ]
727
+ }
728
+ ```
729
+
730
+ ### Example
731
+
732
+ ```
733
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/re-apply" \
734
+ -u "username:app_password" \
735
+ -H "Content-Type: application/json" \
736
+ -d '{
737
+ "order_uuid": "abc123-def456",
738
+ "order_items": [
739
+ {
740
+ "post_id": 42,
741
+ "quantity": 1,
742
+ "price": 2500,
743
+ "unit_price": 2500,
744
+ "item_total": 2500,
745
+ "line_total": 2500
746
+ },
747
+ {
748
+ "post_id": 55,
749
+ "quantity": 1,
750
+ "price": 2000,
751
+ "unit_price": 2000,
752
+ "item_total": 2000,
753
+ "line_total": 2000
754
+ }
755
+ ],
756
+ "applied_coupons": [1]
757
+ }'
758
+ ```
759
+
760
+ ---
761
+
762
+ ## Check Product Eligibility
763
+
764
+ POST `/fluent-cart/v2/coupons/checkProductEligibility`
765
+
766
+ Check whether a product is eligible for a set of applied coupons. This is used in the order form to validate that adding a product does not conflict with currently applied coupons.
767
+
768
+ - **Permission:** `orders/create` or `orders/manage`
769
+
770
+ ### Parameters
771
+
772
+ | Parameter | Type | Location | Required | Description |
773
+ | --- | --- | --- | --- | --- |
774
+ | `productId` | integer | body | Yes | The product (post) ID to check eligibility for. |
775
+ | `appliedCoupons` | array | body | No | Array of coupon codes currently applied. Each code is checked against the product's categories and the coupon's inclusion/exclusion rules. |
776
+ | `origin` | string | body | No | The context where the check originates (e.g., `checkout`). |
777
+
778
+ ### Response (Eligible)
779
+
780
+ ```
781
+ {
782
+ "isApplicable": true
783
+ }
784
+ ```
785
+
786
+ ### Response (Not Eligible)
787
+
788
+ ```
789
+ {
790
+ "isApplicable": false,
791
+ "message": "Product A conflicts with SAVE10 coupon. Remove the coupon first."
792
+ }
793
+ ```
794
+
795
+ ### Eligibility Rules
796
+
797
+ The eligibility check evaluates these rules in order:
798
+
799
+ 1. If the coupon has `included_products` and the product is not in the list, check `included_categories` as a fallback.
800
+ 2. If no restrictions are set (no included/excluded products or categories), the product is eligible.
801
+ 3. If the product is in `excluded_products`, it is not eligible.
802
+ 4. If the product is in `included_products`, it is eligible.
803
+ 5. If the product's categories overlap with `excluded_categories`, it is not eligible.
804
+ 6. If `included_categories` is set and the product's categories do not overlap, it is not eligible.
805
+
806
+ ### Example
807
+
808
+ ```
809
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/checkProductEligibility" \
810
+ -u "username:app_password" \
811
+ -H "Content-Type: application/json" \
812
+ -d '{
813
+ "productId": 42,
814
+ "appliedCoupons": ["SAVE10", "WELCOME5"],
815
+ "origin": "admin_order"
816
+ }'
817
+ ```
818
+
819
+ ---
820
+
821
+ ## Store Coupon Settings
822
+
823
+ POST `/fluent-cart/v2/coupons/storeCouponSettings`
824
+
825
+ Update the global coupon settings. Currently controls whether the coupon input field is displayed on the checkout page.
826
+
827
+ - **Permission:** `coupons/manage`
828
+
829
+ ### Parameters
830
+
831
+ | Parameter | Type | Location | Required | Description |
832
+ | --- | --- | --- | --- | --- |
833
+ | `show_on_checkout` | boolean | body | No | Whether to show the coupon input on the checkout page. Any truthy value sets it to `1`, falsy sets to `0`. |
834
+
835
+ ### Response
836
+
837
+ The response varies based on whether the setting already existed:
838
+
839
+ **If updating an existing setting:**
840
+
841
+ ```
842
+ true
843
+ ```
844
+
845
+ **If creating the setting for the first time:**
846
+
847
+ ```
848
+ {
849
+ "id": 1,
850
+ "meta_key": "fluent_cart_coupon_settings",
851
+ "meta_value": 1,
852
+ "object_id": 0,
853
+ "object_type": ""
854
+ }
855
+ ```
856
+
857
+ ### Example
858
+
859
+ ```
860
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/coupons/storeCouponSettings" \
861
+ -u "username:app_password" \
862
+ -H "Content-Type: application/json" \
863
+ -d '{
864
+ "show_on_checkout": true
865
+ }'
866
+ ```
867
+
868
+ ---
869
+
870
+ ## Coupon Model Reference
871
+
872
+ ### Coupon Types
873
+
874
+ | Type | Description | Amount Handling |
875
+ | --- | --- | --- |
876
+ | `fixed` | Fixed amount discount | Stored in **cents** (e.g., `1000` = $10.00) |
877
+ | `percentage` | Percentage discount | Stored as percentage (e.g., `10` = 10%). Max: 100. |
878
+ | `free_shipping` | Free shipping coupon | Amount is typically `0` |
879
+ | `buy_x_get_y` | Buy X Get Y promotion | Uses `conditions.buy_products` and `conditions.get_products` |
880
+
881
+ ### Coupon Statuses
882
+
883
+ | Status | Description |
884
+ | --- | --- |
885
+ | `active` | Coupon is available for use |
886
+ | `expired` | Coupon has passed its end date (automatically set) |
887
+ | `disabled` | Coupon has been manually disabled |
888
+ | `scheduled` | Coupon start date is in the future (automatically set) |
889
+
890
+ ### Status Auto-Update Rules
891
+
892
+ Coupon statuses are automatically updated when retrieved:
893
+
894
+ - If `end_date` has passed and status is not `expired`, it is set to `expired`.
895
+ - If `start_date` is in the future and status is not `disabled` or `scheduled`, it is set to `scheduled`.
896
+ - If `start_date` has passed and status is not `disabled` or `active`, it is set to `active`.
897
+
898
+ ### Stackability
899
+
900
+ | Value | Behavior |
901
+ | --- | --- |
902
+ | `yes` | Coupon can be combined with other stackable coupons |
903
+ | `no` | Coupon cannot be used alongside any other coupon |
904
+
905
+ If a non-stackable coupon is already applied, no additional coupons can be added. If a non-stackable coupon is being applied while other coupons are already present, the application is rejected.
906
+
907
+ ### Database Table
908
+
909
+ Coupons are stored in the `fct_coupons` table with the following columns:
910
+
911
+ | Column | Type | Description |
912
+ | --- | --- | --- |
913
+ | `id` | BIGINT (PK) | Auto-increment ID |
914
+ | `parent` | BIGINT | Parent coupon ID (for variations) |
915
+ | `title` | VARCHAR(200) | Display name |
916
+ | `code` | VARCHAR(50) | Unique coupon code |
917
+ | `status` | VARCHAR(20) | Coupon status |
918
+ | `type` | VARCHAR(20) | Discount type |
919
+ | `conditions` | TEXT (JSON) | JSON-encoded conditions object |
920
+ | `amount` | BIGINT | Discount amount (cents for fixed, percentage for percentage type) |
921
+ | `stackable` | VARCHAR(10) | Stackability flag |
922
+ | `priority` | INT | Sort priority |
923
+ | `use_count` | INT | Current usage count |
924
+ | `notes` | TEXT | Internal notes |
925
+ | `show_on_checkout` | VARCHAR(10) | Display on checkout flag |
926
+ | `start_date` | DATETIME | Start date (GMT) |
927
+ | `end_date` | DATETIME | End date (GMT) |
928
+ | `created_at` | DATETIME | Creation timestamp |
929
+ | `updated_at` | DATETIME | Last update timestamp |
930
+
931
+ ---
932
+
933
+ ## Permissions Reference
934
+
935
+ | Endpoint | Permission(s) |
936
+ | --- | --- |
937
+ | `GET /coupons/listCoupons` | `orders/create` or `orders/manage` or `coupons/view` |
938
+ | `GET /coupons` | `coupons/view` |
939
+ | `GET /coupons/getSettings` | `coupons/view` |
940
+ | `GET /coupons/{id}` | `coupons/view` |
941
+ | `POST /coupons` | `coupons/manage` |
942
+ | `PUT /coupons/{id}` | `coupons/manage` |
943
+ | `DELETE /coupons/{id}` | `coupons/delete` |
944
+ | `POST /coupons/apply` | `orders/create` or `orders/manage` |
945
+ | `POST /coupons/cancel` | `orders/create` or `orders/manage` |
946
+ | `POST /coupons/re-apply` | `orders/create` or `orders/manage` |
947
+ | `POST /coupons/checkProductEligibility` | `orders/create` or `orders/manage` |
948
+ | `POST /coupons/storeCouponSettings` | `coupons/manage` |
949
+
950
+ ---
951
+
952
+ ## Related Hooks
953
+
954
+ | Hook | Type | Description |
955
+ | --- | --- | --- |
956
+ | `fluent_cart/coupon_created` | Action | Fired after a coupon is created. Receives array with `data` and `coupon`. |
957
+ | `fluent_cart/coupon_updated` | Action | Fired after a coupon is updated. Receives array with `data` and `coupon`. |
958
+ | `fluent_cart/coupons_list_filter_query` | Filter | Modify the coupon list query before execution. |