fluentcart-developer 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (609) 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/skills/fluentcart-developer/SKILL.md +108 -108
  6. package/dist/skills/fluentcart-developer/examples/README.md +30 -30
  7. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
  8. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
  9. package/dist/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +113 -113
  10. package/dist/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +148 -148
  11. package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
  12. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/README.md +22 -22
  13. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/sample-plugin-with-licensing-sdk.php +79 -79
  14. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/FluentLicensing.php +303 -303
  15. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/LicenseSettings.php +566 -566
  16. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/PluginUpdater.php +304 -304
  17. package/dist/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +61 -61
  18. package/dist/skills/fluentcart-developer/references/api/authentication.md +452 -452
  19. package/dist/skills/fluentcart-developer/references/api/coupons.md +786 -786
  20. package/dist/skills/fluentcart-developer/references/api/customers.md +889 -889
  21. package/dist/skills/fluentcart-developer/references/api/files.md +609 -609
  22. package/dist/skills/fluentcart-developer/references/api/index.md +432 -432
  23. package/dist/skills/fluentcart-developer/references/api/licensing.md +633 -633
  24. package/dist/skills/fluentcart-developer/references/api/order-bump.md +384 -384
  25. package/dist/skills/fluentcart-developer/references/api/orders.md +814 -814
  26. package/dist/skills/fluentcart-developer/references/api/products.md +866 -866
  27. package/dist/skills/fluentcart-developer/references/api/roles-permissions.md +536 -536
  28. package/dist/skills/fluentcart-developer/references/api/subscriptions.md +827 -827
  29. package/dist/skills/fluentcart-developer/references/database/index.md +44 -44
  30. package/dist/skills/fluentcart-developer/references/database/models/activity.md +178 -178
  31. package/dist/skills/fluentcart-developer/references/database/models/applied-coupon.md +291 -291
  32. package/dist/skills/fluentcart-developer/references/database/models/attribute-group.md +239 -239
  33. package/dist/skills/fluentcart-developer/references/database/models/attribute-relation.md +181 -181
  34. package/dist/skills/fluentcart-developer/references/database/models/attribute-term.md +219 -219
  35. package/dist/skills/fluentcart-developer/references/database/models/cart.md +645 -645
  36. package/dist/skills/fluentcart-developer/references/database/models/coupon.md +427 -427
  37. package/dist/skills/fluentcart-developer/references/database/models/customer-addresses.md +348 -348
  38. package/dist/skills/fluentcart-developer/references/database/models/customer-meta.md +156 -156
  39. package/dist/skills/fluentcart-developer/references/database/models/customer.md +584 -584
  40. package/dist/skills/fluentcart-developer/references/database/models/dynamic-model.md +163 -163
  41. package/dist/skills/fluentcart-developer/references/database/models/label-relationship.md +155 -155
  42. package/dist/skills/fluentcart-developer/references/database/models/label.md +153 -153
  43. package/dist/skills/fluentcart-developer/references/database/models/license-activation.md +182 -182
  44. package/dist/skills/fluentcart-developer/references/database/models/license-meta.md +163 -163
  45. package/dist/skills/fluentcart-developer/references/database/models/license-site.md +208 -208
  46. package/dist/skills/fluentcart-developer/references/database/models/license.md +640 -640
  47. package/dist/skills/fluentcart-developer/references/database/models/meta.md +233 -233
  48. package/dist/skills/fluentcart-developer/references/database/models/order-address.md +391 -391
  49. package/dist/skills/fluentcart-developer/references/database/models/order-download-permission.md +144 -144
  50. package/dist/skills/fluentcart-developer/references/database/models/order-item.md +383 -383
  51. package/dist/skills/fluentcart-developer/references/database/models/order-meta.md +303 -303
  52. package/dist/skills/fluentcart-developer/references/database/models/order-operation.md +158 -158
  53. package/dist/skills/fluentcart-developer/references/database/models/order-promotion-stat.md +175 -175
  54. package/dist/skills/fluentcart-developer/references/database/models/order-promotion.md +250 -250
  55. package/dist/skills/fluentcart-developer/references/database/models/order-tax-rate.md +172 -172
  56. package/dist/skills/fluentcart-developer/references/database/models/order-transaction.md +440 -440
  57. package/dist/skills/fluentcart-developer/references/database/models/order.md +727 -727
  58. package/dist/skills/fluentcart-developer/references/database/models/product-detail.md +397 -397
  59. package/dist/skills/fluentcart-developer/references/database/models/product-download.md +258 -258
  60. package/dist/skills/fluentcart-developer/references/database/models/product-meta.md +153 -153
  61. package/dist/skills/fluentcart-developer/references/database/models/product-variation.md +556 -556
  62. package/dist/skills/fluentcart-developer/references/database/models/product.md +580 -580
  63. package/dist/skills/fluentcart-developer/references/database/models/relationships.md +427 -427
  64. package/dist/skills/fluentcart-developer/references/database/models/scheduled-action.md +175 -175
  65. package/dist/skills/fluentcart-developer/references/database/models/shipping-class.md +148 -148
  66. package/dist/skills/fluentcart-developer/references/database/models/shipping-method.md +280 -280
  67. package/dist/skills/fluentcart-developer/references/database/models/shipping-zone.md +205 -205
  68. package/dist/skills/fluentcart-developer/references/database/models/subscription-meta.md +173 -173
  69. package/dist/skills/fluentcart-developer/references/database/models/subscription.md +528 -528
  70. package/dist/skills/fluentcart-developer/references/database/models/tax-class.md +195 -195
  71. package/dist/skills/fluentcart-developer/references/database/models/tax-rate.md +225 -225
  72. package/dist/skills/fluentcart-developer/references/database/models/user-meta.md +166 -166
  73. package/dist/skills/fluentcart-developer/references/database/models/user.md +220 -220
  74. package/dist/skills/fluentcart-developer/references/database/models.md +404 -404
  75. package/dist/skills/fluentcart-developer/references/database/query-builder.md +860 -860
  76. package/dist/skills/fluentcart-developer/references/database/readme.md +276 -276
  77. package/dist/skills/fluentcart-developer/references/database/schema.md +1002 -1002
  78. package/dist/skills/fluentcart-developer/references/engineering/adding-custom-pages-to-the-customer-dashboard.md +395 -395
  79. package/dist/skills/fluentcart-developer/references/engineering/index.md +4 -4
  80. package/dist/skills/fluentcart-developer/references/engineering.md +4 -4
  81. package/dist/skills/fluentcart-developer/references/getting-started.md +249 -249
  82. package/dist/skills/fluentcart-developer/references/guides/frontend.md +519 -519
  83. package/dist/skills/fluentcart-developer/references/guides/index.md +107 -107
  84. package/dist/skills/fluentcart-developer/references/guides/integrations.md +600 -600
  85. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/index.md +237 -237
  86. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/labels-and-tracking.md +481 -481
  87. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/live-rates.md +269 -269
  88. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/reference.md +223 -223
  89. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/settings.md +370 -370
  90. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier.md +237 -237
  91. package/dist/skills/fluentcart-developer/references/guides/subscriptions.md +217 -217
  92. package/dist/skills/fluentcart-developer/references/hooks/actions/admin-and-templates.md +1079 -1079
  93. package/dist/skills/fluentcart-developer/references/hooks/actions/cart-and-checkout.md +1795 -1795
  94. package/dist/skills/fluentcart-developer/references/hooks/actions/customers-and-users.md +327 -327
  95. package/dist/skills/fluentcart-developer/references/hooks/actions/licenses.md +829 -829
  96. package/dist/skills/fluentcart-developer/references/hooks/actions/modules.md +81 -81
  97. package/dist/skills/fluentcart-developer/references/hooks/actions/orders.md +757 -757
  98. package/dist/skills/fluentcart-developer/references/hooks/actions/payments-and-integrations.md +1163 -1163
  99. package/dist/skills/fluentcart-developer/references/hooks/actions/pro-modules.md +219 -219
  100. package/dist/skills/fluentcart-developer/references/hooks/actions/products-and-coupons.md +1019 -1019
  101. package/dist/skills/fluentcart-developer/references/hooks/actions/subscriptions.md +1290 -1290
  102. package/dist/skills/fluentcart-developer/references/hooks/actions.md +16 -16
  103. package/dist/skills/fluentcart-developer/references/hooks/deprecated.md +60 -60
  104. package/dist/skills/fluentcart-developer/references/hooks/filters/cart-and-checkout.md +2032 -2032
  105. package/dist/skills/fluentcart-developer/references/hooks/filters/customers-and-subscriptions.md +1746 -1746
  106. package/dist/skills/fluentcart-developer/references/hooks/filters/integrations-and-advanced.md +2439 -2439
  107. package/dist/skills/fluentcart-developer/references/hooks/filters/modules.md +464 -464
  108. package/dist/skills/fluentcart-developer/references/hooks/filters/orders-and-payments.md +2658 -2658
  109. package/dist/skills/fluentcart-developer/references/hooks/filters/pro-modules.md +502 -502
  110. package/dist/skills/fluentcart-developer/references/hooks/filters/products-and-pricing.md +1785 -1785
  111. package/dist/skills/fluentcart-developer/references/hooks/filters/settings-and-configuration.md +2966 -2966
  112. package/dist/skills/fluentcart-developer/references/hooks/filters.md +14 -14
  113. package/dist/skills/fluentcart-developer/references/hooks/index.md +35 -35
  114. package/dist/skills/fluentcart-developer/references/index.md +625 -625
  115. package/dist/skills/fluentcart-developer/references/modules/fee-system.md +427 -427
  116. package/dist/skills/fluentcart-developer/references/modules/ghost-product-selling.md +440 -440
  117. package/dist/skills/fluentcart-developer/references/modules/index.md +484 -484
  118. package/dist/skills/fluentcart-developer/references/modules/licensing.md +342 -342
  119. package/dist/skills/fluentcart-developer/references/modules/order-bump.md +433 -433
  120. package/dist/skills/fluentcart-developer/references/modules/payment-methods.md +129 -129
  121. package/dist/skills/fluentcart-developer/references/modules/refunds.md +170 -170
  122. package/dist/skills/fluentcart-developer/references/modules/shipping.md +846 -846
  123. package/dist/skills/fluentcart-developer/references/modules/storage.md +986 -986
  124. package/dist/skills/fluentcart-developer/references/modules/subscription-vendor-ids.md +186 -186
  125. package/dist/skills/fluentcart-developer/references/modules/subscriptions.md +678 -678
  126. package/dist/skills/fluentcart-developer/references/payment-methods-integration/index.md +164 -164
  127. package/dist/skills/fluentcart-developer/references/payment-methods-integration/paddle-example.md +1648 -1648
  128. package/dist/skills/fluentcart-developer/references/payment-methods-integration/payment/setting/fields.md +353 -353
  129. package/dist/skills/fluentcart-developer/references/payment-methods-integration/quick-implementation.md +1079 -1079
  130. package/dist/skills/fluentcart-developer/references/payment-methods-integration.md +164 -164
  131. package/dist/skills/fluentcart-developer/references/restapi/checkout.md +573 -573
  132. package/dist/skills/fluentcart-developer/references/restapi/coupons.md +958 -958
  133. package/dist/skills/fluentcart-developer/references/restapi/customer-profile.md +1423 -1423
  134. package/dist/skills/fluentcart-developer/references/restapi/customers.md +1103 -1103
  135. package/dist/skills/fluentcart-developer/references/restapi/dashboard.md +1083 -1083
  136. package/dist/skills/fluentcart-developer/references/restapi/data-export.md +132 -132
  137. package/dist/skills/fluentcart-developer/references/restapi/email-notifications.md +846 -846
  138. package/dist/skills/fluentcart-developer/references/restapi/files.md +313 -313
  139. package/dist/skills/fluentcart-developer/references/restapi/index.md +127 -127
  140. package/dist/skills/fluentcart-developer/references/restapi/integrations.md +1000 -1000
  141. package/dist/skills/fluentcart-developer/references/restapi/inventory.md +192 -192
  142. package/dist/skills/fluentcart-developer/references/restapi/labels-and-attributes.md +797 -797
  143. package/dist/skills/fluentcart-developer/references/restapi/licensing.md +1733 -1733
  144. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-available-shipping-methods.md +30 -30
  145. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-checkout-summary.md +28 -28
  146. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-country-info.md +29 -29
  147. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-order-info.md +28 -28
  148. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-shipping-methods-list-view.md +30 -30
  149. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/login.md +66 -66
  150. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/place-order.md +179 -179
  151. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/apply-coupon.md +83 -83
  152. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/cancel-coupon.md +87 -87
  153. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/check-product-eligibility.md +59 -59
  154. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/create-coupon.md +230 -230
  155. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/delete-coupon.md +29 -29
  156. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon-settings.md +20 -20
  157. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon.md +27 -27
  158. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupon-codes.md +20 -20
  159. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupons.md +37 -37
  160. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/re-apply-coupons.md +75 -75
  161. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/store-coupon-settings.md +40 -40
  162. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/update-coupon.md +133 -133
  163. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-address-checkout.md +138 -138
  164. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-profile-address.md +119 -119
  165. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/dashboard-overview.md +22 -22
  166. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/delete-profile-address.md +46 -46
  167. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-order-details.md +30 -30
  168. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-portal-sections.md +29 -29
  169. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-profile-details.md +22 -22
  170. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-transaction-billing-address.md +30 -30
  171. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-upgrade-paths.md +31 -31
  172. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-downloads.md +29 -29
  173. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-orders.md +28 -28
  174. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/make-profile-address-primary.md +55 -55
  175. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/pause-subscription.md +29 -29
  176. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/resume-subscription.md +29 -29
  177. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/save-transaction-billing-address.md +92 -92
  178. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/select-address-for-checkout.md +32 -32
  179. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-address.md +115 -115
  180. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-details.md +69 -69
  181. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/attach-user.md +50 -50
  182. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/bulk-actions.md +65 -65
  183. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-address.md +135 -135
  184. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-customer.md +108 -108
  185. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/delete-address.md +62 -62
  186. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/detach-user.md +28 -28
  187. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/find-customer-order.md +27 -27
  188. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-attachable-users.md +20 -20
  189. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-addresses.md +28 -28
  190. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-orders.md +37 -37
  191. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-stats.md +27 -27
  192. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer.md +32 -32
  193. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/list-customers.md +37 -37
  194. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/recalculate-ltv.md +28 -28
  195. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/set-primary-address.md +72 -72
  196. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-additional-info.md +55 -55
  197. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-address.md +144 -144
  198. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-customer.md +123 -123
  199. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/attach-note-to-order.md +49 -49
  200. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-all-pages.md +21 -21
  201. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-single-page.md +55 -55
  202. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/delete-activity.md +28 -28
  203. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-country-info.md +29 -29
  204. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-dashboard-stats.md +22 -22
  205. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-filter-options.md +31 -31
  206. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-data.md +20 -20
  207. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-settings.md +20 -20
  208. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-print-templates.md +20 -20
  209. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-search-options.md +27 -27
  210. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-widgets.md +28 -28
  211. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/initialize-app.md +20 -20
  212. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-activities.md +33 -33
  213. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-attachments.md +21 -21
  214. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-countries.md +20 -20
  215. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/mark-activity-read.md +53 -53
  216. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/run-data-backfills.md +21 -21
  217. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-settings.md +54 -54
  218. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-tax-settings.md +73 -73
  219. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-print-templates.md +64 -64
  220. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/upload-attachment.md +42 -42
  221. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-customers-batch.md +129 -129
  222. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-licenses-batch.md +133 -133
  223. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-orders-batch.md +129 -129
  224. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-subscriptions-batch.md +129 -129
  225. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-customers-export-schema.md +21 -21
  226. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-licenses-export-schema.md +26 -26
  227. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-orders-export-schema.md +21 -21
  228. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-subscriptions-export-schema.md +21 -21
  229. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/enable-notification.md +57 -57
  230. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-digest-settings.md +22 -22
  231. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-notification.md +30 -30
  232. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-reminders.md +22 -22
  233. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-settings.md +22 -22
  234. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-shortcodes.md +22 -22
  235. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/list-notifications.md +20 -20
  236. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-default-template.md +66 -66
  237. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-notification.md +50 -50
  238. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-digest-settings.md +101 -101
  239. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-reminders.md +162 -162
  240. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-settings.md +99 -99
  241. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-digest-test.md +47 -47
  242. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-manual-reminder.md +51 -51
  243. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/update-notification.md +93 -93
  244. package/dist/skills/fluentcart-developer/references/restapi/operations/files/delete-file.md +31 -31
  245. package/dist/skills/fluentcart-developer/references/restapi/operations/files/get-bucket-list.md +28 -28
  246. package/dist/skills/fluentcart-developer/references/restapi/operations/files/list-files.md +30 -30
  247. package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-editor-file.md +32 -32
  248. package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-file.md +34 -34
  249. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/chained-data-request.md +46 -46
  250. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/change-feed-status.md +51 -51
  251. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/delete-feed.md +27 -27
  252. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-dynamic-options.md +29 -29
  253. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-lists.md +27 -27
  254. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-settings.md +27 -27
  255. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-feeds.md +20 -20
  256. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-settings.md +26 -26
  257. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/install-addon-plugin.md +49 -49
  258. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/list-addons.md +20 -20
  259. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/save-feed-settings.md +52 -52
  260. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/set-global-settings.md +50 -50
  261. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/bulk-update-stock.md +94 -94
  262. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/export-inventory.md +81 -81
  263. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-adjustment-history.md +26 -26
  264. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-inventory-stats.md +21 -21
  265. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/list-inventory.md +33 -33
  266. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/update-stock.md +75 -75
  267. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-attribute-group.md +31 -31
  268. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-label.md +31 -31
  269. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-terms.md +90 -90
  270. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-group.md +28 -28
  271. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-term.md +29 -29
  272. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-group.md +28 -28
  273. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-library.md +20 -20
  274. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-groups.md +32 -32
  275. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-terms.md +33 -33
  276. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-labels.md +20 -20
  277. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-groups.md +51 -51
  278. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-terms.md +56 -56
  279. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-group.md +37 -37
  280. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-term.md +39 -39
  281. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-label-selections.md +32 -32
  282. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-plugin-license.md +41 -41
  283. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-site-admin.md +60 -60
  284. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-plugin-license.md +18 -18
  285. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-admin.md +67 -67
  286. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-customer.md +47 -47
  287. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/delete-license.md +24 -24
  288. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/extend-license-validity.md +47 -47
  289. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-license-details.md +25 -25
  290. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-licenses-admin.md +26 -26
  291. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-activations.md +25 -25
  292. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-details.md +25 -25
  293. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-site.md +30 -30
  294. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-plugin-license-status.md +18 -18
  295. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-product-license-settings.md +24 -24
  296. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-customer-licenses.md +25 -25
  297. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-license-sites.md +33 -33
  298. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-licenses.md +38 -38
  299. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-activate-license.md +54 -54
  300. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-check-license.md +26 -26
  301. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-deactivate-license.md +46 -46
  302. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-download-license-package.md +23 -23
  303. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-get-license-version.md +26 -26
  304. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/regenerate-license-key.md +24 -24
  305. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/save-product-license-settings.md +193 -193
  306. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-activation-limit.md +53 -53
  307. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-status.md +52 -52
  308. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/create-order-bump.md +47 -47
  309. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/delete-order-bump.md +25 -25
  310. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/get-order-bump.md +25 -25
  311. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/list-order-bumps.md +29 -29
  312. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/update-order-bump.md +141 -141
  313. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/accept-dispute.md +47 -47
  314. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/bulk-actions.md +72 -72
  315. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-shipping.md +67 -67
  316. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-tax.md +98 -98
  317. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/change-customer.md +50 -50
  318. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/charge-now.md +29 -29
  319. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-and-change-customer.md +92 -92
  320. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-custom-order-item.md +68 -68
  321. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-order.md +351 -351
  322. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-renewal-now.md +29 -29
  323. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/delete-order.md +28 -28
  324. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/generate-missing-licenses.md +29 -29
  325. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order-transactions.md +27 -27
  326. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order.md +27 -27
  327. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-renewal.md +28 -28
  328. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-shipping-methods.md +28 -28
  329. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-single-transaction.md +28 -28
  330. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-order-currencies.md +22 -22
  331. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-orders.md +42 -42
  332. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-renewals.md +28 -28
  333. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/mark-as-paid.md +61 -61
  334. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/price-order.md +135 -135
  335. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/refund-order.md +72 -72
  336. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/resend-renewal-invoice.md +29 -29
  337. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/skip-renewal.md +48 -48
  338. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-order-statuses.md +28 -28
  339. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-pending-transaction.md +29 -29
  340. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address-id.md +60 -60
  341. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address.md +98 -98
  342. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order.md +172 -172
  343. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-statuses.md +77 -77
  344. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-subscription-details.md +84 -84
  345. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-transaction-status.md +51 -51
  346. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/void-renewal.md +30 -30
  347. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/create-pdf-template.md +42 -42
  348. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/delete-pdf-template.md +26 -26
  349. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/download-pdf-preview.md +44 -44
  350. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-factory-default-templates.md +19 -19
  351. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-status.md +21 -21
  352. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-template.md +26 -26
  353. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-saved-templates.md +21 -21
  354. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-seller-details.md +19 -19
  355. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/list-pdf-templates.md +19 -19
  356. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-pdf-template.md +53 -53
  357. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-seller-details.md +97 -97
  358. package/dist/skills/fluentcart-developer/references/restapi/operations/products/add-product-terms.md +64 -64
  359. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-edit-fetch.md +30 -30
  360. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-insert-products.md +62 -62
  361. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-products.md +59 -59
  362. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-variants.md +83 -83
  363. package/dist/skills/fluentcart-developer/references/restapi/operations/products/change-integration-status.md +64 -64
  364. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-dummy-products.md +45 -45
  365. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-product.md +81 -81
  366. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-variation.md +181 -181
  367. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-downloadable-file.md +27 -27
  368. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product-integration.md +30 -30
  369. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product.md +27 -27
  370. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-taxonomy-term.md +55 -55
  371. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-upgrade-path.md +27 -27
  372. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-variation.md +27 -27
  373. package/dist/skills/fluentcart-developer/references/restapi/operations/products/do-bulk-action.md +56 -56
  374. package/dist/skills/fluentcart-developer/references/restapi/operations/products/duplicate-product.md +56 -56
  375. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-products-by-ids.md +26 -26
  376. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-taxonomy-terms.md +20 -20
  377. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-terms-by-parent.md +60 -60
  378. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-variations-by-ids.md +26 -26
  379. package/dist/skills/fluentcart-developer/references/restapi/operations/products/find-subscription-variants.md +26 -26
  380. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-bundle-info.md +27 -27
  381. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-downloadable-url.md +27 -27
  382. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-max-excerpt-word-count.md +20 -20
  383. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-pricing-widgets.md +27 -27
  384. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-feeds.md +29 -29
  385. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-settings.md +31 -31
  386. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-pricing.md +28 -28
  387. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product.md +28 -28
  388. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-related-products.md +31 -31
  389. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-upgrade-settings.md +27 -27
  390. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-variation-upgrade-paths.md +28 -28
  391. package/dist/skills/fluentcart-developer/references/restapi/operations/products/group-bulk-update-variants.md +103 -103
  392. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-all-variants.md +26 -26
  393. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-product-variations.md +26 -26
  394. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-products.md +34 -34
  395. package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-shipping-class.md +27 -27
  396. package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-tax-class.md +27 -27
  397. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-bundle-info.md +56 -56
  398. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-product-integration.md +62 -62
  399. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-upgrade-path.md +78 -78
  400. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-product-variant-options.md +29 -29
  401. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-products-by-name.md +28 -28
  402. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-variants-by-name.md +28 -28
  403. package/dist/skills/fluentcart-developer/references/restapi/operations/products/set-variation-media.md +74 -74
  404. package/dist/skills/fluentcart-developer/references/restapi/operations/products/suggest-sku.md +28 -28
  405. package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-downloadable-files.md +134 -134
  406. package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-taxonomy-terms.md +61 -61
  407. package/dist/skills/fluentcart-developer/references/restapi/operations/products/toggle-product-tax-exemption.md +56 -56
  408. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-downloadable-file.md +98 -98
  409. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-inventory.md +56 -56
  410. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-long-desc-editor-mode.md +49 -49
  411. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-manage-stock.md +53 -53
  412. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-detail.md +58 -58
  413. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-pricing.md +225 -225
  414. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-shipping-class.md +49 -49
  415. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-tax-class.md +49 -49
  416. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-upgrade-path.md +78 -78
  417. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-option.md +79 -79
  418. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-tax-exemption.md +56 -56
  419. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation-pricing-table.md +49 -49
  420. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation.md +105 -105
  421. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/get-product-views.md +34 -34
  422. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/list-products.md +42 -42
  423. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/search-products.md +30 -30
  424. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/channel-rules.md +24 -24
  425. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/country-heat-map.md +22 -22
  426. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupon-overview.md +37 -37
  427. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupons.md +36 -36
  428. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-insights.md +31 -31
  429. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-overview.md +36 -36
  430. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-repeat.md +35 -35
  431. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segment-customers.md +36 -36
  432. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segments.md +30 -30
  433. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-value.md +34 -34
  434. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/dashboard-stats.md +30 -30
  435. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/failed-orders.md +34 -34
  436. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-new-vs-returning-customer.md +34 -34
  437. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-by-day-and-hour.md +34 -34
  438. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-meta.md +29 -29
  439. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-top-sold-products.md +34 -34
  440. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/future-renewals.md +31 -31
  441. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/generate-retention-snapshots.md +24 -24
  442. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-overview.md +30 -30
  443. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-activities.md +26 -26
  444. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-orders.md +20 -20
  445. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-revenue.md +37 -37
  446. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-at-risk.md +35 -35
  447. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-variations.md +33 -33
  448. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments.md +33 -33
  449. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/item-count-distribution.md +34 -34
  450. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-chart.md +30 -30
  451. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-pie-chart.md +22 -22
  452. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-summary.md +22 -22
  453. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/locations.md +43 -43
  454. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-chart.md +37 -37
  455. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-completion-time.md +34 -34
  456. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-mix.md +34 -34
  457. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-value-distribution.md +34 -34
  458. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-disputes.md +38 -38
  459. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-methods.md +36 -36
  460. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods.md +37 -37
  461. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison-launch.md +33 -33
  462. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison.md +40 -40
  463. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-detail.md +37 -37
  464. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-sales.md +37 -37
  465. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/refunds-overview.md +37 -37
  466. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/retention-snapshots-step.md +45 -45
  467. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sales-growth-chart.md +35 -35
  468. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/save-channel-rules.md +73 -73
  469. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/source-channels.md +37 -37
  470. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sources.md +49 -49
  471. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-cohorts.md +33 -33
  472. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-health.md +30 -30
  473. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-rebuys.md +37 -37
  474. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-retention.md +34 -34
  475. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-variations.md +22 -22
  476. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscriptions-overview.md +37 -37
  477. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/weeks-between-refund.md +34 -34
  478. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/assign-role.md +48 -48
  479. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/delete-role-assignment.md +47 -47
  480. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/get-role.md +25 -25
  481. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-managers.md +18 -18
  482. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-roles.md +18 -18
  483. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/search-users.md +25 -25
  484. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/update-role.md +43 -43
  485. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/create-saved-view.md +106 -106
  486. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/delete-saved-view.md +26 -26
  487. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/list-saved-views.md +25 -25
  488. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/update-saved-view.md +83 -83
  489. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-payment-addon.md +44 -44
  490. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-plugin-addon.md +44 -44
  491. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/change-storage-driver-status.md +56 -56
  492. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/check-paypal-webhook.md +26 -26
  493. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/create-storage-bucket.md +63 -63
  494. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/disconnect-payment-method.md +55 -55
  495. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/exchange-paypal-seller-auth-token.md +62 -62
  496. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-active-storage-drivers.md +20 -20
  497. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-checkout-fields.md +22 -22
  498. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-email-shortcodes.md +20 -20
  499. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-config-snippets.md +26 -26
  500. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-status.md +20 -20
  501. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-module-settings.md +20 -20
  502. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-connection-info.md +26 -26
  503. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-settings.md +26 -26
  504. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-permissions.md +22 -22
  505. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-plugin-addons.md +20 -20
  506. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-storage-driver-settings.md +27 -27
  507. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-store-settings.md +26 -26
  508. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-mcp-adapter.md +21 -21
  509. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-payment-addon.md +60 -60
  510. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-plugin-addon.md +64 -64
  511. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-payment-methods.md +20 -20
  512. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-storage-drivers.md +20 -20
  513. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-storage-buckets.md +67 -67
  514. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reorder-payment-methods.md +55 -55
  515. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reset-storage-driver-settings.md +45 -45
  516. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-checkout-fields.md +133 -133
  517. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-confirmation-settings.md +68 -68
  518. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-module-settings.md +68 -68
  519. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-design.md +67 -67
  520. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-settings.md +58 -58
  521. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-permissions.md +68 -68
  522. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-storage-driver-settings.md +62 -62
  523. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-store-settings.md +239 -239
  524. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/setup-paypal-webhook.md +48 -48
  525. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/toggle-mcp.md +40 -40
  526. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-storage-driver-connection.md +62 -62
  527. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-turnstile-keys.md +55 -55
  528. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-class.md +73 -73
  529. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-method.md +110 -110
  530. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-zone.md +56 -56
  531. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-class.md +29 -29
  532. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-method.md +29 -29
  533. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-zone.md +29 -29
  534. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class-profile.md +30 -30
  535. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class.md +29 -29
  536. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-packages.md +22 -22
  537. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-zone.md +27 -27
  538. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-countries.md +22 -22
  539. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-states.md +28 -28
  540. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-classes.md +31 -31
  541. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-zones.md +31 -31
  542. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/save-shipping-packages.md +112 -112
  543. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-class.md +79 -79
  544. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-method.md +113 -113
  545. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-zone.md +62 -62
  546. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-zone-order.md +52 -52
  547. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-auto-renew.md +30 -30
  548. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-subscription.md +52 -52
  549. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/confirm-subscription-switch.md +70 -70
  550. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/fetch-subscription-remote.md +28 -28
  551. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/generate-early-payment-link.md +29 -29
  552. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-customer-subscription.md +27 -27
  553. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-or-create-plan.md +69 -69
  554. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-setup-intent-attempts.md +30 -30
  555. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-subscription.md +28 -28
  556. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/initiate-early-payment.md +31 -31
  557. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-customer-subscriptions.md +27 -27
  558. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-subscriptions.md +39 -39
  559. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/pause-subscription.md +28 -28
  560. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/reactivate-subscription.md +28 -28
  561. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/resume-subscription.md +28 -28
  562. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/switch-payment-method.md +70 -70
  563. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-payment-method.md +69 -69
  564. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-vendor-ids.md +56 -56
  565. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/verify-vendor-ids.md +56 -56
  566. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-class.md +51 -51
  567. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-rate.md +117 -117
  568. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-product-override.md +27 -27
  569. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-shipping-tax-override.md +27 -27
  570. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-class.md +28 -28
  571. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-rate.md +27 -27
  572. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-id.md +27 -27
  573. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-rates.md +28 -28
  574. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-eu-vat-product-overrides.md +20 -20
  575. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-oss-country-rates.md +20 -20
  576. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-preconfigured-tax-rates.md +20 -20
  577. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-product-overrides.md +27 -27
  578. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-tax-settings.md +20 -20
  579. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-all-tax-rates.md +20 -20
  580. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-classes.md +20 -20
  581. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-records.md +37 -37
  582. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/mark-taxes-as-filed.md +58 -58
  583. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/reset-eu-vat-rates.md +21 -21
  584. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-configured-countries.md +57 -57
  585. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-country-tax-id.md +50 -50
  586. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-eu-vat-cross-border-settings.md +127 -127
  587. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-oss-country-rates.md +100 -100
  588. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-product-override.md +110 -110
  589. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-shipping-tax-override.md +52 -52
  590. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-tax-settings.md +166 -166
  591. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-country-status.md +54 -54
  592. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-tax-rate.md +116 -116
  593. package/dist/skills/fluentcart-developer/references/restapi/order-bumps.md +433 -433
  594. package/dist/skills/fluentcart-developer/references/restapi/orders.md +1212 -1212
  595. package/dist/skills/fluentcart-developer/references/restapi/pdf-templates.md +212 -212
  596. package/dist/skills/fluentcart-developer/references/restapi/products.md +2485 -2485
  597. package/dist/skills/fluentcart-developer/references/restapi/public-shop.md +191 -191
  598. package/dist/skills/fluentcart-developer/references/restapi/reports.md +3773 -3773
  599. package/dist/skills/fluentcart-developer/references/restapi/roles.md +403 -403
  600. package/dist/skills/fluentcart-developer/references/restapi/saved-views.md +136 -136
  601. package/dist/skills/fluentcart-developer/references/restapi/settings.md +1423 -1423
  602. package/dist/skills/fluentcart-developer/references/restapi/shipping.md +905 -905
  603. package/dist/skills/fluentcart-developer/references/restapi/subscriptions.md +1169 -1169
  604. package/dist/skills/fluentcart-developer/references/restapi/tax.md +1551 -1551
  605. package/dist/skills/fluentcart-developer/references/restapi.md +127 -127
  606. package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
  607. package/dist/version.d.ts +1 -1
  608. package/dist/version.js +1 -1
  609. package/package.json +66 -65
