@sixtyninecommerce/admin 0.9.0 → 0.11.0

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 (258) hide show
  1. package/README.md +4598 -128
  2. package/dist/catalog/assets.d.ts +120 -8
  3. package/dist/catalog/assets.js +98 -12
  4. package/dist/catalog/collections.d.ts +279 -14
  5. package/dist/catalog/collections.js +246 -15
  6. package/dist/catalog/index.d.ts +9 -2
  7. package/dist/catalog/index.js +4 -0
  8. package/dist/catalog/products.d.ts +318 -17
  9. package/dist/catalog/products.js +182 -14
  10. package/dist/catalog/properties.d.ts +102 -14
  11. package/dist/catalog/properties.js +13 -0
  12. package/dist/catalog/recommendations.d.ts +261 -0
  13. package/dist/catalog/recommendations.js +145 -0
  14. package/dist/catalog/reviews.d.ts +368 -0
  15. package/dist/catalog/reviews.js +318 -0
  16. package/dist/catalog/types.d.ts +17 -1
  17. package/dist/catalog/types.js +10 -0
  18. package/dist/catalog/variant-find.d.ts +136 -0
  19. package/dist/catalog/variant-find.js +239 -0
  20. package/dist/catalog/variants.d.ts +282 -25
  21. package/dist/catalog/variants.js +173 -25
  22. package/dist/catalog/visibility.d.ts +20 -5
  23. package/dist/catalog/visibility.js +19 -1
  24. package/dist/client.d.ts +116 -9
  25. package/dist/client.js +41 -7
  26. package/dist/content/assets.d.ts +286 -0
  27. package/dist/content/assets.js +181 -0
  28. package/dist/content/items.d.ts +269 -0
  29. package/dist/content/items.js +170 -0
  30. package/dist/content/types.d.ts +282 -0
  31. package/dist/content/types.js +100 -0
  32. package/dist/customers/age-verification.d.ts +66 -0
  33. package/dist/customers/age-verification.js +79 -0
  34. package/dist/customers/credit.d.ts +263 -0
  35. package/dist/customers/credit.js +244 -0
  36. package/dist/customers/delivery-preferences.d.ts +120 -0
  37. package/dist/customers/delivery-preferences.js +97 -0
  38. package/dist/customers/groups.d.ts +207 -0
  39. package/dist/customers/groups.js +438 -0
  40. package/dist/customers/index.d.ts +447 -37
  41. package/dist/customers/index.js +313 -40
  42. package/dist/customers/invitation-status.d.ts +57 -0
  43. package/dist/customers/invitation-status.js +21 -0
  44. package/dist/customers/notes.d.ts +67 -0
  45. package/dist/customers/notes.js +51 -0
  46. package/dist/customers/notification-recipients.d.ts +97 -0
  47. package/dist/customers/notification-recipients.js +84 -0
  48. package/dist/customers/saved-lists.d.ts +42 -0
  49. package/dist/customers/saved-lists.js +61 -0
  50. package/dist/customers/vat.d.ts +83 -0
  51. package/dist/customers/vat.js +46 -0
  52. package/dist/customers/wire.d.ts +20 -0
  53. package/dist/customers/wire.js +35 -0
  54. package/dist/documents/ar.d.ts +307 -0
  55. package/dist/documents/ar.js +254 -0
  56. package/dist/documents/index.d.ts +731 -21
  57. package/dist/documents/index.js +436 -24
  58. package/dist/documents/pdf.d.ts +2 -0
  59. package/dist/documents/pdf.js +11 -0
  60. package/dist/fulfillments/create.d.ts +167 -0
  61. package/dist/fulfillments/create.js +216 -0
  62. package/dist/fulfillments/index.d.ts +121 -10
  63. package/dist/fulfillments/index.js +120 -2
  64. package/dist/fulfillments/payment-policy.d.ts +64 -0
  65. package/dist/fulfillments/payment-policy.js +140 -0
  66. package/dist/fulfillments/warehouse.d.ts +724 -0
  67. package/dist/fulfillments/warehouse.js +914 -0
  68. package/dist/geo/index.d.ts +119 -0
  69. package/dist/geo/index.js +107 -0
  70. package/dist/index.d.ts +129 -30
  71. package/dist/index.js +47 -9
  72. package/dist/integrations/afas-actions.d.ts +234 -0
  73. package/dist/integrations/afas-actions.js +310 -0
  74. package/dist/integrations/afas-types.d.ts +483 -0
  75. package/dist/integrations/afas-types.js +5 -0
  76. package/dist/integrations/afas.d.ts +234 -0
  77. package/dist/integrations/afas.js +290 -0
  78. package/dist/integrations/connections.d.ts +103 -0
  79. package/dist/integrations/connections.js +55 -0
  80. package/dist/integrations/esp.d.ts +313 -0
  81. package/dist/integrations/esp.js +169 -0
  82. package/dist/integrations/exact-online-types.d.ts +423 -0
  83. package/dist/integrations/exact-online-types.js +6 -0
  84. package/dist/integrations/exact-online.d.ts +248 -0
  85. package/dist/integrations/exact-online.js +376 -0
  86. package/dist/integrations/index.d.ts +40 -0
  87. package/dist/integrations/index.js +24 -0
  88. package/dist/integrations/pipeline-keys.d.ts +13 -0
  89. package/dist/integrations/pipeline-keys.js +22 -0
  90. package/dist/integrations/pipelines.d.ts +114 -0
  91. package/dist/integrations/pipelines.js +46 -0
  92. package/dist/integrations/types.d.ts +322 -0
  93. package/dist/integrations/types.js +8 -0
  94. package/dist/jobs/bulk-action-run.d.ts +11 -2
  95. package/dist/jobs/bulk-action-run.js +4 -5
  96. package/dist/locations/index.d.ts +66 -0
  97. package/dist/locations/index.js +31 -0
  98. package/dist/meta/index.d.ts +162 -0
  99. package/dist/orders/bulk.d.ts +75 -0
  100. package/dist/orders/bulk.js +150 -0
  101. package/dist/orders/cancel-with-money.d.ts +227 -0
  102. package/dist/orders/cancel-with-money.js +153 -0
  103. package/dist/orders/commit-edit.d.ts +7 -1
  104. package/dist/orders/commit-edit.js +5 -1
  105. package/dist/orders/deposit-policy.d.ts +103 -0
  106. package/dist/orders/deposit-policy.js +202 -0
  107. package/dist/orders/drafts.d.ts +800 -0
  108. package/dist/orders/drafts.js +771 -0
  109. package/dist/orders/fields.d.ts +245 -0
  110. package/dist/orders/fields.js +188 -0
  111. package/dist/orders/get.d.ts +29 -19
  112. package/dist/orders/get.js +17 -8
  113. package/dist/orders/index.d.ts +125 -5
  114. package/dist/orders/index.js +35 -2
  115. package/dist/orders/lifecycle.d.ts +128 -0
  116. package/dist/orders/lifecycle.js +158 -0
  117. package/dist/orders/line-price-preview.d.ts +7 -2
  118. package/dist/orders/list.d.ts +222 -0
  119. package/dist/orders/list.js +377 -0
  120. package/dist/orders/manual-discounts.d.ts +11 -2
  121. package/dist/orders/manual-discounts.js +2 -0
  122. package/dist/orders/manual-pricing.d.ts +5 -0
  123. package/dist/orders/order-entry.d.ts +20 -7
  124. package/dist/orders/plan-edit.d.ts +1 -1
  125. package/dist/orders/plan-edit.js +4 -1
  126. package/dist/orders/settings.d.ts +201 -0
  127. package/dist/orders/settings.js +325 -0
  128. package/dist/orders/status.d.ts +159 -13
  129. package/dist/orders/status.js +21 -0
  130. package/dist/orders/surcharges.d.ts +8 -1
  131. package/dist/orders/surcharges.js +3 -2
  132. package/dist/payments/account-credit.d.ts +30 -0
  133. package/dist/payments/account-credit.js +19 -0
  134. package/dist/payments/ar.d.ts +292 -0
  135. package/dist/payments/ar.js +223 -0
  136. package/dist/payments/connected-account.d.ts +47 -0
  137. package/dist/payments/connected-account.js +61 -0
  138. package/dist/payments/credit-noted-fields.d.ts +12 -0
  139. package/dist/payments/credit-noted-fields.js +37 -0
  140. package/dist/payments/index.d.ts +263 -10
  141. package/dist/payments/index.js +133 -1
  142. package/dist/payments/methods.d.ts +332 -0
  143. package/dist/payments/methods.js +363 -0
  144. package/dist/payments/mollie-methods.d.ts +159 -0
  145. package/dist/payments/mollie-methods.js +141 -0
  146. package/dist/payments/payment-links.d.ts +180 -0
  147. package/dist/payments/payment-links.js +97 -0
  148. package/dist/payments/provider-keys.d.ts +150 -0
  149. package/dist/payments/provider-keys.js +118 -0
  150. package/dist/payments/providers.d.ts +86 -11
  151. package/dist/payments/providers.js +29 -0
  152. package/dist/payments/requests.d.ts +144 -0
  153. package/dist/payments/requests.js +92 -0
  154. package/dist/payments/store-credit-fields.d.ts +15 -0
  155. package/dist/payments/store-credit-fields.js +51 -0
  156. package/dist/pickups/index.d.ts +104 -0
  157. package/dist/pickups/index.js +105 -0
  158. package/dist/platform/channels.d.ts +132 -0
  159. package/dist/platform/channels.js +128 -0
  160. package/dist/platform/geo.d.ts +123 -0
  161. package/dist/platform/geo.js +144 -0
  162. package/dist/platform/tax.d.ts +154 -0
  163. package/dist/platform/tax.js +139 -0
  164. package/dist/pos/anomalies.d.ts +158 -0
  165. package/dist/pos/anomalies.js +64 -0
  166. package/dist/pos/assisted-selling.d.ts +79 -0
  167. package/dist/pos/assisted-selling.js +38 -0
  168. package/dist/pos/exchanges.d.ts +103 -0
  169. package/dist/pos/exchanges.js +22 -0
  170. package/dist/pos/gift-cards.d.ts +135 -0
  171. package/dist/pos/gift-cards.js +47 -0
  172. package/dist/pos/index.d.ts +2125 -32
  173. package/dist/pos/index.js +742 -4
  174. package/dist/pos/no-receipt.d.ts +94 -0
  175. package/dist/pos/no-receipt.js +25 -0
  176. package/dist/pos/offline-sales.d.ts +187 -0
  177. package/dist/pos/offline-sales.js +116 -0
  178. package/dist/pos/pay-by-link.d.ts +143 -0
  179. package/dist/pos/pay-by-link.js +57 -0
  180. package/dist/pos/quick-keys.d.ts +103 -0
  181. package/dist/pos/quick-keys.js +45 -0
  182. package/dist/pos/reports.d.ts +360 -0
  183. package/dist/pos/reports.js +62 -0
  184. package/dist/pos/returns.d.ts +217 -0
  185. package/dist/pos/returns.js +53 -0
  186. package/dist/pricing/bulk-coupons.d.ts +139 -0
  187. package/dist/pricing/bulk-coupons.js +112 -0
  188. package/dist/pricing/index.d.ts +177 -4
  189. package/dist/pricing/index.js +176 -1
  190. package/dist/pricing/price-lists.d.ts +604 -0
  191. package/dist/pricing/price-lists.js +600 -0
  192. package/dist/pricing/vouchers.d.ts +103 -0
  193. package/dist/pricing/vouchers.js +69 -0
  194. package/dist/purchasing/alerts.d.ts +89 -0
  195. package/dist/purchasing/alerts.js +62 -0
  196. package/dist/purchasing/cost.d.ts +110 -0
  197. package/dist/purchasing/cost.js +86 -0
  198. package/dist/purchasing/index.d.ts +36 -0
  199. package/dist/purchasing/index.js +16 -0
  200. package/dist/purchasing/purchase-orders.d.ts +548 -0
  201. package/dist/purchasing/purchase-orders.js +491 -0
  202. package/dist/purchasing/replenishment.d.ts +281 -0
  203. package/dist/purchasing/replenishment.js +240 -0
  204. package/dist/purchasing/settings.d.ts +152 -0
  205. package/dist/purchasing/settings.js +181 -0
  206. package/dist/purchasing/suppliers.d.ts +476 -0
  207. package/dist/purchasing/suppliers.js +438 -0
  208. package/dist/quotes/index.d.ts +501 -0
  209. package/dist/quotes/index.js +439 -0
  210. package/dist/reports/index.d.ts +71 -8
  211. package/dist/reports/index.js +74 -11
  212. package/dist/returns/index.d.ts +818 -0
  213. package/dist/returns/index.js +844 -0
  214. package/dist/search/index.d.ts +174 -0
  215. package/dist/search/index.js +125 -0
  216. package/dist/shipping/definitions.d.ts +29 -0
  217. package/dist/shipping/definitions.js +47 -0
  218. package/dist/shipping/fulfillment-profiles.d.ts +174 -0
  219. package/dist/shipping/fulfillment-profiles.js +104 -0
  220. package/dist/shipping/hendriks.d.ts +97 -0
  221. package/dist/shipping/hendriks.js +50 -0
  222. package/dist/shipping/index.d.ts +48 -0
  223. package/dist/shipping/index.js +25 -0
  224. package/dist/shipping/methods.d.ts +198 -0
  225. package/dist/shipping/methods.js +240 -0
  226. package/dist/shipping/myparcel.d.ts +254 -0
  227. package/dist/shipping/myparcel.js +178 -0
  228. package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
  229. package/dist/shipping/parcel-rule.d.ts +6 -5
  230. package/dist/shipping/parcel-rule.js +21 -23
  231. package/dist/shipping/rate-tables.d.ts +179 -0
  232. package/dist/shipping/rate-tables.js +184 -0
  233. package/dist/stock/index.d.ts +10 -3
  234. package/dist/stock/index.js +3 -0
  235. package/dist/stock/locations.d.ts +144 -0
  236. package/dist/stock/locations.js +168 -0
  237. package/dist/stock/transfers.d.ts +216 -43
  238. package/dist/stock/transfers.js +140 -13
  239. package/dist/stored-value/index.d.ts +214 -4
  240. package/dist/stored-value/index.js +152 -0
  241. package/dist/subscriptions/index.d.ts +682 -0
  242. package/dist/subscriptions/index.js +815 -0
  243. package/dist/tax/index.d.ts +76 -1
  244. package/dist/tax/index.js +50 -0
  245. package/dist/tenant/email-style.d.ts +102 -0
  246. package/dist/tenant/email-style.js +72 -0
  247. package/dist/tenant/email-templates.d.ts +66 -0
  248. package/dist/tenant/email-templates.js +54 -0
  249. package/dist/tenant/notifications.d.ts +23 -17
  250. package/dist/tenant/settings-sources.d.ts +1 -1
  251. package/dist/tenant/time-zone.d.ts +17 -0
  252. package/dist/tenant/time-zone.js +11 -0
  253. package/dist/types.d.ts +51 -4
  254. package/dist/users/index.d.ts +3 -0
  255. package/dist/users/index.js +2 -0
  256. package/dist/users/warehouses.d.ts +50 -0
  257. package/dist/users/warehouses.js +51 -0
  258. package/package.json +2 -2
