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,129 +1,129 @@
1
- # Payment Methods Module
2
-
3
- The Payment Methods module is FluentCart's core payment processing system. It provides a flexible architecture for integrating various payment gateways while maintaining a consistent interface for order processing.
4
-
5
- ## Architecture Overview
6
-
7
- ### Core Components
8
-
9
- #### 1. **GatewayManager**
10
-
11
- The central manager for all payment gateways using the Singleton pattern.
12
-
13
- ```
14
- use FluentCart\App\Modules\PaymentMethods\Core\GatewayManager;
15
-
16
- // Get manager instance
17
- $manager = GatewayManager::getInstance();
18
-
19
- // Get specific gateway
20
- $stripe = GatewayManager::gateway('stripe');
21
-
22
- // Check if gateway exists
23
- $exists = GatewayManager::has('stripe');
24
- ```
25
-
26
- #### 2. **PaymentGatewayInterface**
27
-
28
- The interface that all payment gateways must implement.
29
-
30
- ```
31
- interface PaymentGatewayInterface
32
- {
33
- public function has(string $feature): bool;
34
- public function meta(): array;
35
- public function makePaymentFromPaymentInstance(PaymentInstance $paymentInstance);
36
- public function handleIPN();
37
- public function getOrderInfo(array $data);
38
- public function fields();
39
- }
40
- ```
41
-
42
- #### 3. **AbstractPaymentGateway**
43
-
44
- Base class providing common functionality for all gateways.
45
-
46
- ```
47
- abstract class AbstractPaymentGateway implements PaymentGatewayInterface
48
- {
49
- public array $supportedFeatures = [];
50
- public StoreSettings $storeSettings;
51
- public ?AbstractSubscriptionModule $subscriptions;
52
- public BaseGatewaySettings $settings;
53
- }
54
- ```
55
-
56
- ## Supported Payment Gateways
57
-
58
- A gateway is "built-in" only if FluentCart or FluentCart Pro registers it. Core registers three in `GlobalPaymentHandler::init()`; Pro registers three more. Everything else is a separate add-on plugin that registers itself through `fluent_cart/register_payment_methods`.
59
-
60
- ### Built-in — FluentCart (free)
61
-
62
- | Gateway | Slug | Location | Declared features |
63
- | --- | --- | --- | --- |
64
- | Stripe | `stripe` | `app/Modules/PaymentMethods/StripeGateway/` | payment, refund, webhook, custom_payment, card_update, multi_currency, switch_payment_method, dispute_handler, subscriptions, zero_recurring, system_subscription, manual_subscription, verify_vendor_ids |
65
- | PayPal | `paypal` | `app/Modules/PaymentMethods/PayPalGateway/` | payment, refund, webhook, custom_payment, card_update, multi_currency, switch_payment_method, dispute_handler, subscriptions, resume_subscription, system_subscription, manual_subscription, verify_vendor_ids |
66
- | Offline / Cash on Delivery | `offline_payment` | `app/Modules/PaymentMethods/Cod/` | payment, refund, offline, local_refund_only, multi_currency |
67
-
68
- Note the slug: the class is `Cod`, but it registers as `offline_payment`.
69
-
70
- ### Built-in — FluentCart Pro
71
-
72
- | Gateway | Slug | Location | Declared features |
73
- | --- | --- | --- | --- |
74
- | Paddle | `paddle` | `fluent-cart-pro/app/Modules/PaymentMethods/PaddleGateway/` | payment, refund, webhook, subscriptions, custom_payment, upgrade_plan, card_update, resume_subscription, manual_subscription, first_cycle_discount, multi_currency |
75
- | Mollie | `mollie` | `fluent-cart-pro/app/Modules/PaymentMethods/MollieGateway/` | payment, refund, webhook, subscriptions, upgrade_plan, manual_subscription, multi_currency |
76
- | Authorize.Net | `authorize_dot_net` | `fluent-cart-pro/app/Modules/PaymentMethods/AuthorizeDotNetGateway/` | payment, refund, webhook, subscriptions, custom_payment, manual_subscription |
77
-
78
- ### Add-on gateways (separate plugins)
79
-
80
- These are **not** in the core or Pro codebase. `AddonGatewaysHandler` holds an entry for each so the admin can offer installation, and the add-on plugin registers the gateway itself once active:
81
-
82
- `paystack`, `razorpay`, `mercado_pago`, `flutterwave`, `square`, `airwallex`, `sslcommerz`
83
-
84
- Feature flags are declarative
85
-
86
- `has()` tests membership of `$supportedFeatures`. Core acts on these flags: `payment`, `refund`, `local_refund_only`, `offline`, `multi_currency`, `subscriptions`, `system_subscription`, `manual_subscription`, `zero_recurring`, `verify_vendor_ids`, `resume_subscription`, `pause_subscription`, `dispute_handler` and `card_update`.
87
-
88
- `webhook`, `custom_payment`, `upgrade_plan` and `first_cycle_discount` are declared by built-in gateways but never queried through `has()`, so adding one does not switch any behaviour on.
89
-
90
- ## Building a custom gateway
91
-
92
- The full walkthrough lives in the **[Payment Gateway Integration Guide](/payment-methods-integration/quick-implementation.md)** — registering the gateway, the settings class, the gateway class, the API handler, payment processing, confirmation and the IPN listener, with the real return contract the checkout frontend expects.
93
-
94
- Related:
95
-
96
- - [Overview](/payment-methods-integration/) — what a gateway has to provide
97
- - [Setting Fields](/payment-methods-integration/payment_setting_fields.md) — every field type the settings renderer handles
98
- - [Paddle Example](/payment-methods-integration/paddle-example.md) — a complete working gateway
99
-
100
- ### Registering your gateway
101
-
102
- Gateways register on `fluent_cart/register_payment_methods`, which passes the manager:
103
-
104
- ```
105
- add_action('fluent_cart/register_payment_methods', function ($payload) {
106
- $payload['gatewayManager']->register('your_gateway', new YourGateway());
107
- });
108
- ```
109
-
110
- Core registers `stripe`, `paypal` and `offline_payment` this way in `GlobalPaymentHandler::init()`; Pro adds `paddle`, `mollie` and `authorize_dot_net`.
111
-
112
- ### Testing a gateway
113
-
114
- The IPN listener URL is built by `getListenerUrl()`, which returns an array:
115
-
116
- ```
117
- $url = $this->getListenerUrl()['listener_url'];
118
- // https://example.com/?fluent-cart=fct_payment_listener_ipn&method=your_gateway
119
- ```
120
-
121
- Point your gateway's webhook configuration at that URL. The store's `order_mode` decides whether the store is in test or live mode, and `BaseGatewaySettings::getMode()` reads it.
122
-
123
- ---
124
-
125
- **Next Steps:**
126
-
127
- - [Shipping Module](./shipping.md) - Shipping method development
128
- - [Storage Drivers](./storage.md) - File storage integration
129
- - [Modules Overview](./index.md) - Back to modules overview
1
+ # Payment Methods Module
2
+
3
+ The Payment Methods module is FluentCart's core payment processing system. It provides a flexible architecture for integrating various payment gateways while maintaining a consistent interface for order processing.
4
+
5
+ ## Architecture Overview
6
+
7
+ ### Core Components
8
+
9
+ #### 1. **GatewayManager**
10
+
11
+ The central manager for all payment gateways using the Singleton pattern.
12
+
13
+ ```
14
+ use FluentCart\App\Modules\PaymentMethods\Core\GatewayManager;
15
+
16
+ // Get manager instance
17
+ $manager = GatewayManager::getInstance();
18
+
19
+ // Get specific gateway
20
+ $stripe = GatewayManager::gateway('stripe');
21
+
22
+ // Check if gateway exists
23
+ $exists = GatewayManager::has('stripe');
24
+ ```
25
+
26
+ #### 2. **PaymentGatewayInterface**
27
+
28
+ The interface that all payment gateways must implement.
29
+
30
+ ```
31
+ interface PaymentGatewayInterface
32
+ {
33
+ public function has(string $feature): bool;
34
+ public function meta(): array;
35
+ public function makePaymentFromPaymentInstance(PaymentInstance $paymentInstance);
36
+ public function handleIPN();
37
+ public function getOrderInfo(array $data);
38
+ public function fields();
39
+ }
40
+ ```
41
+
42
+ #### 3. **AbstractPaymentGateway**
43
+
44
+ Base class providing common functionality for all gateways.
45
+
46
+ ```
47
+ abstract class AbstractPaymentGateway implements PaymentGatewayInterface
48
+ {
49
+ public array $supportedFeatures = [];
50
+ public StoreSettings $storeSettings;
51
+ public ?AbstractSubscriptionModule $subscriptions;
52
+ public BaseGatewaySettings $settings;
53
+ }
54
+ ```
55
+
56
+ ## Supported Payment Gateways
57
+
58
+ A gateway is "built-in" only if FluentCart or FluentCart Pro registers it. Core registers three in `GlobalPaymentHandler::init()`; Pro registers three more. Everything else is a separate add-on plugin that registers itself through `fluent_cart/register_payment_methods`.
59
+
60
+ ### Built-in — FluentCart (free)
61
+
62
+ | Gateway | Slug | Location | Declared features |
63
+ | --- | --- | --- | --- |
64
+ | Stripe | `stripe` | `app/Modules/PaymentMethods/StripeGateway/` | payment, refund, webhook, custom_payment, card_update, multi_currency, switch_payment_method, dispute_handler, subscriptions, zero_recurring, system_subscription, manual_subscription, verify_vendor_ids |
65
+ | PayPal | `paypal` | `app/Modules/PaymentMethods/PayPalGateway/` | payment, refund, webhook, custom_payment, card_update, multi_currency, switch_payment_method, dispute_handler, subscriptions, resume_subscription, system_subscription, manual_subscription, verify_vendor_ids |
66
+ | Offline / Cash on Delivery | `offline_payment` | `app/Modules/PaymentMethods/Cod/` | payment, refund, offline, local_refund_only, multi_currency |
67
+
68
+ Note the slug: the class is `Cod`, but it registers as `offline_payment`.
69
+
70
+ ### Built-in — FluentCart Pro
71
+
72
+ | Gateway | Slug | Location | Declared features |
73
+ | --- | --- | --- | --- |
74
+ | Paddle | `paddle` | `fluent-cart-pro/app/Modules/PaymentMethods/PaddleGateway/` | payment, refund, webhook, subscriptions, custom_payment, upgrade_plan, card_update, resume_subscription, manual_subscription, first_cycle_discount, multi_currency |
75
+ | Mollie | `mollie` | `fluent-cart-pro/app/Modules/PaymentMethods/MollieGateway/` | payment, refund, webhook, subscriptions, upgrade_plan, manual_subscription, multi_currency |
76
+ | Authorize.Net | `authorize_dot_net` | `fluent-cart-pro/app/Modules/PaymentMethods/AuthorizeDotNetGateway/` | payment, refund, webhook, subscriptions, custom_payment, manual_subscription |
77
+
78
+ ### Add-on gateways (separate plugins)
79
+
80
+ These are **not** in the core or Pro codebase. `AddonGatewaysHandler` holds an entry for each so the admin can offer installation, and the add-on plugin registers the gateway itself once active:
81
+
82
+ `paystack`, `razorpay`, `mercado_pago`, `flutterwave`, `square`, `airwallex`, `sslcommerz`
83
+
84
+ Feature flags are declarative
85
+
86
+ `has()` tests membership of `$supportedFeatures`. Core acts on these flags: `payment`, `refund`, `local_refund_only`, `offline`, `multi_currency`, `subscriptions`, `system_subscription`, `manual_subscription`, `zero_recurring`, `verify_vendor_ids`, `resume_subscription`, `pause_subscription`, `dispute_handler` and `card_update`.
87
+
88
+ `webhook`, `custom_payment`, `upgrade_plan` and `first_cycle_discount` are declared by built-in gateways but never queried through `has()`, so adding one does not switch any behaviour on.
89
+
90
+ ## Building a custom gateway
91
+
92
+ The full walkthrough lives in the **[Payment Gateway Integration Guide](/payment-methods-integration/quick-implementation.md)** — registering the gateway, the settings class, the gateway class, the API handler, payment processing, confirmation and the IPN listener, with the real return contract the checkout frontend expects.
93
+
94
+ Related:
95
+
96
+ - [Overview](/payment-methods-integration/) — what a gateway has to provide
97
+ - [Setting Fields](/payment-methods-integration/payment_setting_fields.md) — every field type the settings renderer handles
98
+ - [Paddle Example](/payment-methods-integration/paddle-example.md) — a complete working gateway
99
+
100
+ ### Registering your gateway
101
+
102
+ Gateways register on `fluent_cart/register_payment_methods`, which passes the manager:
103
+
104
+ ```
105
+ add_action('fluent_cart/register_payment_methods', function ($payload) {
106
+ $payload['gatewayManager']->register('your_gateway', new YourGateway());
107
+ });
108
+ ```
109
+
110
+ Core registers `stripe`, `paypal` and `offline_payment` this way in `GlobalPaymentHandler::init()`; Pro adds `paddle`, `mollie` and `authorize_dot_net`.
111
+
112
+ ### Testing a gateway
113
+
114
+ The IPN listener URL is built by `getListenerUrl()`, which returns an array:
115
+
116
+ ```
117
+ $url = $this->getListenerUrl()['listener_url'];
118
+ // https://example.com/?fluent-cart=fct_payment_listener_ipn&method=your_gateway
119
+ ```
120
+
121
+ Point your gateway's webhook configuration at that URL. The store's `order_mode` decides whether the store is in test or live mode, and `BaseGatewaySettings::getMode()` reads it.
122
+
123
+ ---
124
+
125
+ **Next Steps:**
126
+
127
+ - [Shipping Module](./shipping.md) - Shipping method development
128
+ - [Storage Drivers](./storage.md) - File storage integration
129
+ - [Modules Overview](./index.md) - Back to modules overview
@@ -1,170 +1,170 @@
1
- # Refunds
2
-
3
- A refund in FluentCart is **remote first**: the payment gateway is called before anything is written. A refund transaction row exists only once the refund is real, meaning the gateway accepted it or an admin deliberately recorded it locally.
4
-
5
- At a glance
6
-
7
- | Concern | Where |
8
- | --- | --- |
9
- | Admin endpoint | `POST /orders/{order}/refund` · `OrderController::refundOrder()` |
10
- | Re-sync endpoint | `POST /orders/{order}/refund/{transaction}/resync` · `OrderController::resyncRefund()` |
11
- | Engine | `FluentCart\App\Services\Payments\Refund::processRefund()` |
12
- | Webhook recorder | `Refund::createOrRecordRefund()` |
13
- | Event | `FluentCart\App\Events\Order\OrderRefund` |
14
- | Per-order lock | MySQL `GET_LOCK('fct_refund_')` |
15
- | Permission | `orders/can_refund` |
16
-
17
- For the gateway side of the contract (what `processRefund()` must return and what a webhook handler must call), see [Refunds in Quick Implementation](/payment-methods-integration/quick-implementation.md).
18
-
19
- ## Two kinds of refund
20
-
21
- | Kind | Sent when | Amount comes from |
22
- | --- | --- | --- |
23
- | Item and shipping | `refunded_items` is not empty, or `shipping_amount` is greater than 0 | The server, in `RefundPlanner::plan()`. Each line's charge left (line total plus any tax added on top, minus `refund_total`) divided by its units left. Refunding every unit left takes the whole remainder. |
24
- | Amount only | Neither is sent | The `amount` the admin typed. Used for goodwill and dispute refunds. No unit or stock changes; the money is spread over the lines' `refund_total`. |
25
-
26
- A line keeps what was sold: `quantity`, `line_total` and `tax_amount` never change. An item refund adds the units to `line_meta.refunded_quantity` and caps `fulfilled_quantity` at the units left. The `OrderRefund` listener adds each line's refunded money to `refund_total`. An amount refund is spread over the lines by what each has left, and any part the lines cannot take is counted as shipping, only when the lines plus shipping make up the whole order total. Shipping is tracked as a running total in order meta `shipping_refunded_amount`; `shipping_refunded` is set to `1` once the whole shipping amount is returned.
27
-
28
- ## The admin refund, step by step
29
-
30
- ```
31
- Refund modal ── POST orders/{id}/refund ──▶ OrderController::refundOrder()
32
- 1. order must be refundable else 400
33
- 2. Refund::withOrderRefundLock(order, wait 0) else 409 "another refund in progress"
34
- └ refundOrderUnderLock():
35
- 3. RefundPlanner::plan(): amount, units per line, else 422
36
- shipping, refund_intent (the item + shipping writes)
37
- 4. Refund::processRefund(charge, amount, refund_info, refund_intent)
38
- a. validate amount against order and charge limits
39
- b. pick a route (remote / local / forced_local / unavailable)
40
- c. remote: call the gateway ── fails ──▶ activity log entry only, 422 force-local payload
41
- d. save: refund row + item/shipping writes, one DB transaction
42
- e. dispatch OrderRefund: order totals, line refund_total, charge refunded_total
43
- 5. optional: cancel the subscription (never on a forced local refund)
44
- 6. release the lock
45
- ```
46
-
47
- ### Routes
48
-
49
- | Route | Chosen when | Gateway called |
50
- | --- | --- | --- |
51
- | `remote` | The gateway has the `refund` feature and the charge has a `vendor_charge_id` | Yes |
52
- | `local` | `fluent_cart/order_refund_manually` returned `yes`, or the gateway has `local_refund_only` (Cash on Delivery), `offline`, or no `refund` feature. The admin returns the money outside FluentCart. | Only for Cash on Delivery, so `fluent_cart/offline_payment_refund_id` still fires |
53
- | `forced_local` | The request carried `refund_info.force_local` | No |
54
- | `unavailable` | Gateway not registered, gateway without the `payment` feature (a deactivated Pro or add-on gateway), or the charge has no `vendor_charge_id` | No. Same prompt as a failure. |
55
-
56
- Whatever status the gateway returns, a non-error return is success. `pending` is normal on Stripe, Paddle and PayPal.
57
-
58
- ### When the gateway fails
59
-
60
- Nothing is saved except an error entry in the order activity log. The endpoint answers **422**:
61
-
62
- ```
63
- {
64
- "code": "remote_refund_failed",
65
- "message": "Refund failed on Stripe.",
66
- "gateway": "Stripe",
67
- "gateway_message": "Charge ch_… has already been refunded.",
68
- "can_force_local": true,
69
- "impact": {
70
- "amount": 4000,
71
- "shipping_amount": 0,
72
- "items": [{ "id": 12, "refund_qty": 1, "restore_quantity": 1 }],
73
- "manage_stock": true,
74
- "payment_status_after": "partially_refunded",
75
- "cancel_subscription": false
76
- }
77
- }
78
- ```
79
-
80
- `code` is `remote_refund_failed` (the gateway returned a `WP_Error` or threw) or `gateway_unavailable`. The admin UI shows the gateway message and the impact list. If the admin picks **Record locally only**, the UI resends the exact failed payload with `refund_info.force_local = true`. It is validated against the current order state like any refund.
81
-
82
- ### Forced local refund
83
-
84
- - Records the refund row, updates totals, stock, payment status and sends the customer refund email (subject to the `order_refunded_customer` notification setting).
85
- - Does not call the gateway and returns no money. The order log gets a warning saying so.
86
- - Does not cancel the subscription.
87
- - Skips `fluent_cart/order_refund_manually`.
88
-
89
- ## What gets written
90
-
91
- | Store | Key | When |
92
- | --- | --- | --- |
93
- | `fct_order_transactions` | new row: `transaction_type = refund`, `status = refunded`, `total`, `vendor_charge_id` = gateway refund id, `meta.parent_id`, `meta.reason`, `meta.created_by`, `meta.refund_route`, `meta.is_item_refund`, `meta.refunded_items`, `meta.manage_stock` | Once the refund is real |
94
- | `fct_order_transactions` (charge row) | `meta.refunded_total` | Every refund. Recounted from linked refund rows, never lowered. |
95
- | `fct_orders` | `total_refund`, `payment_status` | By the `OrderRefund` listener |
96
- | `fct_order_items` | `line_meta.refunded_quantity`, `fulfilled_quantity` | Item refunds |
97
- | `fct_order_items` | `refund_total` | By the `OrderRefund` listener: the line's own amount on an item refund, a spread on an amount refund. Capped at the line's charge inside the `UPDATE`. |
98
- | `fct_order_meta` | `shipping_refunded_amount`, `shipping_refunded` | Shipping refunds |
99
- | Stock tables | `available`, `on_hold`, `committed`, `stock_status`, movement ledger | Item refunds with restock on and stock management enabled |
100
-
101
- ## Recording a refund once
102
-
103
- Several things can try to record the same refund: the admin request, a webhook, a webhook redelivery. The rules that keep it to one row and one announcement:
104
-
105
- 1. **Match by gateway refund id first.** Then adopt a row that has no gateway id yet but the same charge and total. Otherwise create a row. This is `Refund::createOrRecordRefund()`.
106
- 2. **A webhook that beats the admin request.** Before the gateway call, the admin refund snapshots the refund row ids on the order. After the gateway answers, it adopts a row with the returned refund id only if that row was created during the call. A row that already existed before the call, or one for another charge or amount, is not adopted and gives `refund_not_recorded`.
107
- 3. **Pending to final is one conditional update.** A pending refund moves to `refunded` or `failed` with a single `UPDATE ... WHERE status = 'pending'`. Only the delivery that moved the row counts the refund and dispatches `OrderRefund`. A late failure cannot overwrite a completed refund.
108
- 4. **Redelivery repairs.** A redelivered webhook for an already `refunded` row re-runs the order accounting under the `fct_refund_` lock. `OrderRefund` applies only the part the order has not counted.
109
- 5. **Charge total recount.** After every refund the `OrderRefunded` listener recounts each charge's `meta.refunded_total` from its linked refund rows with one atomic `JSON_SET` that keeps the higher value. This keeps the per-charge cap correct when a webhook created the row without adding its amount.
110
- 6. **Announce once.** The admin path reloads the order before dispatching, so a refund a webhook already announced is not announced twice. When the event stays silent for that reason, `OrderRefund` restocks the refunded items itself, once.
111
-
112
- ## When saving fails after the gateway succeeded
113
-
114
- The money has moved, so the refund must not be lost.
115
-
116
- 1. The full save (row plus item and shipping writes) is tried twice.
117
- 2. Then a **bare refund row** is written without item and shipping changes. When the refund had such changes, the row gets `meta.local_sync = pending` and `meta.refund_intent`, and the order log gets a warning. The response carries a `local_sync` warning. Pending rows are left out of order refund totals and payment status.
118
- 3. If the row and line writes saved but counting the refund failed (`OrderRefund` threw), the row is marked pending with an empty `refund_intent.items`, since the units are already written, and the log says "Refund recorded without order totals".
119
- 4. The admin runs **Re-sync refund** from the transaction list. It reapplies the stored item and shipping changes in one DB transaction, marks `local_sync = done` and counts the refund once.
120
- 5. If even the bare row cannot be written, the endpoint returns a `refund_not_recorded` error carrying the gateway refund id and amount, and the order log gets an error entry. The admin must not refund again.
121
-
122
- Re-sync answers:
123
-
124
- | Code | Status | When |
125
- | --- | --- | --- |
126
- | `nothing_to_resync` | 400 | The row is not `refunded` or is not awaiting re-sync |
127
- | `refund_lock_timeout` | 409 | Another refund holds the order's lock |
128
- | `refund_order_changed` | 409 | A line is gone, or its units left differ from the stored `pre_refund_qty`. Reconcile by hand. |
129
- | `resync_failed` | 500 | A write or the count failed. The row stays pending; a retry applies only what is still missing and counts the refund once. |
130
-
131
- ## Webhook refunds
132
-
133
- Every gateway records refunds the same way:
134
-
135
- ```
136
- \FluentCart\App\Services\Payments\Refund::createOrRecordRefund([
137
- 'vendor_charge_id' => $refundId, // the provider's refund id
138
- 'total' => $refundAmount, // cents
139
- 'status' => 'refunded', // refunded | pending | failed
140
- 'reason' => $reason,
141
- ], $parentTransaction);
142
- ```
143
-
144
- A `pending` row adds nothing until it becomes `refunded`. A `failed` report never adopts a locally recorded row. Gateways must not keep their own matcher, status ranking or `OrderRefund` dispatch.
145
-
146
- The recorder takes the same `fct_refund_` lock as the admin refund and waits up to 10 seconds for it. If the lock stays busy it records nothing and returns `WP_Error('refund_lock_timeout')`. The webhook must answer a non-2xx for that code (Stripe, Authorize.Net, Mollie and the addons answer 503, PayPal and Paddle 500) so the gateway redelivers. Redelivery is idempotent because the refund matches by vendor refund id. Other error codes (`missing_vendor_refund_id`, `invalid_refund_amount`) are not retryable and keep their current handling.
147
-
148
- ## Events and hooks
149
-
150
- | Hook | Fires |
151
- | --- | --- |
152
- | `fluent_cart/order_refunded` | After every counted refund (stock, reminders, email) |
153
- | `fluent_cart/order_fully_refunded` · `fluent_cart/order_partially_refunded` | By resulting payment status |
154
- | `fluent_cart/order_refund_manually` (filter) | Lets an integration declare a refund manual. Skipped for forced local. |
155
- | `fluent_cart/offline_payment_refund_id` (filter) | Cash on Delivery refund id |
156
-
157
- `OrderRefund` stays silent when the refunded amount was already announced, so listeners run once per refund.
158
-
159
- ## MCP refund tool
160
-
161
- `fluent-cart/refund-order` follows the same rules as the admin request and never forces a local refund.
162
-
163
- - It takes the same `fct_refund_` lock before reading the order, so the confirm step checks its fingerprint against totals no other refund can change.
164
- - If the gateway refunded but FluentCart could not record it, the result is cached under the idempotency key and the order is marked (`_mcp_unrecorded_refund`). Preview and confirm then refuse with `unrecorded_refund_pending` until a store admin reconciles.
165
- - The marker clears only for the lost refund: a refund row carrying the same gateway refund id, or, when the id is unknown, a row with the same amount recorded after the failure.
166
-
167
- ## Not covered by this page
168
-
169
- - Writing a gateway: [Quick Implementation](/payment-methods-integration/quick-implementation.md).
170
- - The REST schema: [Refund Order](/restapi/operations/orders/refund-order.md).
1
+ # Refunds
2
+
3
+ A refund in FluentCart is **remote first**: the payment gateway is called before anything is written. A refund transaction row exists only once the refund is real, meaning the gateway accepted it or an admin deliberately recorded it locally.
4
+
5
+ At a glance
6
+
7
+ | Concern | Where |
8
+ | --- | --- |
9
+ | Admin endpoint | `POST /orders/{order}/refund` · `OrderController::refundOrder()` |
10
+ | Re-sync endpoint | `POST /orders/{order}/refund/{transaction}/resync` · `OrderController::resyncRefund()` |
11
+ | Engine | `FluentCart\App\Services\Payments\Refund::processRefund()` |
12
+ | Webhook recorder | `Refund::createOrRecordRefund()` |
13
+ | Event | `FluentCart\App\Events\Order\OrderRefund` |
14
+ | Per-order lock | MySQL `GET_LOCK('fct_refund_')` |
15
+ | Permission | `orders/can_refund` |
16
+
17
+ For the gateway side of the contract (what `processRefund()` must return and what a webhook handler must call), see [Refunds in Quick Implementation](/payment-methods-integration/quick-implementation.md).
18
+
19
+ ## Two kinds of refund
20
+
21
+ | Kind | Sent when | Amount comes from |
22
+ | --- | --- | --- |
23
+ | Item and shipping | `refunded_items` is not empty, or `shipping_amount` is greater than 0 | The server, in `RefundPlanner::plan()`. Each line's charge left (line total plus any tax added on top, minus `refund_total`) divided by its units left. Refunding every unit left takes the whole remainder. |
24
+ | Amount only | Neither is sent | The `amount` the admin typed. Used for goodwill and dispute refunds. No unit or stock changes; the money is spread over the lines' `refund_total`. |
25
+
26
+ A line keeps what was sold: `quantity`, `line_total` and `tax_amount` never change. An item refund adds the units to `line_meta.refunded_quantity` and caps `fulfilled_quantity` at the units left. The `OrderRefund` listener adds each line's refunded money to `refund_total`. An amount refund is spread over the lines by what each has left, and any part the lines cannot take is counted as shipping, only when the lines plus shipping make up the whole order total. Shipping is tracked as a running total in order meta `shipping_refunded_amount`; `shipping_refunded` is set to `1` once the whole shipping amount is returned.
27
+
28
+ ## The admin refund, step by step
29
+
30
+ ```
31
+ Refund modal ── POST orders/{id}/refund ──▶ OrderController::refundOrder()
32
+ 1. order must be refundable else 400
33
+ 2. Refund::withOrderRefundLock(order, wait 0) else 409 "another refund in progress"
34
+ └ refundOrderUnderLock():
35
+ 3. RefundPlanner::plan(): amount, units per line, else 422
36
+ shipping, refund_intent (the item + shipping writes)
37
+ 4. Refund::processRefund(charge, amount, refund_info, refund_intent)
38
+ a. validate amount against order and charge limits
39
+ b. pick a route (remote / local / forced_local / unavailable)
40
+ c. remote: call the gateway ── fails ──▶ activity log entry only, 422 force-local payload
41
+ d. save: refund row + item/shipping writes, one DB transaction
42
+ e. dispatch OrderRefund: order totals, line refund_total, charge refunded_total
43
+ 5. optional: cancel the subscription (never on a forced local refund)
44
+ 6. release the lock
45
+ ```
46
+
47
+ ### Routes
48
+
49
+ | Route | Chosen when | Gateway called |
50
+ | --- | --- | --- |
51
+ | `remote` | The gateway has the `refund` feature and the charge has a `vendor_charge_id` | Yes |
52
+ | `local` | `fluent_cart/order_refund_manually` returned `yes`, or the gateway has `local_refund_only` (Cash on Delivery), `offline`, or no `refund` feature. The admin returns the money outside FluentCart. | Only for Cash on Delivery, so `fluent_cart/offline_payment_refund_id` still fires |
53
+ | `forced_local` | The request carried `refund_info.force_local` | No |
54
+ | `unavailable` | Gateway not registered, gateway without the `payment` feature (a deactivated Pro or add-on gateway), or the charge has no `vendor_charge_id` | No. Same prompt as a failure. |
55
+
56
+ Whatever status the gateway returns, a non-error return is success. `pending` is normal on Stripe, Paddle and PayPal.
57
+
58
+ ### When the gateway fails
59
+
60
+ Nothing is saved except an error entry in the order activity log. The endpoint answers **422**:
61
+
62
+ ```
63
+ {
64
+ "code": "remote_refund_failed",
65
+ "message": "Refund failed on Stripe.",
66
+ "gateway": "Stripe",
67
+ "gateway_message": "Charge ch_… has already been refunded.",
68
+ "can_force_local": true,
69
+ "impact": {
70
+ "amount": 4000,
71
+ "shipping_amount": 0,
72
+ "items": [{ "id": 12, "refund_qty": 1, "restore_quantity": 1 }],
73
+ "manage_stock": true,
74
+ "payment_status_after": "partially_refunded",
75
+ "cancel_subscription": false
76
+ }
77
+ }
78
+ ```
79
+
80
+ `code` is `remote_refund_failed` (the gateway returned a `WP_Error` or threw) or `gateway_unavailable`. The admin UI shows the gateway message and the impact list. If the admin picks **Record locally only**, the UI resends the exact failed payload with `refund_info.force_local = true`. It is validated against the current order state like any refund.
81
+
82
+ ### Forced local refund
83
+
84
+ - Records the refund row, updates totals, stock, payment status and sends the customer refund email (subject to the `order_refunded_customer` notification setting).
85
+ - Does not call the gateway and returns no money. The order log gets a warning saying so.
86
+ - Does not cancel the subscription.
87
+ - Skips `fluent_cart/order_refund_manually`.
88
+
89
+ ## What gets written
90
+
91
+ | Store | Key | When |
92
+ | --- | --- | --- |
93
+ | `fct_order_transactions` | new row: `transaction_type = refund`, `status = refunded`, `total`, `vendor_charge_id` = gateway refund id, `meta.parent_id`, `meta.reason`, `meta.created_by`, `meta.refund_route`, `meta.is_item_refund`, `meta.refunded_items`, `meta.manage_stock` | Once the refund is real |
94
+ | `fct_order_transactions` (charge row) | `meta.refunded_total` | Every refund. Recounted from linked refund rows, never lowered. |
95
+ | `fct_orders` | `total_refund`, `payment_status` | By the `OrderRefund` listener |
96
+ | `fct_order_items` | `line_meta.refunded_quantity`, `fulfilled_quantity` | Item refunds |
97
+ | `fct_order_items` | `refund_total` | By the `OrderRefund` listener: the line's own amount on an item refund, a spread on an amount refund. Capped at the line's charge inside the `UPDATE`. |
98
+ | `fct_order_meta` | `shipping_refunded_amount`, `shipping_refunded` | Shipping refunds |
99
+ | Stock tables | `available`, `on_hold`, `committed`, `stock_status`, movement ledger | Item refunds with restock on and stock management enabled |
100
+
101
+ ## Recording a refund once
102
+
103
+ Several things can try to record the same refund: the admin request, a webhook, a webhook redelivery. The rules that keep it to one row and one announcement:
104
+
105
+ 1. **Match by gateway refund id first.** Then adopt a row that has no gateway id yet but the same charge and total. Otherwise create a row. This is `Refund::createOrRecordRefund()`.
106
+ 2. **A webhook that beats the admin request.** Before the gateway call, the admin refund snapshots the refund row ids on the order. After the gateway answers, it adopts a row with the returned refund id only if that row was created during the call. A row that already existed before the call, or one for another charge or amount, is not adopted and gives `refund_not_recorded`.
107
+ 3. **Pending to final is one conditional update.** A pending refund moves to `refunded` or `failed` with a single `UPDATE ... WHERE status = 'pending'`. Only the delivery that moved the row counts the refund and dispatches `OrderRefund`. A late failure cannot overwrite a completed refund.
108
+ 4. **Redelivery repairs.** A redelivered webhook for an already `refunded` row re-runs the order accounting under the `fct_refund_` lock. `OrderRefund` applies only the part the order has not counted.
109
+ 5. **Charge total recount.** After every refund the `OrderRefunded` listener recounts each charge's `meta.refunded_total` from its linked refund rows with one atomic `JSON_SET` that keeps the higher value. This keeps the per-charge cap correct when a webhook created the row without adding its amount.
110
+ 6. **Announce once.** The admin path reloads the order before dispatching, so a refund a webhook already announced is not announced twice. When the event stays silent for that reason, `OrderRefund` restocks the refunded items itself, once.
111
+
112
+ ## When saving fails after the gateway succeeded
113
+
114
+ The money has moved, so the refund must not be lost.
115
+
116
+ 1. The full save (row plus item and shipping writes) is tried twice.
117
+ 2. Then a **bare refund row** is written without item and shipping changes. When the refund had such changes, the row gets `meta.local_sync = pending` and `meta.refund_intent`, and the order log gets a warning. The response carries a `local_sync` warning. Pending rows are left out of order refund totals and payment status.
118
+ 3. If the row and line writes saved but counting the refund failed (`OrderRefund` threw), the row is marked pending with an empty `refund_intent.items`, since the units are already written, and the log says "Refund recorded without order totals".
119
+ 4. The admin runs **Re-sync refund** from the transaction list. It reapplies the stored item and shipping changes in one DB transaction, marks `local_sync = done` and counts the refund once.
120
+ 5. If even the bare row cannot be written, the endpoint returns a `refund_not_recorded` error carrying the gateway refund id and amount, and the order log gets an error entry. The admin must not refund again.
121
+
122
+ Re-sync answers:
123
+
124
+ | Code | Status | When |
125
+ | --- | --- | --- |
126
+ | `nothing_to_resync` | 400 | The row is not `refunded` or is not awaiting re-sync |
127
+ | `refund_lock_timeout` | 409 | Another refund holds the order's lock |
128
+ | `refund_order_changed` | 409 | A line is gone, or its units left differ from the stored `pre_refund_qty`. Reconcile by hand. |
129
+ | `resync_failed` | 500 | A write or the count failed. The row stays pending; a retry applies only what is still missing and counts the refund once. |
130
+
131
+ ## Webhook refunds
132
+
133
+ Every gateway records refunds the same way:
134
+
135
+ ```
136
+ \FluentCart\App\Services\Payments\Refund::createOrRecordRefund([
137
+ 'vendor_charge_id' => $refundId, // the provider's refund id
138
+ 'total' => $refundAmount, // cents
139
+ 'status' => 'refunded', // refunded | pending | failed
140
+ 'reason' => $reason,
141
+ ], $parentTransaction);
142
+ ```
143
+
144
+ A `pending` row adds nothing until it becomes `refunded`. A `failed` report never adopts a locally recorded row. Gateways must not keep their own matcher, status ranking or `OrderRefund` dispatch.
145
+
146
+ The recorder takes the same `fct_refund_` lock as the admin refund and waits up to 10 seconds for it. If the lock stays busy it records nothing and returns `WP_Error('refund_lock_timeout')`. The webhook must answer a non-2xx for that code (Stripe, Authorize.Net, Mollie and the addons answer 503, PayPal and Paddle 500) so the gateway redelivers. Redelivery is idempotent because the refund matches by vendor refund id. Other error codes (`missing_vendor_refund_id`, `invalid_refund_amount`) are not retryable and keep their current handling.
147
+
148
+ ## Events and hooks
149
+
150
+ | Hook | Fires |
151
+ | --- | --- |
152
+ | `fluent_cart/order_refunded` | After every counted refund (stock, reminders, email) |
153
+ | `fluent_cart/order_fully_refunded` · `fluent_cart/order_partially_refunded` | By resulting payment status |
154
+ | `fluent_cart/order_refund_manually` (filter) | Lets an integration declare a refund manual. Skipped for forced local. |
155
+ | `fluent_cart/offline_payment_refund_id` (filter) | Cash on Delivery refund id |
156
+
157
+ `OrderRefund` stays silent when the refunded amount was already announced, so listeners run once per refund.
158
+
159
+ ## MCP refund tool
160
+
161
+ `fluent-cart/refund-order` follows the same rules as the admin request and never forces a local refund.
162
+
163
+ - It takes the same `fct_refund_` lock before reading the order, so the confirm step checks its fingerprint against totals no other refund can change.
164
+ - If the gateway refunded but FluentCart could not record it, the result is cached under the idempotency key and the order is marked (`_mcp_unrecorded_refund`). Preview and confirm then refuse with `unrecorded_refund_pending` until a store admin reconciles.
165
+ - The marker clears only for the lost refund: a refund row carrying the same gateway refund id, or, when the id is unknown, a row with the same amount recorded after the failure.
166
+
167
+ ## Not covered by this page
168
+
169
+ - Writing a gateway: [Quick Implementation](/payment-methods-integration/quick-implementation.md).
170
+ - The REST schema: [Refund Order](/restapi/operations/orders/refund-order.md).