@@ -1,1290 +1,1290 @@
1
- # Subscriptions
2
-
3
- Action hooks for [Subscription](/database/models/subscription.md) lifecycle management, status transitions, and scheduled reminder notifications. These hooks let you react to subscription state changes, send custom notifications, and integrate with external systems. Most hooks pass the related [Order](/database/models/order.md) and [Customer](/database/models/customer.md) models as well.
4
-
5
- ---
6
-
7
- ## Subscription Status Changes
8
-
9
- ### ` subscription_status_changed `
10
-
11
- `fluent_cart/payments/subscription_status_changed` — Fires on any subscription status transition
12
-
13
- **When it runs:** This action fires whenever a [Subscription](/database/models/subscription.md)'s status changes from one value to another (e.g., `pending` to `active`, `active` to `cancelled`, etc.). It does **not** fire when other subscription data changes without a status transition. This is the generic handler -- for status-specific hooks, see `fluent_cart/payments/subscription_{$status}` below.
14
-
15
- **Parameters:**
16
-
17
- - `$data` (array): Subscription status change data
18
-
19
- ```
20
- $data = [
21
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
22
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
23
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
24
- 'old_status' => 'pending', // string — previous status
25
- 'new_status' => 'active', // string — current status after update
26
- ];
27
- ```
28
-
29
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
30
-
31
- **Usage:**
32
-
33
- ```
34
- add_action('fluent_cart/payments/subscription_status_changed', function ($data) {
35
- $subscription = $data['subscription'];
36
- $oldStatus = $data['old_status'];
37
- $newStatus = $data['new_status'];
38
-
39
- // Log every status transition
40
- fluent_cart_add_log(
41
- 'Subscription Status Changed',
42
- sprintf('Subscription #%d changed from %s to %s', $subscription->id, $oldStatus, $newStatus),
43
- 'info'
44
- );
45
- }, 10, 1);
46
- ```
47
-
48
- ### ` subscription_active `
49
-
50
- `fluent_cart/payments/subscription_active` — Fires when a subscription becomes active
51
-
52
- **When it runs:** This action fires when a subscription's status transitions to `active`. This may occur after initial payment, after reactivation, or when moving from `trialing` to `active`.
53
-
54
- **Parameters:**
55
-
56
- - `$data` (array): Subscription data
57
-
58
- ```
59
- $data = [
60
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
61
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
62
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
63
- 'old_status' => 'pending', // string — previous status
64
- 'new_status' => 'active', // string — always 'active'
65
- ];
66
- ```
67
-
68
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:852`
69
-
70
- **Usage:**
71
-
72
- ```
73
- add_action('fluent_cart/payments/subscription_active', function ($data) {
74
- $customer = $data['customer'];
75
-
76
- // Grant premium access when subscription activates
77
- update_user_meta($customer->user_id, 'premium_member', true);
78
- }, 10, 1);
79
- ```
80
-
81
- ### ` subscription_canceled `
82
-
83
- `fluent_cart/payments/subscription_canceled` — Fires when a subscription is cancelled
84
-
85
- **When it runs:** This action fires when a subscription's status transitions to `canceled`. The `canceled_at` timestamp is automatically set if not already provided.
86
-
87
- **Parameters:**
88
-
89
- - `$data` (array): Subscription data
90
-
91
- ```
92
- $data = [
93
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
94
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
95
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
96
- 'old_status' => 'active', // string — previous status
97
- 'new_status' => 'canceled', // string — always 'canceled'
98
- ];
99
- ```
100
-
101
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
102
-
103
- **Usage:**
104
-
105
- ```
106
- add_action('fluent_cart/payments/subscription_canceled', function ($data) {
107
- $subscription = $data['subscription'];
108
- $customer = $data['customer'];
109
-
110
- // Revoke premium access on cancellation
111
- update_user_meta($customer->user_id, 'premium_member', false);
112
-
113
- // Notify admin
114
- wp_mail(
115
- get_option('admin_email'),
116
- 'Subscription Cancelled',
117
- sprintf('Subscription #%d for %s has been cancelled.', $subscription->id, $customer->email)
118
- );
119
- }, 10, 1);
120
- ```
121
-
122
- ### ` payments/subscription_paused `
123
-
124
- `fluent_cart/payments/subscription_paused` — Fires when a subscription is paused
125
-
126
- **When it runs:** This action fires when a subscription's status transitions to `paused`. The subscription remains in the system but billing is temporarily halted.
127
-
128
- **Parameters:**
129
-
130
- - `$data` (array): Subscription data
131
-
132
- ```
133
- $data = [
134
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
135
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
136
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
137
- 'old_status' => 'active', // string — previous status
138
- 'new_status' => 'paused', // string — always 'paused'
139
- ];
140
- ```
141
-
142
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
143
-
144
- **Usage:**
145
-
146
- ```
147
- add_action('fluent_cart/payments/subscription_paused', function ($data) {
148
- $subscription = $data['subscription'];
149
-
150
- // Temporarily suspend feature access
151
- update_user_meta($data['customer']->user_id, 'subscription_paused', true);
152
- }, 10, 1);
153
- ```
154
-
155
- ### ` subscription_expired `
156
-
157
- `fluent_cart/payments/subscription_expired` — Fires when a subscription expires
158
-
159
- **When it runs:** This action fires when a subscription's status transitions to `expired`. After this hook fires, the system also stores a `validity_expired_at` meta value and dispatches the `SubscriptionValidityExpired` event.
160
-
161
- **Parameters:**
162
-
163
- - `$data` (array): Subscription data
164
-
165
- ```
166
- $data = [
167
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
168
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
169
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
170
- 'old_status' => 'active', // string — previous status
171
- 'new_status' => 'expired', // string — always 'expired'
172
- ];
173
- ```
174
-
175
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
176
-
177
- **Usage:**
178
-
179
- ```
180
- add_action('fluent_cart/payments/subscription_expired', function ($data) {
181
- $customer = $data['customer'];
182
-
183
- // Remove premium access
184
- update_user_meta($customer->user_id, 'premium_member', false);
185
-
186
- // Notify the customer
187
- wp_mail(
188
- $customer->email,
189
- 'Your Subscription Has Expired',
190
- 'Your subscription has expired. Please renew to continue using premium features.'
191
- );
192
- }, 10, 1);
193
- ```
194
-
195
- ### ` subscription_failing `
196
-
197
- `fluent_cart/payments/subscription_failing` — Fires when a subscription payment is failing
198
-
199
- **When it runs:** This action fires when a subscription's status transitions to `failing`, indicating that a renewal payment attempt has failed. The subscription is still technically active but requires payment attention.
200
-
201
- **Parameters:**
202
-
203
- - `$data` (array): Subscription data
204
-
205
- ```
206
- $data = [
207
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
208
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
209
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
210
- 'old_status' => 'active', // string — previous status
211
- 'new_status' => 'failing', // string — always 'failing'
212
- ];
213
- ```
214
-
215
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
216
-
217
- **Usage:**
218
-
219
- ```
220
- add_action('fluent_cart/payments/subscription_failing', function ($data) {
221
- $subscription = $data['subscription'];
222
- $customer = $data['customer'];
223
-
224
- // Alert the customer about the payment failure
225
- wp_mail(
226
- $customer->email,
227
- 'Payment Failed for Your Subscription',
228
- sprintf('We were unable to process payment for subscription #%d. Please update your payment method.', $subscription->id)
229
- );
230
- }, 10, 1);
231
- ```
232
-
233
- ### ` subscription_expiring `
234
-
235
- `fluent_cart/payments/subscription_expiring` — Fires when a subscription is marked as expiring soon
236
-
237
- **When it runs:** This action fires when a subscription's status transitions to `expiring`, indicating that the subscription is approaching its end-of-term and will not be renewed.
238
-
239
- **Parameters:**
240
-
241
- - `$data` (array): Subscription data
242
-
243
- ```
244
- $data = [
245
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
246
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
247
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
248
- 'old_status' => 'active', // string — previous status
249
- 'new_status' => 'expiring', // string — always 'expiring'
250
- ];
251
- ```
252
-
253
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
254
-
255
- **Usage:**
256
-
257
- ```
258
- add_action('fluent_cart/payments/subscription_expiring', function ($data) {
259
- $subscription = $data['subscription'];
260
- $customer = $data['customer'];
261
-
262
- // Send a win-back offer before the subscription fully expires
263
- wp_mail(
264
- $customer->email,
265
- 'Your Subscription is About to Expire',
266
- 'Renew now and get 10% off your next billing cycle!'
267
- );
268
- }, 10, 1);
269
- ```
270
-
271
- ### ` subscription_completed `
272
-
273
- `fluent_cart/payments/subscription_completed` — Fires when a subscription completes all billing cycles
274
-
275
- **When it runs:** This action fires when a subscription's status transitions to `completed`. This occurs when the subscription has reached its end-of-term (EOT) -- i.e., the `bill_count` has met or exceeded `bill_times`. The `next_billing_date` is set to `NULL` and `canceled_at` is cleared.
276
-
277
- **Parameters:**
278
-
279
- - `$data` (array): Subscription data
280
-
281
- ```
282
- $data = [
283
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
284
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
285
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
286
- 'old_status' => 'active', // string — previous status
287
- 'new_status' => 'completed', // string — always 'completed'
288
- ];
289
- ```
290
-
291
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
292
-
293
- **Usage:**
294
-
295
- ```
296
- add_action('fluent_cart/payments/subscription_completed', function ($data) {
297
- $subscription = $data['subscription'];
298
- $customer = $data['customer'];
299
-
300
- // Thank the customer for completing their subscription term
301
- wp_mail(
302
- $customer->email,
303
- 'Subscription Complete',
304
- sprintf('Your subscription #%d has completed all %d billing cycles. Thank you!', $subscription->id, $subscription->bill_times)
305
- );
306
- }, 10, 1);
307
- ```
308
-
309
- ### ` subscription_trialing `
310
-
311
- `fluent_cart/payments/subscription_trialing` — Fires when a subscription enters trial status
312
-
313
- **When it runs:** This action fires when a subscription's status transitions to `trialing`. The subscription is in a free trial period and will transition to `active` (with billing) when the trial ends.
314
-
315
- **Parameters:**
316
-
317
- - `$data` (array): Subscription data
318
-
319
- ```
320
- $data = [
321
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
322
- 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
323
- 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
324
- 'old_status' => 'pending', // string — previous status
325
- 'new_status' => 'trialing', // string — always 'trialing'
326
- ];
327
- ```
328
-
329
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
330
-
331
- **Usage:**
332
-
333
- ```
334
- add_action('fluent_cart/payments/subscription_trialing', function ($data) {
335
- $subscription = $data['subscription'];
336
- $customer = $data['customer'];
337
-
338
- // Grant trial access
339
- update_user_meta($customer->user_id, 'trial_active', true);
340
-
341
- // Schedule a welcome email
342
- wp_mail(
343
- $customer->email,
344
- 'Your Free Trial Has Started',
345
- sprintf('Enjoy your trial! Your first payment will be on %s.', $subscription->next_billing_date)
346
- );
347
- }, 10, 1);
348
- ```
349
-
350
- ---
351
-
352
- ## Subscription Data Updates
353
-
354
- ### ` subscription_data_updated `
355
-
356
- `fluent_cart/subscription/data_updated` — Fires when subscription data changes without a status transition
357
-
358
- **When it runs:** This action fires when [Subscription](/database/models/subscription.md) attributes are modified but the status remains the same. Examples include billing amount changes, next payment date adjustments, or metadata updates. It only fires when there are actual dirty (changed) fields on the model.
359
-
360
- **Parameters:**
361
-
362
- - `$data` (array): Subscription update data
363
-
364
- ```
365
- $data = [
366
- 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription (already saved)
367
- 'updated_data' => [
368
- // Only the fields that actually changed (dirty attributes), e.g.:
369
- 'recurring_total' => 2999, // int — new amount in cents
370
- 'next_billing_date' => '2025-03-15 00:00:00', // string — updated billing date
371
- ],
372
- ];
373
- ```
374
-
375
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:418,1141`
376
-
377
- **Usage:**
378
-
379
- ```
380
- add_action('fluent_cart/subscription/data_updated', function ($data) {
381
- $subscription = $data['subscription'];
382
- $updatedData = $data['updated_data'];
383
-
384
- // Log billing amount changes
385
- if (isset($updatedData['recurring_total'])) {
386
- fluent_cart_add_log(
387
- 'Subscription Amount Changed',
388
- sprintf(
389
- 'Subscription #%d recurring total changed to %s',
390
- $subscription->id,
391
- number_format($updatedData['recurring_total'] / 100, 2)
392
- ),
393
- 'info'
394
- );
395
- }
396
-
397
- // Sync next billing date with external calendar
398
- if (isset($updatedData['next_billing_date'])) {
399
- do_action('my_plugin/sync_billing_date', $subscription->id, $updatedData['next_billing_date']);
400
- }
401
- }, 10, 1);
402
- ```
403
-
404
- ---
405
-
406
- ## Reminders & Notifications
407
-
408
- ### ` subscription_renewal_reminder `
409
-
410
- `fluent_cart/subscription_renewal_reminder` — Fires when a subscription renewal reminder is due
411
-
412
- **When it runs:** This action fires on a scheduled basis (via Action Scheduler) when a subscription's next billing date is approaching. The reminder system supports multiple billing cycles (yearly, monthly, quarterly, half-yearly) and configurable "days before" thresholds. Only fires for subscriptions with `active` or `trialing` status. The stage name indicates how many days before renewal (e.g., `before_30`, `before_7`).
413
-
414
- **Parameters:**
415
-
416
- - `$data` (array): Renewal reminder data
417
-
418
- ```
419
- $data = [
420
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
421
- 'order' => $subscription->order, // \FluentCart\App\Models\Order
422
- 'customer' => $subscription->customer, // \FluentCart\App\Models\Customer
423
- 'reminder' => [
424
- 'stage' => 'before_30', // string — e.g., 'before_30', 'before_7'
425
- 'billing_cycle' => 'yearly', // string — 'yearly', 'monthly', 'quarterly', 'half_yearly'
426
- 'billing_date' => '2025-03-15 00:00:00', // string — GMT formatted next billing date
427
- ],
428
- ];
429
- ```
430
-
431
- **Source:** `app/Services/Reminders/SubscriptionReminderService.php`
432
-
433
- **Usage:**
434
-
435
- ```
436
- add_action('fluent_cart/subscription_renewal_reminder', function ($data) {
437
- $subscription = $data['subscription'];
438
- $customer = $data['customer'];
439
- $reminder = $data['reminder'];
440
-
441
- // Send a custom renewal reminder email
442
- wp_mail(
443
- $customer->email,
444
- 'Subscription Renewal Coming Up',
445
- sprintf(
446
- 'Your %s subscription #%d will renew on %s.',
447
- $reminder['billing_cycle'],
448
- $subscription->id,
449
- date('F j, Y', strtotime($reminder['billing_date']))
450
- )
451
- );
452
- }, 10, 1);
453
- ```
454
-
455
- ### ` subscription_trial_end_reminder `
456
-
457
- `fluent_cart/subscription_trial_end_reminder` — Fires when a trial ending reminder is due
458
-
459
- **When it runs:** This action fires on a scheduled basis when a trialing subscription's trial period is about to end. Only fires for subscriptions with `trialing` status (excluding simulated trials). The stage name indicates how many days before the trial ends (e.g., `trial_end_3`, `trial_end_1`). Configurable via the `trial_end_reminder_days` store setting.
460
-
461
- **Parameters:**
462
-
463
- - `$data` (array): Trial end reminder data
464
-
465
- ```
466
- $data = [
467
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
468
- 'order' => $subscription->order, // \FluentCart\App\Models\Order
469
- 'customer' => $subscription->customer, // \FluentCart\App\Models\Customer
470
- 'reminder' => [
471
- 'stage' => 'trial_end_3', // string — e.g., 'trial_end_3', 'trial_end_1'
472
- 'trial_end_date' => '2025-02-01 00:00:00', // string — GMT formatted trial end date
473
- ],
474
- ];
475
- ```
476
-
477
- **Source:** `app/Services/Reminders/SubscriptionReminderService.php`
478
-
479
- **Usage:**
480
-
481
- ```
482
- add_action('fluent_cart/subscription_trial_end_reminder', function ($data) {
483
- $subscription = $data['subscription'];
484
- $customer = $data['customer'];
485
- $reminder = $data['reminder'];
486
-
487
- // Notify customer that their trial is ending soon
488
- wp_mail(
489
- $customer->email,
490
- 'Your Free Trial is Ending Soon',
491
- sprintf(
492
- 'Your trial for subscription #%d ends on %s. After that, you will be billed %s.',
493
- $subscription->id,
494
- date('F j, Y', strtotime($reminder['trial_end_date'])),
495
- number_format($subscription->recurring_total / 100, 2)
496
- )
497
- );
498
- }, 10, 1);
499
- ```
500
-
501
- ### ` renewal_reminder_overdue `
502
-
503
- `fluent_cart/renewal_reminder_overdue` — Fires when an overdue renewal reminder is triggered
504
-
505
- **When it runs:** This action fires on a scheduled basis when a renewal [Order](/database/models/order.md) with an outstanding balance has passed its due date by a configured number of days. The stage name indicates how many days overdue (e.g., `overdue_1`, `overdue_3`, `overdue_7`). The overdue offsets are configurable via the `renewal_reminder_overdue_days` store setting (defaults to `1,3,7`) and the `fluent_cart/reminders/renewal_overdue_days` filter. Reminders as a whole are gated by the `renewal_reminders_enabled` setting.
506
-
507
- **Parameters:**
508
-
509
- - `$data` (array): Renewal overdue reminder data
510
-
511
- ```
512
- $data = [
513
- 'order' => $order, // \FluentCart\App\Models\Order
514
- 'customer' => $order->customer, // \FluentCart\App\Models\Customer
515
- 'reminder' => [
516
- 'stage' => 'overdue_3', // string — e.g., 'overdue_1', 'overdue_3', 'overdue_7'
517
- 'order_id' => 123, // int — order ID
518
- 'order_ref' => 'INV-00123', // string — invoice number or '#123' fallback
519
- 'due_at' => '2025-01-15 00:00:00', // string — GMT formatted due date
520
- 'due_amount' => 5000, // int — outstanding amount in cents
521
- 'payment_link' => 'https://example.com/checkout/pay/uuid', // string — customer payment URL
522
- ],
523
- ];
524
- ```
525
-
526
- **Source:** `app/Services/Reminders/RenewalReminderService.php`
527
-
528
- **Usage:**
529
-
530
- ```
531
- add_action('fluent_cart/renewal_reminder_overdue', function ($data) {
532
- $order = $data['order'];
533
- $customer = $data['customer'];
534
- $reminder = $data['reminder'];
535
-
536
- // Send a payment reminder with a direct payment link
537
- wp_mail(
538
- $customer->email,
539
- sprintf('Payment Overdue for %s', $reminder['order_ref']),
540
- sprintf(
541
- "Your payment of %s for order %s is overdue.\n\nPay now: %s",
542
- number_format($reminder['due_amount'] / 100, 2),
543
- $reminder['order_ref'],
544
- $reminder['payment_link']
545
- )
546
- );
547
- }, 10, 1);
548
- ```
549
-
550
- ### ` renewal_reminder_due `
551
-
552
- `fluent_cart/renewal_reminder_due` — Fires when a renewal due-date reminder is triggered
553
-
554
- **When it runs:** This action fires on a scheduled basis when a renewal order with an outstanding balance reaches its due-date reminder window. This is the pre-/on-due-date notification, as opposed to the overdue reminders that fire after the due date has passed. Shares the same parameter structure as the overdue reminder. Gated by the `renewal_reminder_due_days` store setting (default `0` — no due reminder until set) and the `fluent_cart/reminders/renewal_due_days` filter.
555
-
556
- **Parameters:**
557
-
558
- - `$data` (array): Renewal due reminder data
559
-
560
- ```
561
- $data = [
562
- 'order' => $order, // \FluentCart\App\Models\Order
563
- 'customer' => $order->customer, // \FluentCart\App\Models\Customer
564
- 'reminder' => [
565
- 'stage' => 'before_0', // string — due-date reminder stage
566
- 'order_id' => 123, // int — order ID
567
- 'order_ref' => 'INV-00123', // string — invoice number or '#123' fallback
568
- 'due_at' => '2025-01-15 00:00:00', // string — GMT formatted due date
569
- 'due_amount' => 5000, // int — outstanding amount in cents
570
- 'payment_link' => 'https://example.com/checkout/pay/uuid', // string — customer payment URL
571
- ],
572
- ];
573
- ```
574
-
575
- **Source:** `app/Services/Reminders/RenewalReminderService.php`
576
-
577
- **Usage:**
578
-
579
- ```
580
- add_action('fluent_cart/renewal_reminder_due', function ($data) {
581
- $order = $data['order'];
582
- $customer = $data['customer'];
583
- $reminder = $data['reminder'];
584
-
585
- // Notify customer that their renewal is due
586
- wp_mail(
587
- $customer->email,
588
- sprintf('Payment Due for %s', $reminder['order_ref']),
589
- sprintf(
590
- "Your payment of %s for order %s is due.\n\nPay now: %s",
591
- number_format($reminder['due_amount'] / 100, 2),
592
- $reminder['order_ref'],
593
- $reminder['payment_link']
594
- )
595
- );
596
- }, 10, 1);
597
- ```
598
-
599
- ---
600
-
601
- ## Renewal Lifecycle Store-managed
602
-
603
- These fire for **store-managed** renewals (the `manual` / `system` collection methods), where FluentCart generates renewal orders on a schedule rather than mirroring a gateway subscription. See the [Subscriptions Module](/modules/subscriptions.md) for the full engine.
604
-
605
- ### ` renewal_created `
606
-
607
- `fluent_cart/renewal_created` — Fires when a renewal order is generated
608
-
609
- **When it runs:** This action fires whenever the renewal engine creates a renewal [Order](/database/models/order.md) for a store-managed [Subscription](/database/models/subscription.md) — from the advance-window cron (`system`/`manual`), from a `system` auto-charge cycle, and from the admin "Create Renewal Now" action.
610
-
611
- **Parameters:**
612
-
613
- - `$data` (array): Renewal creation data
614
-
615
- ```
616
- $data = [
617
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
618
- 'order' => $order, // \FluentCart\App\Models\Order — the new renewal order
619
- 'parent_order' => $parentOrder, // \FluentCart\App\Models\Order — the original order
620
- 'customer' => $customer, // \FluentCart\App\Models\Customer
621
- 'transaction' => $transaction, // \FluentCart\App\Models\OrderTransaction
622
- ];
623
- ```
624
-
625
- **Source:** `app/Http/Controllers/RenewalController.php:165`, `app/Modules/Subscriptions/Services/SystemChargeService.php:310`, `app/Modules/StoreManagedRenewal/Services/RenewalService.php:237`
626
-
627
- **Usage:**
628
-
629
- ```
630
- add_action('fluent_cart/renewal_created', function ($data) {
631
- $order = $data['order'];
632
- // Sync the freshly generated renewal order to an external ledger
633
- }, 10, 1);
634
- ```
635
-
636
- ### ` renewal_paid `
637
-
638
- `fluent_cart/renewal_paid` — Fires once when a renewal order is paid
639
-
640
- **When it runs:** This action fires exactly once when a renewal [Order](/database/models/order.md) transitions to paid — the single edge-triggered "a renewal was collected" signal, whether the payment came from a `system` off-session charge, a customer Pay-Now, or a gateway-managed renewal webhook. It is the canonical place to grant/extend access on renewal.
641
-
642
- **Parameters:**
643
-
644
- - `$data` (array): Renewal payment data
645
-
646
- ```
647
- $data = [
648
- 'order' => $order, // \FluentCart\App\Models\Order — the paid renewal order
649
- ];
650
- ```
651
-
652
- **Source:** `app/Helpers/StatusHelper.php:225`
653
-
654
- **Usage:**
655
-
656
- ```
657
- add_action('fluent_cart/renewal_paid', function ($data) {
658
- $order = $data['order'];
659
- // Extend the customer's access period for this renewal
660
- }, 10, 1);
661
- ```
662
-
663
- ### ` renewal_payment_scheduled `
664
-
665
- `fluent_cart/renewal_payment_scheduled` — Fires when a gateway renewal payment is scheduled (positional args)
666
-
667
- **When it runs:** This action fires when a gateway confirms a renewal payment is scheduled at the vendor (Stripe/PayPal confirmation paths). Fires alongside `fluent_cart/renewal/payment_scheduled` (array shape) — this is the legacy positional-argument variant.
668
-
669
- Positional arguments
670
-
671
- This hook passes **two positional arguments**, not a single array. Register with `, 10, 2`.
672
-
673
- **Parameters:**
674
-
675
- - `$order` ([Order](/database/models/order.md)): The renewal order
676
- - `$subscription` ([Subscription](/database/models/subscription.md)): The subscription
677
-
678
- **Source:** `app/Modules/PaymentMethods/PayPalGateway/Processor.php:476`, `app/Modules/PaymentMethods/StripeGateway/Confirmations.php:485`
679
-
680
- **Usage:**
681
-
682
- ```
683
- add_action('fluent_cart/renewal_payment_scheduled', function ($order, $subscription) {
684
- // React to a scheduled gateway renewal payment
685
- }, 10, 2);
686
- ```
687
-
688
- ### ` renewal/payment_scheduled `
689
-
690
- `fluent_cart/renewal/payment_scheduled` — Fires when a gateway renewal payment is scheduled (array payload)
691
-
692
- **When it runs:** The array-payload variant of the hook above, fired back-to-back with `fluent_cart/renewal_payment_scheduled`. Prefer this one for new integrations.
693
-
694
- **Parameters:**
695
-
696
- - `$data` (array): Scheduled renewal payment data
697
-
698
- ```
699
- $data = [
700
- 'order' => $order, // \FluentCart\App\Models\Order
701
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
702
- ];
703
- ```
704
-
705
- **Source:** `app/Modules/PaymentMethods/PayPalGateway/Processor.php:752`, `app/Modules/PaymentMethods/StripeGateway/Confirmations.php:486`
706
-
707
- **Usage:**
708
-
709
- ```
710
- add_action('fluent_cart/renewal/payment_scheduled', function ($data) {
711
- $order = $data['order'];
712
- }, 10, 1);
713
- ```
714
-
715
- ### ` renewal_voided `
716
-
717
- `fluent_cart/renewal_voided` — Fires when a renewal order is voided
718
-
719
- **When it runs:** This action fires when an open renewal order is voided (e.g., superseded or cancelled before payment).
720
-
721
- **Parameters:**
722
-
723
- - `$data` (array): Voided renewal data
724
-
725
- ```
726
- $data = [
727
- 'order' => $order, // \FluentCart\App\Models\Order — the voided renewal order
728
- 'customer' => $customer, // \FluentCart\App\Models\Customer
729
- ];
730
- ```
731
-
732
- **Source:** `app/Http/Controllers/RenewalController.php:126`
733
-
734
- **Usage:**
735
-
736
- ```
737
- add_action('fluent_cart/renewal_voided', function ($data) {
738
- // Clean up any external state tied to the voided renewal
739
- }, 10, 1);
740
- ```
741
-
742
- ### ` subscriptions/system_renewal_scheduled `
743
-
744
- `fluent_cart/subscriptions/system_renewal_scheduled` — Fires when a store-managed renewal is scheduled for auto-charge
745
-
746
- **When it runs:** This action fires when the renewal engine schedules a store-managed renewal order for its due-date off-session charge attempt.
747
-
748
- **Parameters:**
749
-
750
- - `$data` (array): Scheduled renewal data
751
-
752
- ```
753
- $data = [
754
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
755
- 'order' => $order, // \FluentCart\App\Models\Order
756
- 'parent_order' => $parentOrder, // \FluentCart\App\Models\Order
757
- 'customer' => $customer, // \FluentCart\App\Models\Customer
758
- 'transaction' => $transaction, // \FluentCart\App\Models\OrderTransaction
759
- ];
760
- ```
761
-
762
- **Source:** `app/Modules/StoreManagedRenewal/Services/RenewalService.php:227`
763
-
764
- **Usage:**
765
-
766
- ```
767
- add_action('fluent_cart/subscriptions/system_renewal_scheduled', function ($data) {
768
- // Notify the customer that an automatic charge is upcoming
769
- }, 10, 1);
770
- ```
771
-
772
- ---
773
-
774
- ## Collection Method & Status Store-managed
775
-
776
- ### ` subscription_converted_to_automatic `
777
-
778
- `fluent_cart/subscription_converted_to_automatic` — Fires when a subscription becomes gateway-managed
779
-
780
- **When it runs:** This action fires when a subscription's collection method is converted to `automatic` — a live vendor subscription now owns the billing schedule (legacy manual→automatic conversion at a subscription-capable gateway).
781
-
782
- **Parameters:**
783
-
784
- - `$data` (array): Conversion data
785
-
786
- ```
787
- $data = [
788
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
789
- 'payment_method' => $paymentMethod, // string — gateway slug now managing billing
790
- ];
791
- ```
792
-
793
- **Source:** `app/Modules/PaymentMethods/PayPalGateway/PayPal.php:150`, `app/Modules/PaymentMethods/StripeGateway/Stripe.php:148`
794
-
795
- **Usage:**
796
-
797
- ```
798
- add_action('fluent_cart/subscription_converted_to_automatic', function ($data) {
799
- $subscription = $data['subscription'];
800
- }, 10, 1);
801
- ```
802
-
803
- ### ` subscription_converted_to_manual `
804
-
805
- `fluent_cart/subscription_converted_to_manual` — Fires when a subscription falls back to manual invoicing
806
-
807
- **When it runs:** This action fires when a subscription is demoted to the `manual` collection method — for example, a `system` subscription whose gateway can no longer token-charge (see [demotion](/modules/subscriptions.md#store-managed-auto-charge-system)).
808
-
809
- **Parameters:**
810
-
811
- - `$data` (array): Conversion data
812
-
813
- ```
814
- $data = [
815
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
816
- 'payment_method' => $paymentMethod, // string — current payment method slug
817
- ];
818
- ```
819
-
820
- **Source:** `app/Modules/PaymentMethods/Core/AbstractPaymentGateway.php:343`
821
-
822
- **Usage:**
823
-
824
- ```
825
- add_action('fluent_cart/subscription_converted_to_manual', function ($data) {
826
- // Alert staff that automatic billing was lost for this subscription
827
- }, 10, 1);
828
- ```
829
-
830
- ### ` subscription_past_due `
831
-
832
- `fluent_cart/subscription_past_due` — Fires when a store-managed subscription enters dunning
833
-
834
- **When it runs:** This action fires when a store-managed subscription's renewal passes its grace anchor and the subscription enters the past-due (dunning) window, before eventual expiry.
835
-
836
- **Parameters:**
837
-
838
- - `$data` (array): Past-due data
839
-
840
- ```
841
- $data = [
842
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
843
- 'order' => $order, // \FluentCart\App\Models\Order — the unpaid renewal
844
- 'customer' => $customer, // \FluentCart\App\Models\Customer
845
- ];
846
- ```
847
-
848
- **Source:** `app/Modules/StoreManagedRenewal/Services/RenewalService.php:696`
849
-
850
- **Usage:**
851
-
852
- ```
853
- add_action('fluent_cart/subscription_past_due', function ($data) {
854
- // Trigger a custom dunning sequence
855
- }, 10, 1);
856
- ```
857
-
858
- ### ` subscription/reactivated_locally `
859
-
860
- `fluent_cart/subscription/reactivated_locally` — Fires when a store-managed subscription is reactivated locally (positional arg)
861
-
862
- **When it runs:** This action fires when a store-managed subscription is reactivated by FluentCart itself (no vendor call), e.g., after a successful late payment.
863
-
864
- Positional argument
865
-
866
- This hook passes the **Subscription model directly**, not an array. Register with `, 10, 1` and type-hint the model.
867
-
868
- **Parameters:**
869
-
870
- - `$subscription` ([Subscription](/database/models/subscription.md)): The reactivated subscription
871
-
872
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:864`
873
-
874
- **Usage:**
875
-
876
- ```
877
- add_action('fluent_cart/subscription/reactivated_locally', function ($subscription) {
878
- // Restore access for the reactivated subscription
879
- }, 10, 1);
880
- ```
881
-
882
- ---
883
-
884
- ## Native Subscription Events Store-managed
885
-
886
- Distinct from the `payments/subscription_{status}` bus
887
-
888
- These `fluent_cart/subscription_*` events carry richer payloads (`reason`, `updates`, `changes`) and are **separate hooks** from the like-named [status bus](#subscription-status-changes) (`fluent_cart/payments/subscription_paused`, etc.). Both may fire for the same transition.
889
-
890
- ### ` subscription_paused `
891
-
892
- `fluent_cart/subscription_paused` — Native event: subscription paused
893
-
894
- **When it runs:** Dispatched when a subscription is paused, via the subscription event dispatcher.
895
-
896
- **Parameters:**
897
-
898
- - `$data` (array): Pause event data
899
-
900
- ```
901
- $data = [
902
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
903
- 'reason' => 'user_request', // string — pause reason
904
- 'order' => $order, // \FluentCart\App\Models\Order
905
- 'customer' => $customer, // \FluentCart\App\Models\Customer
906
- 'old_status' => 'active', // string — status before pause
907
- ];
908
- ```
909
-
910
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:527` (via `EventDispatcher`)
911
-
912
- **Usage:**
913
-
914
- ```
915
- add_action('fluent_cart/subscription_paused', function ($data) {
916
- $reason = $data['reason'];
917
- }, 10, 1);
918
- ```
919
-
920
- ### ` subscription_resumed `
921
-
922
- `fluent_cart/subscription_resumed` — Native event: subscription resumed
923
-
924
- **When it runs:** Dispatched when a paused subscription is resumed.
925
-
926
- **Parameters:**
927
-
928
- - `$data` (array): Resume event data
929
-
930
- ```
931
- $data = [
932
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
933
- 'reason' => 'user_request', // string — resume reason
934
- 'order' => $order, // \FluentCart\App\Models\Order
935
- 'customer' => $customer, // \FluentCart\App\Models\Customer
936
- 'old_status' => 'paused', // string — status before resume
937
- ];
938
- ```
939
-
940
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:530` (via `EventDispatcher`)
941
-
942
- **Usage:**
943
-
944
- ```
945
- add_action('fluent_cart/subscription_resumed', function ($data) {
946
- $subscription = $data['subscription'];
947
- }, 10, 1);
948
- ```
949
-
950
- ### ` subscription_updated `
951
-
952
- `fluent_cart/subscription_updated` — Native event: subscription terms updated
953
-
954
- **When it runs:** Dispatched when a store-managed subscription's editable terms change (amount, interval, next billing date, etc.).
955
-
956
- **Parameters:**
957
-
958
- - `$data` (array): Update event data
959
-
960
- ```
961
- $data = [
962
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
963
- 'updates' => [ /* ... */ ], // array — fields submitted for update
964
- 'changes' => [ /* ... */ ], // array — fields that actually changed
965
- 'order' => $order, // \FluentCart\App\Models\Order
966
- 'customer' => $customer, // \FluentCart\App\Models\Customer
967
- ];
968
- ```
969
-
970
- **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:533` (via `EventDispatcher`)
971
-
972
- **Usage:**
973
-
974
- ```
975
- add_action('fluent_cart/subscription_updated', function ($data) {
976
- $changes = $data['changes'];
977
- }, 10, 1);
978
- ```
979
-
980
- ---
981
-
982
- ## System Auto-Charge system
983
-
984
- These fire only for `system` subscriptions — store-managed subscriptions that auto-charge a saved token each renewal. See [Store-managed + auto-charge](/modules/subscriptions.md#store-managed-auto-charge-system).
985
-
986
- ### ` subscriptions/system_charge_succeeded `
987
-
988
- `fluent_cart/subscriptions/system_charge_succeeded` — Fires when an off-session renewal charge succeeds
989
-
990
- **When it runs:** This action fires when a `system` subscription's off-session renewal charge is confirmed successful.
991
-
992
- **Parameters:**
993
-
994
- - `$data` (array): Successful charge data
995
-
996
- ```
997
- $data = [
998
- 'order' => $order, // \FluentCart\App\Models\Order — the renewal order
999
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1000
- 'attempt' => 1, // int — which retry attempt succeeded
1001
- ];
1002
- ```
1003
-
1004
- **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:584`
1005
-
1006
- **Usage:**
1007
-
1008
- ```
1009
- add_action('fluent_cart/subscriptions/system_charge_succeeded', function ($data) {
1010
- $order = $data['order'];
1011
- }, 10, 1);
1012
- ```
1013
-
1014
- ### ` subscriptions/system_charge_failed `
1015
-
1016
- `fluent_cart/subscriptions/system_charge_failed` — Fires when an off-session renewal charge fails
1017
-
1018
- **When it runs:** This action fires when a `system` renewal charge attempt fails. The retry ladder may schedule further attempts within the grace window before the subscription is marked past due.
1019
-
1020
- **Parameters:**
1021
-
1022
- - `$data` (array): Failed charge data
1023
-
1024
- ```
1025
- $data = [
1026
- 'order' => $order, // \FluentCart\App\Models\Order
1027
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1028
- 'attempt' => 2, // int — attempt number that failed
1029
- 'error' => 'card_declined', // string — gateway error
1030
- 'next_retry_at' => '2025-01-18 00:00:00', // string|null — GMT time of next attempt, null if exhausted
1031
- ];
1032
- ```
1033
-
1034
- **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:730`
1035
-
1036
- **Usage:**
1037
-
1038
- ```
1039
- add_action('fluent_cart/subscriptions/system_charge_failed', function ($data) {
1040
- if (empty($data['next_retry_at'])) {
1041
- // Retries exhausted — escalate
1042
- }
1043
- }, 10, 1);
1044
- ```
1045
-
1046
- ### ` subscriptions/system_charge_failed_notification `
1047
-
1048
- `fluent_cart/subscriptions/system_charge_failed_notification` — Fires when a charge-failure notification should be sent
1049
-
1050
- **When it runs:** This action fires when a `system` charge failure warrants notifying the customer (gated by `fluent_cart/subscriptions/system_charge_failure_notify`). Carries the full context needed to render an email.
1051
-
1052
- **Parameters:**
1053
-
1054
- - `$data` (array): Failure notification data
1055
-
1056
- ```
1057
- $data = [
1058
- 'order' => $order, // \FluentCart\App\Models\Order
1059
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1060
- 'parent_order' => $parentOrder, // \FluentCart\App\Models\Order
1061
- 'customer' => $customer, // \FluentCart\App\Models\Customer
1062
- 'transaction' => $transaction, // \FluentCart\App\Models\OrderTransaction
1063
- 'error' => 'card_declined', // string — gateway error
1064
- 'attempt' => 2, // int — attempt number
1065
- 'next_retry_at' => '2025-01-18 00:00:00', // string|null — GMT time of next attempt
1066
- ];
1067
- ```
1068
-
1069
- **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:746`
1070
-
1071
- **Usage:**
1072
-
1073
- ```
1074
- add_action('fluent_cart/subscriptions/system_charge_failed_notification', function ($data) {
1075
- // Send a custom "payment failed" email
1076
- }, 10, 1);
1077
- ```
1078
-
1079
- ### ` subscriptions/system_charge_disabled `
1080
-
1081
- `fluent_cart/subscriptions/system_charge_disabled` — Fires when auto-charge is turned off for a subscription
1082
-
1083
- **When it runs:** This action fires when a subscription loses `system` auto-charge and is handed back to plain manual invoicing (`demoteToManual()`), e.g., its gateway can no longer token-charge.
1084
-
1085
- **Parameters:**
1086
-
1087
- - `$data` (array): Disable data
1088
-
1089
- ```
1090
- $data = [
1091
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1092
- 'reason' => 'gateway_incapable', // string — why auto-charge was disabled
1093
- ];
1094
- ```
1095
-
1096
- **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:325`
1097
-
1098
- **Usage:**
1099
-
1100
- ```
1101
- add_action('fluent_cart/subscriptions/system_charge_disabled', function ($data) {
1102
- $reason = $data['reason'];
1103
- }, 10, 1);
1104
- ```
1105
-
1106
- ### ` subscriptions/system_charge_manual_triggered `
1107
-
1108
- `fluent_cart/subscriptions/system_charge_manual_triggered` — Fires when an admin triggers an off-session charge
1109
-
1110
- **When it runs:** This action fires when a store admin manually triggers a `system` charge (the "Charge Now" / "Charge Next Renewal Now" actions).
1111
-
1112
- **Parameters:**
1113
-
1114
- - `$data` (array): Manual trigger data
1115
-
1116
- ```
1117
- $data = [
1118
- 'order' => $order, // \FluentCart\App\Models\Order
1119
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1120
- 'attempt' => 1, // int — attempt number
1121
- 'actor_id' => 5, // int — admin user ID who triggered it
1122
- 'result' => 'success', // mixed — charge result
1123
- ];
1124
- ```
1125
-
1126
- **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:444`
1127
-
1128
- **Usage:**
1129
-
1130
- ```
1131
- add_action('fluent_cart/subscriptions/system_charge_manual_triggered', function ($data) {
1132
- // Audit-log the admin-initiated charge
1133
- }, 10, 1);
1134
- ```
1135
-
1136
- ### ` subscriptions/system_payment_method_updated `
1137
-
1138
- `fluent_cart/subscriptions/system_payment_method_updated` — Fires when the saved token for a system subscription changes
1139
-
1140
- **When it runs:** This action fires when the vaulted payment method (token) backing a `system` subscription is updated — e.g., the customer updates the card on file.
1141
-
1142
- **Parameters:**
1143
-
1144
- - `$data` (array): Payment method update data
1145
-
1146
- ```
1147
- $data = [
1148
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1149
- 'payment_method' => $paymentMethod, // array|string — the new vaulted method reference
1150
- ];
1151
- ```
1152
-
1153
- **Source:** `app/Modules/PaymentMethods/StripeGateway/UpdateCustomerPaymentMethod.php:129`
1154
-
1155
- **Usage:**
1156
-
1157
- ```
1158
- add_action('fluent_cart/subscriptions/system_payment_method_updated', function ($data) {
1159
- // Confirm the new card to the customer
1160
- }, 10, 1);
1161
- ```
1162
-
1163
- ---
1164
-
1165
- ## Subscription Upgrades & Early Payments Pro
1166
-
1167
- ### ` early_payment_completed `
1168
-
1169
- `fluent_cart/subscription/early_payment_completed` Pro — Fires when an early installment payment is completed
1170
-
1171
- **When it runs:** This action fires when a customer makes an early installment payment on their subscription, paying for one or more future billing cycles ahead of schedule.
1172
-
1173
- **Parameters:**
1174
-
1175
- - `$data` (array): Early payment completion data
1176
-
1177
- ```
1178
- $data = [
1179
- 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1180
- 'order' => $order, // \FluentCart\App\Models\Order
1181
- 'installment_count' => $installmentCount, // int — number of installments paid early
1182
- ];
1183
- ```
1184
-
1185
- **Source:** `fluent-cart-pro/app/Hooks/Handlers/EarlyInstallmentPaymentHandler.php:279`
1186
-
1187
- **Usage:**
1188
-
1189
- ```
1190
- add_action('fluent_cart/subscription/early_payment_completed', function ($data) {
1191
- $subscription = $data['subscription'];
1192
- $order = $data['order'];
1193
- $installmentCount = $data['installment_count'];
1194
-
1195
- fluent_cart_add_log(
1196
- 'Early Payment Completed',
1197
- sprintf('Subscription #%d received %d early installment(s) via order #%d', $subscription->id, $installmentCount, $order->id),
1198
- 'info'
1199
- );
1200
- }, 10, 1);
1201
- ```
1202
-
1203
- ### ` order_upgraded `
1204
-
1205
- `fluent_cart/order/upgraded` Pro — Fires when a plan upgrade is completed
1206
-
1207
- **When it runs:** This action fires when a customer completes a plan upgrade, transitioning from one product variant to another. The upgrade creates a new order and transaction record.
1208
-
1209
- **Parameters:**
1210
-
1211
- - `$data` (array): Upgrade completion data
1212
-
1213
- ```
1214
- $data = [
1215
- 'order' => $newOrder, // \FluentCart\App\Models\Order — the new upgrade order
1216
- 'from_order' => $upgradeFromOrder, // \FluentCart\App\Models\Order — the original order
1217
- 'cart' => $cartModel, // \FluentCart\App\Models\Cart — the cart used for the upgrade
1218
- 'from_variant_id' => $fromVariantId, // int — ID of the original product variant
1219
- 'transaction' => $transaction, // \FluentCart\App\Models\OrderTransaction — the upgrade payment transaction
1220
- ];
1221
- ```
1222
-
1223
- **Source:** `fluent-cart-pro/app/Hooks/Handlers/UpgradeHandler.php:268`
1224
-
1225
- **Usage:**
1226
-
1227
- ```
1228
- add_action('fluent_cart/order/upgraded', function ($data) {
1229
- $order = $data['order'];
1230
- $fromOrder = $data['from_order'];
1231
- $fromVariantId = $data['from_variant_id'];
1232
- $transaction = $data['transaction'];
1233
-
1234
- fluent_cart_add_log(
1235
- 'Plan Upgraded',
1236
- sprintf(
1237
- 'Order #%d upgraded from order #%d (variant %d). Transaction: %s',
1238
- $order->id,
1239
- $fromOrder->id,
1240
- $fromVariantId,
1241
- $transaction->charge_id
1242
- ),
1243
- 'info'
1244
- );
1245
- }, 10, 1);
1246
- ```
1247
-
1248
- ### ` plan_changed `
1249
-
1250
- `fluent_cart/plan_changed` Pro — Fires when a plan upgrade changes the customer's plan
1251
-
1252
- **When it runs:** This action fires when a plan upgrade completes, right after `fluent_cart/order/upgraded`. Core defines the event (`FluentCart\App\Events\PlanChanged`), and FluentCart Pro fires it when it finishes the upgrade. It does not fire if Pro cannot find the old or the new variation.
1253
-
1254
- Unlike `fluent_cart/order/upgraded`, the payload gives both variations, so you do not need to read the upgrade cart. The models arrive as arrays.
1255
-
1256
- With a gateway that can confirm the same payment twice at the same time (a webhook and a redirect), the action can fire twice for one upgrade. Make your listener safe to run twice.
1257
-
1258
- **Parameters:**
1259
-
1260
- - `$data` (array): Plan change data
1261
-
1262
- ```
1263
- $data = [
1264
- 'order' => [...], // array — the new upgrade order (Order::toArray())
1265
- 'customer' => [...], // array — the customer, or [] if none
1266
- 'new_variation' => [...], // array — the variation the customer upgraded to
1267
- 'old_variation' => [...], // array — the variation the customer upgraded from
1268
- 'other_info' => [
1269
- 'from_order_id' => 120, // int — the original order
1270
- 'from_subscription_id' => 45, // int — the old subscription, 0 if none
1271
- 'subscription_id' => 46, // int — the new subscription, 0 if none
1272
- ],
1273
- ];
1274
- ```
1275
-
1276
- **Source:** `fluent-cart-pro/app/Hooks/Handlers/UpgradeHandler.php:417` (dispatch), `app/Events/PlanChanged.php` (event)
1277
-
1278
- **Usage:**
1279
-
1280
- ```
1281
- add_action('fluent_cart/plan_changed', function ($data) {
1282
- $customerEmail = $data['customer']['email'] ?? '';
1283
- $fromVariation = $data['old_variation']['id'];
1284
- $toVariation = $data['new_variation']['id'];
1285
-
1286
- my_plugin_move_member($customerEmail, $fromVariation, $toVariation);
1287
- }, 10, 1);
1288
- ```
1289
-
1290
- ---
1
+ # Subscriptions
2
+
3
+ Action hooks for [Subscription](/database/models/subscription.md) lifecycle management, status transitions, and scheduled reminder notifications. These hooks let you react to subscription state changes, send custom notifications, and integrate with external systems. Most hooks pass the related [Order](/database/models/order.md) and [Customer](/database/models/customer.md) models as well.
4
+
5
+ ---
6
+
7
+ ## Subscription Status Changes
8
+
9
+ ### ` subscription_status_changed `
10
+
11
+ `fluent_cart/payments/subscription_status_changed` — Fires on any subscription status transition
12
+
13
+ **When it runs:** This action fires whenever a [Subscription](/database/models/subscription.md)'s status changes from one value to another (e.g., `pending` to `active`, `active` to `cancelled`, etc.). It does **not** fire when other subscription data changes without a status transition. This is the generic handler -- for status-specific hooks, see `fluent_cart/payments/subscription_{$status}` below.
14
+
15
+ **Parameters:**
16
+
17
+ - `$data` (array): Subscription status change data
18
+
19
+ ```
20
+ $data = [
21
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
22
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
23
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
24
+ 'old_status' => 'pending', // string — previous status
25
+ 'new_status' => 'active', // string — current status after update
26
+ ];
27
+ ```
28
+
29
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
30
+
31
+ **Usage:**
32
+
33
+ ```
34
+ add_action('fluent_cart/payments/subscription_status_changed', function ($data) {
35
+ $subscription = $data['subscription'];
36
+ $oldStatus = $data['old_status'];
37
+ $newStatus = $data['new_status'];
38
+
39
+ // Log every status transition
40
+ fluent_cart_add_log(
41
+ 'Subscription Status Changed',
42
+ sprintf('Subscription #%d changed from %s to %s', $subscription->id, $oldStatus, $newStatus),
43
+ 'info'
44
+ );
45
+ }, 10, 1);
46
+ ```
47
+
48
+ ### ` subscription_active `
49
+
50
+ `fluent_cart/payments/subscription_active` — Fires when a subscription becomes active
51
+
52
+ **When it runs:** This action fires when a subscription's status transitions to `active`. This may occur after initial payment, after reactivation, or when moving from `trialing` to `active`.
53
+
54
+ **Parameters:**
55
+
56
+ - `$data` (array): Subscription data
57
+
58
+ ```
59
+ $data = [
60
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
61
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
62
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
63
+ 'old_status' => 'pending', // string — previous status
64
+ 'new_status' => 'active', // string — always 'active'
65
+ ];
66
+ ```
67
+
68
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:852`
69
+
70
+ **Usage:**
71
+
72
+ ```
73
+ add_action('fluent_cart/payments/subscription_active', function ($data) {
74
+ $customer = $data['customer'];
75
+
76
+ // Grant premium access when subscription activates
77
+ update_user_meta($customer->user_id, 'premium_member', true);
78
+ }, 10, 1);
79
+ ```
80
+
81
+ ### ` subscription_canceled `
82
+
83
+ `fluent_cart/payments/subscription_canceled` — Fires when a subscription is cancelled
84
+
85
+ **When it runs:** This action fires when a subscription's status transitions to `canceled`. The `canceled_at` timestamp is automatically set if not already provided.
86
+
87
+ **Parameters:**
88
+
89
+ - `$data` (array): Subscription data
90
+
91
+ ```
92
+ $data = [
93
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
94
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
95
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
96
+ 'old_status' => 'active', // string — previous status
97
+ 'new_status' => 'canceled', // string — always 'canceled'
98
+ ];
99
+ ```
100
+
101
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
102
+
103
+ **Usage:**
104
+
105
+ ```
106
+ add_action('fluent_cart/payments/subscription_canceled', function ($data) {
107
+ $subscription = $data['subscription'];
108
+ $customer = $data['customer'];
109
+
110
+ // Revoke premium access on cancellation
111
+ update_user_meta($customer->user_id, 'premium_member', false);
112
+
113
+ // Notify admin
114
+ wp_mail(
115
+ get_option('admin_email'),
116
+ 'Subscription Cancelled',
117
+ sprintf('Subscription #%d for %s has been cancelled.', $subscription->id, $customer->email)
118
+ );
119
+ }, 10, 1);
120
+ ```
121
+
122
+ ### ` payments/subscription_paused `
123
+
124
+ `fluent_cart/payments/subscription_paused` — Fires when a subscription is paused
125
+
126
+ **When it runs:** This action fires when a subscription's status transitions to `paused`. The subscription remains in the system but billing is temporarily halted.
127
+
128
+ **Parameters:**
129
+
130
+ - `$data` (array): Subscription data
131
+
132
+ ```
133
+ $data = [
134
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
135
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
136
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
137
+ 'old_status' => 'active', // string — previous status
138
+ 'new_status' => 'paused', // string — always 'paused'
139
+ ];
140
+ ```
141
+
142
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
143
+
144
+ **Usage:**
145
+
146
+ ```
147
+ add_action('fluent_cart/payments/subscription_paused', function ($data) {
148
+ $subscription = $data['subscription'];
149
+
150
+ // Temporarily suspend feature access
151
+ update_user_meta($data['customer']->user_id, 'subscription_paused', true);
152
+ }, 10, 1);
153
+ ```
154
+
155
+ ### ` subscription_expired `
156
+
157
+ `fluent_cart/payments/subscription_expired` — Fires when a subscription expires
158
+
159
+ **When it runs:** This action fires when a subscription's status transitions to `expired`. After this hook fires, the system also stores a `validity_expired_at` meta value and dispatches the `SubscriptionValidityExpired` event.
160
+
161
+ **Parameters:**
162
+
163
+ - `$data` (array): Subscription data
164
+
165
+ ```
166
+ $data = [
167
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
168
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
169
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
170
+ 'old_status' => 'active', // string — previous status
171
+ 'new_status' => 'expired', // string — always 'expired'
172
+ ];
173
+ ```
174
+
175
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
176
+
177
+ **Usage:**
178
+
179
+ ```
180
+ add_action('fluent_cart/payments/subscription_expired', function ($data) {
181
+ $customer = $data['customer'];
182
+
183
+ // Remove premium access
184
+ update_user_meta($customer->user_id, 'premium_member', false);
185
+
186
+ // Notify the customer
187
+ wp_mail(
188
+ $customer->email,
189
+ 'Your Subscription Has Expired',
190
+ 'Your subscription has expired. Please renew to continue using premium features.'
191
+ );
192
+ }, 10, 1);
193
+ ```
194
+
195
+ ### ` subscription_failing `
196
+
197
+ `fluent_cart/payments/subscription_failing` — Fires when a subscription payment is failing
198
+
199
+ **When it runs:** This action fires when a subscription's status transitions to `failing`, indicating that a renewal payment attempt has failed. The subscription is still technically active but requires payment attention.
200
+
201
+ **Parameters:**
202
+
203
+ - `$data` (array): Subscription data
204
+
205
+ ```
206
+ $data = [
207
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
208
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
209
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
210
+ 'old_status' => 'active', // string — previous status
211
+ 'new_status' => 'failing', // string — always 'failing'
212
+ ];
213
+ ```
214
+
215
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
216
+
217
+ **Usage:**
218
+
219
+ ```
220
+ add_action('fluent_cart/payments/subscription_failing', function ($data) {
221
+ $subscription = $data['subscription'];
222
+ $customer = $data['customer'];
223
+
224
+ // Alert the customer about the payment failure
225
+ wp_mail(
226
+ $customer->email,
227
+ 'Payment Failed for Your Subscription',
228
+ sprintf('We were unable to process payment for subscription #%d. Please update your payment method.', $subscription->id)
229
+ );
230
+ }, 10, 1);
231
+ ```
232
+
233
+ ### ` subscription_expiring `
234
+
235
+ `fluent_cart/payments/subscription_expiring` — Fires when a subscription is marked as expiring soon
236
+
237
+ **When it runs:** This action fires when a subscription's status transitions to `expiring`, indicating that the subscription is approaching its end-of-term and will not be renewed.
238
+
239
+ **Parameters:**
240
+
241
+ - `$data` (array): Subscription data
242
+
243
+ ```
244
+ $data = [
245
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
246
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
247
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
248
+ 'old_status' => 'active', // string — previous status
249
+ 'new_status' => 'expiring', // string — always 'expiring'
250
+ ];
251
+ ```
252
+
253
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
254
+
255
+ **Usage:**
256
+
257
+ ```
258
+ add_action('fluent_cart/payments/subscription_expiring', function ($data) {
259
+ $subscription = $data['subscription'];
260
+ $customer = $data['customer'];
261
+
262
+ // Send a win-back offer before the subscription fully expires
263
+ wp_mail(
264
+ $customer->email,
265
+ 'Your Subscription is About to Expire',
266
+ 'Renew now and get 10% off your next billing cycle!'
267
+ );
268
+ }, 10, 1);
269
+ ```
270
+
271
+ ### ` subscription_completed `
272
+
273
+ `fluent_cart/payments/subscription_completed` — Fires when a subscription completes all billing cycles
274
+
275
+ **When it runs:** This action fires when a subscription's status transitions to `completed`. This occurs when the subscription has reached its end-of-term (EOT) -- i.e., the `bill_count` has met or exceeded `bill_times`. The `next_billing_date` is set to `NULL` and `canceled_at` is cleared.
276
+
277
+ **Parameters:**
278
+
279
+ - `$data` (array): Subscription data
280
+
281
+ ```
282
+ $data = [
283
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
284
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
285
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
286
+ 'old_status' => 'active', // string — previous status
287
+ 'new_status' => 'completed', // string — always 'completed'
288
+ ];
289
+ ```
290
+
291
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
292
+
293
+ **Usage:**
294
+
295
+ ```
296
+ add_action('fluent_cart/payments/subscription_completed', function ($data) {
297
+ $subscription = $data['subscription'];
298
+ $customer = $data['customer'];
299
+
300
+ // Thank the customer for completing their subscription term
301
+ wp_mail(
302
+ $customer->email,
303
+ 'Subscription Complete',
304
+ sprintf('Your subscription #%d has completed all %d billing cycles. Thank you!', $subscription->id, $subscription->bill_times)
305
+ );
306
+ }, 10, 1);
307
+ ```
308
+
309
+ ### ` subscription_trialing `
310
+
311
+ `fluent_cart/payments/subscription_trialing` — Fires when a subscription enters trial status
312
+
313
+ **When it runs:** This action fires when a subscription's status transitions to `trialing`. The subscription is in a free trial period and will transition to `active` (with billing) when the trial ends.
314
+
315
+ **Parameters:**
316
+
317
+ - `$data` (array): Subscription data
318
+
319
+ ```
320
+ $data = [
321
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription
322
+ 'order' => $subscriptionModel->order, // \FluentCart\App\Models\Order
323
+ 'customer' => $subscriptionModel->customer, // \FluentCart\App\Models\Customer
324
+ 'old_status' => 'pending', // string — previous status
325
+ 'new_status' => 'trialing', // string — always 'trialing'
326
+ ];
327
+ ```
328
+
329
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:449,1155`
330
+
331
+ **Usage:**
332
+
333
+ ```
334
+ add_action('fluent_cart/payments/subscription_trialing', function ($data) {
335
+ $subscription = $data['subscription'];
336
+ $customer = $data['customer'];
337
+
338
+ // Grant trial access
339
+ update_user_meta($customer->user_id, 'trial_active', true);
340
+
341
+ // Schedule a welcome email
342
+ wp_mail(
343
+ $customer->email,
344
+ 'Your Free Trial Has Started',
345
+ sprintf('Enjoy your trial! Your first payment will be on %s.', $subscription->next_billing_date)
346
+ );
347
+ }, 10, 1);
348
+ ```
349
+
350
+ ---
351
+
352
+ ## Subscription Data Updates
353
+
354
+ ### ` subscription_data_updated `
355
+
356
+ `fluent_cart/subscription/data_updated` — Fires when subscription data changes without a status transition
357
+
358
+ **When it runs:** This action fires when [Subscription](/database/models/subscription.md) attributes are modified but the status remains the same. Examples include billing amount changes, next payment date adjustments, or metadata updates. It only fires when there are actual dirty (changed) fields on the model.
359
+
360
+ **Parameters:**
361
+
362
+ - `$data` (array): Subscription update data
363
+
364
+ ```
365
+ $data = [
366
+ 'subscription' => $subscriptionModel, // \FluentCart\App\Models\Subscription (already saved)
367
+ 'updated_data' => [
368
+ // Only the fields that actually changed (dirty attributes), e.g.:
369
+ 'recurring_total' => 2999, // int — new amount in cents
370
+ 'next_billing_date' => '2025-03-15 00:00:00', // string — updated billing date
371
+ ],
372
+ ];
373
+ ```
374
+
375
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:418,1141`
376
+
377
+ **Usage:**
378
+
379
+ ```
380
+ add_action('fluent_cart/subscription/data_updated', function ($data) {
381
+ $subscription = $data['subscription'];
382
+ $updatedData = $data['updated_data'];
383
+
384
+ // Log billing amount changes
385
+ if (isset($updatedData['recurring_total'])) {
386
+ fluent_cart_add_log(
387
+ 'Subscription Amount Changed',
388
+ sprintf(
389
+ 'Subscription #%d recurring total changed to %s',
390
+ $subscription->id,
391
+ number_format($updatedData['recurring_total'] / 100, 2)
392
+ ),
393
+ 'info'
394
+ );
395
+ }
396
+
397
+ // Sync next billing date with external calendar
398
+ if (isset($updatedData['next_billing_date'])) {
399
+ do_action('my_plugin/sync_billing_date', $subscription->id, $updatedData['next_billing_date']);
400
+ }
401
+ }, 10, 1);
402
+ ```
403
+
404
+ ---
405
+
406
+ ## Reminders & Notifications
407
+
408
+ ### ` subscription_renewal_reminder `
409
+
410
+ `fluent_cart/subscription_renewal_reminder` — Fires when a subscription renewal reminder is due
411
+
412
+ **When it runs:** This action fires on a scheduled basis (via Action Scheduler) when a subscription's next billing date is approaching. The reminder system supports multiple billing cycles (yearly, monthly, quarterly, half-yearly) and configurable "days before" thresholds. Only fires for subscriptions with `active` or `trialing` status. The stage name indicates how many days before renewal (e.g., `before_30`, `before_7`).
413
+
414
+ **Parameters:**
415
+
416
+ - `$data` (array): Renewal reminder data
417
+
418
+ ```
419
+ $data = [
420
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
421
+ 'order' => $subscription->order, // \FluentCart\App\Models\Order
422
+ 'customer' => $subscription->customer, // \FluentCart\App\Models\Customer
423
+ 'reminder' => [
424
+ 'stage' => 'before_30', // string — e.g., 'before_30', 'before_7'
425
+ 'billing_cycle' => 'yearly', // string — 'yearly', 'monthly', 'quarterly', 'half_yearly'
426
+ 'billing_date' => '2025-03-15 00:00:00', // string — GMT formatted next billing date
427
+ ],
428
+ ];
429
+ ```
430
+
431
+ **Source:** `app/Services/Reminders/SubscriptionReminderService.php`
432
+
433
+ **Usage:**
434
+
435
+ ```
436
+ add_action('fluent_cart/subscription_renewal_reminder', function ($data) {
437
+ $subscription = $data['subscription'];
438
+ $customer = $data['customer'];
439
+ $reminder = $data['reminder'];
440
+
441
+ // Send a custom renewal reminder email
442
+ wp_mail(
443
+ $customer->email,
444
+ 'Subscription Renewal Coming Up',
445
+ sprintf(
446
+ 'Your %s subscription #%d will renew on %s.',
447
+ $reminder['billing_cycle'],
448
+ $subscription->id,
449
+ date('F j, Y', strtotime($reminder['billing_date']))
450
+ )
451
+ );
452
+ }, 10, 1);
453
+ ```
454
+
455
+ ### ` subscription_trial_end_reminder `
456
+
457
+ `fluent_cart/subscription_trial_end_reminder` — Fires when a trial ending reminder is due
458
+
459
+ **When it runs:** This action fires on a scheduled basis when a trialing subscription's trial period is about to end. Only fires for subscriptions with `trialing` status (excluding simulated trials). The stage name indicates how many days before the trial ends (e.g., `trial_end_3`, `trial_end_1`). Configurable via the `trial_end_reminder_days` store setting.
460
+
461
+ **Parameters:**
462
+
463
+ - `$data` (array): Trial end reminder data
464
+
465
+ ```
466
+ $data = [
467
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
468
+ 'order' => $subscription->order, // \FluentCart\App\Models\Order
469
+ 'customer' => $subscription->customer, // \FluentCart\App\Models\Customer
470
+ 'reminder' => [
471
+ 'stage' => 'trial_end_3', // string — e.g., 'trial_end_3', 'trial_end_1'
472
+ 'trial_end_date' => '2025-02-01 00:00:00', // string — GMT formatted trial end date
473
+ ],
474
+ ];
475
+ ```
476
+
477
+ **Source:** `app/Services/Reminders/SubscriptionReminderService.php`
478
+
479
+ **Usage:**
480
+
481
+ ```
482
+ add_action('fluent_cart/subscription_trial_end_reminder', function ($data) {
483
+ $subscription = $data['subscription'];
484
+ $customer = $data['customer'];
485
+ $reminder = $data['reminder'];
486
+
487
+ // Notify customer that their trial is ending soon
488
+ wp_mail(
489
+ $customer->email,
490
+ 'Your Free Trial is Ending Soon',
491
+ sprintf(
492
+ 'Your trial for subscription #%d ends on %s. After that, you will be billed %s.',
493
+ $subscription->id,
494
+ date('F j, Y', strtotime($reminder['trial_end_date'])),
495
+ number_format($subscription->recurring_total / 100, 2)
496
+ )
497
+ );
498
+ }, 10, 1);
499
+ ```
500
+
501
+ ### ` renewal_reminder_overdue `
502
+
503
+ `fluent_cart/renewal_reminder_overdue` — Fires when an overdue renewal reminder is triggered
504
+
505
+ **When it runs:** This action fires on a scheduled basis when a renewal [Order](/database/models/order.md) with an outstanding balance has passed its due date by a configured number of days. The stage name indicates how many days overdue (e.g., `overdue_1`, `overdue_3`, `overdue_7`). The overdue offsets are configurable via the `renewal_reminder_overdue_days` store setting (defaults to `1,3,7`) and the `fluent_cart/reminders/renewal_overdue_days` filter. Reminders as a whole are gated by the `renewal_reminders_enabled` setting.
506
+
507
+ **Parameters:**
508
+
509
+ - `$data` (array): Renewal overdue reminder data
510
+
511
+ ```
512
+ $data = [
513
+ 'order' => $order, // \FluentCart\App\Models\Order
514
+ 'customer' => $order->customer, // \FluentCart\App\Models\Customer
515
+ 'reminder' => [
516
+ 'stage' => 'overdue_3', // string — e.g., 'overdue_1', 'overdue_3', 'overdue_7'
517
+ 'order_id' => 123, // int — order ID
518
+ 'order_ref' => 'INV-00123', // string — invoice number or '#123' fallback
519
+ 'due_at' => '2025-01-15 00:00:00', // string — GMT formatted due date
520
+ 'due_amount' => 5000, // int — outstanding amount in cents
521
+ 'payment_link' => 'https://example.com/checkout/pay/uuid', // string — customer payment URL
522
+ ],
523
+ ];
524
+ ```
525
+
526
+ **Source:** `app/Services/Reminders/RenewalReminderService.php`
527
+
528
+ **Usage:**
529
+
530
+ ```
531
+ add_action('fluent_cart/renewal_reminder_overdue', function ($data) {
532
+ $order = $data['order'];
533
+ $customer = $data['customer'];
534
+ $reminder = $data['reminder'];
535
+
536
+ // Send a payment reminder with a direct payment link
537
+ wp_mail(
538
+ $customer->email,
539
+ sprintf('Payment Overdue for %s', $reminder['order_ref']),
540
+ sprintf(
541
+ "Your payment of %s for order %s is overdue.\n\nPay now: %s",
542
+ number_format($reminder['due_amount'] / 100, 2),
543
+ $reminder['order_ref'],
544
+ $reminder['payment_link']
545
+ )
546
+ );
547
+ }, 10, 1);
548
+ ```
549
+
550
+ ### ` renewal_reminder_due `
551
+
552
+ `fluent_cart/renewal_reminder_due` — Fires when a renewal due-date reminder is triggered
553
+
554
+ **When it runs:** This action fires on a scheduled basis when a renewal order with an outstanding balance reaches its due-date reminder window. This is the pre-/on-due-date notification, as opposed to the overdue reminders that fire after the due date has passed. Shares the same parameter structure as the overdue reminder. Gated by the `renewal_reminder_due_days` store setting (default `0` — no due reminder until set) and the `fluent_cart/reminders/renewal_due_days` filter.
555
+
556
+ **Parameters:**
557
+
558
+ - `$data` (array): Renewal due reminder data
559
+
560
+ ```
561
+ $data = [
562
+ 'order' => $order, // \FluentCart\App\Models\Order
563
+ 'customer' => $order->customer, // \FluentCart\App\Models\Customer
564
+ 'reminder' => [
565
+ 'stage' => 'before_0', // string — due-date reminder stage
566
+ 'order_id' => 123, // int — order ID
567
+ 'order_ref' => 'INV-00123', // string — invoice number or '#123' fallback
568
+ 'due_at' => '2025-01-15 00:00:00', // string — GMT formatted due date
569
+ 'due_amount' => 5000, // int — outstanding amount in cents
570
+ 'payment_link' => 'https://example.com/checkout/pay/uuid', // string — customer payment URL
571
+ ],
572
+ ];
573
+ ```
574
+
575
+ **Source:** `app/Services/Reminders/RenewalReminderService.php`
576
+
577
+ **Usage:**
578
+
579
+ ```
580
+ add_action('fluent_cart/renewal_reminder_due', function ($data) {
581
+ $order = $data['order'];
582
+ $customer = $data['customer'];
583
+ $reminder = $data['reminder'];
584
+
585
+ // Notify customer that their renewal is due
586
+ wp_mail(
587
+ $customer->email,
588
+ sprintf('Payment Due for %s', $reminder['order_ref']),
589
+ sprintf(
590
+ "Your payment of %s for order %s is due.\n\nPay now: %s",
591
+ number_format($reminder['due_amount'] / 100, 2),
592
+ $reminder['order_ref'],
593
+ $reminder['payment_link']
594
+ )
595
+ );
596
+ }, 10, 1);
597
+ ```
598
+
599
+ ---
600
+
601
+ ## Renewal Lifecycle Store-managed
602
+
603
+ These fire for **store-managed** renewals (the `manual` / `system` collection methods), where FluentCart generates renewal orders on a schedule rather than mirroring a gateway subscription. See the [Subscriptions Module](/modules/subscriptions.md) for the full engine.
604
+
605
+ ### ` renewal_created `
606
+
607
+ `fluent_cart/renewal_created` — Fires when a renewal order is generated
608
+
609
+ **When it runs:** This action fires whenever the renewal engine creates a renewal [Order](/database/models/order.md) for a store-managed [Subscription](/database/models/subscription.md) — from the advance-window cron (`system`/`manual`), from a `system` auto-charge cycle, and from the admin "Create Renewal Now" action.
610
+
611
+ **Parameters:**
612
+
613
+ - `$data` (array): Renewal creation data
614
+
615
+ ```
616
+ $data = [
617
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
618
+ 'order' => $order, // \FluentCart\App\Models\Order — the new renewal order
619
+ 'parent_order' => $parentOrder, // \FluentCart\App\Models\Order — the original order
620
+ 'customer' => $customer, // \FluentCart\App\Models\Customer
621
+ 'transaction' => $transaction, // \FluentCart\App\Models\OrderTransaction
622
+ ];
623
+ ```
624
+
625
+ **Source:** `app/Http/Controllers/RenewalController.php:165`, `app/Modules/Subscriptions/Services/SystemChargeService.php:310`, `app/Modules/StoreManagedRenewal/Services/RenewalService.php:237`
626
+
627
+ **Usage:**
628
+
629
+ ```
630
+ add_action('fluent_cart/renewal_created', function ($data) {
631
+ $order = $data['order'];
632
+ // Sync the freshly generated renewal order to an external ledger
633
+ }, 10, 1);
634
+ ```
635
+
636
+ ### ` renewal_paid `
637
+
638
+ `fluent_cart/renewal_paid` — Fires once when a renewal order is paid
639
+
640
+ **When it runs:** This action fires exactly once when a renewal [Order](/database/models/order.md) transitions to paid — the single edge-triggered "a renewal was collected" signal, whether the payment came from a `system` off-session charge, a customer Pay-Now, or a gateway-managed renewal webhook. It is the canonical place to grant/extend access on renewal.
641
+
642
+ **Parameters:**
643
+
644
+ - `$data` (array): Renewal payment data
645
+
646
+ ```
647
+ $data = [
648
+ 'order' => $order, // \FluentCart\App\Models\Order — the paid renewal order
649
+ ];
650
+ ```
651
+
652
+ **Source:** `app/Helpers/StatusHelper.php:225`
653
+
654
+ **Usage:**
655
+
656
+ ```
657
+ add_action('fluent_cart/renewal_paid', function ($data) {
658
+ $order = $data['order'];
659
+ // Extend the customer's access period for this renewal
660
+ }, 10, 1);
661
+ ```
662
+
663
+ ### ` renewal_payment_scheduled `
664
+
665
+ `fluent_cart/renewal_payment_scheduled` — Fires when a gateway renewal payment is scheduled (positional args)
666
+
667
+ **When it runs:** This action fires when a gateway confirms a renewal payment is scheduled at the vendor (Stripe/PayPal confirmation paths). Fires alongside `fluent_cart/renewal/payment_scheduled` (array shape) — this is the legacy positional-argument variant.
668
+
669
+ Positional arguments
670
+
671
+ This hook passes **two positional arguments**, not a single array. Register with `, 10, 2`.
672
+
673
+ **Parameters:**
674
+
675
+ - `$order` ([Order](/database/models/order.md)): The renewal order
676
+ - `$subscription` ([Subscription](/database/models/subscription.md)): The subscription
677
+
678
+ **Source:** `app/Modules/PaymentMethods/PayPalGateway/Processor.php:476`, `app/Modules/PaymentMethods/StripeGateway/Confirmations.php:485`
679
+
680
+ **Usage:**
681
+
682
+ ```
683
+ add_action('fluent_cart/renewal_payment_scheduled', function ($order, $subscription) {
684
+ // React to a scheduled gateway renewal payment
685
+ }, 10, 2);
686
+ ```
687
+
688
+ ### ` renewal/payment_scheduled `
689
+
690
+ `fluent_cart/renewal/payment_scheduled` — Fires when a gateway renewal payment is scheduled (array payload)
691
+
692
+ **When it runs:** The array-payload variant of the hook above, fired back-to-back with `fluent_cart/renewal_payment_scheduled`. Prefer this one for new integrations.
693
+
694
+ **Parameters:**
695
+
696
+ - `$data` (array): Scheduled renewal payment data
697
+
698
+ ```
699
+ $data = [
700
+ 'order' => $order, // \FluentCart\App\Models\Order
701
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
702
+ ];
703
+ ```
704
+
705
+ **Source:** `app/Modules/PaymentMethods/PayPalGateway/Processor.php:752`, `app/Modules/PaymentMethods/StripeGateway/Confirmations.php:486`
706
+
707
+ **Usage:**
708
+
709
+ ```
710
+ add_action('fluent_cart/renewal/payment_scheduled', function ($data) {
711
+ $order = $data['order'];
712
+ }, 10, 1);
713
+ ```
714
+
715
+ ### ` renewal_voided `
716
+
717
+ `fluent_cart/renewal_voided` — Fires when a renewal order is voided
718
+
719
+ **When it runs:** This action fires when an open renewal order is voided (e.g., superseded or cancelled before payment).
720
+
721
+ **Parameters:**
722
+
723
+ - `$data` (array): Voided renewal data
724
+
725
+ ```
726
+ $data = [
727
+ 'order' => $order, // \FluentCart\App\Models\Order — the voided renewal order
728
+ 'customer' => $customer, // \FluentCart\App\Models\Customer
729
+ ];
730
+ ```
731
+
732
+ **Source:** `app/Http/Controllers/RenewalController.php:126`
733
+
734
+ **Usage:**
735
+
736
+ ```
737
+ add_action('fluent_cart/renewal_voided', function ($data) {
738
+ // Clean up any external state tied to the voided renewal
739
+ }, 10, 1);
740
+ ```
741
+
742
+ ### ` subscriptions/system_renewal_scheduled `
743
+
744
+ `fluent_cart/subscriptions/system_renewal_scheduled` — Fires when a store-managed renewal is scheduled for auto-charge
745
+
746
+ **When it runs:** This action fires when the renewal engine schedules a store-managed renewal order for its due-date off-session charge attempt.
747
+
748
+ **Parameters:**
749
+
750
+ - `$data` (array): Scheduled renewal data
751
+
752
+ ```
753
+ $data = [
754
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
755
+ 'order' => $order, // \FluentCart\App\Models\Order
756
+ 'parent_order' => $parentOrder, // \FluentCart\App\Models\Order
757
+ 'customer' => $customer, // \FluentCart\App\Models\Customer
758
+ 'transaction' => $transaction, // \FluentCart\App\Models\OrderTransaction
759
+ ];
760
+ ```
761
+
762
+ **Source:** `app/Modules/StoreManagedRenewal/Services/RenewalService.php:227`
763
+
764
+ **Usage:**
765
+
766
+ ```
767
+ add_action('fluent_cart/subscriptions/system_renewal_scheduled', function ($data) {
768
+ // Notify the customer that an automatic charge is upcoming
769
+ }, 10, 1);
770
+ ```
771
+
772
+ ---
773
+
774
+ ## Collection Method & Status Store-managed
775
+
776
+ ### ` subscription_converted_to_automatic `
777
+
778
+ `fluent_cart/subscription_converted_to_automatic` — Fires when a subscription becomes gateway-managed
779
+
780
+ **When it runs:** This action fires when a subscription's collection method is converted to `automatic` — a live vendor subscription now owns the billing schedule (legacy manual→automatic conversion at a subscription-capable gateway).
781
+
782
+ **Parameters:**
783
+
784
+ - `$data` (array): Conversion data
785
+
786
+ ```
787
+ $data = [
788
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
789
+ 'payment_method' => $paymentMethod, // string — gateway slug now managing billing
790
+ ];
791
+ ```
792
+
793
+ **Source:** `app/Modules/PaymentMethods/PayPalGateway/PayPal.php:150`, `app/Modules/PaymentMethods/StripeGateway/Stripe.php:148`
794
+
795
+ **Usage:**
796
+
797
+ ```
798
+ add_action('fluent_cart/subscription_converted_to_automatic', function ($data) {
799
+ $subscription = $data['subscription'];
800
+ }, 10, 1);
801
+ ```
802
+
803
+ ### ` subscription_converted_to_manual `
804
+
805
+ `fluent_cart/subscription_converted_to_manual` — Fires when a subscription falls back to manual invoicing
806
+
807
+ **When it runs:** This action fires when a subscription is demoted to the `manual` collection method — for example, a `system` subscription whose gateway can no longer token-charge (see [demotion](/modules/subscriptions.md#store-managed-auto-charge-system)).
808
+
809
+ **Parameters:**
810
+
811
+ - `$data` (array): Conversion data
812
+
813
+ ```
814
+ $data = [
815
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
816
+ 'payment_method' => $paymentMethod, // string — current payment method slug
817
+ ];
818
+ ```
819
+
820
+ **Source:** `app/Modules/PaymentMethods/Core/AbstractPaymentGateway.php:343`
821
+
822
+ **Usage:**
823
+
824
+ ```
825
+ add_action('fluent_cart/subscription_converted_to_manual', function ($data) {
826
+ // Alert staff that automatic billing was lost for this subscription
827
+ }, 10, 1);
828
+ ```
829
+
830
+ ### ` subscription_past_due `
831
+
832
+ `fluent_cart/subscription_past_due` — Fires when a store-managed subscription enters dunning
833
+
834
+ **When it runs:** This action fires when a store-managed subscription's renewal passes its grace anchor and the subscription enters the past-due (dunning) window, before eventual expiry.
835
+
836
+ **Parameters:**
837
+
838
+ - `$data` (array): Past-due data
839
+
840
+ ```
841
+ $data = [
842
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
843
+ 'order' => $order, // \FluentCart\App\Models\Order — the unpaid renewal
844
+ 'customer' => $customer, // \FluentCart\App\Models\Customer
845
+ ];
846
+ ```
847
+
848
+ **Source:** `app/Modules/StoreManagedRenewal/Services/RenewalService.php:696`
849
+
850
+ **Usage:**
851
+
852
+ ```
853
+ add_action('fluent_cart/subscription_past_due', function ($data) {
854
+ // Trigger a custom dunning sequence
855
+ }, 10, 1);
856
+ ```
857
+
858
+ ### ` subscription/reactivated_locally `
859
+
860
+ `fluent_cart/subscription/reactivated_locally` — Fires when a store-managed subscription is reactivated locally (positional arg)
861
+
862
+ **When it runs:** This action fires when a store-managed subscription is reactivated by FluentCart itself (no vendor call), e.g., after a successful late payment.
863
+
864
+ Positional argument
865
+
866
+ This hook passes the **Subscription model directly**, not an array. Register with `, 10, 1` and type-hint the model.
867
+
868
+ **Parameters:**
869
+
870
+ - `$subscription` ([Subscription](/database/models/subscription.md)): The reactivated subscription
871
+
872
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:864`
873
+
874
+ **Usage:**
875
+
876
+ ```
877
+ add_action('fluent_cart/subscription/reactivated_locally', function ($subscription) {
878
+ // Restore access for the reactivated subscription
879
+ }, 10, 1);
880
+ ```
881
+
882
+ ---
883
+
884
+ ## Native Subscription Events Store-managed
885
+
886
+ Distinct from the `payments/subscription_{status}` bus
887
+
888
+ These `fluent_cart/subscription_*` events carry richer payloads (`reason`, `updates`, `changes`) and are **separate hooks** from the like-named [status bus](#subscription-status-changes) (`fluent_cart/payments/subscription_paused`, etc.). Both may fire for the same transition.
889
+
890
+ ### ` subscription_paused `
891
+
892
+ `fluent_cart/subscription_paused` — Native event: subscription paused
893
+
894
+ **When it runs:** Dispatched when a subscription is paused, via the subscription event dispatcher.
895
+
896
+ **Parameters:**
897
+
898
+ - `$data` (array): Pause event data
899
+
900
+ ```
901
+ $data = [
902
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
903
+ 'reason' => 'user_request', // string — pause reason
904
+ 'order' => $order, // \FluentCart\App\Models\Order
905
+ 'customer' => $customer, // \FluentCart\App\Models\Customer
906
+ 'old_status' => 'active', // string — status before pause
907
+ ];
908
+ ```
909
+
910
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:527` (via `EventDispatcher`)
911
+
912
+ **Usage:**
913
+
914
+ ```
915
+ add_action('fluent_cart/subscription_paused', function ($data) {
916
+ $reason = $data['reason'];
917
+ }, 10, 1);
918
+ ```
919
+
920
+ ### ` subscription_resumed `
921
+
922
+ `fluent_cart/subscription_resumed` — Native event: subscription resumed
923
+
924
+ **When it runs:** Dispatched when a paused subscription is resumed.
925
+
926
+ **Parameters:**
927
+
928
+ - `$data` (array): Resume event data
929
+
930
+ ```
931
+ $data = [
932
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
933
+ 'reason' => 'user_request', // string — resume reason
934
+ 'order' => $order, // \FluentCart\App\Models\Order
935
+ 'customer' => $customer, // \FluentCart\App\Models\Customer
936
+ 'old_status' => 'paused', // string — status before resume
937
+ ];
938
+ ```
939
+
940
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:530` (via `EventDispatcher`)
941
+
942
+ **Usage:**
943
+
944
+ ```
945
+ add_action('fluent_cart/subscription_resumed', function ($data) {
946
+ $subscription = $data['subscription'];
947
+ }, 10, 1);
948
+ ```
949
+
950
+ ### ` subscription_updated `
951
+
952
+ `fluent_cart/subscription_updated` — Native event: subscription terms updated
953
+
954
+ **When it runs:** Dispatched when a store-managed subscription's editable terms change (amount, interval, next billing date, etc.).
955
+
956
+ **Parameters:**
957
+
958
+ - `$data` (array): Update event data
959
+
960
+ ```
961
+ $data = [
962
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
963
+ 'updates' => [ /* ... */ ], // array — fields submitted for update
964
+ 'changes' => [ /* ... */ ], // array — fields that actually changed
965
+ 'order' => $order, // \FluentCart\App\Models\Order
966
+ 'customer' => $customer, // \FluentCart\App\Models\Customer
967
+ ];
968
+ ```
969
+
970
+ **Source:** `app/Modules/Subscriptions/Services/SubscriptionService.php:533` (via `EventDispatcher`)
971
+
972
+ **Usage:**
973
+
974
+ ```
975
+ add_action('fluent_cart/subscription_updated', function ($data) {
976
+ $changes = $data['changes'];
977
+ }, 10, 1);
978
+ ```
979
+
980
+ ---
981
+
982
+ ## System Auto-Charge system
983
+
984
+ These fire only for `system` subscriptions — store-managed subscriptions that auto-charge a saved token each renewal. See [Store-managed + auto-charge](/modules/subscriptions.md#store-managed-auto-charge-system).
985
+
986
+ ### ` subscriptions/system_charge_succeeded `
987
+
988
+ `fluent_cart/subscriptions/system_charge_succeeded` — Fires when an off-session renewal charge succeeds
989
+
990
+ **When it runs:** This action fires when a `system` subscription's off-session renewal charge is confirmed successful.
991
+
992
+ **Parameters:**
993
+
994
+ - `$data` (array): Successful charge data
995
+
996
+ ```
997
+ $data = [
998
+ 'order' => $order, // \FluentCart\App\Models\Order — the renewal order
999
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1000
+ 'attempt' => 1, // int — which retry attempt succeeded
1001
+ ];
1002
+ ```
1003
+
1004
+ **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:584`
1005
+
1006
+ **Usage:**
1007
+
1008
+ ```
1009
+ add_action('fluent_cart/subscriptions/system_charge_succeeded', function ($data) {
1010
+ $order = $data['order'];
1011
+ }, 10, 1);
1012
+ ```
1013
+
1014
+ ### ` subscriptions/system_charge_failed `
1015
+
1016
+ `fluent_cart/subscriptions/system_charge_failed` — Fires when an off-session renewal charge fails
1017
+
1018
+ **When it runs:** This action fires when a `system` renewal charge attempt fails. The retry ladder may schedule further attempts within the grace window before the subscription is marked past due.
1019
+
1020
+ **Parameters:**
1021
+
1022
+ - `$data` (array): Failed charge data
1023
+
1024
+ ```
1025
+ $data = [
1026
+ 'order' => $order, // \FluentCart\App\Models\Order
1027
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1028
+ 'attempt' => 2, // int — attempt number that failed
1029
+ 'error' => 'card_declined', // string — gateway error
1030
+ 'next_retry_at' => '2025-01-18 00:00:00', // string|null — GMT time of next attempt, null if exhausted
1031
+ ];
1032
+ ```
1033
+
1034
+ **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:730`
1035
+
1036
+ **Usage:**
1037
+
1038
+ ```
1039
+ add_action('fluent_cart/subscriptions/system_charge_failed', function ($data) {
1040
+ if (empty($data['next_retry_at'])) {
1041
+ // Retries exhausted — escalate
1042
+ }
1043
+ }, 10, 1);
1044
+ ```
1045
+
1046
+ ### ` subscriptions/system_charge_failed_notification `
1047
+
1048
+ `fluent_cart/subscriptions/system_charge_failed_notification` — Fires when a charge-failure notification should be sent
1049
+
1050
+ **When it runs:** This action fires when a `system` charge failure warrants notifying the customer (gated by `fluent_cart/subscriptions/system_charge_failure_notify`). Carries the full context needed to render an email.
1051
+
1052
+ **Parameters:**
1053
+
1054
+ - `$data` (array): Failure notification data
1055
+
1056
+ ```
1057
+ $data = [
1058
+ 'order' => $order, // \FluentCart\App\Models\Order
1059
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1060
+ 'parent_order' => $parentOrder, // \FluentCart\App\Models\Order
1061
+ 'customer' => $customer, // \FluentCart\App\Models\Customer
1062
+ 'transaction' => $transaction, // \FluentCart\App\Models\OrderTransaction
1063
+ 'error' => 'card_declined', // string — gateway error
1064
+ 'attempt' => 2, // int — attempt number
1065
+ 'next_retry_at' => '2025-01-18 00:00:00', // string|null — GMT time of next attempt
1066
+ ];
1067
+ ```
1068
+
1069
+ **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:746`
1070
+
1071
+ **Usage:**
1072
+
1073
+ ```
1074
+ add_action('fluent_cart/subscriptions/system_charge_failed_notification', function ($data) {
1075
+ // Send a custom "payment failed" email
1076
+ }, 10, 1);
1077
+ ```
1078
+
1079
+ ### ` subscriptions/system_charge_disabled `
1080
+
1081
+ `fluent_cart/subscriptions/system_charge_disabled` — Fires when auto-charge is turned off for a subscription
1082
+
1083
+ **When it runs:** This action fires when a subscription loses `system` auto-charge and is handed back to plain manual invoicing (`demoteToManual()`), e.g., its gateway can no longer token-charge.
1084
+
1085
+ **Parameters:**
1086
+
1087
+ - `$data` (array): Disable data
1088
+
1089
+ ```
1090
+ $data = [
1091
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1092
+ 'reason' => 'gateway_incapable', // string — why auto-charge was disabled
1093
+ ];
1094
+ ```
1095
+
1096
+ **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:325`
1097
+
1098
+ **Usage:**
1099
+
1100
+ ```
1101
+ add_action('fluent_cart/subscriptions/system_charge_disabled', function ($data) {
1102
+ $reason = $data['reason'];
1103
+ }, 10, 1);
1104
+ ```
1105
+
1106
+ ### ` subscriptions/system_charge_manual_triggered `
1107
+
1108
+ `fluent_cart/subscriptions/system_charge_manual_triggered` — Fires when an admin triggers an off-session charge
1109
+
1110
+ **When it runs:** This action fires when a store admin manually triggers a `system` charge (the "Charge Now" / "Charge Next Renewal Now" actions).
1111
+
1112
+ **Parameters:**
1113
+
1114
+ - `$data` (array): Manual trigger data
1115
+
1116
+ ```
1117
+ $data = [
1118
+ 'order' => $order, // \FluentCart\App\Models\Order
1119
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1120
+ 'attempt' => 1, // int — attempt number
1121
+ 'actor_id' => 5, // int — admin user ID who triggered it
1122
+ 'result' => 'success', // mixed — charge result
1123
+ ];
1124
+ ```
1125
+
1126
+ **Source:** `app/Modules/Subscriptions/Services/SystemChargeService.php:444`
1127
+
1128
+ **Usage:**
1129
+
1130
+ ```
1131
+ add_action('fluent_cart/subscriptions/system_charge_manual_triggered', function ($data) {
1132
+ // Audit-log the admin-initiated charge
1133
+ }, 10, 1);
1134
+ ```
1135
+
1136
+ ### ` subscriptions/system_payment_method_updated `
1137
+
1138
+ `fluent_cart/subscriptions/system_payment_method_updated` — Fires when the saved token for a system subscription changes
1139
+
1140
+ **When it runs:** This action fires when the vaulted payment method (token) backing a `system` subscription is updated — e.g., the customer updates the card on file.
1141
+
1142
+ **Parameters:**
1143
+
1144
+ - `$data` (array): Payment method update data
1145
+
1146
+ ```
1147
+ $data = [
1148
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1149
+ 'payment_method' => $paymentMethod, // array|string — the new vaulted method reference
1150
+ ];
1151
+ ```
1152
+
1153
+ **Source:** `app/Modules/PaymentMethods/StripeGateway/UpdateCustomerPaymentMethod.php:129`
1154
+
1155
+ **Usage:**
1156
+
1157
+ ```
1158
+ add_action('fluent_cart/subscriptions/system_payment_method_updated', function ($data) {
1159
+ // Confirm the new card to the customer
1160
+ }, 10, 1);
1161
+ ```
1162
+
1163
+ ---
1164
+
1165
+ ## Subscription Upgrades & Early Payments Pro
1166
+
1167
+ ### ` early_payment_completed `
1168
+
1169
+ `fluent_cart/subscription/early_payment_completed` Pro — Fires when an early installment payment is completed
1170
+
1171
+ **When it runs:** This action fires when a customer makes an early installment payment on their subscription, paying for one or more future billing cycles ahead of schedule.
1172
+
1173
+ **Parameters:**
1174
+
1175
+ - `$data` (array): Early payment completion data
1176
+
1177
+ ```
1178
+ $data = [
1179
+ 'subscription' => $subscription, // \FluentCart\App\Models\Subscription
1180
+ 'order' => $order, // \FluentCart\App\Models\Order
1181
+ 'installment_count' => $installmentCount, // int — number of installments paid early
1182
+ ];
1183
+ ```
1184
+
1185
+ **Source:** `fluent-cart-pro/app/Hooks/Handlers/EarlyInstallmentPaymentHandler.php:279`
1186
+
1187
+ **Usage:**
1188
+
1189
+ ```
1190
+ add_action('fluent_cart/subscription/early_payment_completed', function ($data) {
1191
+ $subscription = $data['subscription'];
1192
+ $order = $data['order'];
1193
+ $installmentCount = $data['installment_count'];
1194
+
1195
+ fluent_cart_add_log(
1196
+ 'Early Payment Completed',
1197
+ sprintf('Subscription #%d received %d early installment(s) via order #%d', $subscription->id, $installmentCount, $order->id),
1198
+ 'info'
1199
+ );
1200
+ }, 10, 1);
1201
+ ```
1202
+
1203
+ ### ` order_upgraded `
1204
+
1205
+ `fluent_cart/order/upgraded` Pro — Fires when a plan upgrade is completed
1206
+
1207
+ **When it runs:** This action fires when a customer completes a plan upgrade, transitioning from one product variant to another. The upgrade creates a new order and transaction record.
1208
+
1209
+ **Parameters:**
1210
+
1211
+ - `$data` (array): Upgrade completion data
1212
+
1213
+ ```
1214
+ $data = [
1215
+ 'order' => $newOrder, // \FluentCart\App\Models\Order — the new upgrade order
1216
+ 'from_order' => $upgradeFromOrder, // \FluentCart\App\Models\Order — the original order
1217
+ 'cart' => $cartModel, // \FluentCart\App\Models\Cart — the cart used for the upgrade
1218
+ 'from_variant_id' => $fromVariantId, // int — ID of the original product variant
1219
+ 'transaction' => $transaction, // \FluentCart\App\Models\OrderTransaction — the upgrade payment transaction
1220
+ ];
1221
+ ```
1222
+
1223
+ **Source:** `fluent-cart-pro/app/Hooks/Handlers/UpgradeHandler.php:268`
1224
+
1225
+ **Usage:**
1226
+
1227
+ ```
1228
+ add_action('fluent_cart/order/upgraded', function ($data) {
1229
+ $order = $data['order'];
1230
+ $fromOrder = $data['from_order'];
1231
+ $fromVariantId = $data['from_variant_id'];
1232
+ $transaction = $data['transaction'];
1233
+
1234
+ fluent_cart_add_log(
1235
+ 'Plan Upgraded',
1236
+ sprintf(
1237
+ 'Order #%d upgraded from order #%d (variant %d). Transaction: %s',
1238
+ $order->id,
1239
+ $fromOrder->id,
1240
+ $fromVariantId,
1241
+ $transaction->charge_id
1242
+ ),
1243
+ 'info'
1244
+ );
1245
+ }, 10, 1);
1246
+ ```
1247
+
1248
+ ### ` plan_changed `
1249
+
1250
+ `fluent_cart/plan_changed` Pro — Fires when a plan upgrade changes the customer's plan
1251
+
1252
+ **When it runs:** This action fires when a plan upgrade completes, right after `fluent_cart/order/upgraded`. Core defines the event (`FluentCart\App\Events\PlanChanged`), and FluentCart Pro fires it when it finishes the upgrade. It does not fire if Pro cannot find the old or the new variation.
1253
+
1254
+ Unlike `fluent_cart/order/upgraded`, the payload gives both variations, so you do not need to read the upgrade cart. The models arrive as arrays.
1255
+
1256
+ With a gateway that can confirm the same payment twice at the same time (a webhook and a redirect), the action can fire twice for one upgrade. Make your listener safe to run twice.
1257
+
1258
+ **Parameters:**
1259
+
1260
+ - `$data` (array): Plan change data
1261
+
1262
+ ```
1263
+ $data = [
1264
+ 'order' => [...], // array — the new upgrade order (Order::toArray())
1265
+ 'customer' => [...], // array — the customer, or [] if none
1266
+ 'new_variation' => [...], // array — the variation the customer upgraded to
1267
+ 'old_variation' => [...], // array — the variation the customer upgraded from
1268
+ 'other_info' => [
1269
+ 'from_order_id' => 120, // int — the original order
1270
+ 'from_subscription_id' => 45, // int — the old subscription, 0 if none
1271
+ 'subscription_id' => 46, // int — the new subscription, 0 if none
1272
+ ],
1273
+ ];
1274
+ ```
1275
+
1276
+ **Source:** `fluent-cart-pro/app/Hooks/Handlers/UpgradeHandler.php:417` (dispatch), `app/Events/PlanChanged.php` (event)
1277
+
1278
+ **Usage:**
1279
+
1280
+ ```
1281
+ add_action('fluent_cart/plan_changed', function ($data) {
1282
+ $customerEmail = $data['customer']['email'] ?? '';
1283
+ $fromVariation = $data['old_variation']['id'];
1284
+ $toVariation = $data['new_variation']['id'];
1285
+
1286
+ my_plugin_move_member($customerEmail, $fromVariation, $toVariation);
1287
+ }, 10, 1);
1288
+ ```
1289
+
1290
+ ---