@@ -0,0 +1,682 @@
1
+ /**
2
+ * `admin.subscriptions`: subscription plans and the subscriptions sold on them (headless spec
3
+ * §9.2 `subscriptions`; plans W10-36, lifecycle W10-114). It reads subscriptions, manages plans,
4
+ * and runs the lifecycle and billing commands (purchase, pause/resume/cancel, payment recovery
5
+ * and reconciliation, renewal and settlement retries, price changes), each command that can
6
+ * charge, refund or change what a customer pays under one idempotency key per attempt (see
7
+ * `SubscriptionLifecycleCommands`).
8
+ *
9
+ * A plan is a store's template: a price per billing interval, the products each cycle ships, and
10
+ * the commitment rules. Changing or deleting a plan never changes a subscription already sold on
11
+ * it: each subscription keeps its own `recurringPrice` and products.
12
+ *
13
+ * **Money** is an integer in minor units of `currencyCode`. A plan's `price` and a subscription's
14
+ * `recurringPrice` are on the store's price basis (`readiness().pricesIncludeTax`: gross with VAT
15
+ * and shipping on a tax-inclusive store, net with net shipping otherwise). What a cycle actually
16
+ * charged (`billingCycles[].amount`, `upcomingPayment.amount`) is always gross.
17
+ *
18
+ * **Status words** are the meta catalog's `labels.subscription_status` keys (`active`,
19
+ * `past_due`, …): the SDK lower-cases the engine's enum, as it does a mandate's status. Every
20
+ * value set grows over time: treat a word this version does not name as one with no action.
21
+ *
22
+ * **Refusals** (`PlatformError`, by `code`) pass through as the engine sent them:
23
+ * `SUBSCRIPTION_PLAN_NOT_FOUND` (404), `SUBSCRIPTION_INPUT_INVALID` (400, the sentence names the
24
+ * value), `SUBSCRIPTION_PLAN_IN_USE` (422), `SUBSCRIPTION_PRODUCT_UNAVAILABLE` (422),
25
+ * `PLUGIN_ACCESS_DENIED` (403, the store has no subscriptions entitlement), and
26
+ * `HUB_HAS_NO_ORDERS` / `ORGANIZATION_WORKSPACE_NOT_A_STORE`. Another store's plan, subscription
27
+ * or customer is not found (a read answers null or an empty list), never served.
28
+ */
29
+ import { type Transport } from '@sixtyninecommerce/core';
30
+ import type { Call } from '../types.js';
31
+ /** The meta catalog's `labels.subscription_status` keys. */
32
+ export declare const SUBSCRIPTION_STATUSES: readonly ["incomplete", "trial", "active", "paused", "past_due", "cancelled", "expired", "completed"];
33
+ export type SubscriptionStatus = (typeof SUBSCRIPTION_STATUSES)[number];
34
+ export type SubscriptionBillingInterval = 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
35
+ /** `physical`: each cycle ships, at the plan's shipping method. `digital`: nothing ships. */
36
+ export type SubscriptionFulfillmentMode = 'digital' | 'physical';
37
+ /** `immediate`: the first cycle is charged at purchase; `after_interval`: one interval later. */
38
+ export type SubscriptionFirstChargeTiming = 'immediate' | 'after_interval';
39
+ /** A payment mandate's status, lower-cased: `pending`, `valid`, `invalid`, `revoked`. */
40
+ export type PaymentMandateStatus = 'pending' | 'valid' | 'invalid' | 'revoked';
41
+ export interface SubscriptionPlanVariant {
42
+ id: string;
43
+ variantId: string;
44
+ quantity: number;
45
+ position: number;
46
+ }
47
+ export interface SubscriptionPlan {
48
+ id: string;
49
+ channelId: string;
50
+ name: string;
51
+ description: string | null;
52
+ billingInterval: SubscriptionBillingInterval;
53
+ billingIntervalCount: number;
54
+ currencyCode: string;
55
+ /** Per cycle, minor units, on the store's price basis (see the module header). */
56
+ price: number;
57
+ trialDays: number;
58
+ firstChargeTiming: SubscriptionFirstChargeTiming;
59
+ /** How many hours before a renewal the customer can no longer change it. */
60
+ customerChangeCutoffHours: number;
61
+ minCycles: number | null;
62
+ maxCycles: number | null;
63
+ enabled: boolean;
64
+ fulfillmentMode: SubscriptionFulfillmentMode;
65
+ shippingMethodId: string | null;
66
+ /** The products each cycle ships, in order. */
67
+ variants: SubscriptionPlanVariant[];
68
+ activeSubscriptionCount: number;
69
+ createdAt: string;
70
+ updatedAt: string;
71
+ }
72
+ export interface SubscriptionPlanList {
73
+ items: SubscriptionPlan[];
74
+ totalItems: number;
75
+ }
76
+ export interface SubscriptionPlanVariantInput {
77
+ variantId: string;
78
+ quantity: number;
79
+ }
80
+ export interface CreateSubscriptionPlanInput {
81
+ name: string;
82
+ description?: string | null;
83
+ billingInterval: SubscriptionBillingInterval;
84
+ billingIntervalCount?: number;
85
+ currencyCode: string;
86
+ price: number;
87
+ trialDays?: number;
88
+ firstChargeTiming?: SubscriptionFirstChargeTiming;
89
+ customerChangeCutoffHours?: number;
90
+ minCycles?: number | null;
91
+ maxCycles?: number | null;
92
+ enabled?: boolean;
93
+ fulfillmentMode?: SubscriptionFulfillmentMode;
94
+ shippingMethodId?: string | null;
95
+ variants: SubscriptionPlanVariantInput[];
96
+ }
97
+ /** Only what is sent changes; `null` clears a nullable field. The products: `plans.setVariants`. */
98
+ export type UpdateSubscriptionPlanInput = Partial<Omit<CreateSubscriptionPlanInput, 'variants' | 'currencyCode'>>;
99
+ export interface SubscriptionPlanPriceBreakdownInput {
100
+ /** Minor units on the store's price basis. */
101
+ price: number;
102
+ variants: SubscriptionPlanVariantInput[];
103
+ fulfillmentMode: SubscriptionFulfillmentMode;
104
+ shippingMethodId?: string | null;
105
+ }
106
+ /** What a plan price comes to at the store's default tax zone, priced like a subscription order. */
107
+ export interface SubscriptionPlanPriceBreakdown {
108
+ pricesIncludeTax: boolean;
109
+ netAmount: number;
110
+ taxAmount: number;
111
+ grossAmount: number;
112
+ currencyCode: string;
113
+ /** The default tax zone's name; null when the store has none. */
114
+ zoneName: string | null;
115
+ }
116
+ export interface PaymentMandate {
117
+ id: string;
118
+ channelId: string;
119
+ customerId: string;
120
+ /** The payment provider's code (`mollie`, `stripe`, …). */
121
+ provider: string;
122
+ mandateMethod: string | null;
123
+ mandateStatus: PaymentMandateStatus;
124
+ isDefault: boolean;
125
+ createdAt: string;
126
+ updatedAt: string;
127
+ }
128
+ /** A mandate as a subscription carries it. */
129
+ export type SubscriptionMandate = Pick<PaymentMandate, 'id' | 'provider' | 'mandateMethod' | 'mandateStatus'> & {
130
+ isDefault?: boolean;
131
+ };
132
+ /** What the store has set up for subscription billing. */
133
+ export interface SubscriptionChannelReadiness {
134
+ /** The store's price basis: plan prices are gross when true, net otherwise. */
135
+ pricesIncludeTax: boolean;
136
+ /** Whether hosted checkouts have a storefront URL to return to. */
137
+ storefrontUrlConfigured: boolean;
138
+ managementUrlConfigured: boolean;
139
+ /** Each provider, and whether the store has a configured and enabled payment method for it. */
140
+ providers: Array<{
141
+ code: string;
142
+ configured: boolean;
143
+ enabled: boolean;
144
+ }>;
145
+ }
146
+ /** A subscription as a list (and a customer's subscriptions) answers it. */
147
+ export interface SubscriptionListItem {
148
+ id: string;
149
+ channelId: string;
150
+ customerId: string;
151
+ customerName: string;
152
+ paidCycleCount: number;
153
+ currencyCode: string;
154
+ /** Per cycle, minor units, on the store's price basis. */
155
+ recurringPrice: number;
156
+ billingInterval: SubscriptionBillingInterval;
157
+ billingIntervalCount: number;
158
+ /** Null for a subscription the engine has not given a status yet. */
159
+ currentStatus: SubscriptionStatus | null;
160
+ currentCycle: number;
161
+ currentPeriodStart: string | null;
162
+ currentPeriodEnd: string | null;
163
+ nextRenewalAt: string | null;
164
+ lastRenewedAt: string | null;
165
+ cancelAtPeriodEnd: boolean;
166
+ createdAt: string;
167
+ /** Why the subscription needs staff attention, when it does. */
168
+ attentionSummary: string | null;
169
+ plan: {
170
+ id: string;
171
+ name: string;
172
+ price: number;
173
+ maxCycles: number | null;
174
+ };
175
+ mandate: SubscriptionMandate;
176
+ /** Set when the caller's customer-data level withheld part of the answer (the name). */
177
+ redacted?: true;
178
+ }
179
+ export interface SubscriptionBillingAttempt {
180
+ id: string;
181
+ attemptNumber: number;
182
+ paymentState: string | null;
183
+ paymentProvider: string;
184
+ providerPaymentId: string | null;
185
+ providerSessionId: string | null;
186
+ failureReason: string | null;
187
+ checkoutUrl: string | null;
188
+ nextRetryAt: string | null;
189
+ createdAt: string;
190
+ }
191
+ /** A billing cycle with its frozen charge and its collection attempts. */
192
+ export interface SubscriptionBillingCycle {
193
+ id: string;
194
+ cycleNumber: number;
195
+ dueAt: string;
196
+ periodStart: string;
197
+ periodEnd: string;
198
+ /** Gross, as charged. */
199
+ amount: number;
200
+ currencyCode: string;
201
+ paymentState: string;
202
+ settlementState: string;
203
+ attentionReason: string | null;
204
+ orderId: string | null;
205
+ orderCode: string | null;
206
+ paidAt: string | null;
207
+ settledAt: string | null;
208
+ nextRetryAt: string | null;
209
+ attempts: SubscriptionBillingAttempt[];
210
+ }
211
+ /** A subscription email in the outbox: queued, retrying, parked or recently sent. */
212
+ export interface SubscriptionNotification {
213
+ id: string;
214
+ event: string;
215
+ dueAt: string;
216
+ dispatchedAt: string | null;
217
+ failureCount: number;
218
+ lastError: string | null;
219
+ nextAttemptAt: string | null;
220
+ parkedAt: string | null;
221
+ parkedReason: string | null;
222
+ }
223
+ export interface SubscriptionRenewal {
224
+ id: string;
225
+ cycleNumber: number;
226
+ cycleId: string | null;
227
+ attemptNumber: number;
228
+ paymentState: string | null;
229
+ orderId: string | null;
230
+ paymentProvider: string;
231
+ providerPaymentId: string | null;
232
+ amount: number;
233
+ currencyCode: string;
234
+ result: string;
235
+ failureReason: string | null;
236
+ retryCount: number;
237
+ createdAt: string;
238
+ }
239
+ /** One subscription, as `get` answers it. */
240
+ export interface Subscription extends Omit<SubscriptionListItem, 'plan' | 'paidCycleCount' | 'attentionSummary'> {
241
+ paidCycleCount: number;
242
+ trialEndsAt: string | null;
243
+ customerChangeCutoffHours: number;
244
+ cutoffAt: string | null;
245
+ cancellationRequested: boolean;
246
+ cancellationEffectiveAt: string | null;
247
+ earliestCancellationAt: string | null;
248
+ remainingPaidCycles: number;
249
+ committedPayment: boolean;
250
+ resumeAt: string | null;
251
+ retainedResumeAt: string | null;
252
+ earliestResumeAt: string;
253
+ /** Whether the customer must act on a hosted checkout. */
254
+ paymentActionRequired: boolean;
255
+ /** What the engine allows now, with its reason when it does not. Show the buttons from it. */
256
+ allowedActions: Array<{
257
+ action: string;
258
+ allowed: boolean;
259
+ reason: string | null;
260
+ }>;
261
+ /** What each cycle ships. */
262
+ products: Array<{
263
+ variantId: string;
264
+ quantity: number;
265
+ name: string;
266
+ sku: string;
267
+ }>;
268
+ upcomingPayment: {
269
+ purchaseId: string | null;
270
+ dueAt: string | null;
271
+ /** Gross. */
272
+ amount: number;
273
+ currencyCode: string;
274
+ state: string;
275
+ nextRetryAt: string | null;
276
+ checkoutUrl: string | null;
277
+ };
278
+ activity: Array<{
279
+ id: string;
280
+ action: string;
281
+ actor: string | null;
282
+ reason: string | null;
283
+ createdAt: string;
284
+ }>;
285
+ /** Newest first. */
286
+ billingCycles: SubscriptionBillingCycle[];
287
+ notifications: SubscriptionNotification[];
288
+ minCycles: number | null;
289
+ maxCycles: number | null;
290
+ cancelAt: string | null;
291
+ externalId: string | null;
292
+ externalPlatform: string | null;
293
+ updatedAt: string;
294
+ plan: Omit<SubscriptionPlan, 'variants' | 'activeSubscriptionCount' | 'channelId' | 'minCycles' | 'maxCycles' | 'fulfillmentMode' | 'shippingMethodId' | 'createdAt' | 'updatedAt'>;
295
+ renewalHistory: SubscriptionRenewal[];
296
+ }
297
+ export interface SubscriptionList {
298
+ items: SubscriptionListItem[];
299
+ totalItems: number;
300
+ }
301
+ export interface SubscriptionListOptions {
302
+ /** Matches the customer's name or email, the plan's name, or the subscription's id. */
303
+ search?: string;
304
+ /** Only subscriptions that need staff attention. */
305
+ needsAttention?: boolean;
306
+ status?: SubscriptionStatus;
307
+ customerId?: string;
308
+ planId?: string;
309
+ take?: number;
310
+ skip?: number;
311
+ }
312
+ /**
313
+ * A lifecycle change, as `previewChange` reads it and `manage` / `cancel` make it:
314
+ * - `pause`: stop renewals, until `date` when given (an indefinite pause otherwise);
315
+ * - `resume`: renew again, from `date` when given;
316
+ * - `skip`: skip the next cycle;
317
+ * - `reschedule`: move the next payment to `date`;
318
+ * - `undoCancellation`: withdraw a requested cancellation;
319
+ * - `cancel`: request cancellation at the earliest date the commitment allows;
320
+ * - `cancelImmediately`: staff only, end it now (needs `overrideReason` unless still in its trial
321
+ * or setup).
322
+ */
323
+ export type SubscriptionChangeAction = 'pause' | 'resume' | 'skip' | 'reschedule' | 'undoCancellation' | 'cancel' | 'cancelImmediately';
324
+ /** The actions `manage` makes; cancelling is `cancel`. */
325
+ export type SubscriptionManageAction = Exclude<SubscriptionChangeAction, 'cancel' | 'cancelImmediately'>;
326
+ export interface SubscriptionChange {
327
+ action: SubscriptionChangeAction;
328
+ /**
329
+ * An ISO-8601 instant WITH its offset (`2026-10-25T09:00:00+01:00`); a wall clock without one
330
+ * is refused before anything is sent (spec §9.3). Build it in the store's time zone
331
+ * (`tenant.timeZone()`): the day a merchant picks is the store's day.
332
+ */
333
+ date?: string | null;
334
+ /** Recorded in the subscription's activity. */
335
+ reason?: string | null;
336
+ /** Staff only: why the customer change cutoff (or cancellation timing) is overridden. */
337
+ overrideReason?: string | null;
338
+ }
339
+ /** What a change would do, before it is made. */
340
+ export interface SubscriptionChangePreview {
341
+ allowed: boolean;
342
+ /** Why it is not allowed, or what it would cost (a committed payment). */
343
+ reason: string | null;
344
+ nextRenewalAt: string | null;
345
+ cancellationEffectiveAt: string | null;
346
+ /** A payment already committed stays payable. */
347
+ committedPayment: boolean;
348
+ remainingPaidCycles: number;
349
+ }
350
+ /** What a purchase would charge, priced for the customer like the order it will make. */
351
+ export interface SubscriptionPurchasePreview {
352
+ planId: string;
353
+ planName: string;
354
+ /** Gross, charged per cycle (minor units). */
355
+ amount: number;
356
+ /** The store's price basis (plan prices gross when true). */
357
+ pricesIncludeTax: boolean;
358
+ /** `amount` without tax. */
359
+ netAmount: number;
360
+ /** The tax in `amount` for the customer's zone (0 under reverse charge). */
361
+ taxAmount: number;
362
+ currencyCode: string;
363
+ firstPaymentAt: string;
364
+ firstChargeTiming: SubscriptionFirstChargeTiming;
365
+ billingInterval: SubscriptionBillingInterval;
366
+ billingIntervalCount: number;
367
+ trialDays: number;
368
+ trialEndsAt: string | null;
369
+ minCycles: number | null;
370
+ maxCycles: number | null;
371
+ customerChangeCutoffHours: number;
372
+ cutoffAt: string | null;
373
+ /** What a new payment method's verification charges (a provider's minimum). */
374
+ mandateVerificationAmount: number;
375
+ products: Array<{
376
+ variantId: string;
377
+ name: string;
378
+ quantity: number;
379
+ }>;
380
+ }
381
+ export interface SubscriptionPurchasePreviewInput {
382
+ planId: string;
383
+ customerId: string;
384
+ /** A new payment method through this provider's hosted checkout. */
385
+ provider?: string | null;
386
+ /** Or one of the customer's saved, valid mandates. */
387
+ mandateId?: string | null;
388
+ }
389
+ export interface StartSubscriptionPurchaseInput extends SubscriptionPurchasePreviewInput {
390
+ /**
391
+ * The previewed `amount`. When given, the purchase is refused before anything is kept or sent
392
+ * to a provider (`SUBSCRIPTION_PREVIEW_CONFLICT`) unless the first order charges exactly this.
393
+ */
394
+ expectedAmount?: number | null;
395
+ /** Where a hosted checkout returns; the store's storefront when omitted. */
396
+ returnUrl?: string | null;
397
+ /** Email the hosted checkout link to the customer. */
398
+ sendPaymentEmail?: boolean;
399
+ }
400
+ /**
401
+ * A purchase, a payment method replacement or a payment recovery: what the customer must do (a
402
+ * hosted checkout), and where it stands. `state` is the engine's (`reserved`, `processing`,
403
+ * `action_required`, `complete`, `failed`, `unknown`, …); confirmation comes from the provider.
404
+ */
405
+ export interface SubscriptionPurchase {
406
+ id: string;
407
+ subscriptionId: string;
408
+ state: string;
409
+ checkoutUrl: string | null;
410
+ expiresAt: string | null;
411
+ currentStatus: SubscriptionStatus | null;
412
+ paymentActionRequired: boolean;
413
+ nextRenewalAt: string | null;
414
+ }
415
+ export interface SubscriptionPurchaseModule {
416
+ /**
417
+ * What a purchase would charge this customer per cycle, and when. Needs `ReadOrder`.
418
+ *
419
+ * @effect read
420
+ */
421
+ preview(input: SubscriptionPurchasePreviewInput, options?: Call): Promise<SubscriptionPurchasePreview>;
422
+ /**
423
+ * Sell a plan to a customer. Needs `UpdateOrder`. With a saved mandate the first payment is
424
+ * collected now; with a provider the answer carries the hosted checkout the customer pays.
425
+ * One key per purchase (`options.idempotencyKey`, minted when omitted): a repeat under it
426
+ * answers the first purchase, never a second one; another request under it is refused
427
+ * `SUBSCRIPTION_REQUEST_KEY_CONFLICT`.
428
+ *
429
+ * @effect money
430
+ */
431
+ start(input: StartSubscriptionPurchaseInput, options?: Call): Promise<SubscriptionPurchase>;
432
+ /**
433
+ * Where a purchase, replacement or recovery stands now. Needs `ReadOrder`.
434
+ *
435
+ * @effect read
436
+ */
437
+ status(purchaseId: string, options?: Call): Promise<SubscriptionPurchase>;
438
+ /**
439
+ * Staff reconciliation of a purchase's checkout whose outcome is unknown: verify the
440
+ * provider's reference, or (`reopen`) record that no payment exists so it can be started
441
+ * again. `investigationReason` (20+ characters) is recorded. Needs `UpdateOrder`. Keyed like
442
+ * `start`.
443
+ *
444
+ * @effect money
445
+ */
446
+ reconcile(purchaseId: string, input: {
447
+ investigationReason: string;
448
+ providerReference?: string | null;
449
+ reopen?: boolean;
450
+ }, options?: Call): Promise<void>;
451
+ }
452
+ /**
453
+ * The lifecycle and billing commands (headless W10-114). Every command that can charge, refund or
454
+ * change what a customer pays takes one idempotency key per attempt (`options.idempotencyKey`,
455
+ * minted when omitted): mint it when the merchant starts the action and send the SAME key when
456
+ * repeating that attempt. A repeat answers the first call's result and never acts again; another
457
+ * request under the key is refused `SUBSCRIPTION_REQUEST_KEY_CONFLICT` (409). A key whose first
458
+ * call is still running answers `IDEMPOTENCY_IN_PROGRESS` (409: repeat it later); one whose
459
+ * first call failed without an answer answers `IDEMPOTENCY_OUTCOME_UNKNOWN` (409,
460
+ * `outcomeUnknown`): read the subscription back, reconcile, and act again with a new key.
461
+ */
462
+ export interface SubscriptionLifecycleCommands {
463
+ purchase: SubscriptionPurchaseModule;
464
+ /**
465
+ * What a change would do now, without making it. Needs `ReadOrder`.
466
+ *
467
+ * @effect read
468
+ */
469
+ previewChange(subscriptionId: string, change: SubscriptionChange, options?: Call): Promise<SubscriptionChangePreview>;
470
+ /**
471
+ * Pause, resume, skip, reschedule, or withdraw a cancellation. Each changes when, or whether,
472
+ * the customer is charged next. Needs `UpdateOrder`. `cancel` and `cancelImmediately` are
473
+ * refused here (`SUBSCRIPTION_INPUT_INVALID`): use `cancel`.
474
+ *
475
+ * @effect money
476
+ */
477
+ manage(subscriptionId: string, change: SubscriptionChange & {
478
+ action: SubscriptionManageAction;
479
+ }, options?: Call): Promise<Subscription>;
480
+ /**
481
+ * Cancel: at the earliest date the commitment allows, or (`immediately`, staff) now. An
482
+ * immediate cancellation outside the trial or setup needs `overrideReason`. Needs `UpdateOrder`.
483
+ *
484
+ * @effect destructive
485
+ */
486
+ cancel(subscriptionId: string, input?: {
487
+ immediately?: boolean;
488
+ reason?: string | null;
489
+ overrideReason?: string | null;
490
+ }, options?: Call): Promise<Subscription>;
491
+ /**
492
+ * Replace the payment method through a provider's hosted checkout; the subscription changes
493
+ * only after the new method is verified. Needs `UpdateOrder`.
494
+ *
495
+ * @effect money
496
+ */
497
+ replaceMandate(subscriptionId: string, input: {
498
+ provider: string;
499
+ returnUrl?: string | null;
500
+ }, options?: Call): Promise<SubscriptionPurchase>;
501
+ /**
502
+ * A hosted payment link for the outstanding cycle; it is paid once. Needs `UpdateOrder`.
503
+ *
504
+ * @effect money
505
+ */
506
+ recoverPayment(subscriptionId: string, input?: {
507
+ returnUrl?: string | null;
508
+ }, options?: Call): Promise<SubscriptionPurchase>;
509
+ /**
510
+ * Staff vouch for a provider payment on an attempt whose outcome is unknown: the engine reads
511
+ * the reference back and checks tenant, customer, amount and currency before the cycle takes
512
+ * it. `investigationReason` (20+ characters) is recorded. Needs `UpdateOrder`.
513
+ *
514
+ * @effect money
515
+ */
516
+ reconcilePayment(subscriptionId: string, input: {
517
+ attemptId: string;
518
+ providerReference: string;
519
+ investigationReason: string;
520
+ }, options?: Call): Promise<Subscription>;
521
+ /**
522
+ * Staff record that an unknown attempt created no payment: the cycle fails and is collected
523
+ * again by the retry schedule. Needs `UpdateOrder`.
524
+ *
525
+ * @effect money
526
+ */
527
+ reopenUnknownPayment(subscriptionId: string, input: {
528
+ attemptId: string;
529
+ investigationReason: string;
530
+ }, options?: Call): Promise<Subscription>;
531
+ /**
532
+ * Collect the outstanding cycle again now: one provider payment attempt per key. Answers the
533
+ * latest attempt (its `paymentState`: `paid`, `failed`, `unknown`, …). Needs `UpdateOrder`.
534
+ *
535
+ * @effect money
536
+ */
537
+ retryRenewal(subscriptionId: string, options?: Call): Promise<SubscriptionRenewal>;
538
+ /**
539
+ * Settle a paid cycle's order (records the payment on it); never a new provider payment.
540
+ * Answers the cycle: `settled`, or still `attention` with the reason. Needs `UpdateOrder`.
541
+ *
542
+ * @effect money
543
+ */
544
+ retrySettlement(subscriptionId: string, options?: Call): Promise<SubscriptionBillingCycle>;
545
+ /**
546
+ * Clear a cycle's attention flag once staff handled it at the provider (a refund, a partial
547
+ * chargeback review). The payment it was about stops counting as money the cycle holds, so a
548
+ * later recovery can charge again. `reason` (20+ characters) is recorded. Needs `UpdateOrder`.
549
+ *
550
+ * @effect money
551
+ */
552
+ clearAttention(cycleId: string, reason: string, options?: Call): Promise<SubscriptionBillingCycle>;
553
+ /**
554
+ * Change what each renewal charges (minor units, on the store's price basis). Needs
555
+ * `UpdateOrder`.
556
+ *
557
+ * @effect money
558
+ */
559
+ updatePrice(subscriptionId: string, newPrice: number, options?: Call): Promise<Subscription>;
560
+ }
561
+ export interface SubscriptionPlansModule {
562
+ /**
563
+ * The store's plans, newest first. Needs `ReadOrder`.
564
+ *
565
+ * @effect read
566
+ */
567
+ list(options?: {
568
+ enabled?: boolean;
569
+ take?: number;
570
+ skip?: number;
571
+ } & Call): Promise<SubscriptionPlanList>;
572
+ /**
573
+ * One plan, or null when the store has none by that id (another store's included). Needs
574
+ * `ReadOrder`.
575
+ *
576
+ * @effect read
577
+ */
578
+ get(planId: string, options?: Call): Promise<SubscriptionPlan | null>;
579
+ /**
580
+ * Create a plan with its products. Needs `UpdateOrder`. A product the store does not sell is
581
+ * refused (`SUBSCRIPTION_PRODUCT_UNAVAILABLE`), as is a malformed value
582
+ * (`SUBSCRIPTION_INPUT_INVALID`). Moves no money: nothing is sold until a purchase.
583
+ *
584
+ * @effect write
585
+ */
586
+ create(input: CreateSubscriptionPlanInput, options?: Call): Promise<SubscriptionPlan>;
587
+ /**
588
+ * Change a plan. Needs `UpdateOrder`. Subscriptions already sold on it keep their own price and
589
+ * products.
590
+ *
591
+ * @effect write
592
+ */
593
+ update(planId: string, input: UpdateSubscriptionPlanInput, options?: Call): Promise<SubscriptionPlan>;
594
+ /**
595
+ * Replace the plan's products with exactly these, in this order. Needs `UpdateOrder`.
596
+ * Subscriptions already sold on it keep their own products.
597
+ *
598
+ * @effect write
599
+ */
600
+ setVariants(planId: string, variants: readonly SubscriptionPlanVariantInput[], options?: Call): Promise<SubscriptionPlan>;
601
+ /**
602
+ * Delete a plan for good. Needs `DeleteOrder`. A plan that has subscriptions is refused
603
+ * (`SUBSCRIPTION_PLAN_IN_USE`: disable it instead); one this store does not have is refused
604
+ * `SUBSCRIPTION_PLAN_NOT_DELETED` (`ConflictError`, 409, as every `*_NOT_DELETED` of this SDK)
605
+ * with the engine's reason.
606
+ *
607
+ * @effect destructive
608
+ */
609
+ delete(planId: string, options?: Call): Promise<void>;
610
+ /**
611
+ * What a plan price comes to at the store's default tax zone, priced exactly like a
612
+ * subscription order (the plan form's helper text). Needs `UpdateOrder`.
613
+ *
614
+ * @effect read
615
+ */
616
+ priceBreakdown(input: SubscriptionPlanPriceBreakdownInput, options?: Call): Promise<SubscriptionPlanPriceBreakdown>;
617
+ }
618
+ export interface SubscriptionsModule extends SubscriptionLifecycleCommands {
619
+ plans: SubscriptionPlansModule;
620
+ /**
621
+ * A page of the store's subscriptions, newest first. Needs `ReadOrder`. An unknown `status`
622
+ * is refused before anything is sent (`SUBSCRIPTION_INPUT_INVALID`).
623
+ *
624
+ * @effect read
625
+ */
626
+ list(options?: SubscriptionListOptions & Call): Promise<SubscriptionList>;
627
+ /**
628
+ * One subscription with its cycles, attempts, outbox, activity and what the engine allows now;
629
+ * null when the store has none by that id (another store's included). Needs `ReadOrder`.
630
+ *
631
+ * @effect read
632
+ */
633
+ get(subscriptionId: string, options?: Call): Promise<Subscription | null>;
634
+ /**
635
+ * Every subscription of one customer of this store (empty for another store's customer).
636
+ * Needs `ReadOrder`.
637
+ *
638
+ * @effect read
639
+ */
640
+ forCustomer(customerId: string, options?: Call): Promise<SubscriptionListItem[]>;
641
+ /**
642
+ * The customer's payment mandates in this store, the ones a purchase can charge. Needs
643
+ * `ReadOrder`.
644
+ *
645
+ * @effect read
646
+ */
647
+ mandates(customerId: string, options?: Call): Promise<PaymentMandate[]>;
648
+ /**
649
+ * What the store has set up for subscription billing: its price basis, whether hosted
650
+ * checkouts can return to a storefront, and which providers can take a payment now.
651
+ *
652
+ * @effect read
653
+ */
654
+ readiness(options?: Call): Promise<SubscriptionChannelReadiness>;
655
+ }
656
+ export declare const SUBSCRIPTION_PLANS_QUERY = "\n query SubscriptionsPlansList($options: SubscriptionPlanListOptions) {\n subscriptionPlans(options: $options) {\n items {\n \n id\n channelId\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n minCycles\n maxCycles\n enabled\n fulfillmentMode\n shippingMethodId\n activeSubscriptionCount\n createdAt\n updatedAt\n variants {\n id\n variantId\n quantity\n position\n }\n\n }\n totalItems\n }\n }\n";
657
+ export declare const SUBSCRIPTION_PLAN_QUERY = "\n query SubscriptionsPlansGet($id: ID!) {\n subscriptionPlan(id: $id) {\n \n id\n channelId\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n minCycles\n maxCycles\n enabled\n fulfillmentMode\n shippingMethodId\n activeSubscriptionCount\n createdAt\n updatedAt\n variants {\n id\n variantId\n quantity\n position\n }\n\n }\n }\n";
658
+ export declare const CREATE_SUBSCRIPTION_PLAN_MUTATION = "\n mutation SubscriptionsPlansCreate($input: CreateSubscriptionPlanInput!) {\n createSubscriptionPlan(input: $input) {\n \n id\n channelId\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n minCycles\n maxCycles\n enabled\n fulfillmentMode\n shippingMethodId\n activeSubscriptionCount\n createdAt\n updatedAt\n variants {\n id\n variantId\n quantity\n position\n }\n\n }\n }\n";
659
+ export declare const UPDATE_SUBSCRIPTION_PLAN_MUTATION = "\n mutation SubscriptionsPlansUpdate($id: ID!, $input: UpdateSubscriptionPlanInput!) {\n updateSubscriptionPlan(id: $id, input: $input) {\n \n id\n channelId\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n minCycles\n maxCycles\n enabled\n fulfillmentMode\n shippingMethodId\n activeSubscriptionCount\n createdAt\n updatedAt\n variants {\n id\n variantId\n quantity\n position\n }\n\n }\n }\n";
660
+ export declare const SET_SUBSCRIPTION_PLAN_VARIANTS_MUTATION = "\n mutation SubscriptionsPlansSetVariants(\n $planId: ID!\n $variants: [SubscriptionPlanVariantInput!]!\n ) {\n setSubscriptionPlanVariants(planId: $planId, variants: $variants) {\n \n id\n channelId\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n minCycles\n maxCycles\n enabled\n fulfillmentMode\n shippingMethodId\n activeSubscriptionCount\n createdAt\n updatedAt\n variants {\n id\n variantId\n quantity\n position\n }\n\n }\n }\n";
661
+ export declare const DELETE_SUBSCRIPTION_PLAN_MUTATION = "\n mutation SubscriptionsPlansDelete($id: ID!) {\n deleteSubscriptionPlan(id: $id) {\n result\n message\n }\n }\n";
662
+ export declare const SUBSCRIPTION_PLAN_PRICE_BREAKDOWN_QUERY = "\n query SubscriptionsPlansPriceBreakdown($input: SubscriptionPlanPriceBreakdownInput!) {\n subscriptionPlanPriceBreakdown(input: $input) {\n pricesIncludeTax\n netAmount\n taxAmount\n grossAmount\n currencyCode\n zoneName\n }\n }\n";
663
+ export declare const SUBSCRIPTIONS_QUERY = "\n query SubscriptionsList($options: SubscriptionListOptions) {\n subscriptions(options: $options) {\n items {\n \n id\n channelId\n customerId\n customerName\n paidCycleCount\n currencyCode\n recurringPrice\n billingInterval\n billingIntervalCount\n currentStatus\n currentCycle\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n lastRenewedAt\n cancelAtPeriodEnd\n createdAt\n attentionSummary\n plan {\n id\n name\n price\n maxCycles\n }\n mandate {\n id\n provider\n mandateMethod\n mandateStatus\n }\n\n }\n totalItems\n }\n }\n";
664
+ export declare const SUBSCRIPTION_QUERY = "\n query SubscriptionsGet($id: ID!) {\n subscription(id: $id) {\n \n id\n channelId\n customerId\n customerName\n paidCycleCount\n currencyCode\n recurringPrice\n billingInterval\n billingIntervalCount\n currentStatus\n trialEndsAt\n customerChangeCutoffHours\n cutoffAt\n cancellationRequested\n cancellationEffectiveAt\n earliestCancellationAt\n remainingPaidCycles\n committedPayment\n resumeAt\n retainedResumeAt\n earliestResumeAt\n paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { purchaseId dueAt amount currencyCode state nextRetryAt checkoutUrl }\n activity { id action actor reason createdAt }\n billingCycles {\n \n id cycleNumber dueAt periodStart periodEnd amount currencyCode paymentState settlementState\n attentionReason orderId orderCode paidAt settledAt nextRetryAt\n attempts {\n id attemptNumber paymentState paymentProvider providerPaymentId providerSessionId\n failureReason checkoutUrl nextRetryAt createdAt\n }\n\n }\n notifications {\n id event dueAt dispatchedAt failureCount lastError nextAttemptAt parkedAt parkedReason\n }\n currentCycle\n minCycles\n maxCycles\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n lastRenewedAt\n cancelAtPeriodEnd\n cancelAt\n externalId\n externalPlatform\n createdAt\n updatedAt\n plan {\n id\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n enabled\n }\n mandate {\n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n }\n renewalHistory {\n id\n cycleNumber\n cycleId\n attemptNumber\n paymentState\n orderId\n paymentProvider\n providerPaymentId\n amount\n currencyCode\n result\n failureReason\n retryCount\n createdAt\n }\n\n }\n }\n";
665
+ export declare const CUSTOMER_SUBSCRIPTIONS_QUERY = "\n query SubscriptionsForCustomer($customerId: ID!) {\n customerSubscriptions(customerId: $customerId) {\n \n id\n channelId\n customerId\n customerName\n paidCycleCount\n currencyCode\n recurringPrice\n billingInterval\n billingIntervalCount\n currentStatus\n currentCycle\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n lastRenewedAt\n cancelAtPeriodEnd\n createdAt\n attentionSummary\n plan {\n id\n name\n price\n maxCycles\n }\n mandate {\n id\n provider\n mandateMethod\n mandateStatus\n }\n\n }\n }\n";
666
+ export declare const CUSTOMER_MANDATES_QUERY = "\n query SubscriptionsMandates($customerId: ID!) {\n customerMandates(customerId: $customerId) {\n \n id\n channelId\n customerId\n provider\n mandateMethod\n mandateStatus\n isDefault\n createdAt\n updatedAt\n\n }\n }\n";
667
+ export declare const SUBSCRIPTION_CHANNEL_READINESS_QUERY = "\n query SubscriptionsReadiness {\n subscriptionChannelReadiness {\n pricesIncludeTax\n storefrontUrlConfigured\n managementUrlConfigured\n providers {\n code\n configured\n enabled\n }\n }\n }\n";
668
+ export declare const SUBSCRIPTION_PURCHASE_PREVIEW_QUERY = "\n query SubscriptionsPurchasePreview(\n $planId: ID!\n $customerId: ID\n $provider: String\n $mandateId: ID\n ) {\n subscriptionPurchasePreview(\n planId: $planId\n customerId: $customerId\n provider: $provider\n mandateId: $mandateId\n ) {\n planId\n planName\n amount\n pricesIncludeTax\n netAmount\n taxAmount\n currencyCode\n firstPaymentAt\n firstChargeTiming\n billingInterval\n billingIntervalCount\n trialDays\n trialEndsAt\n minCycles\n maxCycles\n customerChangeCutoffHours\n cutoffAt\n mandateVerificationAmount\n products {\n variantId\n name\n quantity\n }\n }\n }\n";
669
+ export declare const START_SUBSCRIPTION_PURCHASE_MUTATION = "\n mutation SubscriptionsPurchaseStart($input: SubscriptionPurchaseInput!) {\n startSubscriptionPurchase(input: $input) {\n \n id\n subscriptionId\n state\n checkoutUrl\n expiresAt\n currentStatus\n paymentActionRequired\n nextRenewalAt\n\n }\n }\n";
670
+ export declare const SUBSCRIPTION_PURCHASE_STATUS_QUERY = "\n query SubscriptionsPurchaseStatus($id: ID!) {\n subscriptionPurchaseStatus(id: $id) {\n \n id\n subscriptionId\n state\n checkoutUrl\n expiresAt\n currentStatus\n paymentActionRequired\n nextRenewalAt\n\n }\n }\n";
671
+ export declare const RECONCILE_SUBSCRIPTION_PURCHASE_MUTATION = "\n mutation SubscriptionsPurchaseReconcile(\n $id: ID!\n $requestKey: String!\n $investigationReason: String!\n $providerReference: String\n $reopen: Boolean\n ) {\n reconcileSubscriptionPurchase(\n id: $id\n requestKey: $requestKey\n investigationReason: $investigationReason\n providerReference: $providerReference\n reopen: $reopen\n )\n }\n";
672
+ export declare const PREVIEW_SUBSCRIPTION_CHANGE_QUERY = "\n query SubscriptionsPreviewChange($id: ID!, $input: SubscriptionLifecycleCommand!) {\n previewSubscriptionChange(id: $id, input: $input) {\n allowed\n reason\n nextRenewalAt\n cancellationEffectiveAt\n committedPayment\n remainingPaidCycles\n }\n }\n";
673
+ export declare const MANAGE_SUBSCRIPTION_MUTATION = "\n mutation SubscriptionsManage($id: ID!, $input: SubscriptionLifecycleCommand!) {\n manageSubscription(id: $id, input: $input) {\n \n id\n channelId\n customerId\n customerName\n paidCycleCount\n currencyCode\n recurringPrice\n billingInterval\n billingIntervalCount\n currentStatus\n trialEndsAt\n customerChangeCutoffHours\n cutoffAt\n cancellationRequested\n cancellationEffectiveAt\n earliestCancellationAt\n remainingPaidCycles\n committedPayment\n resumeAt\n retainedResumeAt\n earliestResumeAt\n paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { purchaseId dueAt amount currencyCode state nextRetryAt checkoutUrl }\n activity { id action actor reason createdAt }\n billingCycles {\n \n id cycleNumber dueAt periodStart periodEnd amount currencyCode paymentState settlementState\n attentionReason orderId orderCode paidAt settledAt nextRetryAt\n attempts {\n id attemptNumber paymentState paymentProvider providerPaymentId providerSessionId\n failureReason checkoutUrl nextRetryAt createdAt\n }\n\n }\n notifications {\n id event dueAt dispatchedAt failureCount lastError nextAttemptAt parkedAt parkedReason\n }\n currentCycle\n minCycles\n maxCycles\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n lastRenewedAt\n cancelAtPeriodEnd\n cancelAt\n externalId\n externalPlatform\n createdAt\n updatedAt\n plan {\n id\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n enabled\n }\n mandate {\n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n }\n renewalHistory {\n id\n cycleNumber\n cycleId\n attemptNumber\n paymentState\n orderId\n paymentProvider\n providerPaymentId\n amount\n currencyCode\n result\n failureReason\n retryCount\n createdAt\n }\n\n }\n }\n";
674
+ export declare const REPLACE_SUBSCRIPTION_MANDATE_MUTATION = "\n mutation SubscriptionsReplaceMandate($id: ID!, $input: SubscriptionPaymentActionInput!) {\n replaceSubscriptionMandate(id: $id, input: $input) {\n \n id\n subscriptionId\n state\n checkoutUrl\n expiresAt\n currentStatus\n paymentActionRequired\n nextRenewalAt\n\n }\n }\n";
675
+ export declare const RECOVER_SUBSCRIPTION_PAYMENT_MUTATION = "\n mutation SubscriptionsRecoverPayment($id: ID!, $input: SubscriptionPaymentActionInput!) {\n recoverSubscriptionPayment(id: $id, input: $input) {\n \n id\n subscriptionId\n state\n checkoutUrl\n expiresAt\n currentStatus\n paymentActionRequired\n nextRenewalAt\n\n }\n }\n";
676
+ export declare const RECONCILE_SUBSCRIPTION_PAYMENT_MUTATION = "\n mutation SubscriptionsReconcilePayment(\n $id: ID!\n $attemptId: ID!\n $providerReference: String!\n $requestKey: String!\n $investigationReason: String!\n ) {\n reconcileSubscriptionPayment(\n id: $id\n attemptId: $attemptId\n providerReference: $providerReference\n requestKey: $requestKey\n investigationReason: $investigationReason\n ) {\n \n id\n channelId\n customerId\n customerName\n paidCycleCount\n currencyCode\n recurringPrice\n billingInterval\n billingIntervalCount\n currentStatus\n trialEndsAt\n customerChangeCutoffHours\n cutoffAt\n cancellationRequested\n cancellationEffectiveAt\n earliestCancellationAt\n remainingPaidCycles\n committedPayment\n resumeAt\n retainedResumeAt\n earliestResumeAt\n paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { purchaseId dueAt amount currencyCode state nextRetryAt checkoutUrl }\n activity { id action actor reason createdAt }\n billingCycles {\n \n id cycleNumber dueAt periodStart periodEnd amount currencyCode paymentState settlementState\n attentionReason orderId orderCode paidAt settledAt nextRetryAt\n attempts {\n id attemptNumber paymentState paymentProvider providerPaymentId providerSessionId\n failureReason checkoutUrl nextRetryAt createdAt\n }\n\n }\n notifications {\n id event dueAt dispatchedAt failureCount lastError nextAttemptAt parkedAt parkedReason\n }\n currentCycle\n minCycles\n maxCycles\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n lastRenewedAt\n cancelAtPeriodEnd\n cancelAt\n externalId\n externalPlatform\n createdAt\n updatedAt\n plan {\n id\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n enabled\n }\n mandate {\n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n }\n renewalHistory {\n id\n cycleNumber\n cycleId\n attemptNumber\n paymentState\n orderId\n paymentProvider\n providerPaymentId\n amount\n currencyCode\n result\n failureReason\n retryCount\n createdAt\n }\n\n }\n }\n";
677
+ export declare const REOPEN_UNKNOWN_SUBSCRIPTION_PAYMENT_MUTATION = "\n mutation SubscriptionsReopenUnknownPayment(\n $id: ID!\n $attemptId: ID!\n $requestKey: String!\n $investigationReason: String!\n ) {\n reopenUnknownSubscriptionPayment(\n id: $id\n attemptId: $attemptId\n requestKey: $requestKey\n investigationReason: $investigationReason\n ) {\n \n id\n channelId\n customerId\n customerName\n paidCycleCount\n currencyCode\n recurringPrice\n billingInterval\n billingIntervalCount\n currentStatus\n trialEndsAt\n customerChangeCutoffHours\n cutoffAt\n cancellationRequested\n cancellationEffectiveAt\n earliestCancellationAt\n remainingPaidCycles\n committedPayment\n resumeAt\n retainedResumeAt\n earliestResumeAt\n paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { purchaseId dueAt amount currencyCode state nextRetryAt checkoutUrl }\n activity { id action actor reason createdAt }\n billingCycles {\n \n id cycleNumber dueAt periodStart periodEnd amount currencyCode paymentState settlementState\n attentionReason orderId orderCode paidAt settledAt nextRetryAt\n attempts {\n id attemptNumber paymentState paymentProvider providerPaymentId providerSessionId\n failureReason checkoutUrl nextRetryAt createdAt\n }\n\n }\n notifications {\n id event dueAt dispatchedAt failureCount lastError nextAttemptAt parkedAt parkedReason\n }\n currentCycle\n minCycles\n maxCycles\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n lastRenewedAt\n cancelAtPeriodEnd\n cancelAt\n externalId\n externalPlatform\n createdAt\n updatedAt\n plan {\n id\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n enabled\n }\n mandate {\n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n }\n renewalHistory {\n id\n cycleNumber\n cycleId\n attemptNumber\n paymentState\n orderId\n paymentProvider\n providerPaymentId\n amount\n currencyCode\n result\n failureReason\n retryCount\n createdAt\n }\n\n }\n }\n";
678
+ export declare const RETRY_SUBSCRIPTION_RENEWAL_MUTATION = "\n mutation SubscriptionsRetryRenewal($subscriptionId: ID!, $requestKey: String) {\n retrySubscriptionRenewal(subscriptionId: $subscriptionId, requestKey: $requestKey) {\n \n id\n cycleNumber\n cycleId\n attemptNumber\n paymentState\n orderId\n paymentProvider\n providerPaymentId\n amount\n currencyCode\n result\n failureReason\n retryCount\n createdAt\n\n }\n }\n";
679
+ export declare const RETRY_SUBSCRIPTION_SETTLEMENT_MUTATION = "\n mutation SubscriptionsRetrySettlement($subscriptionId: ID!, $requestKey: String) {\n retrySubscriptionSettlement(subscriptionId: $subscriptionId, requestKey: $requestKey) {\n \n id cycleNumber dueAt periodStart periodEnd amount currencyCode paymentState settlementState\n attentionReason orderId orderCode paidAt settledAt nextRetryAt\n attempts {\n id attemptNumber paymentState paymentProvider providerPaymentId providerSessionId\n failureReason checkoutUrl nextRetryAt createdAt\n }\n\n }\n }\n";
680
+ export declare const CLEAR_SUBSCRIPTION_CYCLE_ATTENTION_MUTATION = "\n mutation SubscriptionsClearAttention($cycleId: ID!, $reason: String!, $requestKey: String) {\n clearSubscriptionCycleAttention(cycleId: $cycleId, reason: $reason, requestKey: $requestKey) {\n \n id cycleNumber dueAt periodStart periodEnd amount currencyCode paymentState settlementState\n attentionReason orderId orderCode paidAt settledAt nextRetryAt\n attempts {\n id attemptNumber paymentState paymentProvider providerPaymentId providerSessionId\n failureReason checkoutUrl nextRetryAt createdAt\n }\n\n }\n }\n";
681
+ export declare const UPDATE_SUBSCRIPTION_PRICE_MUTATION = "\n mutation SubscriptionsUpdatePrice($id: ID!, $newPrice: Int!, $requestKey: String) {\n updateSubscriptionPrice(id: $id, newPrice: $newPrice, requestKey: $requestKey) {\n \n id\n channelId\n customerId\n customerName\n paidCycleCount\n currencyCode\n recurringPrice\n billingInterval\n billingIntervalCount\n currentStatus\n trialEndsAt\n customerChangeCutoffHours\n cutoffAt\n cancellationRequested\n cancellationEffectiveAt\n earliestCancellationAt\n remainingPaidCycles\n committedPayment\n resumeAt\n retainedResumeAt\n earliestResumeAt\n paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { purchaseId dueAt amount currencyCode state nextRetryAt checkoutUrl }\n activity { id action actor reason createdAt }\n billingCycles {\n \n id cycleNumber dueAt periodStart periodEnd amount currencyCode paymentState settlementState\n attentionReason orderId orderCode paidAt settledAt nextRetryAt\n attempts {\n id attemptNumber paymentState paymentProvider providerPaymentId providerSessionId\n failureReason checkoutUrl nextRetryAt createdAt\n }\n\n }\n notifications {\n id event dueAt dispatchedAt failureCount lastError nextAttemptAt parkedAt parkedReason\n }\n currentCycle\n minCycles\n maxCycles\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n lastRenewedAt\n cancelAtPeriodEnd\n cancelAt\n externalId\n externalPlatform\n createdAt\n updatedAt\n plan {\n id\n name\n description\n billingInterval\n billingIntervalCount\n currencyCode\n price\n trialDays\n firstChargeTiming\n customerChangeCutoffHours\n enabled\n }\n mandate {\n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n }\n renewalHistory {\n id\n cycleNumber\n cycleId\n attemptNumber\n paymentState\n orderId\n paymentProvider\n providerPaymentId\n amount\n currencyCode\n result\n failureReason\n retryCount\n createdAt\n }\n\n }\n }\n";
682
+ export declare function createSubscriptionsModule(transport: Transport): SubscriptionsModule;