fluentcart-developer 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (612) hide show
  1. package/LICENSE.md +26 -26
  2. package/README.md +59 -59
  3. package/dist/cards/fluentcart/templates-native.js +1087 -1087
  4. package/dist/cards/fluentcart/tools.js +2309 -2309
  5. package/dist/server.d.ts.map +1 -1
  6. package/dist/server.js +37 -1
  7. package/dist/server.js.map +1 -1
  8. package/dist/skills/fluentcart-developer/SKILL.md +108 -108
  9. package/dist/skills/fluentcart-developer/examples/README.md +30 -30
  10. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
  11. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
  12. package/dist/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +113 -113
  13. package/dist/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +148 -148
  14. package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
  15. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/README.md +22 -22
  16. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/sample-plugin-with-licensing-sdk.php +79 -79
  17. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/FluentLicensing.php +303 -303
  18. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/LicenseSettings.php +566 -566
  19. package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/PluginUpdater.php +304 -304
  20. package/dist/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +61 -61
  21. package/dist/skills/fluentcart-developer/references/api/authentication.md +452 -452
  22. package/dist/skills/fluentcart-developer/references/api/coupons.md +786 -786
  23. package/dist/skills/fluentcart-developer/references/api/customers.md +889 -889
  24. package/dist/skills/fluentcart-developer/references/api/files.md +609 -609
  25. package/dist/skills/fluentcart-developer/references/api/index.md +432 -432
  26. package/dist/skills/fluentcart-developer/references/api/licensing.md +633 -633
  27. package/dist/skills/fluentcart-developer/references/api/order-bump.md +384 -384
  28. package/dist/skills/fluentcart-developer/references/api/orders.md +814 -814
  29. package/dist/skills/fluentcart-developer/references/api/products.md +866 -866
  30. package/dist/skills/fluentcart-developer/references/api/roles-permissions.md +536 -536
  31. package/dist/skills/fluentcart-developer/references/api/subscriptions.md +827 -827
  32. package/dist/skills/fluentcart-developer/references/database/index.md +44 -44
  33. package/dist/skills/fluentcart-developer/references/database/models/activity.md +178 -178
  34. package/dist/skills/fluentcart-developer/references/database/models/applied-coupon.md +291 -291
  35. package/dist/skills/fluentcart-developer/references/database/models/attribute-group.md +239 -239
  36. package/dist/skills/fluentcart-developer/references/database/models/attribute-relation.md +181 -181
  37. package/dist/skills/fluentcart-developer/references/database/models/attribute-term.md +219 -219
  38. package/dist/skills/fluentcart-developer/references/database/models/cart.md +645 -645
  39. package/dist/skills/fluentcart-developer/references/database/models/coupon.md +427 -427
  40. package/dist/skills/fluentcart-developer/references/database/models/customer-addresses.md +348 -348
  41. package/dist/skills/fluentcart-developer/references/database/models/customer-meta.md +156 -156
  42. package/dist/skills/fluentcart-developer/references/database/models/customer.md +584 -584
  43. package/dist/skills/fluentcart-developer/references/database/models/dynamic-model.md +163 -163
  44. package/dist/skills/fluentcart-developer/references/database/models/label-relationship.md +155 -155
  45. package/dist/skills/fluentcart-developer/references/database/models/label.md +153 -153
  46. package/dist/skills/fluentcart-developer/references/database/models/license-activation.md +182 -182
  47. package/dist/skills/fluentcart-developer/references/database/models/license-meta.md +163 -163
  48. package/dist/skills/fluentcart-developer/references/database/models/license-site.md +208 -208
  49. package/dist/skills/fluentcart-developer/references/database/models/license.md +640 -640
  50. package/dist/skills/fluentcart-developer/references/database/models/meta.md +233 -233
  51. package/dist/skills/fluentcart-developer/references/database/models/order-address.md +391 -391
  52. package/dist/skills/fluentcart-developer/references/database/models/order-download-permission.md +144 -144
  53. package/dist/skills/fluentcart-developer/references/database/models/order-item.md +383 -383
  54. package/dist/skills/fluentcart-developer/references/database/models/order-meta.md +303 -303
  55. package/dist/skills/fluentcart-developer/references/database/models/order-operation.md +158 -158
  56. package/dist/skills/fluentcart-developer/references/database/models/order-promotion-stat.md +175 -175
  57. package/dist/skills/fluentcart-developer/references/database/models/order-promotion.md +250 -250
  58. package/dist/skills/fluentcart-developer/references/database/models/order-tax-rate.md +172 -172
  59. package/dist/skills/fluentcart-developer/references/database/models/order-transaction.md +440 -440
  60. package/dist/skills/fluentcart-developer/references/database/models/order.md +727 -727
  61. package/dist/skills/fluentcart-developer/references/database/models/product-detail.md +397 -397
  62. package/dist/skills/fluentcart-developer/references/database/models/product-download.md +258 -258
  63. package/dist/skills/fluentcart-developer/references/database/models/product-meta.md +153 -153
  64. package/dist/skills/fluentcart-developer/references/database/models/product-variation.md +556 -556
  65. package/dist/skills/fluentcart-developer/references/database/models/product.md +580 -580
  66. package/dist/skills/fluentcart-developer/references/database/models/relationships.md +427 -427
  67. package/dist/skills/fluentcart-developer/references/database/models/scheduled-action.md +175 -175
  68. package/dist/skills/fluentcart-developer/references/database/models/shipping-class.md +148 -148
  69. package/dist/skills/fluentcart-developer/references/database/models/shipping-method.md +280 -280
  70. package/dist/skills/fluentcart-developer/references/database/models/shipping-zone.md +205 -205
  71. package/dist/skills/fluentcart-developer/references/database/models/subscription-meta.md +173 -173
  72. package/dist/skills/fluentcart-developer/references/database/models/subscription.md +528 -528
  73. package/dist/skills/fluentcart-developer/references/database/models/tax-class.md +195 -195
  74. package/dist/skills/fluentcart-developer/references/database/models/tax-rate.md +225 -225
  75. package/dist/skills/fluentcart-developer/references/database/models/user-meta.md +166 -166
  76. package/dist/skills/fluentcart-developer/references/database/models/user.md +220 -220
  77. package/dist/skills/fluentcart-developer/references/database/models.md +404 -404
  78. package/dist/skills/fluentcart-developer/references/database/query-builder.md +860 -860
  79. package/dist/skills/fluentcart-developer/references/database/readme.md +276 -276
  80. package/dist/skills/fluentcart-developer/references/database/schema.md +1002 -1002
  81. package/dist/skills/fluentcart-developer/references/engineering/adding-custom-pages-to-the-customer-dashboard.md +395 -395
  82. package/dist/skills/fluentcart-developer/references/engineering/index.md +4 -4
  83. package/dist/skills/fluentcart-developer/references/engineering.md +4 -4
  84. package/dist/skills/fluentcart-developer/references/getting-started.md +249 -249
  85. package/dist/skills/fluentcart-developer/references/guides/frontend.md +519 -519
  86. package/dist/skills/fluentcart-developer/references/guides/index.md +107 -107
  87. package/dist/skills/fluentcart-developer/references/guides/integrations.md +600 -600
  88. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/index.md +237 -237
  89. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/labels-and-tracking.md +481 -481
  90. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/live-rates.md +269 -269
  91. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/reference.md +223 -223
  92. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/settings.md +370 -370
  93. package/dist/skills/fluentcart-developer/references/guides/shipping-carrier.md +237 -237
  94. package/dist/skills/fluentcart-developer/references/guides/subscriptions.md +217 -217
  95. package/dist/skills/fluentcart-developer/references/hooks/actions/admin-and-templates.md +1079 -1079
  96. package/dist/skills/fluentcart-developer/references/hooks/actions/cart-and-checkout.md +1795 -1795
  97. package/dist/skills/fluentcart-developer/references/hooks/actions/customers-and-users.md +327 -327
  98. package/dist/skills/fluentcart-developer/references/hooks/actions/licenses.md +829 -829
  99. package/dist/skills/fluentcart-developer/references/hooks/actions/modules.md +81 -81
  100. package/dist/skills/fluentcart-developer/references/hooks/actions/orders.md +757 -757
  101. package/dist/skills/fluentcart-developer/references/hooks/actions/payments-and-integrations.md +1163 -1163
  102. package/dist/skills/fluentcart-developer/references/hooks/actions/pro-modules.md +219 -219
  103. package/dist/skills/fluentcart-developer/references/hooks/actions/products-and-coupons.md +1019 -1019
  104. package/dist/skills/fluentcart-developer/references/hooks/actions/subscriptions.md +1290 -1290
  105. package/dist/skills/fluentcart-developer/references/hooks/actions.md +16 -16
  106. package/dist/skills/fluentcart-developer/references/hooks/deprecated.md +60 -60
  107. package/dist/skills/fluentcart-developer/references/hooks/filters/cart-and-checkout.md +2032 -2032
  108. package/dist/skills/fluentcart-developer/references/hooks/filters/customers-and-subscriptions.md +1746 -1746
  109. package/dist/skills/fluentcart-developer/references/hooks/filters/integrations-and-advanced.md +2439 -2439
  110. package/dist/skills/fluentcart-developer/references/hooks/filters/modules.md +464 -464
  111. package/dist/skills/fluentcart-developer/references/hooks/filters/orders-and-payments.md +2658 -2658
  112. package/dist/skills/fluentcart-developer/references/hooks/filters/pro-modules.md +502 -502
  113. package/dist/skills/fluentcart-developer/references/hooks/filters/products-and-pricing.md +1785 -1785
  114. package/dist/skills/fluentcart-developer/references/hooks/filters/settings-and-configuration.md +2966 -2966
  115. package/dist/skills/fluentcart-developer/references/hooks/filters.md +14 -14
  116. package/dist/skills/fluentcart-developer/references/hooks/index.md +35 -35
  117. package/dist/skills/fluentcart-developer/references/index.md +625 -625
  118. package/dist/skills/fluentcart-developer/references/modules/fee-system.md +427 -427
  119. package/dist/skills/fluentcart-developer/references/modules/ghost-product-selling.md +440 -440
  120. package/dist/skills/fluentcart-developer/references/modules/index.md +484 -484
  121. package/dist/skills/fluentcart-developer/references/modules/licensing.md +342 -342
  122. package/dist/skills/fluentcart-developer/references/modules/order-bump.md +433 -433
  123. package/dist/skills/fluentcart-developer/references/modules/payment-methods.md +129 -129
  124. package/dist/skills/fluentcart-developer/references/modules/refunds.md +170 -170
  125. package/dist/skills/fluentcart-developer/references/modules/shipping.md +846 -846
  126. package/dist/skills/fluentcart-developer/references/modules/storage.md +986 -986
  127. package/dist/skills/fluentcart-developer/references/modules/subscription-vendor-ids.md +186 -186
  128. package/dist/skills/fluentcart-developer/references/modules/subscriptions.md +678 -678
  129. package/dist/skills/fluentcart-developer/references/payment-methods-integration/index.md +164 -164
  130. package/dist/skills/fluentcart-developer/references/payment-methods-integration/paddle-example.md +1648 -1648
  131. package/dist/skills/fluentcart-developer/references/payment-methods-integration/payment/setting/fields.md +353 -353
  132. package/dist/skills/fluentcart-developer/references/payment-methods-integration/quick-implementation.md +1079 -1079
  133. package/dist/skills/fluentcart-developer/references/payment-methods-integration.md +164 -164
  134. package/dist/skills/fluentcart-developer/references/restapi/checkout.md +573 -573
  135. package/dist/skills/fluentcart-developer/references/restapi/coupons.md +958 -958
  136. package/dist/skills/fluentcart-developer/references/restapi/customer-profile.md +1423 -1423
  137. package/dist/skills/fluentcart-developer/references/restapi/customers.md +1103 -1103
  138. package/dist/skills/fluentcart-developer/references/restapi/dashboard.md +1083 -1083
  139. package/dist/skills/fluentcart-developer/references/restapi/data-export.md +132 -132
  140. package/dist/skills/fluentcart-developer/references/restapi/email-notifications.md +846 -846
  141. package/dist/skills/fluentcart-developer/references/restapi/files.md +313 -313
  142. package/dist/skills/fluentcart-developer/references/restapi/index.md +127 -127
  143. package/dist/skills/fluentcart-developer/references/restapi/integrations.md +1000 -1000
  144. package/dist/skills/fluentcart-developer/references/restapi/inventory.md +192 -192
  145. package/dist/skills/fluentcart-developer/references/restapi/labels-and-attributes.md +797 -797
  146. package/dist/skills/fluentcart-developer/references/restapi/licensing.md +1733 -1733
  147. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-available-shipping-methods.md +30 -30
  148. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-checkout-summary.md +28 -28
  149. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-country-info.md +29 -29
  150. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-order-info.md +28 -28
  151. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-shipping-methods-list-view.md +30 -30
  152. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/login.md +66 -66
  153. package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/place-order.md +179 -179
  154. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/apply-coupon.md +83 -83
  155. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/cancel-coupon.md +87 -87
  156. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/check-product-eligibility.md +59 -59
  157. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/create-coupon.md +230 -230
  158. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/delete-coupon.md +29 -29
  159. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon-settings.md +20 -20
  160. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon.md +27 -27
  161. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupon-codes.md +20 -20
  162. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupons.md +37 -37
  163. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/re-apply-coupons.md +75 -75
  164. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/store-coupon-settings.md +40 -40
  165. package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/update-coupon.md +133 -133
  166. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-address-checkout.md +138 -138
  167. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-profile-address.md +119 -119
  168. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/dashboard-overview.md +22 -22
  169. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/delete-profile-address.md +46 -46
  170. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-order-details.md +30 -30
  171. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-portal-sections.md +29 -29
  172. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-profile-details.md +22 -22
  173. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-transaction-billing-address.md +30 -30
  174. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-upgrade-paths.md +31 -31
  175. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-downloads.md +29 -29
  176. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-orders.md +28 -28
  177. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/make-profile-address-primary.md +55 -55
  178. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/pause-subscription.md +29 -29
  179. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/resume-subscription.md +29 -29
  180. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/save-transaction-billing-address.md +92 -92
  181. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/select-address-for-checkout.md +32 -32
  182. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-address.md +115 -115
  183. package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-details.md +69 -69
  184. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/attach-user.md +50 -50
  185. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/bulk-actions.md +65 -65
  186. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-address.md +135 -135
  187. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-customer.md +108 -108
  188. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/delete-address.md +62 -62
  189. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/detach-user.md +28 -28
  190. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/find-customer-order.md +27 -27
  191. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-attachable-users.md +20 -20
  192. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-addresses.md +28 -28
  193. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-orders.md +37 -37
  194. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-stats.md +27 -27
  195. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer.md +32 -32
  196. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/list-customers.md +37 -37
  197. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/recalculate-ltv.md +28 -28
  198. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/set-primary-address.md +72 -72
  199. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-additional-info.md +55 -55
  200. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-address.md +144 -144
  201. package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-customer.md +123 -123
  202. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/attach-note-to-order.md +49 -49
  203. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-all-pages.md +21 -21
  204. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-single-page.md +55 -55
  205. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/delete-activity.md +28 -28
  206. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-country-info.md +29 -29
  207. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-dashboard-stats.md +22 -22
  208. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-filter-options.md +31 -31
  209. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-data.md +20 -20
  210. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-settings.md +20 -20
  211. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-print-templates.md +20 -20
  212. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-search-options.md +27 -27
  213. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-widgets.md +28 -28
  214. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/initialize-app.md +20 -20
  215. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-activities.md +33 -33
  216. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-attachments.md +21 -21
  217. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-countries.md +20 -20
  218. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/mark-activity-read.md +53 -53
  219. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/run-data-backfills.md +21 -21
  220. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-settings.md +54 -54
  221. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-tax-settings.md +73 -73
  222. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-print-templates.md +64 -64
  223. package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/upload-attachment.md +42 -42
  224. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-customers-batch.md +129 -129
  225. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-licenses-batch.md +133 -133
  226. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-orders-batch.md +129 -129
  227. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-subscriptions-batch.md +129 -129
  228. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-customers-export-schema.md +21 -21
  229. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-licenses-export-schema.md +26 -26
  230. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-orders-export-schema.md +21 -21
  231. package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-subscriptions-export-schema.md +21 -21
  232. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/enable-notification.md +57 -57
  233. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-digest-settings.md +22 -22
  234. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-notification.md +30 -30
  235. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-reminders.md +22 -22
  236. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-settings.md +22 -22
  237. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-shortcodes.md +22 -22
  238. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/list-notifications.md +20 -20
  239. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-default-template.md +66 -66
  240. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-notification.md +50 -50
  241. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-digest-settings.md +101 -101
  242. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-reminders.md +162 -162
  243. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-settings.md +99 -99
  244. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-digest-test.md +47 -47
  245. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-manual-reminder.md +51 -51
  246. package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/update-notification.md +93 -93
  247. package/dist/skills/fluentcart-developer/references/restapi/operations/files/delete-file.md +31 -31
  248. package/dist/skills/fluentcart-developer/references/restapi/operations/files/get-bucket-list.md +28 -28
  249. package/dist/skills/fluentcart-developer/references/restapi/operations/files/list-files.md +30 -30
  250. package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-editor-file.md +32 -32
  251. package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-file.md +34 -34
  252. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/chained-data-request.md +46 -46
  253. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/change-feed-status.md +51 -51
  254. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/delete-feed.md +27 -27
  255. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-dynamic-options.md +29 -29
  256. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-lists.md +27 -27
  257. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-settings.md +27 -27
  258. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-feeds.md +20 -20
  259. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-settings.md +26 -26
  260. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/install-addon-plugin.md +49 -49
  261. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/list-addons.md +20 -20
  262. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/save-feed-settings.md +52 -52
  263. package/dist/skills/fluentcart-developer/references/restapi/operations/integration/set-global-settings.md +50 -50
  264. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/bulk-update-stock.md +94 -94
  265. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/export-inventory.md +81 -81
  266. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-adjustment-history.md +26 -26
  267. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-inventory-stats.md +21 -21
  268. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/list-inventory.md +33 -33
  269. package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/update-stock.md +75 -75
  270. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-attribute-group.md +31 -31
  271. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-label.md +31 -31
  272. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-terms.md +90 -90
  273. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-group.md +28 -28
  274. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-term.md +29 -29
  275. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-group.md +28 -28
  276. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-library.md +20 -20
  277. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-groups.md +32 -32
  278. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-terms.md +33 -33
  279. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-labels.md +20 -20
  280. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-groups.md +51 -51
  281. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-terms.md +56 -56
  282. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-group.md +37 -37
  283. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-term.md +39 -39
  284. package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-label-selections.md +32 -32
  285. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-plugin-license.md +41 -41
  286. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-site-admin.md +60 -60
  287. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-plugin-license.md +18 -18
  288. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-admin.md +67 -67
  289. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-customer.md +47 -47
  290. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/delete-license.md +24 -24
  291. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/extend-license-validity.md +47 -47
  292. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-license-details.md +25 -25
  293. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-licenses-admin.md +26 -26
  294. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-activations.md +25 -25
  295. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-details.md +25 -25
  296. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-site.md +30 -30
  297. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-plugin-license-status.md +18 -18
  298. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-product-license-settings.md +24 -24
  299. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-customer-licenses.md +25 -25
  300. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-license-sites.md +33 -33
  301. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-licenses.md +38 -38
  302. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-activate-license.md +54 -54
  303. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-check-license.md +26 -26
  304. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-deactivate-license.md +46 -46
  305. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-download-license-package.md +23 -23
  306. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-get-license-version.md +26 -26
  307. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/regenerate-license-key.md +24 -24
  308. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/save-product-license-settings.md +193 -193
  309. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-activation-limit.md +53 -53
  310. package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-status.md +52 -52
  311. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/create-order-bump.md +47 -47
  312. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/delete-order-bump.md +25 -25
  313. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/get-order-bump.md +25 -25
  314. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/list-order-bumps.md +29 -29
  315. package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/update-order-bump.md +141 -141
  316. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/accept-dispute.md +47 -47
  317. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/bulk-actions.md +72 -72
  318. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-shipping.md +67 -67
  319. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-tax.md +98 -98
  320. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/change-customer.md +50 -50
  321. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/charge-now.md +29 -29
  322. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-and-change-customer.md +92 -92
  323. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-custom-order-item.md +68 -68
  324. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-order.md +351 -351
  325. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-renewal-now.md +29 -29
  326. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/delete-order.md +28 -28
  327. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/generate-missing-licenses.md +29 -29
  328. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order-transactions.md +27 -27
  329. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order.md +27 -27
  330. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-renewal.md +28 -28
  331. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-shipping-methods.md +28 -28
  332. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-single-transaction.md +28 -28
  333. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-order-currencies.md +22 -22
  334. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-orders.md +42 -42
  335. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-renewals.md +28 -28
  336. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/mark-as-paid.md +61 -61
  337. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/price-order.md +135 -135
  338. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/refund-order.md +72 -72
  339. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/resend-renewal-invoice.md +29 -29
  340. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/skip-renewal.md +48 -48
  341. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-order-statuses.md +28 -28
  342. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-pending-transaction.md +29 -29
  343. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address-id.md +60 -60
  344. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address.md +98 -98
  345. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order.md +172 -172
  346. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-statuses.md +77 -77
  347. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-subscription-details.md +84 -84
  348. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-transaction-status.md +51 -51
  349. package/dist/skills/fluentcart-developer/references/restapi/operations/orders/void-renewal.md +30 -30
  350. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/create-pdf-template.md +42 -42
  351. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/delete-pdf-template.md +26 -26
  352. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/download-pdf-preview.md +44 -44
  353. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-factory-default-templates.md +19 -19
  354. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-status.md +21 -21
  355. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-template.md +26 -26
  356. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-saved-templates.md +21 -21
  357. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-seller-details.md +19 -19
  358. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/list-pdf-templates.md +19 -19
  359. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-pdf-template.md +53 -53
  360. package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-seller-details.md +97 -97
  361. package/dist/skills/fluentcart-developer/references/restapi/operations/products/add-product-terms.md +64 -64
  362. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-edit-fetch.md +30 -30
  363. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-insert-products.md +62 -62
  364. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-products.md +59 -59
  365. package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-variants.md +83 -83
  366. package/dist/skills/fluentcart-developer/references/restapi/operations/products/change-integration-status.md +64 -64
  367. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-dummy-products.md +45 -45
  368. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-product.md +81 -81
  369. package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-variation.md +181 -181
  370. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-downloadable-file.md +27 -27
  371. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product-integration.md +30 -30
  372. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product.md +27 -27
  373. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-taxonomy-term.md +55 -55
  374. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-upgrade-path.md +27 -27
  375. package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-variation.md +27 -27
  376. package/dist/skills/fluentcart-developer/references/restapi/operations/products/do-bulk-action.md +56 -56
  377. package/dist/skills/fluentcart-developer/references/restapi/operations/products/duplicate-product.md +56 -56
  378. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-products-by-ids.md +26 -26
  379. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-taxonomy-terms.md +20 -20
  380. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-terms-by-parent.md +60 -60
  381. package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-variations-by-ids.md +26 -26
  382. package/dist/skills/fluentcart-developer/references/restapi/operations/products/find-subscription-variants.md +26 -26
  383. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-bundle-info.md +27 -27
  384. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-downloadable-url.md +27 -27
  385. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-max-excerpt-word-count.md +20 -20
  386. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-pricing-widgets.md +27 -27
  387. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-feeds.md +29 -29
  388. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-settings.md +31 -31
  389. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-pricing.md +28 -28
  390. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product.md +28 -28
  391. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-related-products.md +31 -31
  392. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-upgrade-settings.md +27 -27
  393. package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-variation-upgrade-paths.md +28 -28
  394. package/dist/skills/fluentcart-developer/references/restapi/operations/products/group-bulk-update-variants.md +103 -103
  395. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-all-variants.md +26 -26
  396. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-product-variations.md +26 -26
  397. package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-products.md +34 -34
  398. package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-shipping-class.md +27 -27
  399. package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-tax-class.md +27 -27
  400. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-bundle-info.md +56 -56
  401. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-product-integration.md +62 -62
  402. package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-upgrade-path.md +78 -78
  403. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-product-variant-options.md +29 -29
  404. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-products-by-name.md +28 -28
  405. package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-variants-by-name.md +28 -28
  406. package/dist/skills/fluentcart-developer/references/restapi/operations/products/set-variation-media.md +74 -74
  407. package/dist/skills/fluentcart-developer/references/restapi/operations/products/suggest-sku.md +28 -28
  408. package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-downloadable-files.md +134 -134
  409. package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-taxonomy-terms.md +61 -61
  410. package/dist/skills/fluentcart-developer/references/restapi/operations/products/toggle-product-tax-exemption.md +56 -56
  411. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-downloadable-file.md +98 -98
  412. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-inventory.md +56 -56
  413. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-long-desc-editor-mode.md +49 -49
  414. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-manage-stock.md +53 -53
  415. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-detail.md +58 -58
  416. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-pricing.md +225 -225
  417. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-shipping-class.md +49 -49
  418. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-tax-class.md +49 -49
  419. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-upgrade-path.md +78 -78
  420. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-option.md +79 -79
  421. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-tax-exemption.md +56 -56
  422. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation-pricing-table.md +49 -49
  423. package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation.md +105 -105
  424. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/get-product-views.md +34 -34
  425. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/list-products.md +42 -42
  426. package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/search-products.md +30 -30
  427. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/channel-rules.md +24 -24
  428. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/country-heat-map.md +22 -22
  429. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupon-overview.md +37 -37
  430. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupons.md +36 -36
  431. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-insights.md +31 -31
  432. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-overview.md +36 -36
  433. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-repeat.md +35 -35
  434. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segment-customers.md +36 -36
  435. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segments.md +30 -30
  436. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-value.md +34 -34
  437. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/dashboard-stats.md +30 -30
  438. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/failed-orders.md +34 -34
  439. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-new-vs-returning-customer.md +34 -34
  440. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-by-day-and-hour.md +34 -34
  441. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-meta.md +29 -29
  442. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-top-sold-products.md +34 -34
  443. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/future-renewals.md +31 -31
  444. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/generate-retention-snapshots.md +24 -24
  445. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-overview.md +30 -30
  446. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-activities.md +26 -26
  447. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-orders.md +20 -20
  448. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-revenue.md +37 -37
  449. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-at-risk.md +35 -35
  450. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-variations.md +33 -33
  451. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments.md +33 -33
  452. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/item-count-distribution.md +34 -34
  453. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-chart.md +30 -30
  454. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-pie-chart.md +22 -22
  455. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-summary.md +22 -22
  456. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/locations.md +43 -43
  457. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-chart.md +37 -37
  458. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-completion-time.md +34 -34
  459. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-mix.md +34 -34
  460. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-value-distribution.md +34 -34
  461. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-disputes.md +38 -38
  462. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-methods.md +36 -36
  463. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods.md +37 -37
  464. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison-launch.md +33 -33
  465. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison.md +40 -40
  466. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-detail.md +37 -37
  467. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-sales.md +37 -37
  468. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/refunds-overview.md +37 -37
  469. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/retention-snapshots-step.md +45 -45
  470. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sales-growth-chart.md +35 -35
  471. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/save-channel-rules.md +73 -73
  472. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/source-channels.md +37 -37
  473. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sources.md +49 -49
  474. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-cohorts.md +33 -33
  475. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-health.md +30 -30
  476. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-rebuys.md +37 -37
  477. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-retention.md +34 -34
  478. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-variations.md +22 -22
  479. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscriptions-overview.md +37 -37
  480. package/dist/skills/fluentcart-developer/references/restapi/operations/reports/weeks-between-refund.md +34 -34
  481. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/assign-role.md +48 -48
  482. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/delete-role-assignment.md +47 -47
  483. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/get-role.md +25 -25
  484. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-managers.md +18 -18
  485. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-roles.md +18 -18
  486. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/search-users.md +25 -25
  487. package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/update-role.md +43 -43
  488. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/create-saved-view.md +106 -106
  489. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/delete-saved-view.md +26 -26
  490. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/list-saved-views.md +25 -25
  491. package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/update-saved-view.md +83 -83
  492. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-payment-addon.md +44 -44
  493. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-plugin-addon.md +44 -44
  494. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/change-storage-driver-status.md +56 -56
  495. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/check-paypal-webhook.md +26 -26
  496. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/create-storage-bucket.md +63 -63
  497. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/disconnect-payment-method.md +55 -55
  498. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/exchange-paypal-seller-auth-token.md +62 -62
  499. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-active-storage-drivers.md +20 -20
  500. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-checkout-fields.md +22 -22
  501. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-email-shortcodes.md +20 -20
  502. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-config-snippets.md +26 -26
  503. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-status.md +20 -20
  504. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-module-settings.md +20 -20
  505. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-connection-info.md +26 -26
  506. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-settings.md +26 -26
  507. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-permissions.md +22 -22
  508. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-plugin-addons.md +20 -20
  509. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-storage-driver-settings.md +27 -27
  510. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-store-settings.md +26 -26
  511. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-mcp-adapter.md +21 -21
  512. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-payment-addon.md +60 -60
  513. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-plugin-addon.md +64 -64
  514. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-payment-methods.md +20 -20
  515. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-storage-drivers.md +20 -20
  516. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-storage-buckets.md +67 -67
  517. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reorder-payment-methods.md +55 -55
  518. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reset-storage-driver-settings.md +45 -45
  519. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-checkout-fields.md +133 -133
  520. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-confirmation-settings.md +68 -68
  521. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-module-settings.md +68 -68
  522. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-design.md +67 -67
  523. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-settings.md +58 -58
  524. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-permissions.md +68 -68
  525. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-storage-driver-settings.md +62 -62
  526. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-store-settings.md +239 -239
  527. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/setup-paypal-webhook.md +48 -48
  528. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/toggle-mcp.md +40 -40
  529. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-storage-driver-connection.md +62 -62
  530. package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-turnstile-keys.md +55 -55
  531. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-class.md +73 -73
  532. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-method.md +110 -110
  533. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-zone.md +56 -56
  534. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-class.md +29 -29
  535. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-method.md +29 -29
  536. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-zone.md +29 -29
  537. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class-profile.md +30 -30
  538. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class.md +29 -29
  539. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-packages.md +22 -22
  540. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-zone.md +27 -27
  541. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-countries.md +22 -22
  542. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-states.md +28 -28
  543. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-classes.md +31 -31
  544. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-zones.md +31 -31
  545. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/save-shipping-packages.md +112 -112
  546. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-class.md +79 -79
  547. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-method.md +113 -113
  548. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-zone.md +62 -62
  549. package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-zone-order.md +52 -52
  550. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-auto-renew.md +30 -30
  551. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-subscription.md +52 -52
  552. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/confirm-subscription-switch.md +70 -70
  553. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/fetch-subscription-remote.md +28 -28
  554. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/generate-early-payment-link.md +29 -29
  555. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-customer-subscription.md +27 -27
  556. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-or-create-plan.md +69 -69
  557. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-setup-intent-attempts.md +30 -30
  558. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-subscription.md +28 -28
  559. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/initiate-early-payment.md +31 -31
  560. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-customer-subscriptions.md +27 -27
  561. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-subscriptions.md +39 -39
  562. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/pause-subscription.md +28 -28
  563. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/reactivate-subscription.md +28 -28
  564. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/resume-subscription.md +28 -28
  565. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/switch-payment-method.md +70 -70
  566. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-payment-method.md +69 -69
  567. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-vendor-ids.md +56 -56
  568. package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/verify-vendor-ids.md +56 -56
  569. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-class.md +51 -51
  570. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-rate.md +117 -117
  571. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-product-override.md +27 -27
  572. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-shipping-tax-override.md +27 -27
  573. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-class.md +28 -28
  574. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-rate.md +27 -27
  575. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-id.md +27 -27
  576. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-rates.md +28 -28
  577. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-eu-vat-product-overrides.md +20 -20
  578. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-oss-country-rates.md +20 -20
  579. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-preconfigured-tax-rates.md +20 -20
  580. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-product-overrides.md +27 -27
  581. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-tax-settings.md +20 -20
  582. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-all-tax-rates.md +20 -20
  583. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-classes.md +20 -20
  584. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-records.md +37 -37
  585. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/mark-taxes-as-filed.md +58 -58
  586. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/reset-eu-vat-rates.md +21 -21
  587. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-configured-countries.md +57 -57
  588. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-country-tax-id.md +50 -50
  589. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-eu-vat-cross-border-settings.md +127 -127
  590. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-oss-country-rates.md +100 -100
  591. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-product-override.md +110 -110
  592. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-shipping-tax-override.md +52 -52
  593. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-tax-settings.md +166 -166
  594. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-country-status.md +54 -54
  595. package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-tax-rate.md +116 -116
  596. package/dist/skills/fluentcart-developer/references/restapi/order-bumps.md +433 -433
  597. package/dist/skills/fluentcart-developer/references/restapi/orders.md +1212 -1212
  598. package/dist/skills/fluentcart-developer/references/restapi/pdf-templates.md +212 -212
  599. package/dist/skills/fluentcart-developer/references/restapi/products.md +2485 -2485
  600. package/dist/skills/fluentcart-developer/references/restapi/public-shop.md +191 -191
  601. package/dist/skills/fluentcart-developer/references/restapi/reports.md +3773 -3773
  602. package/dist/skills/fluentcart-developer/references/restapi/roles.md +403 -403
  603. package/dist/skills/fluentcart-developer/references/restapi/saved-views.md +136 -136
  604. package/dist/skills/fluentcart-developer/references/restapi/settings.md +1423 -1423
  605. package/dist/skills/fluentcart-developer/references/restapi/shipping.md +905 -905
  606. package/dist/skills/fluentcart-developer/references/restapi/subscriptions.md +1169 -1169
  607. package/dist/skills/fluentcart-developer/references/restapi/tax.md +1551 -1551
  608. package/dist/skills/fluentcart-developer/references/restapi.md +127 -127
  609. package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
  610. package/dist/version.d.ts +1 -1
  611. package/dist/version.js +1 -1
  612. package/package.json +66 -65
@@ -1,1169 +1,1169 @@
1
- # Subscriptions API
2
-
3
- Manage recurring subscriptions including listing, cancellation, reactivation, payment method updates, and customer self-service operations.
4
-
5
- **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2`
6
-
7
- > All monetary values are in **cents** (e.g., `$10.00` = `1000`).
8
-
9
- ---
10
-
11
- ## Admin Endpoints
12
-
13
- Admin endpoints require an authenticated WordPress user with the appropriate FluentCart capability. Authorization is handled by the `OrderPolicy`.
14
-
15
- ---
16
-
17
- ### List Subscriptions
18
-
19
- GET `/fluent-cart/v2/subscriptions`
20
-
21
- Retrieve a paginated list of subscriptions with optional filtering, sorting, and search.
22
-
23
- - **Permission:** `subscriptions/view`
24
- - **Policy:** `OrderPolicy`
25
-
26
- #### Parameters
27
-
28
- | Parameter | Type | Location | Required | Description |
29
- | --- | --- | --- | --- | --- |
30
- | `page` | integer | query | No | Page number for pagination |
31
- | `per_page` | integer | query | No | Number of records per page (default: 10, max: 200) |
32
- | `search` | string | query | No | Search term. Searches status, subscription ID (`#123`), customer email (`[email protected]`), parent order ID, item name, vendor subscription/customer/plan IDs, payment method, billing interval, and bill count. Also supports operator syntax (e.g., `ID = 5`) |
33
- | `sort_by` | string | query | No | Column to sort by (default: `id`). Must be a fillable column on the Subscription model |
34
- | `sort_type` | string | query | No | Sort direction: `asc` or `desc` (default: `desc`) |
35
- | `active_view` | string | query | No | Tab filter. One of: `active`, `pending`, `intended`, `paused`, `trialing`, `canceled`, `failing`, `expiring`, `expired` |
36
- | `filter_type` | string | query | No | Filter mode: `simple` (default) or `advanced` |
37
- | `advanced_filters` | string (JSON) | query | No | JSON-encoded array of advanced filter groups (requires Pro). Supports filtering by subscription, transaction, product, and license properties |
38
- | `with` | array/string | query | No | Eager-load relations. Supports relation names and `{relation}Count` for counts |
39
- | `select` | array/string | query | No | Comma-separated list of columns to select |
40
- | `scopes` | array | query | No | Model scopes to apply |
41
- | `include_ids` | array/string | query | No | Comma-separated IDs that must always be included in results |
42
- | `limit` | integer | query | No | Limit number of records (used with non-paginated queries) |
43
- | `offset` | integer | query | No | Offset for records |
44
- | `user_tz` | string | query | No | User timezone for date filtering (e.g., `America/New_York`) |
45
-
46
- #### Search Behavior
47
-
48
- The `search` parameter supports several input formats:
49
-
50
- | Input Format | Behavior |
51
- | --- | --- |
52
- | `#123` | Searches by subscription ID |
53
- | `[email protected]` | Searches by customer email |
54
- | `canceled` or `cancelled` | Matches canceled status |
55
- | Any other string | Searches across `parent_order_id`, `item_name`, `vendor_subscription_id`, `vendor_customer_id`, `vendor_plan_id`, `current_payment_method`, `billing_interval`, and `bill_count` |
56
-
57
- #### Advanced Filter Options
58
-
59
- When using `filter_type=advanced`, the following filter categories are available:
60
-
61
- | Category | Filter | Type | Description |
62
- | --- | --- | --- | --- |
63
- | Subscription | `vendor_subscription_id` | text | Filter by vendor subscription ID |
64
- | Subscription | `status` | selections (multiple) | Filter by subscription status |
65
- | Subscription | `variation` | remote tree select | Filter by product variation / order items |
66
- | Subscription | `billing_interval` | selections (multiple) | Filter by billing interval: `yearly`, `half_yearly`, `quarterly`, `monthly`, `weekly`, `daily` |
67
- | Subscription | `current_payment_method` | selections (multiple) | Filter by payment method |
68
- | Subscription | `created_at` | dates | Filter by creation date range |
69
- | Subscription | `next_billing_date` | dates | Filter by next billing date range |
70
- | Subscription | `bill_count` | numeric | Filter by bill count |
71
- | Transaction | `transaction_id` | text (relation) | Filter by transaction vendor charge ID |
72
- | Transaction | `current_payment_method` | selections (multiple) | Filter by transaction payment method |
73
- | Product | `product` | remote tree select | Filter by product variation |
74
- | License | `license_key` | text (relation) | Filter by license key (Pro only) |
75
- | License | `license_status` | selections (multiple) | Filter by license status: `active`, `disabled`, `expired` (Pro only) |
76
-
77
- #### Response
78
-
79
- ```
80
- {
81
- "data": {
82
- "current_page": 1,
83
- "data": [
84
- {
85
- "id": 1,
86
- "uuid": "abc123-def456",
87
- "status": "active",
88
- "item_name": "Pro Plan",
89
- "parent_order_id": 10,
90
- "customer_id": 5,
91
- "product_id": 3,
92
- "variation_id": 7,
93
- "vendor_subscription_id": "sub_1234567890",
94
- "vendor_customer_id": "cus_abc123",
95
- "vendor_plan_id": "price_xyz789",
96
- "current_payment_method": "stripe",
97
- "billing_interval": "monthly",
98
- "recurring_amount": 2999,
99
- "bill_times": 0,
100
- "bill_count": 6,
101
- "next_billing_date": "2025-02-15 00:00:00",
102
- "created_at": "2025-01-15 10:30:00",
103
- "updated_at": "2025-01-15 10:35:00"
104
- }
105
- ],
106
- "per_page": 10,
107
- "total": 50,
108
- "last_page": 5
109
- }
110
- }
111
- ```
112
-
113
- #### Example
114
-
115
- ```
116
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/subscriptions?page=1&per_page=10&active_view=active" \
117
- -u "username:app_password"
118
- ```
119
-
120
- ---
121
-
122
- ### Get Subscription Details
123
-
124
- GET `/fluent-cart/v2/subscriptions/{subscriptionOrderId}`
125
-
126
- Retrieve the full details of a single subscription including customer addresses, labels, activities, and related orders.
127
-
128
- - **Permission:** `subscriptions/view`
129
- - **Policy:** `OrderPolicy`
130
-
131
- #### Parameters
132
-
133
- | Parameter | Type | Location | Required | Description |
134
- | --- | --- | --- | --- | --- |
135
- | `subscriptionOrderId` | integer | path | Yes | The subscription ID |
136
-
137
- #### Response
138
-
139
- The response includes the subscription with eager-loaded relations:
140
-
141
- - `labels` -- associated labels
142
- - `activities.user` -- activity log with user info
143
- - `customer.shipping_address` -- customer's primary shipping address
144
- - `customer.billing_address` -- customer's primary billing address
145
- - `order.billing_address` -- parent order's billing address
146
- - `order.shipping_address` -- parent order's shipping address
147
-
148
- Also includes:
149
-
150
- - `related_orders` -- the parent order and all renewal orders (with order items)
151
- - `selected_labels` -- array of label IDs applied to the subscription
152
-
153
- ```
154
- {
155
- "subscription": {
156
- "id": 1,
157
- "uuid": "abc123-def456",
158
- "status": "active",
159
- "item_name": "Pro Plan",
160
- "parent_order_id": 10,
161
- "customer_id": 5,
162
- "product_id": 3,
163
- "variation_id": 7,
164
- "vendor_subscription_id": "sub_1234567890",
165
- "vendor_customer_id": "cus_abc123",
166
- "current_payment_method": "stripe",
167
- "billing_interval": "monthly",
168
- "recurring_amount": 2999,
169
- "bill_times": 0,
170
- "bill_count": 6,
171
- "next_billing_date": "2025-02-15 00:00:00",
172
- "billing_address": { ... },
173
- "shipping_address": { ... },
174
- "labels": [ ... ],
175
- "activities": [ ... ],
176
- "customer": {
177
- "id": 5,
178
- "shipping_address": { ... },
179
- "billing_address": { ... }
180
- },
181
- "related_orders": [
182
- {
183
- "id": 10,
184
- "order_items": [
185
- {
186
- "id": 1,
187
- "order_id": 10,
188
- "post_title": "Pro Plan",
189
- "title": "Pro Plan",
190
- "quantity": 1,
191
- "payment_type": "subscription",
192
- "line_meta": { ... }
193
- }
194
- ]
195
- }
196
- ]
197
- },
198
- "selected_labels": [1, 3, 5]
199
- }
200
- ```
201
-
202
- #### Example
203
-
204
- ```
205
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/subscriptions/1" \
206
- -u "username:app_password"
207
- ```
208
-
209
- #### Error Response (404)
210
-
211
- ```
212
- {
213
- "message": "Subscription not found",
214
- "action_text": "Back to Subscription list",
215
- "action_url": "/subscriptions"
216
- }
217
- ```
218
-
219
- ---
220
-
221
- ### Cancel Subscription
222
-
223
- PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/cancel`
224
-
225
- Cancel a subscription both locally and with the remote payment gateway.
226
-
227
- - **Permission:** `subscriptions/manage`
228
- - **Policy:** `OrderPolicy`
229
-
230
- #### Parameters
231
-
232
- | Parameter | Type | Location | Required | Description |
233
- | --- | --- | --- | --- | --- |
234
- | `order` | integer | path | Yes | The parent order ID |
235
- | `subscription` | integer | path | Yes | The subscription ID |
236
- | `cancel_reason` | string | body | Yes | Reason for cancellation. Sanitized with `sanitize_text_field` |
237
-
238
- #### Response
239
-
240
- ```
241
- {
242
- "message": "Subscription has been cancelled successfully!",
243
- "subscription": {
244
- "id": 1,
245
- "status": "canceled",
246
- ...
247
- }
248
- }
249
- ```
250
-
251
- #### Error Responses
252
-
253
- Missing cancel reason:
254
-
255
- ```
256
- {
257
- "message": "Please select cancel reason!"
258
- }
259
- ```
260
-
261
- Remote cancellation failure (subscription still cancelled locally):
262
-
263
- ```
264
- {
265
- "message": "Subscription cancelled locally. Vendor Response: <vendor error message>"
266
- }
267
- ```
268
-
269
- #### Example
270
-
271
- ```
272
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/cancel" \
273
- -u "username:app_password" \
274
- -H "Content-Type: application/json" \
275
- -d '{"cancel_reason": "Customer requested cancellation"}'
276
- ```
277
-
278
- ---
279
-
280
- ### Fetch Subscription from Remote
281
-
282
- PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/fetch`
283
-
284
- Re-sync a subscription's data from the remote payment gateway (e.g., Stripe, PayPal). Useful for resolving data inconsistencies between local records and the payment provider.
285
-
286
- - **Permission:** `subscriptions/view`
287
- - **Policy:** `OrderPolicy`
288
-
289
- #### Parameters
290
-
291
- | Parameter | Type | Location | Required | Description |
292
- | --- | --- | --- | --- | --- |
293
- | `order` | integer | path | Yes | The parent order ID |
294
- | `subscription` | integer | path | Yes | The subscription ID |
295
-
296
- #### Response
297
-
298
- ```
299
- {
300
- "message": "Subscription fetched successfully from remote payment gateway!",
301
- "subscription": {
302
- "id": 1,
303
- "status": "active",
304
- "vendor_subscription_id": "sub_1234567890",
305
- ...
306
- }
307
- }
308
- ```
309
-
310
- #### Error Response
311
-
312
- ```
313
- {
314
- "message": "<gateway error message>"
315
- }
316
- ```
317
-
318
- #### Example
319
-
320
- ```
321
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/fetch" \
322
- -u "username:app_password"
323
- ```
324
-
325
- ---
326
-
327
- ### Update Vendor IDs Opt-in
328
-
329
- PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/vendor-ids`
330
-
331
- Correct the gateway identifiers on a gateway-billed (`automatic`) subscription. Writes only `vendor_subscription_id` / `vendor_customer_id` — no renewal is voided, no invoice re-synced, no status event dispatched, and the gateway is not called.
332
-
333
- Disabled unless the site opts in:
334
-
335
- ```
336
- add_filter('fluent_cart/subscription/vendor_id_editing_enabled', '__return_true');
337
- ```
338
-
339
- - **Permission:** `subscriptions/manage`
340
- - **Policy:** `OrderPolicy`
341
- - **Guide:** [Editing Vendor IDs](/modules/subscription-vendor-ids.md)
342
-
343
- #### Parameters
344
-
345
- | Parameter | Type | Location | Required | Description |
346
- | --- | --- | --- | --- | --- |
347
- | `order` | integer | path | Yes | The parent order ID |
348
- | `subscription` | integer | path | Yes | The subscription ID |
349
- | `vendor_subscription_id` | string | body | No | Max 45 chars, `^[a-zA-Z0-9_.-]+$`. Omit to leave untouched; send `""` to clear |
350
- | `vendor_customer_id` | string | body | No | Same constraints |
351
-
352
- At least one of the two body fields must be present. The new `vendor_subscription_id` is claimed atomically — no other subscription on the same payment method may already hold it.
353
-
354
- #### Response
355
-
356
- ```
357
- {
358
- "message": "Vendor IDs have been updated successfully!",
359
- "subscription": {
360
- "id": 1,
361
- "collection_method": "automatic",
362
- "current_payment_method": "stripe",
363
- "vendor_subscription_id": "sub_1P9xyzABCdef",
364
- "vendor_customer_id": "cus_NffrFeUfNV2Hib"
365
- }
366
- }
367
- ```
368
-
369
- #### Error Responses
370
-
371
- ```
372
- { "message": "Vendor IDs can only be edited on an active gateway-billed subscription." }
373
- { "message": "Another subscription on this payment method is already using this Vendor Subscription ID." }
374
- { "message": "No changes detected." }
375
- ```
376
-
377
- #### Example
378
-
379
- ```
380
- curl -X PUT "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/vendor-ids" \
381
- -u "username:app_password" \
382
- -H "Content-Type: application/json" \
383
- -d '{"vendor_subscription_id": "sub_1P9xyzABCdef"}'
384
- ```
385
-
386
- ---
387
-
388
- ### Verify Vendor IDs Opt-in
389
-
390
- POST `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/verify-vendor-ids`
391
-
392
- Read-only lookup of a **candidate** id at the payment gateway, used before saving a correction. Writes nothing anywhere. Requires the same opt-in filter, plus a gateway declaring the `verify_vendor_ids` capability — Stripe and PayPal; every other gateway answers "This payment method does not support subscription lookup."
393
-
394
- - **Permission:** `subscriptions/manage`
395
- - **Policy:** `OrderPolicy`
396
-
397
- #### Parameters
398
-
399
- | Parameter | Type | Location | Required | Description |
400
- | --- | --- | --- | --- | --- |
401
- | `order` | integer | path | Yes | The parent order ID |
402
- | `subscription` | integer | path | Yes | The subscription ID |
403
- | `vendor_subscription_id` | string | body | Yes | The candidate subscription ID to look up |
404
- | `vendor_customer_id` | string | body | No | Sent because some gateways nest the subscription under its customer |
405
-
406
- #### Response
407
-
408
- ```
409
- {
410
- "message": "Subscription found at the payment gateway.",
411
- "verification": {
412
- "id": "sub_1P9xyzABCdef",
413
- "status": "active",
414
- "customer_id": "cus_NffrFeUfNV2Hib",
415
- "amount": "29.00",
416
- "currency": "USD",
417
- "next_billing_date": "2026-09-01 00:00:00"
418
- }
419
- }
420
- ```
421
-
422
- A hit proves the id exists in the merchant account whose credentials this store holds — not that it belongs to this store, since one merchant account can back several stores. Verification is advisory; the duplicate check on save is the hard guard.
423
-
424
- #### Example
425
-
426
- ```
427
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/verify-vendor-ids" \
428
- -u "username:app_password" \
429
- -H "Content-Type: application/json" \
430
- -d '{"vendor_subscription_id": "sub_1P9xyzABCdef"}'
431
- ```
432
-
433
- ---
434
-
435
- ### Generate Early Payment Link
436
-
437
- POST `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/early-payment-link`
438
-
439
- Generate a URL that allows early payment of remaining installments on an installment-based subscription.
440
-
441
- - **Permission:** `subscriptions/manage`
442
- - **Policy:** `OrderPolicy`
443
-
444
- #### Parameters
445
-
446
- | Parameter | Type | Location | Required | Description |
447
- | --- | --- | --- | --- | --- |
448
- | `order` | integer | path | Yes | The parent order ID |
449
- | `subscription` | integer | path | Yes | The subscription ID |
450
-
451
- #### Conditions
452
-
453
- This endpoint requires all of the following conditions to be met:
454
-
455
- - Early payment feature must be enabled on the site
456
- - The subscription must belong to the specified order (`parent_order_id` must match `order.id`)
457
- - The subscription must have a finite number of installments (`bill_times > 0`)
458
- - The subscription status must be `active` or `trialing`
459
- - There must be remaining installments (`bill_times - bill_count > 0`)
460
-
461
- #### Response
462
-
463
- ```
464
- {
465
- "message": "Early payment link generated.",
466
- "payment_url": "https://your-site.com/?fluent-cart=early-installment-payment&subscription_hash=abc123-def456"
467
- }
468
- ```
469
-
470
- #### Error Responses
471
-
472
- Feature not enabled:
473
-
474
- ```
475
- {
476
- "message": "Early payment is not enabled for this site."
477
- }
478
- ```
479
-
480
- Invalid subscription for order:
481
-
482
- ```
483
- {
484
- "message": "Invalid subscription for the specified order."
485
- }
486
- ```
487
-
488
- Not an installment subscription:
489
-
490
- ```
491
- {
492
- "message": "Early payment is only available for installment subscriptions."
493
- }
494
- ```
495
-
496
- Subscription not active:
497
-
498
- ```
499
- {
500
- "message": "Subscription must be active to make early payments."
501
- }
502
- ```
503
-
504
- All installments already paid:
505
-
506
- ```
507
- {
508
- "message": "All installments have already been paid."
509
- }
510
- ```
511
-
512
- #### Example
513
-
514
- ```
515
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/early-payment-link" \
516
- -u "username:app_password"
517
- ```
518
-
519
- ---
520
-
521
- ### Reactivate Subscription
522
-
523
- PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/reactivate`
524
-
525
- Reactivate a previously canceled or paused subscription.
526
-
527
- - **Permission:** `subscriptions/manage`
528
- - **Policy:** `OrderPolicy`
529
-
530
- > **Not Yet Available.** This endpoint is registered but currently returns a "Not available yet" error. It is reserved for future implementation.
531
-
532
- #### Parameters
533
-
534
- | Parameter | Type | Location | Required | Description |
535
- | --- | --- | --- | --- | --- |
536
- | `order` | integer | path | Yes | The parent order ID |
537
- | `subscription` | integer | path | Yes | The subscription ID |
538
-
539
- #### Response
540
-
541
- ```
542
- {
543
- "message": "Not available yet"
544
- }
545
- ```
546
-
547
- ---
548
-
549
- ### Pause Subscription
550
-
551
- PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/pause`
552
-
553
- Pause an active subscription.
554
-
555
- - **Permission:** `subscriptions/manage`
556
- - **Policy:** `OrderPolicy`
557
-
558
- > **Not Yet Available.** This endpoint is registered but currently returns a "Not available yet" error. It is reserved for future implementation.
559
-
560
- #### Parameters
561
-
562
- | Parameter | Type | Location | Required | Description |
563
- | --- | --- | --- | --- | --- |
564
- | `order` | integer | path | Yes | The parent order ID |
565
- | `subscription` | integer | path | Yes | The subscription ID |
566
-
567
- #### Response
568
-
569
- ```
570
- {
571
- "message": "Not available yet"
572
- }
573
- ```
574
-
575
- ---
576
-
577
- ### Resume Subscription
578
-
579
- PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/resume`
580
-
581
- Resume a paused subscription.
582
-
583
- - **Permission:** `subscriptions/manage`
584
- - **Policy:** `OrderPolicy`
585
-
586
- > **Not Yet Available.** This endpoint is registered but currently returns a "Not available yet" error. It is reserved for future implementation.
587
-
588
- #### Parameters
589
-
590
- | Parameter | Type | Location | Required | Description |
591
- | --- | --- | --- | --- | --- |
592
- | `order` | integer | path | Yes | The parent order ID |
593
- | `subscription` | integer | path | Yes | The subscription ID |
594
-
595
- #### Response
596
-
597
- ```
598
- {
599
- "message": "Not available yet"
600
- }
601
- ```
602
-
603
- ---
604
-
605
- ## Customer Portal Endpoints
606
-
607
- Customer portal endpoints are authenticated via the logged-in WordPress user. The system resolves the customer from the current user session. Authorization is handled by the `CustomerFrontendPolicy`.
608
-
609
- All customer portal subscription endpoints use the subscription's **UUID** (not the numeric ID) for identification.
610
-
611
- ---
612
-
613
- ### List Customer Subscriptions
614
-
615
- GET `/fluent-cart/v2/customer-profile/subscriptions`
616
-
617
- Retrieve a paginated list of subscriptions belonging to the currently logged-in customer. Subscriptions with `pending` or `intended` status are excluded.
618
-
619
- - **Policy:** `CustomerFrontendPolicy`
620
- - **Auth:** Logged-in WordPress user
621
-
622
- #### Parameters
623
-
624
- | Parameter | Type | Location | Required | Description |
625
- | --- | --- | --- | --- | --- |
626
- | `page` | integer | query | No | Page number for pagination (default: 1) |
627
- | `per_page` | integer | query | No | Number of records per page (default: 10) |
628
-
629
- #### Response
630
-
631
- If the user is not logged in, the endpoint returns an empty result set rather than an error:
632
-
633
- ```
634
- {
635
- "message": "Success",
636
- "subscriptions": {
637
- "data": [],
638
- "total": 0,
639
- "per_page": 10,
640
- "current_page": 1,
641
- "last_page": 1
642
- }
643
- }
644
- ```
645
-
646
- Successful response with data:
647
-
648
- ```
649
- {
650
- "message": "Success",
651
- "subscriptions": {
652
- "data": [
653
- {
654
- "uuid": "abc123-def456",
655
- "status": "active",
656
- "item_name": "Pro Plan",
657
- "billing_interval": "monthly",
658
- "recurring_amount": 2999,
659
- "next_billing_date": "2025-02-15 00:00:00",
660
- "bill_times": 0,
661
- "bill_count": 6,
662
- ...
663
- }
664
- ],
665
- "total": 5,
666
- "per_page": 10,
667
- "current_page": 1,
668
- "last_page": 1
669
- }
670
- }
671
- ```
672
-
673
- #### Example
674
-
675
- ```
676
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions?page=1&per_page=10" \
677
- -H "X-WP-Nonce: <nonce>"
678
- ```
679
-
680
- ---
681
-
682
- ### Get Customer Subscription Details
683
-
684
- GET `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}`
685
-
686
- Retrieve full details of a specific subscription for the currently logged-in customer, including transactions, upgrade eligibility, and payment method capabilities.
687
-
688
- - **Policy:** `CustomerFrontendPolicy`
689
- - **Auth:** Logged-in WordPress user
690
-
691
- #### Parameters
692
-
693
- | Parameter | Type | Location | Required | Description |
694
- | --- | --- | --- | --- | --- |
695
- | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
696
-
697
- #### Response
698
-
699
- ```
700
- {
701
- "message": "Success",
702
- "subscription": {
703
- "uuid": "abc123-def456",
704
- "status": "active",
705
- "overridden_status": null,
706
- "vendor_subscription_id": "sub_1234567890",
707
- "next_billing_date": "2025-02-15 00:00:00",
708
- "billing_info": {
709
- "interval": "monthly",
710
- "interval_count": 1,
711
- "amount": 2999,
712
- "currency": "USD"
713
- },
714
- "current_payment_method": "stripe",
715
- "payment_method": "stripe",
716
- "payment_info": { ... },
717
- "bill_times": 0,
718
- "bill_count": 6,
719
- "variation_id": 7,
720
- "product_id": 3,
721
- "config": { ... },
722
- "reactivate_url": "https://your-site.com/?fluent-cart=reactivate&hash=abc123",
723
- "title": "Pro Plan",
724
- "subtitle": "Monthly",
725
- "can_upgrade": true,
726
- "can_switch_payment_method": true,
727
- "switchable_payment_methods": ["stripe", "paypal"],
728
- "can_update_payment_method": true,
729
- "order": {
730
- "uuid": "order-uuid-here"
731
- },
732
- "billing_addresses": [ ... ],
733
- "recurring_amount": 2999,
734
- "can_early_pay": false,
735
- "remaining_installments": 0,
736
- "transactions": [
737
- {
738
- "id": 1,
739
- "order_id": 10,
740
- "vendor_charge_id": "ch_abc123",
741
- "amount": 2999,
742
- "status": "completed",
743
- "created_at": "2025-01-15 10:30:00",
744
- "order": { ... }
745
- }
746
- ]
747
- }
748
- }
749
- ```
750
-
751
- #### Response Fields
752
-
753
- | Field | Type | Description |
754
- | --- | --- | --- |
755
- | `uuid` | string | Unique subscription identifier |
756
- | `status` | string | Current status: `active`, `trialing`, `canceled`, `paused`, `failing`, `expiring`, `expired`, `completed`, `past_due` |
757
- | `overridden_status` | string/null | Overridden status if manually set |
758
- | `vendor_subscription_id` | string | Remote gateway subscription ID |
759
- | `next_billing_date` | string | Next billing date in GMT |
760
- | `billing_info` | object | Billing interval and amount details |
761
- | `current_payment_method` | string | Current payment method slug |
762
- | `payment_method` | string | Original payment method slug |
763
- | `payment_info` | object | Payment method details (card brand, last4, etc.) |
764
- | `bill_times` | integer | Total number of billing cycles (0 = unlimited) |
765
- | `bill_count` | integer | Number of completed billing cycles |
766
- | `variation_id` | integer | Product variation ID |
767
- | `product_id` | integer | Product ID |
768
- | `config` | object | Subscription configuration |
769
- | `reactivate_url` | string | URL for reactivating a canceled subscription |
770
- | `title` | string | Product title |
771
- | `subtitle` | string | Variation title (if applicable) |
772
- | `can_upgrade` | boolean | Whether the subscription is eligible for plan upgrade |
773
- | `can_switch_payment_method` | boolean | Whether the payment method can be switched to a different gateway |
774
- | `switchable_payment_methods` | array | List of available payment method slugs to switch to |
775
- | `can_update_payment_method` | boolean | Whether the payment method can be updated (e.g., new card) within the same gateway |
776
- | `order.uuid` | string | Parent order UUID |
777
- | `billing_addresses` | array | Billing addresses associated with the subscription |
778
- | `recurring_amount` | integer | Recurring payment amount in cents |
779
- | `can_early_pay` | boolean | Whether early installment payment is available |
780
- | `remaining_installments` | integer | Number of remaining installments (0 if unlimited) |
781
- | `transactions` | array | All transactions related to this subscription and its renewal orders |
782
-
783
- #### Example
784
-
785
- ```
786
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456" \
787
- -H "X-WP-Nonce: <nonce>"
788
- ```
789
-
790
- ---
791
-
792
- ### Get Setup Intent Remaining Attempts
793
-
794
- GET `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/setup-intent-attempts`
795
-
796
- Check how many Stripe SetupIntent attempts remain for the customer. This is used to enforce rate limiting on payment method update attempts.
797
-
798
- - **Policy:** `CustomerFrontendPolicy`
799
- - **Auth:** Logged-in WordPress user
800
- - **Stripe Only:** Only works when `current_payment_method` is `stripe`
801
-
802
- #### Parameters
803
-
804
- | Parameter | Type | Location | Required | Description |
805
- | --- | --- | --- | --- | --- |
806
- | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
807
-
808
- #### Conditions
809
-
810
- - Customer must own the subscription
811
- - Subscription's `current_payment_method` must be `stripe`
812
- - Subscription must have a `vendor_customer_id`
813
-
814
- #### Response
815
-
816
- ```
817
- {
818
- "remaining": 5
819
- }
820
- ```
821
-
822
- #### Error Responses
823
-
824
- Payment method not supported (non-Stripe subscription):
825
-
826
- ```
827
- {
828
- "message": "Payment method not supported"
829
- }
830
- ```
831
-
832
- #### Example
833
-
834
- ```
835
- curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/setup-intent-attempts" \
836
- -H "X-WP-Nonce: <nonce>"
837
- ```
838
-
839
- ---
840
-
841
- ### Update Payment Method
842
-
843
- POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/update-payment-method`
844
-
845
- Update the payment method (e.g., replace the card on file) for an existing subscription within the **same** payment gateway.
846
-
847
- - **Policy:** `CustomerFrontendPolicy`
848
- - **Auth:** Logged-in WordPress user
849
-
850
- #### Parameters
851
-
852
- | Parameter | Type | Location | Required | Description |
853
- | --- | --- | --- | --- | --- |
854
- | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
855
- | `data` | object | body | Yes | Payment method data object |
856
- | `data.method` | string | body | Yes | Payment gateway slug (e.g., `stripe`, `paypal`) |
857
-
858
- Additional fields inside `data` depend on the specific payment gateway implementation (e.g., Stripe token, PayPal billing agreement ID).
859
-
860
- #### Response
861
-
862
- The response depends on the gateway's `cardUpdate` implementation. On failure:
863
-
864
- ```
865
- {
866
- "message": "Could not update payment method"
867
- }
868
- ```
869
-
870
- #### Example
871
-
872
- ```
873
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/update-payment-method" \
874
- -H "X-WP-Nonce: <nonce>" \
875
- -H "Content-Type: application/json" \
876
- -d '{
877
- "data": {
878
- "method": "stripe",
879
- "payment_method_id": "pm_1234567890"
880
- }
881
- }'
882
- ```
883
-
884
- ---
885
-
886
- ### Get or Create Plan
887
-
888
- POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/get-or-create-plan`
889
-
890
- Get or create a subscription plan on the remote payment gateway. This is typically used during the payment method switch flow to ensure the target gateway has a matching plan configured.
891
-
892
- - **Policy:** `CustomerFrontendPolicy`
893
- - **Auth:** Logged-in WordPress user
894
-
895
- #### Parameters
896
-
897
- | Parameter | Type | Location | Required | Description |
898
- | --- | --- | --- | --- | --- |
899
- | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
900
- | `data` | object | body | Yes | Plan data object |
901
- | `data.method` | string | body | Yes | Target payment gateway slug (e.g., `stripe`, `paypal`) |
902
- | `data.reason` | string | body | No | Reason for creating the plan |
903
-
904
- #### Response
905
-
906
- The response depends on the gateway's `getOrCreateNewPlan` implementation. On failure:
907
-
908
- ```
909
- {
910
- "message": "Could not get or create plan"
911
- }
912
- ```
913
-
914
- #### Example
915
-
916
- ```
917
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/get-or-create-plan" \
918
- -H "X-WP-Nonce: <nonce>" \
919
- -H "Content-Type: application/json" \
920
- -d '{
921
- "data": {
922
- "method": "stripe",
923
- "reason": "switching_payment_method"
924
- }
925
- }'
926
- ```
927
-
928
- ---
929
-
930
- ### Switch Payment Method
931
-
932
- POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/switch-payment-method`
933
-
934
- Switch a subscription's payment method from one gateway to another (e.g., from Stripe to PayPal). This initiates the switch process, which may require a confirmation step depending on the target gateway.
935
-
936
- - **Policy:** `CustomerFrontendPolicy`
937
- - **Auth:** Logged-in WordPress user
938
-
939
- #### Parameters
940
-
941
- | Parameter | Type | Location | Required | Description |
942
- | --- | --- | --- | --- | --- |
943
- | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
944
- | `data` | object | body | Yes | Payment method switch data |
945
- | `data.newPaymentMethod` | string | body | Yes | Target payment gateway slug (e.g., `paypal`) |
946
- | `data.currentPaymentMethod` | string | body | Yes | Current payment gateway slug (e.g., `stripe`) |
947
-
948
- Additional fields inside `data` depend on the specific payment gateway implementation.
949
-
950
- #### Response
951
-
952
- The response depends on the gateway's `switchPaymentMethod` implementation. May return a redirect URL or client secret for the new gateway. On failure:
953
-
954
- ```
955
- {
956
- "message": "Could not switch payment method"
957
- }
958
- ```
959
-
960
- #### Example
961
-
962
- ```
963
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/switch-payment-method" \
964
- -H "X-WP-Nonce: <nonce>" \
965
- -H "Content-Type: application/json" \
966
- -d '{
967
- "data": {
968
- "newPaymentMethod": "paypal",
969
- "currentPaymentMethod": "stripe"
970
- }
971
- }'
972
- ```
973
-
974
- ---
975
-
976
- ### Confirm Subscription Switch
977
-
978
- POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/confirm-subscription-switch`
979
-
980
- Confirm a two-step payment method switch. After the initial `switch-payment-method` call creates a new subscription on the target gateway, this endpoint finalizes the switch by confirming the new subscription and deactivating the old one.
981
-
982
- - **Policy:** `CustomerFrontendPolicy`
983
- - **Auth:** Logged-in WordPress user
984
-
985
- #### Parameters
986
-
987
- | Parameter | Type | Location | Required | Description |
988
- | --- | --- | --- | --- | --- |
989
- | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
990
- | `data` | object | body | Yes | Confirmation data |
991
- | `data.newVendorSubscriptionId` | string | body | Yes | The new subscription ID from the target payment gateway |
992
- | `data.method` | string | body | Yes | The target payment gateway slug (e.g., `paypal`) |
993
-
994
- Additional fields inside `data` depend on the specific payment gateway implementation.
995
-
996
- #### Response
997
-
998
- The response depends on the gateway's `confirmSubscriptionSwitch` implementation. On failure:
999
-
1000
- ```
1001
- {
1002
- "message": "Could not confirm subscription switch"
1003
- }
1004
- ```
1005
-
1006
- #### Example
1007
-
1008
- ```
1009
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/confirm-subscription-switch" \
1010
- -H "X-WP-Nonce: <nonce>" \
1011
- -H "Content-Type: application/json" \
1012
- -d '{
1013
- "data": {
1014
- "newVendorSubscriptionId": "I-ABC123DEF456",
1015
- "method": "paypal"
1016
- }
1017
- }'
1018
- ```
1019
-
1020
- ---
1021
-
1022
- ### Cancel Auto-Renew
1023
-
1024
- POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/cancel-auto-renew`
1025
-
1026
- Cancel auto-renewal for a subscription from the customer portal. The subscription is cancelled both locally and with the remote payment gateway. The cancellation reason is automatically set to `cancelled_by_customer`.
1027
-
1028
- - **Policy:** `CustomerFrontendPolicy`
1029
- - **Auth:** Logged-in WordPress user
1030
-
1031
- #### Parameters
1032
-
1033
- | Parameter | Type | Location | Required | Description |
1034
- | --- | --- | --- | --- | --- |
1035
- | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
1036
-
1037
- No request body is required. The cancellation reason and note are set automatically.
1038
-
1039
- #### Response
1040
-
1041
- ```
1042
- {
1043
- "message": "Your subscription has been successfully cancelled"
1044
- }
1045
- ```
1046
-
1047
- #### Error Responses
1048
-
1049
- Customer not found:
1050
-
1051
- ```
1052
- {
1053
- "message": "Customer not found"
1054
- }
1055
- ```
1056
-
1057
- Subscription not found (or does not belong to the customer):
1058
-
1059
- ```
1060
- {
1061
- "message": "Subscription not found"
1062
- }
1063
- ```
1064
-
1065
- #### Example
1066
-
1067
- ```
1068
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/cancel-auto-renew" \
1069
- -H "X-WP-Nonce: <nonce>"
1070
- ```
1071
-
1072
- ---
1073
-
1074
- ### Initiate Early Payment
1075
-
1076
- POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/initiate-early-payment`
1077
-
1078
- Generate a checkout URL for paying remaining installments early on an installment-based subscription.
1079
-
1080
- - **Policy:** `CustomerFrontendPolicy`
1081
- - **Auth:** Logged-in WordPress user
1082
-
1083
- #### Parameters
1084
-
1085
- | Parameter | Type | Location | Required | Description |
1086
- | --- | --- | --- | --- | --- |
1087
- | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
1088
-
1089
- No request body is required.
1090
-
1091
- #### Conditions
1092
-
1093
- The early payment feature must be enabled, and the subscription must meet the following criteria:
1094
-
1095
- - Pro license must be active
1096
- - `bill_times > 0` (finite installments)
1097
- - `bill_count < bill_times` (remaining installments exist)
1098
- - Status must be `active` or `trialing`
1099
-
1100
- #### Response
1101
-
1102
- ```
1103
- {
1104
- "message": "Early payment URL generated.",
1105
- "checkout_url": "https://your-site.com/?fluent-cart=early-installment-payment&subscription_hash=abc123-def456"
1106
- }
1107
- ```
1108
-
1109
- #### Error Responses
1110
-
1111
- Early payment not available:
1112
-
1113
- ```
1114
- {
1115
- "message": "Early payment is not available for this subscription."
1116
- }
1117
- ```
1118
-
1119
- Customer not found:
1120
-
1121
- ```
1122
- {
1123
- "message": "Customer not found"
1124
- }
1125
- ```
1126
-
1127
- Subscription not found:
1128
-
1129
- ```
1130
- {
1131
- "message": "Subscription not found"
1132
- }
1133
- ```
1134
-
1135
- #### Example
1136
-
1137
- ```
1138
- curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/initiate-early-payment" \
1139
- -H "X-WP-Nonce: <nonce>"
1140
- ```
1141
-
1142
- ---
1143
-
1144
- ## Subscription Statuses
1145
-
1146
- | Status | Constant | Description |
1147
- | --- | --- | --- |
1148
- | `pending` | `SUBSCRIPTION_PENDING` | Subscription created but not yet activated |
1149
- | `intended` | `SUBSCRIPTION_INTENDED` | Payment intent created, awaiting completion |
1150
- | `trialing` | `SUBSCRIPTION_TRIALING` | In trial period |
1151
- | `active` | `SUBSCRIPTION_ACTIVE` | Active and billing normally |
1152
- | `paused` | `SUBSCRIPTION_PAUSED` | Temporarily paused |
1153
- | `failing` | `SUBSCRIPTION_FAILING` | Payment attempts are failing |
1154
- | `expiring` | `SUBSCRIPTION_EXPIRING` | Approaching expiration |
1155
- | `expired` | `SUBSCRIPTION_EXPIRED` | Subscription has expired |
1156
- | `canceled` | `SUBSCRIPTION_CANCELED` | Cancelled by admin or customer |
1157
- | `past_due` | `SUBSCRIPTION_PAST_DUE` | Payment is overdue |
1158
- | `completed` | `SUBSCRIPTION_COMPLETED` | All installments paid |
1159
- | `authenticated` | `SUBSCRIPTION_AUTHENTICATED` | Authentication completed (SCA flow) |
1160
- | `created` | `SUBSCRIPTION_CREATED` | Created on the remote gateway |
1161
-
1162
- ## Hooks and Filters
1163
-
1164
- | Hook | Type | Description |
1165
- | --- | --- | --- |
1166
- | `fluent_cart/subscription/view` | filter | Modify subscription data before returning in admin detail view |
1167
- | `fluent_cart/customer_portal/subscription_data` | filter | Modify subscription data before returning in customer portal detail view |
1168
- | `fluent_cart/subscriptions_list_filter_query` | filter | Modify the subscription list query before execution |
1169
- | `fluent_cart/subscriptions_filter/{provider}/{property}` | action | Custom advanced filter handler for subscription list |
1
+ # Subscriptions API
2
+
3
+ Manage recurring subscriptions including listing, cancellation, reactivation, payment method updates, and customer self-service operations.
4
+
5
+ **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2`
6
+
7
+ > All monetary values are in **cents** (e.g., `$10.00` = `1000`).
8
+
9
+ ---
10
+
11
+ ## Admin Endpoints
12
+
13
+ Admin endpoints require an authenticated WordPress user with the appropriate FluentCart capability. Authorization is handled by the `OrderPolicy`.
14
+
15
+ ---
16
+
17
+ ### List Subscriptions
18
+
19
+ GET `/fluent-cart/v2/subscriptions`
20
+
21
+ Retrieve a paginated list of subscriptions with optional filtering, sorting, and search.
22
+
23
+ - **Permission:** `subscriptions/view`
24
+ - **Policy:** `OrderPolicy`
25
+
26
+ #### Parameters
27
+
28
+ | Parameter | Type | Location | Required | Description |
29
+ | --- | --- | --- | --- | --- |
30
+ | `page` | integer | query | No | Page number for pagination |
31
+ | `per_page` | integer | query | No | Number of records per page (default: 10, max: 200) |
32
+ | `search` | string | query | No | Search term. Searches status, subscription ID (`#123`), customer email (`[email&#160;protected]`), parent order ID, item name, vendor subscription/customer/plan IDs, payment method, billing interval, and bill count. Also supports operator syntax (e.g., `ID = 5`) |
33
+ | `sort_by` | string | query | No | Column to sort by (default: `id`). Must be a fillable column on the Subscription model |
34
+ | `sort_type` | string | query | No | Sort direction: `asc` or `desc` (default: `desc`) |
35
+ | `active_view` | string | query | No | Tab filter. One of: `active`, `pending`, `intended`, `paused`, `trialing`, `canceled`, `failing`, `expiring`, `expired` |
36
+ | `filter_type` | string | query | No | Filter mode: `simple` (default) or `advanced` |
37
+ | `advanced_filters` | string (JSON) | query | No | JSON-encoded array of advanced filter groups (requires Pro). Supports filtering by subscription, transaction, product, and license properties |
38
+ | `with` | array/string | query | No | Eager-load relations. Supports relation names and `{relation}Count` for counts |
39
+ | `select` | array/string | query | No | Comma-separated list of columns to select |
40
+ | `scopes` | array | query | No | Model scopes to apply |
41
+ | `include_ids` | array/string | query | No | Comma-separated IDs that must always be included in results |
42
+ | `limit` | integer | query | No | Limit number of records (used with non-paginated queries) |
43
+ | `offset` | integer | query | No | Offset for records |
44
+ | `user_tz` | string | query | No | User timezone for date filtering (e.g., `America/New_York`) |
45
+
46
+ #### Search Behavior
47
+
48
+ The `search` parameter supports several input formats:
49
+
50
+ | Input Format | Behavior |
51
+ | --- | --- |
52
+ | `#123` | Searches by subscription ID |
53
+ | `[email&#160;protected]` | Searches by customer email |
54
+ | `canceled` or `cancelled` | Matches canceled status |
55
+ | Any other string | Searches across `parent_order_id`, `item_name`, `vendor_subscription_id`, `vendor_customer_id`, `vendor_plan_id`, `current_payment_method`, `billing_interval`, and `bill_count` |
56
+
57
+ #### Advanced Filter Options
58
+
59
+ When using `filter_type=advanced`, the following filter categories are available:
60
+
61
+ | Category | Filter | Type | Description |
62
+ | --- | --- | --- | --- |
63
+ | Subscription | `vendor_subscription_id` | text | Filter by vendor subscription ID |
64
+ | Subscription | `status` | selections (multiple) | Filter by subscription status |
65
+ | Subscription | `variation` | remote tree select | Filter by product variation / order items |
66
+ | Subscription | `billing_interval` | selections (multiple) | Filter by billing interval: `yearly`, `half_yearly`, `quarterly`, `monthly`, `weekly`, `daily` |
67
+ | Subscription | `current_payment_method` | selections (multiple) | Filter by payment method |
68
+ | Subscription | `created_at` | dates | Filter by creation date range |
69
+ | Subscription | `next_billing_date` | dates | Filter by next billing date range |
70
+ | Subscription | `bill_count` | numeric | Filter by bill count |
71
+ | Transaction | `transaction_id` | text (relation) | Filter by transaction vendor charge ID |
72
+ | Transaction | `current_payment_method` | selections (multiple) | Filter by transaction payment method |
73
+ | Product | `product` | remote tree select | Filter by product variation |
74
+ | License | `license_key` | text (relation) | Filter by license key (Pro only) |
75
+ | License | `license_status` | selections (multiple) | Filter by license status: `active`, `disabled`, `expired` (Pro only) |
76
+
77
+ #### Response
78
+
79
+ ```
80
+ {
81
+ "data": {
82
+ "current_page": 1,
83
+ "data": [
84
+ {
85
+ "id": 1,
86
+ "uuid": "abc123-def456",
87
+ "status": "active",
88
+ "item_name": "Pro Plan",
89
+ "parent_order_id": 10,
90
+ "customer_id": 5,
91
+ "product_id": 3,
92
+ "variation_id": 7,
93
+ "vendor_subscription_id": "sub_1234567890",
94
+ "vendor_customer_id": "cus_abc123",
95
+ "vendor_plan_id": "price_xyz789",
96
+ "current_payment_method": "stripe",
97
+ "billing_interval": "monthly",
98
+ "recurring_amount": 2999,
99
+ "bill_times": 0,
100
+ "bill_count": 6,
101
+ "next_billing_date": "2025-02-15 00:00:00",
102
+ "created_at": "2025-01-15 10:30:00",
103
+ "updated_at": "2025-01-15 10:35:00"
104
+ }
105
+ ],
106
+ "per_page": 10,
107
+ "total": 50,
108
+ "last_page": 5
109
+ }
110
+ }
111
+ ```
112
+
113
+ #### Example
114
+
115
+ ```
116
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/subscriptions?page=1&per_page=10&active_view=active" \
117
+ -u "username:app_password"
118
+ ```
119
+
120
+ ---
121
+
122
+ ### Get Subscription Details
123
+
124
+ GET `/fluent-cart/v2/subscriptions/{subscriptionOrderId}`
125
+
126
+ Retrieve the full details of a single subscription including customer addresses, labels, activities, and related orders.
127
+
128
+ - **Permission:** `subscriptions/view`
129
+ - **Policy:** `OrderPolicy`
130
+
131
+ #### Parameters
132
+
133
+ | Parameter | Type | Location | Required | Description |
134
+ | --- | --- | --- | --- | --- |
135
+ | `subscriptionOrderId` | integer | path | Yes | The subscription ID |
136
+
137
+ #### Response
138
+
139
+ The response includes the subscription with eager-loaded relations:
140
+
141
+ - `labels` -- associated labels
142
+ - `activities.user` -- activity log with user info
143
+ - `customer.shipping_address` -- customer's primary shipping address
144
+ - `customer.billing_address` -- customer's primary billing address
145
+ - `order.billing_address` -- parent order's billing address
146
+ - `order.shipping_address` -- parent order's shipping address
147
+
148
+ Also includes:
149
+
150
+ - `related_orders` -- the parent order and all renewal orders (with order items)
151
+ - `selected_labels` -- array of label IDs applied to the subscription
152
+
153
+ ```
154
+ {
155
+ "subscription": {
156
+ "id": 1,
157
+ "uuid": "abc123-def456",
158
+ "status": "active",
159
+ "item_name": "Pro Plan",
160
+ "parent_order_id": 10,
161
+ "customer_id": 5,
162
+ "product_id": 3,
163
+ "variation_id": 7,
164
+ "vendor_subscription_id": "sub_1234567890",
165
+ "vendor_customer_id": "cus_abc123",
166
+ "current_payment_method": "stripe",
167
+ "billing_interval": "monthly",
168
+ "recurring_amount": 2999,
169
+ "bill_times": 0,
170
+ "bill_count": 6,
171
+ "next_billing_date": "2025-02-15 00:00:00",
172
+ "billing_address": { ... },
173
+ "shipping_address": { ... },
174
+ "labels": [ ... ],
175
+ "activities": [ ... ],
176
+ "customer": {
177
+ "id": 5,
178
+ "shipping_address": { ... },
179
+ "billing_address": { ... }
180
+ },
181
+ "related_orders": [
182
+ {
183
+ "id": 10,
184
+ "order_items": [
185
+ {
186
+ "id": 1,
187
+ "order_id": 10,
188
+ "post_title": "Pro Plan",
189
+ "title": "Pro Plan",
190
+ "quantity": 1,
191
+ "payment_type": "subscription",
192
+ "line_meta": { ... }
193
+ }
194
+ ]
195
+ }
196
+ ]
197
+ },
198
+ "selected_labels": [1, 3, 5]
199
+ }
200
+ ```
201
+
202
+ #### Example
203
+
204
+ ```
205
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/subscriptions/1" \
206
+ -u "username:app_password"
207
+ ```
208
+
209
+ #### Error Response (404)
210
+
211
+ ```
212
+ {
213
+ "message": "Subscription not found",
214
+ "action_text": "Back to Subscription list",
215
+ "action_url": "/subscriptions"
216
+ }
217
+ ```
218
+
219
+ ---
220
+
221
+ ### Cancel Subscription
222
+
223
+ PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/cancel`
224
+
225
+ Cancel a subscription both locally and with the remote payment gateway.
226
+
227
+ - **Permission:** `subscriptions/manage`
228
+ - **Policy:** `OrderPolicy`
229
+
230
+ #### Parameters
231
+
232
+ | Parameter | Type | Location | Required | Description |
233
+ | --- | --- | --- | --- | --- |
234
+ | `order` | integer | path | Yes | The parent order ID |
235
+ | `subscription` | integer | path | Yes | The subscription ID |
236
+ | `cancel_reason` | string | body | Yes | Reason for cancellation. Sanitized with `sanitize_text_field` |
237
+
238
+ #### Response
239
+
240
+ ```
241
+ {
242
+ "message": "Subscription has been cancelled successfully!",
243
+ "subscription": {
244
+ "id": 1,
245
+ "status": "canceled",
246
+ ...
247
+ }
248
+ }
249
+ ```
250
+
251
+ #### Error Responses
252
+
253
+ Missing cancel reason:
254
+
255
+ ```
256
+ {
257
+ "message": "Please select cancel reason!"
258
+ }
259
+ ```
260
+
261
+ Remote cancellation failure (subscription still cancelled locally):
262
+
263
+ ```
264
+ {
265
+ "message": "Subscription cancelled locally. Vendor Response: <vendor error message>"
266
+ }
267
+ ```
268
+
269
+ #### Example
270
+
271
+ ```
272
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/cancel" \
273
+ -u "username:app_password" \
274
+ -H "Content-Type: application/json" \
275
+ -d '{"cancel_reason": "Customer requested cancellation"}'
276
+ ```
277
+
278
+ ---
279
+
280
+ ### Fetch Subscription from Remote
281
+
282
+ PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/fetch`
283
+
284
+ Re-sync a subscription's data from the remote payment gateway (e.g., Stripe, PayPal). Useful for resolving data inconsistencies between local records and the payment provider.
285
+
286
+ - **Permission:** `subscriptions/view`
287
+ - **Policy:** `OrderPolicy`
288
+
289
+ #### Parameters
290
+
291
+ | Parameter | Type | Location | Required | Description |
292
+ | --- | --- | --- | --- | --- |
293
+ | `order` | integer | path | Yes | The parent order ID |
294
+ | `subscription` | integer | path | Yes | The subscription ID |
295
+
296
+ #### Response
297
+
298
+ ```
299
+ {
300
+ "message": "Subscription fetched successfully from remote payment gateway!",
301
+ "subscription": {
302
+ "id": 1,
303
+ "status": "active",
304
+ "vendor_subscription_id": "sub_1234567890",
305
+ ...
306
+ }
307
+ }
308
+ ```
309
+
310
+ #### Error Response
311
+
312
+ ```
313
+ {
314
+ "message": "<gateway error message>"
315
+ }
316
+ ```
317
+
318
+ #### Example
319
+
320
+ ```
321
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/fetch" \
322
+ -u "username:app_password"
323
+ ```
324
+
325
+ ---
326
+
327
+ ### Update Vendor IDs Opt-in
328
+
329
+ PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/vendor-ids`
330
+
331
+ Correct the gateway identifiers on a gateway-billed (`automatic`) subscription. Writes only `vendor_subscription_id` / `vendor_customer_id` — no renewal is voided, no invoice re-synced, no status event dispatched, and the gateway is not called.
332
+
333
+ Disabled unless the site opts in:
334
+
335
+ ```
336
+ add_filter('fluent_cart/subscription/vendor_id_editing_enabled', '__return_true');
337
+ ```
338
+
339
+ - **Permission:** `subscriptions/manage`
340
+ - **Policy:** `OrderPolicy`
341
+ - **Guide:** [Editing Vendor IDs](/modules/subscription-vendor-ids.md)
342
+
343
+ #### Parameters
344
+
345
+ | Parameter | Type | Location | Required | Description |
346
+ | --- | --- | --- | --- | --- |
347
+ | `order` | integer | path | Yes | The parent order ID |
348
+ | `subscription` | integer | path | Yes | The subscription ID |
349
+ | `vendor_subscription_id` | string | body | No | Max 45 chars, `^[a-zA-Z0-9_.-]+$`. Omit to leave untouched; send `""` to clear |
350
+ | `vendor_customer_id` | string | body | No | Same constraints |
351
+
352
+ At least one of the two body fields must be present. The new `vendor_subscription_id` is claimed atomically — no other subscription on the same payment method may already hold it.
353
+
354
+ #### Response
355
+
356
+ ```
357
+ {
358
+ "message": "Vendor IDs have been updated successfully!",
359
+ "subscription": {
360
+ "id": 1,
361
+ "collection_method": "automatic",
362
+ "current_payment_method": "stripe",
363
+ "vendor_subscription_id": "sub_1P9xyzABCdef",
364
+ "vendor_customer_id": "cus_NffrFeUfNV2Hib"
365
+ }
366
+ }
367
+ ```
368
+
369
+ #### Error Responses
370
+
371
+ ```
372
+ { "message": "Vendor IDs can only be edited on an active gateway-billed subscription." }
373
+ { "message": "Another subscription on this payment method is already using this Vendor Subscription ID." }
374
+ { "message": "No changes detected." }
375
+ ```
376
+
377
+ #### Example
378
+
379
+ ```
380
+ curl -X PUT "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/vendor-ids" \
381
+ -u "username:app_password" \
382
+ -H "Content-Type: application/json" \
383
+ -d '{"vendor_subscription_id": "sub_1P9xyzABCdef"}'
384
+ ```
385
+
386
+ ---
387
+
388
+ ### Verify Vendor IDs Opt-in
389
+
390
+ POST `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/verify-vendor-ids`
391
+
392
+ Read-only lookup of a **candidate** id at the payment gateway, used before saving a correction. Writes nothing anywhere. Requires the same opt-in filter, plus a gateway declaring the `verify_vendor_ids` capability — Stripe and PayPal; every other gateway answers "This payment method does not support subscription lookup."
393
+
394
+ - **Permission:** `subscriptions/manage`
395
+ - **Policy:** `OrderPolicy`
396
+
397
+ #### Parameters
398
+
399
+ | Parameter | Type | Location | Required | Description |
400
+ | --- | --- | --- | --- | --- |
401
+ | `order` | integer | path | Yes | The parent order ID |
402
+ | `subscription` | integer | path | Yes | The subscription ID |
403
+ | `vendor_subscription_id` | string | body | Yes | The candidate subscription ID to look up |
404
+ | `vendor_customer_id` | string | body | No | Sent because some gateways nest the subscription under its customer |
405
+
406
+ #### Response
407
+
408
+ ```
409
+ {
410
+ "message": "Subscription found at the payment gateway.",
411
+ "verification": {
412
+ "id": "sub_1P9xyzABCdef",
413
+ "status": "active",
414
+ "customer_id": "cus_NffrFeUfNV2Hib",
415
+ "amount": "29.00",
416
+ "currency": "USD",
417
+ "next_billing_date": "2026-09-01 00:00:00"
418
+ }
419
+ }
420
+ ```
421
+
422
+ A hit proves the id exists in the merchant account whose credentials this store holds — not that it belongs to this store, since one merchant account can back several stores. Verification is advisory; the duplicate check on save is the hard guard.
423
+
424
+ #### Example
425
+
426
+ ```
427
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/verify-vendor-ids" \
428
+ -u "username:app_password" \
429
+ -H "Content-Type: application/json" \
430
+ -d '{"vendor_subscription_id": "sub_1P9xyzABCdef"}'
431
+ ```
432
+
433
+ ---
434
+
435
+ ### Generate Early Payment Link
436
+
437
+ POST `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/early-payment-link`
438
+
439
+ Generate a URL that allows early payment of remaining installments on an installment-based subscription.
440
+
441
+ - **Permission:** `subscriptions/manage`
442
+ - **Policy:** `OrderPolicy`
443
+
444
+ #### Parameters
445
+
446
+ | Parameter | Type | Location | Required | Description |
447
+ | --- | --- | --- | --- | --- |
448
+ | `order` | integer | path | Yes | The parent order ID |
449
+ | `subscription` | integer | path | Yes | The subscription ID |
450
+
451
+ #### Conditions
452
+
453
+ This endpoint requires all of the following conditions to be met:
454
+
455
+ - Early payment feature must be enabled on the site
456
+ - The subscription must belong to the specified order (`parent_order_id` must match `order.id`)
457
+ - The subscription must have a finite number of installments (`bill_times > 0`)
458
+ - The subscription status must be `active` or `trialing`
459
+ - There must be remaining installments (`bill_times - bill_count > 0`)
460
+
461
+ #### Response
462
+
463
+ ```
464
+ {
465
+ "message": "Early payment link generated.",
466
+ "payment_url": "https://your-site.com/?fluent-cart=early-installment-payment&subscription_hash=abc123-def456"
467
+ }
468
+ ```
469
+
470
+ #### Error Responses
471
+
472
+ Feature not enabled:
473
+
474
+ ```
475
+ {
476
+ "message": "Early payment is not enabled for this site."
477
+ }
478
+ ```
479
+
480
+ Invalid subscription for order:
481
+
482
+ ```
483
+ {
484
+ "message": "Invalid subscription for the specified order."
485
+ }
486
+ ```
487
+
488
+ Not an installment subscription:
489
+
490
+ ```
491
+ {
492
+ "message": "Early payment is only available for installment subscriptions."
493
+ }
494
+ ```
495
+
496
+ Subscription not active:
497
+
498
+ ```
499
+ {
500
+ "message": "Subscription must be active to make early payments."
501
+ }
502
+ ```
503
+
504
+ All installments already paid:
505
+
506
+ ```
507
+ {
508
+ "message": "All installments have already been paid."
509
+ }
510
+ ```
511
+
512
+ #### Example
513
+
514
+ ```
515
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/orders/10/subscriptions/1/early-payment-link" \
516
+ -u "username:app_password"
517
+ ```
518
+
519
+ ---
520
+
521
+ ### Reactivate Subscription
522
+
523
+ PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/reactivate`
524
+
525
+ Reactivate a previously canceled or paused subscription.
526
+
527
+ - **Permission:** `subscriptions/manage`
528
+ - **Policy:** `OrderPolicy`
529
+
530
+ > **Not Yet Available.** This endpoint is registered but currently returns a "Not available yet" error. It is reserved for future implementation.
531
+
532
+ #### Parameters
533
+
534
+ | Parameter | Type | Location | Required | Description |
535
+ | --- | --- | --- | --- | --- |
536
+ | `order` | integer | path | Yes | The parent order ID |
537
+ | `subscription` | integer | path | Yes | The subscription ID |
538
+
539
+ #### Response
540
+
541
+ ```
542
+ {
543
+ "message": "Not available yet"
544
+ }
545
+ ```
546
+
547
+ ---
548
+
549
+ ### Pause Subscription
550
+
551
+ PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/pause`
552
+
553
+ Pause an active subscription.
554
+
555
+ - **Permission:** `subscriptions/manage`
556
+ - **Policy:** `OrderPolicy`
557
+
558
+ > **Not Yet Available.** This endpoint is registered but currently returns a "Not available yet" error. It is reserved for future implementation.
559
+
560
+ #### Parameters
561
+
562
+ | Parameter | Type | Location | Required | Description |
563
+ | --- | --- | --- | --- | --- |
564
+ | `order` | integer | path | Yes | The parent order ID |
565
+ | `subscription` | integer | path | Yes | The subscription ID |
566
+
567
+ #### Response
568
+
569
+ ```
570
+ {
571
+ "message": "Not available yet"
572
+ }
573
+ ```
574
+
575
+ ---
576
+
577
+ ### Resume Subscription
578
+
579
+ PUT `/fluent-cart/v2/orders/{order}/subscriptions/{subscription}/resume`
580
+
581
+ Resume a paused subscription.
582
+
583
+ - **Permission:** `subscriptions/manage`
584
+ - **Policy:** `OrderPolicy`
585
+
586
+ > **Not Yet Available.** This endpoint is registered but currently returns a "Not available yet" error. It is reserved for future implementation.
587
+
588
+ #### Parameters
589
+
590
+ | Parameter | Type | Location | Required | Description |
591
+ | --- | --- | --- | --- | --- |
592
+ | `order` | integer | path | Yes | The parent order ID |
593
+ | `subscription` | integer | path | Yes | The subscription ID |
594
+
595
+ #### Response
596
+
597
+ ```
598
+ {
599
+ "message": "Not available yet"
600
+ }
601
+ ```
602
+
603
+ ---
604
+
605
+ ## Customer Portal Endpoints
606
+
607
+ Customer portal endpoints are authenticated via the logged-in WordPress user. The system resolves the customer from the current user session. Authorization is handled by the `CustomerFrontendPolicy`.
608
+
609
+ All customer portal subscription endpoints use the subscription's **UUID** (not the numeric ID) for identification.
610
+
611
+ ---
612
+
613
+ ### List Customer Subscriptions
614
+
615
+ GET `/fluent-cart/v2/customer-profile/subscriptions`
616
+
617
+ Retrieve a paginated list of subscriptions belonging to the currently logged-in customer. Subscriptions with `pending` or `intended` status are excluded.
618
+
619
+ - **Policy:** `CustomerFrontendPolicy`
620
+ - **Auth:** Logged-in WordPress user
621
+
622
+ #### Parameters
623
+
624
+ | Parameter | Type | Location | Required | Description |
625
+ | --- | --- | --- | --- | --- |
626
+ | `page` | integer | query | No | Page number for pagination (default: 1) |
627
+ | `per_page` | integer | query | No | Number of records per page (default: 10) |
628
+
629
+ #### Response
630
+
631
+ If the user is not logged in, the endpoint returns an empty result set rather than an error:
632
+
633
+ ```
634
+ {
635
+ "message": "Success",
636
+ "subscriptions": {
637
+ "data": [],
638
+ "total": 0,
639
+ "per_page": 10,
640
+ "current_page": 1,
641
+ "last_page": 1
642
+ }
643
+ }
644
+ ```
645
+
646
+ Successful response with data:
647
+
648
+ ```
649
+ {
650
+ "message": "Success",
651
+ "subscriptions": {
652
+ "data": [
653
+ {
654
+ "uuid": "abc123-def456",
655
+ "status": "active",
656
+ "item_name": "Pro Plan",
657
+ "billing_interval": "monthly",
658
+ "recurring_amount": 2999,
659
+ "next_billing_date": "2025-02-15 00:00:00",
660
+ "bill_times": 0,
661
+ "bill_count": 6,
662
+ ...
663
+ }
664
+ ],
665
+ "total": 5,
666
+ "per_page": 10,
667
+ "current_page": 1,
668
+ "last_page": 1
669
+ }
670
+ }
671
+ ```
672
+
673
+ #### Example
674
+
675
+ ```
676
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions?page=1&per_page=10" \
677
+ -H "X-WP-Nonce: <nonce>"
678
+ ```
679
+
680
+ ---
681
+
682
+ ### Get Customer Subscription Details
683
+
684
+ GET `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}`
685
+
686
+ Retrieve full details of a specific subscription for the currently logged-in customer, including transactions, upgrade eligibility, and payment method capabilities.
687
+
688
+ - **Policy:** `CustomerFrontendPolicy`
689
+ - **Auth:** Logged-in WordPress user
690
+
691
+ #### Parameters
692
+
693
+ | Parameter | Type | Location | Required | Description |
694
+ | --- | --- | --- | --- | --- |
695
+ | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
696
+
697
+ #### Response
698
+
699
+ ```
700
+ {
701
+ "message": "Success",
702
+ "subscription": {
703
+ "uuid": "abc123-def456",
704
+ "status": "active",
705
+ "overridden_status": null,
706
+ "vendor_subscription_id": "sub_1234567890",
707
+ "next_billing_date": "2025-02-15 00:00:00",
708
+ "billing_info": {
709
+ "interval": "monthly",
710
+ "interval_count": 1,
711
+ "amount": 2999,
712
+ "currency": "USD"
713
+ },
714
+ "current_payment_method": "stripe",
715
+ "payment_method": "stripe",
716
+ "payment_info": { ... },
717
+ "bill_times": 0,
718
+ "bill_count": 6,
719
+ "variation_id": 7,
720
+ "product_id": 3,
721
+ "config": { ... },
722
+ "reactivate_url": "https://your-site.com/?fluent-cart=reactivate&hash=abc123",
723
+ "title": "Pro Plan",
724
+ "subtitle": "Monthly",
725
+ "can_upgrade": true,
726
+ "can_switch_payment_method": true,
727
+ "switchable_payment_methods": ["stripe", "paypal"],
728
+ "can_update_payment_method": true,
729
+ "order": {
730
+ "uuid": "order-uuid-here"
731
+ },
732
+ "billing_addresses": [ ... ],
733
+ "recurring_amount": 2999,
734
+ "can_early_pay": false,
735
+ "remaining_installments": 0,
736
+ "transactions": [
737
+ {
738
+ "id": 1,
739
+ "order_id": 10,
740
+ "vendor_charge_id": "ch_abc123",
741
+ "amount": 2999,
742
+ "status": "completed",
743
+ "created_at": "2025-01-15 10:30:00",
744
+ "order": { ... }
745
+ }
746
+ ]
747
+ }
748
+ }
749
+ ```
750
+
751
+ #### Response Fields
752
+
753
+ | Field | Type | Description |
754
+ | --- | --- | --- |
755
+ | `uuid` | string | Unique subscription identifier |
756
+ | `status` | string | Current status: `active`, `trialing`, `canceled`, `paused`, `failing`, `expiring`, `expired`, `completed`, `past_due` |
757
+ | `overridden_status` | string/null | Overridden status if manually set |
758
+ | `vendor_subscription_id` | string | Remote gateway subscription ID |
759
+ | `next_billing_date` | string | Next billing date in GMT |
760
+ | `billing_info` | object | Billing interval and amount details |
761
+ | `current_payment_method` | string | Current payment method slug |
762
+ | `payment_method` | string | Original payment method slug |
763
+ | `payment_info` | object | Payment method details (card brand, last4, etc.) |
764
+ | `bill_times` | integer | Total number of billing cycles (0 = unlimited) |
765
+ | `bill_count` | integer | Number of completed billing cycles |
766
+ | `variation_id` | integer | Product variation ID |
767
+ | `product_id` | integer | Product ID |
768
+ | `config` | object | Subscription configuration |
769
+ | `reactivate_url` | string | URL for reactivating a canceled subscription |
770
+ | `title` | string | Product title |
771
+ | `subtitle` | string | Variation title (if applicable) |
772
+ | `can_upgrade` | boolean | Whether the subscription is eligible for plan upgrade |
773
+ | `can_switch_payment_method` | boolean | Whether the payment method can be switched to a different gateway |
774
+ | `switchable_payment_methods` | array | List of available payment method slugs to switch to |
775
+ | `can_update_payment_method` | boolean | Whether the payment method can be updated (e.g., new card) within the same gateway |
776
+ | `order.uuid` | string | Parent order UUID |
777
+ | `billing_addresses` | array | Billing addresses associated with the subscription |
778
+ | `recurring_amount` | integer | Recurring payment amount in cents |
779
+ | `can_early_pay` | boolean | Whether early installment payment is available |
780
+ | `remaining_installments` | integer | Number of remaining installments (0 if unlimited) |
781
+ | `transactions` | array | All transactions related to this subscription and its renewal orders |
782
+
783
+ #### Example
784
+
785
+ ```
786
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456" \
787
+ -H "X-WP-Nonce: <nonce>"
788
+ ```
789
+
790
+ ---
791
+
792
+ ### Get Setup Intent Remaining Attempts
793
+
794
+ GET `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/setup-intent-attempts`
795
+
796
+ Check how many Stripe SetupIntent attempts remain for the customer. This is used to enforce rate limiting on payment method update attempts.
797
+
798
+ - **Policy:** `CustomerFrontendPolicy`
799
+ - **Auth:** Logged-in WordPress user
800
+ - **Stripe Only:** Only works when `current_payment_method` is `stripe`
801
+
802
+ #### Parameters
803
+
804
+ | Parameter | Type | Location | Required | Description |
805
+ | --- | --- | --- | --- | --- |
806
+ | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
807
+
808
+ #### Conditions
809
+
810
+ - Customer must own the subscription
811
+ - Subscription's `current_payment_method` must be `stripe`
812
+ - Subscription must have a `vendor_customer_id`
813
+
814
+ #### Response
815
+
816
+ ```
817
+ {
818
+ "remaining": 5
819
+ }
820
+ ```
821
+
822
+ #### Error Responses
823
+
824
+ Payment method not supported (non-Stripe subscription):
825
+
826
+ ```
827
+ {
828
+ "message": "Payment method not supported"
829
+ }
830
+ ```
831
+
832
+ #### Example
833
+
834
+ ```
835
+ curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/setup-intent-attempts" \
836
+ -H "X-WP-Nonce: <nonce>"
837
+ ```
838
+
839
+ ---
840
+
841
+ ### Update Payment Method
842
+
843
+ POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/update-payment-method`
844
+
845
+ Update the payment method (e.g., replace the card on file) for an existing subscription within the **same** payment gateway.
846
+
847
+ - **Policy:** `CustomerFrontendPolicy`
848
+ - **Auth:** Logged-in WordPress user
849
+
850
+ #### Parameters
851
+
852
+ | Parameter | Type | Location | Required | Description |
853
+ | --- | --- | --- | --- | --- |
854
+ | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
855
+ | `data` | object | body | Yes | Payment method data object |
856
+ | `data.method` | string | body | Yes | Payment gateway slug (e.g., `stripe`, `paypal`) |
857
+
858
+ Additional fields inside `data` depend on the specific payment gateway implementation (e.g., Stripe token, PayPal billing agreement ID).
859
+
860
+ #### Response
861
+
862
+ The response depends on the gateway's `cardUpdate` implementation. On failure:
863
+
864
+ ```
865
+ {
866
+ "message": "Could not update payment method"
867
+ }
868
+ ```
869
+
870
+ #### Example
871
+
872
+ ```
873
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/update-payment-method" \
874
+ -H "X-WP-Nonce: <nonce>" \
875
+ -H "Content-Type: application/json" \
876
+ -d '{
877
+ "data": {
878
+ "method": "stripe",
879
+ "payment_method_id": "pm_1234567890"
880
+ }
881
+ }'
882
+ ```
883
+
884
+ ---
885
+
886
+ ### Get or Create Plan
887
+
888
+ POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/get-or-create-plan`
889
+
890
+ Get or create a subscription plan on the remote payment gateway. This is typically used during the payment method switch flow to ensure the target gateway has a matching plan configured.
891
+
892
+ - **Policy:** `CustomerFrontendPolicy`
893
+ - **Auth:** Logged-in WordPress user
894
+
895
+ #### Parameters
896
+
897
+ | Parameter | Type | Location | Required | Description |
898
+ | --- | --- | --- | --- | --- |
899
+ | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
900
+ | `data` | object | body | Yes | Plan data object |
901
+ | `data.method` | string | body | Yes | Target payment gateway slug (e.g., `stripe`, `paypal`) |
902
+ | `data.reason` | string | body | No | Reason for creating the plan |
903
+
904
+ #### Response
905
+
906
+ The response depends on the gateway's `getOrCreateNewPlan` implementation. On failure:
907
+
908
+ ```
909
+ {
910
+ "message": "Could not get or create plan"
911
+ }
912
+ ```
913
+
914
+ #### Example
915
+
916
+ ```
917
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/get-or-create-plan" \
918
+ -H "X-WP-Nonce: <nonce>" \
919
+ -H "Content-Type: application/json" \
920
+ -d '{
921
+ "data": {
922
+ "method": "stripe",
923
+ "reason": "switching_payment_method"
924
+ }
925
+ }'
926
+ ```
927
+
928
+ ---
929
+
930
+ ### Switch Payment Method
931
+
932
+ POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/switch-payment-method`
933
+
934
+ Switch a subscription's payment method from one gateway to another (e.g., from Stripe to PayPal). This initiates the switch process, which may require a confirmation step depending on the target gateway.
935
+
936
+ - **Policy:** `CustomerFrontendPolicy`
937
+ - **Auth:** Logged-in WordPress user
938
+
939
+ #### Parameters
940
+
941
+ | Parameter | Type | Location | Required | Description |
942
+ | --- | --- | --- | --- | --- |
943
+ | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
944
+ | `data` | object | body | Yes | Payment method switch data |
945
+ | `data.newPaymentMethod` | string | body | Yes | Target payment gateway slug (e.g., `paypal`) |
946
+ | `data.currentPaymentMethod` | string | body | Yes | Current payment gateway slug (e.g., `stripe`) |
947
+
948
+ Additional fields inside `data` depend on the specific payment gateway implementation.
949
+
950
+ #### Response
951
+
952
+ The response depends on the gateway's `switchPaymentMethod` implementation. May return a redirect URL or client secret for the new gateway. On failure:
953
+
954
+ ```
955
+ {
956
+ "message": "Could not switch payment method"
957
+ }
958
+ ```
959
+
960
+ #### Example
961
+
962
+ ```
963
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/switch-payment-method" \
964
+ -H "X-WP-Nonce: <nonce>" \
965
+ -H "Content-Type: application/json" \
966
+ -d '{
967
+ "data": {
968
+ "newPaymentMethod": "paypal",
969
+ "currentPaymentMethod": "stripe"
970
+ }
971
+ }'
972
+ ```
973
+
974
+ ---
975
+
976
+ ### Confirm Subscription Switch
977
+
978
+ POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/confirm-subscription-switch`
979
+
980
+ Confirm a two-step payment method switch. After the initial `switch-payment-method` call creates a new subscription on the target gateway, this endpoint finalizes the switch by confirming the new subscription and deactivating the old one.
981
+
982
+ - **Policy:** `CustomerFrontendPolicy`
983
+ - **Auth:** Logged-in WordPress user
984
+
985
+ #### Parameters
986
+
987
+ | Parameter | Type | Location | Required | Description |
988
+ | --- | --- | --- | --- | --- |
989
+ | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
990
+ | `data` | object | body | Yes | Confirmation data |
991
+ | `data.newVendorSubscriptionId` | string | body | Yes | The new subscription ID from the target payment gateway |
992
+ | `data.method` | string | body | Yes | The target payment gateway slug (e.g., `paypal`) |
993
+
994
+ Additional fields inside `data` depend on the specific payment gateway implementation.
995
+
996
+ #### Response
997
+
998
+ The response depends on the gateway's `confirmSubscriptionSwitch` implementation. On failure:
999
+
1000
+ ```
1001
+ {
1002
+ "message": "Could not confirm subscription switch"
1003
+ }
1004
+ ```
1005
+
1006
+ #### Example
1007
+
1008
+ ```
1009
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/confirm-subscription-switch" \
1010
+ -H "X-WP-Nonce: <nonce>" \
1011
+ -H "Content-Type: application/json" \
1012
+ -d '{
1013
+ "data": {
1014
+ "newVendorSubscriptionId": "I-ABC123DEF456",
1015
+ "method": "paypal"
1016
+ }
1017
+ }'
1018
+ ```
1019
+
1020
+ ---
1021
+
1022
+ ### Cancel Auto-Renew
1023
+
1024
+ POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/cancel-auto-renew`
1025
+
1026
+ Cancel auto-renewal for a subscription from the customer portal. The subscription is cancelled both locally and with the remote payment gateway. The cancellation reason is automatically set to `cancelled_by_customer`.
1027
+
1028
+ - **Policy:** `CustomerFrontendPolicy`
1029
+ - **Auth:** Logged-in WordPress user
1030
+
1031
+ #### Parameters
1032
+
1033
+ | Parameter | Type | Location | Required | Description |
1034
+ | --- | --- | --- | --- | --- |
1035
+ | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
1036
+
1037
+ No request body is required. The cancellation reason and note are set automatically.
1038
+
1039
+ #### Response
1040
+
1041
+ ```
1042
+ {
1043
+ "message": "Your subscription has been successfully cancelled"
1044
+ }
1045
+ ```
1046
+
1047
+ #### Error Responses
1048
+
1049
+ Customer not found:
1050
+
1051
+ ```
1052
+ {
1053
+ "message": "Customer not found"
1054
+ }
1055
+ ```
1056
+
1057
+ Subscription not found (or does not belong to the customer):
1058
+
1059
+ ```
1060
+ {
1061
+ "message": "Subscription not found"
1062
+ }
1063
+ ```
1064
+
1065
+ #### Example
1066
+
1067
+ ```
1068
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/cancel-auto-renew" \
1069
+ -H "X-WP-Nonce: <nonce>"
1070
+ ```
1071
+
1072
+ ---
1073
+
1074
+ ### Initiate Early Payment
1075
+
1076
+ POST `/fluent-cart/v2/customer-profile/subscriptions/{subscription_uuid}/initiate-early-payment`
1077
+
1078
+ Generate a checkout URL for paying remaining installments early on an installment-based subscription.
1079
+
1080
+ - **Policy:** `CustomerFrontendPolicy`
1081
+ - **Auth:** Logged-in WordPress user
1082
+
1083
+ #### Parameters
1084
+
1085
+ | Parameter | Type | Location | Required | Description |
1086
+ | --- | --- | --- | --- | --- |
1087
+ | `subscription_uuid` | string | path | Yes | The subscription UUID (alphanumeric with dashes) |
1088
+
1089
+ No request body is required.
1090
+
1091
+ #### Conditions
1092
+
1093
+ The early payment feature must be enabled, and the subscription must meet the following criteria:
1094
+
1095
+ - Pro license must be active
1096
+ - `bill_times > 0` (finite installments)
1097
+ - `bill_count < bill_times` (remaining installments exist)
1098
+ - Status must be `active` or `trialing`
1099
+
1100
+ #### Response
1101
+
1102
+ ```
1103
+ {
1104
+ "message": "Early payment URL generated.",
1105
+ "checkout_url": "https://your-site.com/?fluent-cart=early-installment-payment&subscription_hash=abc123-def456"
1106
+ }
1107
+ ```
1108
+
1109
+ #### Error Responses
1110
+
1111
+ Early payment not available:
1112
+
1113
+ ```
1114
+ {
1115
+ "message": "Early payment is not available for this subscription."
1116
+ }
1117
+ ```
1118
+
1119
+ Customer not found:
1120
+
1121
+ ```
1122
+ {
1123
+ "message": "Customer not found"
1124
+ }
1125
+ ```
1126
+
1127
+ Subscription not found:
1128
+
1129
+ ```
1130
+ {
1131
+ "message": "Subscription not found"
1132
+ }
1133
+ ```
1134
+
1135
+ #### Example
1136
+
1137
+ ```
1138
+ curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/subscriptions/abc123-def456/initiate-early-payment" \
1139
+ -H "X-WP-Nonce: <nonce>"
1140
+ ```
1141
+
1142
+ ---
1143
+
1144
+ ## Subscription Statuses
1145
+
1146
+ | Status | Constant | Description |
1147
+ | --- | --- | --- |
1148
+ | `pending` | `SUBSCRIPTION_PENDING` | Subscription created but not yet activated |
1149
+ | `intended` | `SUBSCRIPTION_INTENDED` | Payment intent created, awaiting completion |
1150
+ | `trialing` | `SUBSCRIPTION_TRIALING` | In trial period |
1151
+ | `active` | `SUBSCRIPTION_ACTIVE` | Active and billing normally |
1152
+ | `paused` | `SUBSCRIPTION_PAUSED` | Temporarily paused |
1153
+ | `failing` | `SUBSCRIPTION_FAILING` | Payment attempts are failing |
1154
+ | `expiring` | `SUBSCRIPTION_EXPIRING` | Approaching expiration |
1155
+ | `expired` | `SUBSCRIPTION_EXPIRED` | Subscription has expired |
1156
+ | `canceled` | `SUBSCRIPTION_CANCELED` | Cancelled by admin or customer |
1157
+ | `past_due` | `SUBSCRIPTION_PAST_DUE` | Payment is overdue |
1158
+ | `completed` | `SUBSCRIPTION_COMPLETED` | All installments paid |
1159
+ | `authenticated` | `SUBSCRIPTION_AUTHENTICATED` | Authentication completed (SCA flow) |
1160
+ | `created` | `SUBSCRIPTION_CREATED` | Created on the remote gateway |
1161
+
1162
+ ## Hooks and Filters
1163
+
1164
+ | Hook | Type | Description |
1165
+ | --- | --- | --- |
1166
+ | `fluent_cart/subscription/view` | filter | Modify subscription data before returning in admin detail view |
1167
+ | `fluent_cart/customer_portal/subscription_data` | filter | Modify subscription data before returning in customer portal detail view |
1168
+ | `fluent_cart/subscriptions_list_filter_query` | filter | Modify the subscription list query before execution |
1169
+ | `fluent_cart/subscriptions_filter/{provider}/{property}` | action | Custom advanced filter handler for subscription list |