@openrails/billing-ui 0.242.0 → 0.244.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 (267) hide show
  1. package/CHANGELOG.md +27 -11
  2. package/README.md +41 -8
  3. package/dist/admin/billing-admin.d.ts +3 -0
  4. package/dist/admin/components/app-sidebar.d.ts +1 -0
  5. package/dist/admin/components/confirm.d.ts +4 -0
  6. package/dist/admin/components/cursor-pager.d.ts +8 -0
  7. package/dist/admin/components/data-table.d.ts +14 -0
  8. package/dist/admin/components/fact-card.d.ts +5 -0
  9. package/dist/admin/components/form-field-errors.d.ts +3 -0
  10. package/dist/admin/components/linked-table-row.d.ts +5 -0
  11. package/dist/admin/components/logo.d.ts +3 -0
  12. package/dist/admin/components/no-access.d.ts +3 -0
  13. package/dist/admin/components/no-merchants.d.ts +1 -0
  14. package/dist/admin/components/notification-bell.d.ts +2 -0
  15. package/dist/admin/components/route-error.d.ts +3 -0
  16. package/dist/admin/components/site-header.d.ts +9 -0
  17. package/dist/admin/components/status-badge.d.ts +3 -0
  18. package/dist/admin/components/typed-confirm-dialog.d.ts +11 -0
  19. package/dist/admin/components/ui/alert-dialog.d.ts +18 -0
  20. package/dist/admin/components/ui/avatar.d.ts +11 -0
  21. package/dist/admin/components/ui/badge.d.ts +7 -0
  22. package/dist/admin/components/ui/breadcrumb.d.ts +10 -0
  23. package/dist/admin/components/ui/button.d.ts +8 -0
  24. package/dist/admin/components/ui/card.d.ts +11 -0
  25. package/dist/admin/components/ui/chart.d.ts +44 -0
  26. package/dist/admin/components/ui/dialog.d.ts +17 -0
  27. package/dist/admin/components/ui/dropdown-menu.d.ts +29 -0
  28. package/dist/admin/components/ui/input.d.ts +3 -0
  29. package/dist/admin/components/ui/label.d.ts +3 -0
  30. package/dist/admin/components/ui/select.d.ts +15 -0
  31. package/dist/admin/components/ui/separator.d.ts +3 -0
  32. package/dist/admin/components/ui/sheet.d.ts +14 -0
  33. package/dist/admin/components/ui/sidebar.d.ts +63 -0
  34. package/dist/admin/components/ui/skeleton.d.ts +2 -0
  35. package/dist/admin/components/ui/sonner.d.ts +3 -0
  36. package/dist/admin/components/ui/switch.d.ts +5 -0
  37. package/dist/admin/components/ui/table.d.ts +10 -0
  38. package/dist/admin/components/ui/tabs.d.ts +10 -0
  39. package/dist/admin/components/ui/textarea.d.ts +3 -0
  40. package/dist/admin/components/ui/tooltip.d.ts +6 -0
  41. package/dist/admin/context.d.ts +1193 -0
  42. package/dist/admin/hooks/use-mobile.d.ts +1 -0
  43. package/dist/admin/index.d.ts +5 -0
  44. package/dist/admin/layouts/app-layout.d.ts +4 -0
  45. package/dist/admin/lib/api/client.d.ts +64 -0
  46. package/dist/admin/lib/api/copilot.d.ts +6 -0
  47. package/dist/admin/lib/api/credit-endpoints.d.ts +8 -0
  48. package/dist/admin/lib/api/credit-types.d.ts +9 -0
  49. package/dist/admin/lib/api/endpoints.d.ts +133 -0
  50. package/dist/admin/lib/api/index.d.ts +89 -0
  51. package/dist/admin/lib/api/invoice-profile-endpoints.d.ts +6 -0
  52. package/dist/admin/lib/api/metrics.d.ts +68 -0
  53. package/dist/admin/lib/api/order-endpoints.d.ts +21 -0
  54. package/dist/admin/lib/api/types.d.ts +122 -0
  55. package/dist/admin/lib/auth.d.ts +6 -0
  56. package/dist/admin/lib/capabilities.d.ts +13 -0
  57. package/dist/admin/lib/chunk-error.d.ts +1 -0
  58. package/dist/admin/lib/confirm.d.ts +11 -0
  59. package/dist/admin/lib/credit-queries.d.ts +23 -0
  60. package/dist/admin/lib/csv.d.ts +3 -0
  61. package/dist/admin/lib/cursor-pages.d.ts +13 -0
  62. package/dist/admin/lib/dialog-width.d.ts +6 -0
  63. package/dist/admin/lib/dom.d.ts +1 -0
  64. package/dist/admin/lib/duration.d.ts +3 -0
  65. package/dist/admin/lib/format.d.ts +23 -0
  66. package/dist/admin/lib/mount.d.ts +6 -0
  67. package/dist/admin/lib/mutations.d.ts +125 -0
  68. package/dist/admin/lib/order-queries.d.ts +29 -0
  69. package/dist/admin/lib/queries.d.ts +369 -0
  70. package/dist/admin/lib/query-client.d.ts +3 -0
  71. package/dist/admin/lib/toast.d.ts +10 -0
  72. package/dist/admin/lib/utils.d.ts +2 -0
  73. package/dist/admin/messages.d.ts +670 -0
  74. package/dist/admin/navigation.d.ts +14 -0
  75. package/dist/admin/pages/catalog/application-dialog.d.ts +2 -0
  76. package/dist/admin/pages/catalog/copilot-panel.d.ts +4 -0
  77. package/dist/admin/pages/catalog/index.d.ts +4 -0
  78. package/dist/admin/pages/catalog/meter-form.d.ts +6 -0
  79. package/dist/admin/pages/catalog/metering-model.d.ts +67 -0
  80. package/dist/admin/pages/catalog/metering.d.ts +3 -0
  81. package/dist/admin/pages/catalog/price-detail.d.ts +2 -0
  82. package/dist/admin/pages/catalog/price-format.d.ts +3 -0
  83. package/dist/admin/pages/catalog/price-wizard-logic.d.ts +20 -0
  84. package/dist/admin/pages/catalog/price-wizard.d.ts +10 -0
  85. package/dist/admin/pages/catalog/psp-links.d.ts +10 -0
  86. package/dist/admin/pages/catalog/rate-card-editor.d.ts +10 -0
  87. package/dist/admin/pages/customers/credit-form.d.ts +14 -0
  88. package/dist/admin/pages/customers/credits.d.ts +5 -0
  89. package/dist/admin/pages/customers/default-card-badges.d.ts +3 -0
  90. package/dist/admin/pages/customers/detail.d.ts +5 -0
  91. package/dist/admin/pages/customers/grant-duration.d.ts +32 -0
  92. package/dist/admin/pages/customers/index.d.ts +2 -0
  93. package/dist/admin/pages/customers/invoice-profile-model.d.ts +18 -0
  94. package/dist/admin/pages/customers/invoice-profile.d.ts +9 -0
  95. package/dist/admin/pages/dashboard/index.d.ts +2 -0
  96. package/dist/admin/pages/dashboard/lib.d.ts +48 -0
  97. package/dist/admin/pages/dashboard/range-picker.d.ts +1 -0
  98. package/dist/admin/pages/dashboard/range.d.ts +34 -0
  99. package/dist/admin/pages/dashboard/reports-model.d.ts +29 -0
  100. package/dist/admin/pages/dashboard/reports.d.ts +2 -0
  101. package/dist/admin/pages/dashboard/use-range.d.ts +5 -0
  102. package/dist/admin/pages/dashboard/widget-editor.d.ts +8 -0
  103. package/dist/admin/pages/dashboard/widget-tile.d.ts +9 -0
  104. package/dist/admin/pages/dashboard/widget-viz.d.ts +12 -0
  105. package/dist/admin/pages/ops/index.d.ts +2 -0
  106. package/dist/admin/pages/orders/detail.d.ts +5 -0
  107. package/dist/admin/pages/orders/index.d.ts +1 -0
  108. package/dist/admin/pages/orders/model.d.ts +7 -0
  109. package/dist/admin/pages/payments/attempts.d.ts +7 -0
  110. package/dist/admin/pages/payments/detail.d.ts +2 -0
  111. package/dist/admin/pages/payments/health-model.d.ts +149 -0
  112. package/dist/admin/pages/payments/health.d.ts +2 -0
  113. package/dist/admin/pages/payments/index.d.ts +2 -0
  114. package/dist/admin/pages/settings/configuration-edit.d.ts +9 -0
  115. package/dist/admin/pages/settings/index.d.ts +9 -0
  116. package/dist/admin/pages/settings/notifications.d.ts +2 -0
  117. package/dist/admin/pages/settings/setting-fields.d.ts +20 -0
  118. package/dist/admin/pages/subscriptions/change-subscription-dialog.d.ts +16 -0
  119. package/dist/admin/pages/subscriptions/detail.d.ts +2 -0
  120. package/dist/admin/pages/subscriptions/dunning.d.ts +2 -0
  121. package/dist/admin/pages/subscriptions/index.d.ts +2 -0
  122. package/dist/admin/pages/subscriptions/subscription-change-options.d.ts +23 -0
  123. package/dist/admin/pages/subscriptions/views.d.ts +15 -0
  124. package/dist/admin/router.d.ts +32 -0
  125. package/dist/admin/routes.d.ts +5 -0
  126. package/dist/admin/summary.d.ts +27 -0
  127. package/dist/admin/theme.d.ts +2 -0
  128. package/dist/admin/types.d.ts +56 -0
  129. package/dist/admin/ui-context.d.ts +14 -0
  130. package/dist/admin-attempts-lAoW-Urd.js +419 -0
  131. package/dist/admin-attempts-lAoW-Urd.js.map +1 -0
  132. package/dist/admin-auth-DQGHtt0j.js +14 -0
  133. package/dist/admin-auth-DQGHtt0j.js.map +1 -0
  134. package/dist/admin-badge-DR5-1qd8.js +31 -0
  135. package/dist/admin-badge-DR5-1qd8.js.map +1 -0
  136. package/dist/admin-button-CTL3DgOt.js +46 -0
  137. package/dist/admin-button-CTL3DgOt.js.map +1 -0
  138. package/dist/admin-capabilities-BuigAgtm.js +59 -0
  139. package/dist/admin-capabilities-BuigAgtm.js.map +1 -0
  140. package/dist/admin-card-bzAks3-3.js +51 -0
  141. package/dist/admin-card-bzAks3-3.js.map +1 -0
  142. package/dist/admin-catalog-CK6CM9I2.js +1199 -0
  143. package/dist/admin-catalog-CK6CM9I2.js.map +1 -0
  144. package/dist/admin-confirm-katGq0Qo.js +12 -0
  145. package/dist/admin-confirm-katGq0Qo.js.map +1 -0
  146. package/dist/admin-csv-CPoNZj2D.js +16 -0
  147. package/dist/admin-csv-CPoNZj2D.js.map +1 -0
  148. package/dist/admin-customers-D8u5gq3M.js +160 -0
  149. package/dist/admin-customers-D8u5gq3M.js.map +1 -0
  150. package/dist/admin-dashboard-DqqFjOzq.js +420 -0
  151. package/dist/admin-dashboard-DqqFjOzq.js.map +1 -0
  152. package/dist/admin-data-table-qfXLOFmN.js +96 -0
  153. package/dist/admin-data-table-qfXLOFmN.js.map +1 -0
  154. package/dist/admin-detail-5aNNvrc0.js +324 -0
  155. package/dist/admin-detail-5aNNvrc0.js.map +1 -0
  156. package/dist/admin-detail-7p684Uyc.js +342 -0
  157. package/dist/admin-detail-7p684Uyc.js.map +1 -0
  158. package/dist/admin-detail-CGOyqs7s.js +1312 -0
  159. package/dist/admin-detail-CGOyqs7s.js.map +1 -0
  160. package/dist/admin-detail-DUAJQg8G.js +710 -0
  161. package/dist/admin-detail-DUAJQg8G.js.map +1 -0
  162. package/dist/admin-dialog-BjuKI5Hp.js +88 -0
  163. package/dist/admin-dialog-BjuKI5Hp.js.map +1 -0
  164. package/dist/admin-dialog-width-BPrgdYlj.js +6 -0
  165. package/dist/admin-dialog-width-BPrgdYlj.js.map +1 -0
  166. package/dist/admin-dom-uMmZzRvU.js +149 -0
  167. package/dist/admin-dom-uMmZzRvU.js.map +1 -0
  168. package/dist/admin-dropdown-menu-BW1D_h6s.js +69 -0
  169. package/dist/admin-dropdown-menu-BW1D_h6s.js.map +1 -0
  170. package/dist/admin-dunning-B2zgtrOo.js +10 -0
  171. package/dist/admin-dunning-B2zgtrOo.js.map +1 -0
  172. package/dist/admin-fact-card-DO_fHosg.js +20 -0
  173. package/dist/admin-fact-card-DO_fHosg.js.map +1 -0
  174. package/dist/admin-form-field-errors-hbUMIriS.js +14 -0
  175. package/dist/admin-form-field-errors-hbUMIriS.js.map +1 -0
  176. package/dist/admin-format-DoohJ7Fg.js +136 -0
  177. package/dist/admin-format-DoohJ7Fg.js.map +1 -0
  178. package/dist/admin-health-B4jN2LwR.js +983 -0
  179. package/dist/admin-health-B4jN2LwR.js.map +1 -0
  180. package/dist/admin-input-CcfQfJFN.js +17 -0
  181. package/dist/admin-input-CcfQfJFN.js.map +1 -0
  182. package/dist/admin-invoice-profile-model-Cgjy3zV8.js +53 -0
  183. package/dist/admin-invoice-profile-model-Cgjy3zV8.js.map +1 -0
  184. package/dist/admin-label-BiEN5cjb.js +15 -0
  185. package/dist/admin-label-BiEN5cjb.js.map +1 -0
  186. package/dist/admin-linked-table-row-BsaUruCN.js +26 -0
  187. package/dist/admin-linked-table-row-BsaUruCN.js.map +1 -0
  188. package/dist/admin-metering-COFcSPQy.js +1721 -0
  189. package/dist/admin-metering-COFcSPQy.js.map +1 -0
  190. package/dist/admin-ops-B3mcr76u.js +217 -0
  191. package/dist/admin-ops-B3mcr76u.js.map +1 -0
  192. package/dist/admin-orders-dxC99Idl.js +192 -0
  193. package/dist/admin-orders-dxC99Idl.js.map +1 -0
  194. package/dist/admin-payments-Bs7HSfP0.js +246 -0
  195. package/dist/admin-payments-Bs7HSfP0.js.map +1 -0
  196. package/dist/admin-price-detail-DRquxpA9.js +482 -0
  197. package/dist/admin-price-detail-DRquxpA9.js.map +1 -0
  198. package/dist/admin-price-format-DM1qORWI.js +44 -0
  199. package/dist/admin-price-format-DM1qORWI.js.map +1 -0
  200. package/dist/admin-price-wizard-CI7K-2Nz.js +357 -0
  201. package/dist/admin-price-wizard-CI7K-2Nz.js.map +1 -0
  202. package/dist/admin-range-picker-Dr2M1EZr.js +192 -0
  203. package/dist/admin-range-picker-Dr2M1EZr.js.map +1 -0
  204. package/dist/admin-reports-CywKLiSA.js +320 -0
  205. package/dist/admin-reports-CywKLiSA.js.map +1 -0
  206. package/dist/admin-select-DBgprVW6.js +81 -0
  207. package/dist/admin-select-DBgprVW6.js.map +1 -0
  208. package/dist/admin-settings-Bmoy95uO.js +1434 -0
  209. package/dist/admin-settings-Bmoy95uO.js.map +1 -0
  210. package/dist/admin-skeleton-DsM7crYi.js +14 -0
  211. package/dist/admin-skeleton-DsM7crYi.js.map +1 -0
  212. package/dist/admin-status-badge-BFPgo71d.js +38 -0
  213. package/dist/admin-status-badge-BFPgo71d.js.map +1 -0
  214. package/dist/admin-subscriptions-CLYc_HEV.js +301 -0
  215. package/dist/admin-subscriptions-CLYc_HEV.js.map +1 -0
  216. package/dist/admin-switch-BJUxLCsa.js +20 -0
  217. package/dist/admin-switch-BJUxLCsa.js.map +1 -0
  218. package/dist/admin-table-CH9TrXJf.js +61 -0
  219. package/dist/admin-table-CH9TrXJf.js.map +1 -0
  220. package/dist/admin-tabs-528FJMjt.js +46 -0
  221. package/dist/admin-tabs-528FJMjt.js.map +1 -0
  222. package/dist/admin-textarea-DEz38RaI.js +15 -0
  223. package/dist/admin-textarea-DEz38RaI.js.map +1 -0
  224. package/dist/admin-typed-confirm-dialog-DU7m9-O7.js +66 -0
  225. package/dist/admin-typed-confirm-dialog-DU7m9-O7.js.map +1 -0
  226. package/dist/admin-utils-BK4Vh1o_.js +1809 -0
  227. package/dist/admin-utils-BK4Vh1o_.js.map +1 -0
  228. package/dist/admin-widget-viz-Da48c-Zf.js +581 -0
  229. package/dist/admin-widget-viz-Da48c-Zf.js.map +1 -0
  230. package/dist/admin.css +3 -0
  231. package/dist/admin.js +2164 -0
  232. package/dist/admin.js.map +1 -0
  233. package/dist/appearance.d.ts +1 -1
  234. package/dist/client/client.d.ts +13 -6
  235. package/dist/client/generated/error-codes.d.ts +1 -1
  236. package/dist/client/generated/routes.d.ts +2173 -178
  237. package/dist/client/generated/wire.d.ts +1287 -1
  238. package/dist/client/index.d.ts +1 -1
  239. package/dist/client/types.d.ts +14 -2
  240. package/dist/{client-PjivPHmE.js → client-D5Af726I.js} +8 -7
  241. package/dist/client-D5Af726I.js.map +1 -0
  242. package/dist/client.js +1 -1
  243. package/dist/{hooks-Uiw-zW3H.js → hooks-CYjlHS28.js} +8 -8
  244. package/dist/hooks-CYjlHS28.js.map +1 -0
  245. package/dist/index.d.ts +1 -1
  246. package/dist/index.js +12 -12
  247. package/dist/index.js.map +1 -1
  248. package/dist/lib/{offer-label.d.ts → price-label.d.ts} +1 -1
  249. package/dist/locales/de.js +1 -1
  250. package/dist/locales/de.js.map +1 -1
  251. package/dist/locales/en.d.ts +1 -1
  252. package/dist/locales/en.js +1 -1
  253. package/dist/locales/en.js.map +1 -1
  254. package/dist/locales/es.js +1 -1
  255. package/dist/locales/es.js.map +1 -1
  256. package/dist/locales/ja.js +1 -1
  257. package/dist/locales/ja.js.map +1 -1
  258. package/dist/locales/ko.js +1 -1
  259. package/dist/locales/ko.js.map +1 -1
  260. package/dist/locales/zh.js +1 -1
  261. package/dist/locales/zh.js.map +1 -1
  262. package/dist/{offers.d.ts → product-list.d.ts} +5 -5
  263. package/dist/react.js +1 -1
  264. package/dist/styles.css +1 -1
  265. package/package.json +28 -6
  266. package/dist/client-PjivPHmE.js.map +0 -1
  267. package/dist/hooks-Uiw-zW3H.js.map +0 -1
@@ -2,6 +2,74 @@ export type ListPage<T> = {
2
2
  data: T[];
3
3
  next_cursor: string | null;
4
4
  };
5
+ export type AcknowledgeHostEventsParams = {
6
+ host_event_ids?: string[];
7
+ };
8
+ export type AcknowledgeNotificationEventsParams = {
9
+ notification_ids?: string[];
10
+ };
11
+ export type AdminAccess = {
12
+ admin: "none" | "read" | "update";
13
+ catalog: "none" | "read" | "update";
14
+ merchant_config: "none" | "read" | "update";
15
+ metrics: boolean;
16
+ scope_id: string;
17
+ assistants: AdminAssistants;
18
+ application_permissions: ("merchant:catalog:manage" | "merchant:catalog:read" | "merchant:config:manage" | "merchant:config:read" | "merchant:customer:manage" | "merchant:customer:read" | "merchant:customers:read" | "merchant:entitlements:read" | "merchant:events:read" | "merchant:metrics:read" | "merchant:orders:manage" | "merchant:usage:manage" | "merchant:usage:read" | "root:admin-rate-limits:unlock" | "root:catalog:manage" | "root:catalog:read" | "root:config:manage" | "root:config:read" | "root:customer:manage" | "root:customer:read" | "root:customers:read" | "root:entitlements:read" | "root:events:read" | "root:merchants:delete" | "root:merchants:read" | "root:merchants:restore" | "root:metrics:read" | "root:orders:manage" | "root:usage:manage" | "root:usage:read" | "root:worker-health:read")[];
19
+ };
20
+ export type AdminAssistants = {
21
+ catalog_copilot: boolean;
22
+ catalog_drafting: boolean;
23
+ };
24
+ export type Admission = {
25
+ request_id: string;
26
+ customer_id: string;
27
+ allowed: boolean;
28
+ blocked_by: "abuse" | "budget" | "money" | null;
29
+ deny_code: string | null;
30
+ retry_after_seconds: number | null;
31
+ currency: string;
32
+ estimated_amount: string;
33
+ start_capacity_amount: string;
34
+ state: "captured" | "expired" | "open" | "released" | null;
35
+ expires_at: string | null;
36
+ captured_amount: string | null;
37
+ replayed: boolean;
38
+ };
39
+ export type AdmissionBatchResult = {
40
+ items: AdmissionResult[];
41
+ };
42
+ export type AdmissionResult = {
43
+ status: number;
44
+ admission: Admission | null;
45
+ error: ErrorDetails | null;
46
+ };
47
+ export type AdmissionVerdict = {
48
+ status: number;
49
+ admission: Admission | null;
50
+ error: ErrorDetails | null;
51
+ };
52
+ export type AdmitBatchParams = {
53
+ items?: AdmitParams[];
54
+ };
55
+ export type AdmitBatchResult = {
56
+ items: AdmissionVerdict[];
57
+ };
58
+ export type AdmitParams = {
59
+ request_id?: string;
60
+ customer_id?: string;
61
+ invoker?: string;
62
+ invoker_type?: "customer" | "delegated";
63
+ trust_level?: string;
64
+ resource?: string;
65
+ currency?: string;
66
+ estimated_amount?: string;
67
+ usage?: UsageEstimate;
68
+ accrual_rate_delta_per_hour?: string;
69
+ source?: string;
70
+ expires_at?: string;
71
+ roles?: string[];
72
+ };
5
73
  export type Agreement = {
6
74
  id: string;
7
75
  kind: "card_on_file" | "recurring" | "unscheduled";
@@ -25,6 +93,65 @@ export type AgreementSubscription = {
25
93
  billing_interval_hours: number | null;
26
94
  next_charge_at: string | null;
27
95
  };
96
+ export type AlertWebhook = {
97
+ id: string;
98
+ name: string | null;
99
+ destination_host: string;
100
+ format: "discord" | "generic" | "slack";
101
+ enabled: boolean;
102
+ created_at: string;
103
+ updated_at: string;
104
+ };
105
+ export type Allowance = {
106
+ included?: number;
107
+ };
108
+ export type Application = {
109
+ schema_version?: number;
110
+ prune?: boolean;
111
+ entitlement_replacements?: EntitlementReplacement[];
112
+ products?: Record<string, ApplyProduct>;
113
+ meters?: Record<string, ApplyMeter>;
114
+ };
115
+ export type ApplyMeter = {
116
+ event_type?: string | null;
117
+ value_property?: string | null;
118
+ aggregation?: "count" | "latest" | "max" | "min" | "sum" | "unique_count" | null;
119
+ unit?: string | null;
120
+ group_by?: Record<string, string> | null;
121
+ };
122
+ export type ApplyPrice = {
123
+ id?: string;
124
+ currency?: string | null;
125
+ unit_amount?: string | null;
126
+ access_duration_hours?: number | null;
127
+ billing_interval_hours?: number | null;
128
+ archived?: boolean | null;
129
+ trial_unit_amount?: string | null;
130
+ trial_duration_hours?: number | null;
131
+ customer_amount?: CustomerAmount | null;
132
+ quantity?: Quantity | null;
133
+ psps?: string[] | null;
134
+ psp_links?: Record<string, Record<string, string>> | null;
135
+ amount?: string;
136
+ access_duration?: string | null;
137
+ billing_interval?: string | null;
138
+ trial_duration?: string | null;
139
+ };
140
+ export type ApplyProduct = {
141
+ display_name?: string | null;
142
+ description?: string | null;
143
+ tier_group?: string | null;
144
+ tier_rank?: number | null;
145
+ archived?: boolean | null;
146
+ ownership?: "consumable" | "extend" | "unique" | null;
147
+ entitlements?: string[];
148
+ credit_grant?: CreditGrantSpec | null;
149
+ prices?: Record<string, ApplyPrice>;
150
+ rate_cards?: RateCard[] | null;
151
+ };
152
+ export type AskCatalogParams = {
153
+ question?: string;
154
+ };
28
155
  export type Balance = {
29
156
  customer_id: string;
30
157
  currency: string;
@@ -38,6 +165,15 @@ export type Balance = {
38
165
  as_of: string;
39
166
  depletes_at: string | null;
40
167
  };
168
+ export type BalanceHostEvent = {
169
+ customer_id: string;
170
+ currency: string;
171
+ available_amount: string;
172
+ owed_amount: string;
173
+ accrual_rate_per_hour: string;
174
+ as_of: string;
175
+ depletes_at: string;
176
+ };
41
177
  export type BalanceTransaction = {
42
178
  id: string;
43
179
  customer_id: string;
@@ -59,12 +195,58 @@ export type BillingAddress = {
59
195
  postal_code: string | null;
60
196
  country: string | null;
61
197
  };
198
+ export type BillingArchiveImport = {
199
+ merchant_id: string;
200
+ digest: string;
201
+ rows: string;
202
+ already_imported: boolean;
203
+ };
62
204
  export type BillingDetails = {
63
205
  name: string | null;
64
206
  email: string | null;
65
207
  phone: string | null;
66
208
  address: BillingAddress | null;
67
209
  };
210
+ export type BillingImportResult = {
211
+ imported: string[];
212
+ skipped: string[];
213
+ blocked: string[];
214
+ reasons: Record<string, string> | null;
215
+ };
216
+ export type BillingPolicy = {
217
+ name: string;
218
+ kind: string;
219
+ outstanding_cap_amount?: string;
220
+ spend_windows?: BudgetWindow[];
221
+ accrual_rate_cap_per_hour?: string;
222
+ accrual_rate_window_seconds?: number;
223
+ collection_threshold_amount?: string;
224
+ delinquency_grace_days?: number;
225
+ delinquency_amount_floor?: string;
226
+ collection_cycle_boundary?: string;
227
+ bad_spend_windows?: BudgetWindow[];
228
+ policy_currency?: string;
229
+ };
230
+ export type BillingPolicyBinding = {
231
+ policy: string;
232
+ tier?: string;
233
+ };
234
+ export type BudgetWindow = {
235
+ key: string;
236
+ window_seconds: number;
237
+ limit: string;
238
+ currency?: string;
239
+ };
240
+ export type CancelEvidence = {
241
+ kind?: string;
242
+ at?: string;
243
+ schedule_live?: boolean;
244
+ };
245
+ export type CancelSubscriptionParams = {
246
+ reason?: string;
247
+ revoke_access?: boolean;
248
+ account_deletion?: boolean;
249
+ };
68
250
  export type Capabilities = {
69
251
  route_groups: Record<string, boolean> | null;
70
252
  features: Record<string, boolean> | null;
@@ -76,6 +258,41 @@ export type CaptchaConfig = {
76
258
  action: string;
77
259
  token_header: string;
78
260
  };
261
+ export type CaptureAdmissionBatchParams = {
262
+ items?: CaptureAdmissionParams[];
263
+ };
264
+ export type CaptureAdmissionParams = {
265
+ request_id?: string;
266
+ usage: CaptureUsage;
267
+ amount?: string;
268
+ };
269
+ export type CaptureBatchResult = {
270
+ items: CaptureResult[];
271
+ };
272
+ export type CaptureReceipt = {
273
+ request_id: string;
274
+ customer_id: string;
275
+ currency: string;
276
+ estimated_amount: string;
277
+ amount: string;
278
+ charges: UsageCharge[];
279
+ usage_event_id: string | null;
280
+ balance_transaction_id: string | null;
281
+ replayed: boolean;
282
+ };
283
+ export type CaptureResult = {
284
+ status: number;
285
+ receipt: CaptureReceipt | null;
286
+ error: ErrorDetails | null;
287
+ };
288
+ export type CaptureUsage = {
289
+ event_type?: string;
290
+ resource?: string;
291
+ metadata?: Record<string, unknown>;
292
+ source?: string;
293
+ source_id?: string;
294
+ dimensions?: Record<string, number>;
295
+ };
79
296
  export type CardDetails = {
80
297
  brand: string | null;
81
298
  last4: string | null;
@@ -96,6 +313,110 @@ export type Cart = {
96
313
  last_changed_at: string | null;
97
314
  expires_at: string | null;
98
315
  };
316
+ export type CatalogAnswer = {
317
+ answer: string;
318
+ evidence: CatalogEvidence[];
319
+ drafts: CatalogDraft[];
320
+ };
321
+ export type CatalogApplicationReceipt = {
322
+ application_id: string;
323
+ base_revision: number;
324
+ applied_revision: number;
325
+ replayed: boolean;
326
+ products_changed: number;
327
+ prices_changed: number;
328
+ entitlement_changes: EntitlementChange[];
329
+ changes: CatalogChange[];
330
+ conflicts: CatalogConflict[];
331
+ };
332
+ export type CatalogChange = {
333
+ object: "meter" | "price" | "product";
334
+ key: string;
335
+ product_key: string | null;
336
+ fields: string[];
337
+ revision: number;
338
+ };
339
+ export type CatalogConflict = {
340
+ object: "meter" | "price" | "product";
341
+ key: string;
342
+ product_key: string | null;
343
+ currency: string | null;
344
+ fields: CatalogFieldConflict[];
345
+ };
346
+ export type CatalogDraft = {
347
+ kind: "new_price" | "price_change" | "refused";
348
+ price_change: PriceChangeDraft | null;
349
+ new_price: NewPriceDraft | null;
350
+ refusal: CatalogDraftRefusal | null;
351
+ };
352
+ export type CatalogDraftRefusal = {
353
+ code: string;
354
+ reason: string;
355
+ workaround: string;
356
+ };
357
+ export type CatalogEvidence = {
358
+ tool: string;
359
+ args: string;
360
+ summary: string;
361
+ };
362
+ export type CatalogFieldConflict = {
363
+ field: string;
364
+ file_value: unknown | null;
365
+ live_value: unknown | null;
366
+ set_by: string;
367
+ set_at: string;
368
+ };
369
+ export type ChangeSubscriptionParams = {
370
+ price_id?: string;
371
+ quantity?: number;
372
+ reason?: string;
373
+ };
374
+ export type CheckEntitlementsParams = {
375
+ customer_id?: string;
376
+ entitlements?: string[];
377
+ prefixes?: string[];
378
+ prefix_limit?: number;
379
+ at?: string;
380
+ };
381
+ export type CheckoutRoutingMatch = {
382
+ currency?: string;
383
+ product?: string;
384
+ price?: string;
385
+ mode?: string;
386
+ country?: string;
387
+ };
388
+ export type CheckoutRoutingRule = {
389
+ match?: CheckoutRoutingMatch;
390
+ prefer: string[];
391
+ };
392
+ export type ConfirmOrderParams = {
393
+ signature?: string;
394
+ };
395
+ export type ConfirmPaymentMethodParams = {
396
+ capture?: CustodianCaptureReference;
397
+ };
398
+ export type CreateAlertWebhookParams = {
399
+ name?: string;
400
+ url?: string;
401
+ format?: "discord" | "generic" | "slack";
402
+ enabled?: boolean | null;
403
+ };
404
+ export type CreateCreditGrantBatchParams = {
405
+ items?: CreateCreditGrantParams[];
406
+ };
407
+ export type CreateCreditGrantBatchResult = {
408
+ items: CreditGrant[];
409
+ };
410
+ export type CreateCreditGrantParams = {
411
+ customer_id?: string;
412
+ currency?: string;
413
+ amount?: string;
414
+ source_id?: string;
415
+ source?: string;
416
+ invoker?: string;
417
+ expires_at?: string;
418
+ description?: string;
419
+ };
99
420
  export type CreateMyOrderParams = {
100
421
  lines?: OrderLineParams[];
101
422
  cart?: boolean;
@@ -107,23 +428,144 @@ export type CreateNetworkLinkParams = {
107
428
  challenge_id?: string;
108
429
  id_token?: string;
109
430
  };
431
+ export type CreateOrderParams = {
432
+ customer_id?: string;
433
+ lines?: OrderLineParams[];
434
+ expires_at?: string;
435
+ checkout?: OrderCheckoutParams;
436
+ };
437
+ export type CreatePSPParams = {
438
+ key?: string;
439
+ rail?: "ccbill" | "nmi" | "solana" | "stripe";
440
+ account_id?: string;
441
+ settings?: Record<string, unknown> | null;
442
+ credentials?: Record<string, string> | null;
443
+ };
110
444
  export type CreatePaymentMethodParams = {
111
445
  psp_id?: string;
112
446
  token?: string;
113
447
  card?: CardEntry;
114
448
  billing_details?: BillingDetails;
115
449
  };
450
+ export type CreatePriceMigrationParams = {
451
+ from_price_id?: string;
452
+ product_key?: string;
453
+ price_key?: string;
454
+ to_price_id?: string;
455
+ effective_at?: string;
456
+ acknowledge_short_notice?: boolean;
457
+ fallback_policy?: "cancel_at_period_end" | "keep_grandfathered";
458
+ archive_source?: boolean;
459
+ };
460
+ export type CreatePriceParams = {
461
+ customer_amount?: CustomerAmount;
462
+ quantity?: Quantity;
463
+ product_id?: string;
464
+ product_key?: string;
465
+ product_data?: CreatePriceProduct;
466
+ key?: string;
467
+ unit_amount: string;
468
+ currency: string;
469
+ access_duration_hours?: number;
470
+ billing_interval_hours?: number;
471
+ trial_unit_amount?: string;
472
+ trial_duration_hours?: number;
473
+ psps?: string[];
474
+ psp_links?: Record<string, Record<string, string>>;
475
+ archived?: boolean;
476
+ expected_revision?: number;
477
+ };
478
+ export type CreatePriceProduct = {
479
+ key: string;
480
+ display_name: string;
481
+ description?: string;
482
+ };
483
+ export type CreateProductAccessBatchParams = {
484
+ items?: CreateProductAccessParams[];
485
+ };
486
+ export type CreateProductAccessBatchResult = {
487
+ items: ProductAccessGrant[];
488
+ };
489
+ export type CreateProductAccessParams = {
490
+ customer_id?: string;
491
+ product_id?: string;
492
+ hours?: number | null;
493
+ ends_at?: string | null;
494
+ reason?: "comp" | "import" | "migration" | "staff";
495
+ note?: string | null;
496
+ };
497
+ export type CreateProductParams = {
498
+ key?: string;
499
+ display_name?: string;
500
+ description?: string;
501
+ entitlements?: string[];
502
+ credit_grant?: CreditGrantSpec;
503
+ tier_group?: string;
504
+ tier_rank?: number;
505
+ ownership?: "consumable" | "extend" | "unique";
506
+ archived?: boolean;
507
+ };
508
+ export type CreateProvisioningTokenParams = {
509
+ name?: string;
510
+ };
511
+ export type CreatedProvisioningToken = {
512
+ id: string;
513
+ name: string;
514
+ declared: boolean;
515
+ created_at: string;
516
+ last_used_at: string | null;
517
+ token: string;
518
+ };
519
+ export type CreditGrant = {
520
+ id: string;
521
+ customer_id: string;
522
+ currency: string;
523
+ amount: string;
524
+ spent_amount: string;
525
+ remaining_amount: string;
526
+ revoked_amount: string;
527
+ expired_amount: string;
528
+ state: "active" | "expired" | "revoked" | "scheduled" | "spent" | "terminated";
529
+ source_type: string;
530
+ source_id: string | null;
531
+ description: string | null;
532
+ starts_at: string;
533
+ expires_at: string | null;
534
+ created_at: string;
535
+ terminated_at: string | null;
536
+ termination_reason: string | null;
537
+ replayed: boolean;
538
+ };
116
539
  export type CreditGrantSpec = {
117
540
  currency: string;
118
541
  amount?: string;
119
542
  from_payment?: boolean;
120
543
  expires_after_days?: number;
121
544
  };
545
+ export type CreditLimit = {
546
+ currency: string;
547
+ amount: string;
548
+ };
122
549
  export type CurrencyUnits = {
123
550
  code: string;
124
551
  decimals: number;
125
552
  minor_decimals: number;
126
553
  };
554
+ export type CustodianCaptureReference = {
555
+ custodian_id?: string;
556
+ session_id?: string;
557
+ token?: string;
558
+ };
559
+ export type Customer = {
560
+ id: string;
561
+ contact: CustomerContact | null;
562
+ created_at: string;
563
+ last_seen_at: string;
564
+ settings: CustomerSettings;
565
+ balances: Balance[];
566
+ default_payment_methods: DefaultPaymentMethod[];
567
+ network: CustomerNetwork | null;
568
+ };
127
569
  export type CustomerAccount = {
128
570
  id: string;
129
571
  balances: Balance[];
@@ -146,6 +588,13 @@ export type CustomerConfig = {
146
588
  payment: PaymentConfig;
147
589
  merchant: PublicMerchant;
148
590
  };
591
+ export type CustomerContact = {
592
+ email: string | null;
593
+ name: string | null;
594
+ username: string | null;
595
+ active: boolean | null;
596
+ synced_at: string | null;
597
+ };
149
598
  export type CustomerEntitlement = {
150
599
  customer_id: string;
151
600
  entitlement: string;
@@ -162,22 +611,238 @@ export type CustomerLink = {
162
611
  revoked_at: string | null;
163
612
  revoked_by: "account_deleted" | "customer" | "merchant_left" | null;
164
613
  };
614
+ export type CustomerNetwork = {
615
+ account_id: string;
616
+ linked_at: string;
617
+ method: "checkout" | "connect" | "sign_in";
618
+ };
619
+ export type CustomerNetworkHostEvent = {
620
+ customer_id: string;
621
+ account_id: string;
622
+ method: "checkout" | "connect" | "sign_in" | null;
623
+ revoked_by: "account_deleted" | "customer" | "merchant_left" | null;
624
+ };
625
+ export type CustomerSettings = {
626
+ credit_limits: CreditLimit[];
627
+ trust_levels: TrustLevel[];
628
+ billing_policy: string | null;
629
+ invoice_profile: InvoiceProfile | null;
630
+ };
631
+ export type Dashboard = {
632
+ widgets: DashboardWidget[];
633
+ is_default: boolean;
634
+ updated_at: string | null;
635
+ updated_by: string | null;
636
+ };
637
+ export type DashboardGrid = {
638
+ x: number;
639
+ y: number;
640
+ w: number;
641
+ h: number;
642
+ };
643
+ export type DashboardWidget = {
644
+ id: string;
645
+ title: string;
646
+ viz: string;
647
+ query: MetricsQuery;
648
+ grid: DashboardGrid;
649
+ fixed_range: boolean;
650
+ };
651
+ export type DeclaredAdminGrant = {
652
+ customer?: string;
653
+ product?: string;
654
+ source_id?: string;
655
+ starts_at?: string;
656
+ ends_at?: string;
657
+ };
658
+ export type DeclaredBilling = {
659
+ as_of?: string;
660
+ subscriptions_exhaustive?: boolean;
661
+ expected_subscriptions?: number;
662
+ default_psp?: PSPRef;
663
+ customers?: DeclaredCustomer[];
664
+ payment_methods?: DeclaredPaymentMethod[];
665
+ subscriptions?: DeclaredSubscription[];
666
+ transactions?: DeclaredTransaction[];
667
+ admin_grants?: DeclaredAdminGrant[];
668
+ };
669
+ export type DeclaredCustomer = {
670
+ customer?: string;
671
+ };
672
+ export type DeclaredPaymentMethod = {
673
+ customer?: string;
674
+ rail?: string;
675
+ psp?: PSPRef;
676
+ rail_customer_ref?: string;
677
+ rail_method_ref?: string;
678
+ recurring_transaction_id?: string;
679
+ card?: CardDetails;
680
+ created_at?: string;
681
+ };
682
+ export type DeclaredSubscription = {
683
+ source_id?: string;
684
+ customer?: string;
685
+ price?: string;
686
+ rail?: string;
687
+ rail_subscription_id?: string;
688
+ psp?: PSPRef;
689
+ started_at?: string;
690
+ paid_through?: string;
691
+ cancel?: CancelEvidence;
692
+ dunning?: DunningEvidence;
693
+ payment_method?: PaymentMethodRef;
694
+ evidence?: unknown;
695
+ };
696
+ export type DeclaredTransaction = {
697
+ rail_subscription_id?: string;
698
+ transaction_id?: string;
699
+ type?: string;
700
+ success?: boolean;
701
+ amount?: string;
702
+ currency?: string;
703
+ occurred_at?: string;
704
+ };
165
705
  export type DefaultPaymentMethod = {
166
706
  currency: string;
167
707
  payment_method_id: string;
168
708
  };
709
+ export type DelinquencyHostEvent = {
710
+ customer_id: string;
711
+ currency: string;
712
+ from_state: string;
713
+ to_state: string;
714
+ overdue_started_at?: string;
715
+ overdue_amount: string;
716
+ overdue_orders: number;
717
+ grace_days: number;
718
+ amount_floor: string;
719
+ };
169
720
  export type DriftField = {
170
721
  field: string;
171
722
  openrails_value: string;
172
723
  remote_value: string;
173
724
  };
725
+ export type DunningEvidence = {
726
+ retries?: number;
727
+ last_retry_at?: string;
728
+ next_retry_at?: string;
729
+ schedule_live?: boolean;
730
+ };
731
+ export type DunningPolicy = {
732
+ tiers: DunningTier[];
733
+ transient_retry_minutes?: number[];
734
+ access_during_dunning?: string;
735
+ access_while_renewal_held?: string;
736
+ };
737
+ export type DunningTier = {
738
+ max_cycle_hours?: number;
739
+ retry_after_hours?: number[];
740
+ };
741
+ export type EntitlementChange = {
742
+ product_id: string;
743
+ product_key: string;
744
+ added: string[];
745
+ removed: string[];
746
+ holders: number;
747
+ };
748
+ export type EntitlementCheck = {
749
+ entitlements: Record<string, boolean> | null;
750
+ quantities: Record<string, number | null> | null;
751
+ held: Record<string, HeldEntitlements> | null;
752
+ };
753
+ export type EntitlementReplacement = {
754
+ from?: string;
755
+ to?: string;
756
+ };
757
+ export type ErrorDetails = {
758
+ type: string;
759
+ code: string;
760
+ message: string;
761
+ request_id?: string;
762
+ param?: string;
763
+ metadata?: Record<string, unknown>;
764
+ order?: Order;
765
+ };
766
+ export type ExtendAdmissionBatchParams = {
767
+ items?: ExtendAdmissionParams[];
768
+ };
769
+ export type ExtendAdmissionParams = {
770
+ request_id?: string;
771
+ expires_at?: string;
772
+ };
773
+ export type Finding = {
774
+ id: string;
775
+ finding_type: string;
776
+ provider: string | null;
777
+ psp_id: string | null;
778
+ resource_type: string | null;
779
+ resource_id: string | null;
780
+ external_resource_id: string | null;
781
+ field: string | null;
782
+ openrails_value: string | null;
783
+ external_value: string | null;
784
+ subject_key: string;
785
+ severity: string;
786
+ status: string;
787
+ recommended_action: string | null;
788
+ evidence: Record<string, unknown> | null;
789
+ recommendation: FindingRecommendation | null;
790
+ last_seen_at: string;
791
+ resolved_at: string | null;
792
+ resolution: string | null;
793
+ resolved_by: string | null;
794
+ operator_notes: string | null;
795
+ created_at: string;
796
+ updated_at: string;
797
+ };
798
+ export type FindingRecommendation = {
799
+ action: string;
800
+ params: Record<string, unknown> | null;
801
+ alternatives: FindingRecommendation[];
802
+ };
803
+ export type FindingResolution = {
804
+ finding: Finding;
805
+ execution: Record<string, unknown> | null;
806
+ };
807
+ export type FlatPrice = {
808
+ amount?: string;
809
+ };
174
810
  export type Health = {
175
811
  status: "ok" | "ready";
176
812
  };
813
+ export type HeldEntitlements = {
814
+ keys: string[];
815
+ truncated: boolean;
816
+ };
817
+ export type HostEvent = {
818
+ id: string;
819
+ merchant_id: string;
820
+ type: "balance.depleted" | "balance.low" | "customer.network_linked" | "customer.network_unlinked" | "delinquency.cleared" | "delinquency.entered" | "delinquency.grace" | "mandate.revoked" | "order.canceled" | "order.completed" | "order.expired" | "order.payment_failed" | "order.requires_action" | "order.voided" | "payment.settled" | "product.entitlements_changed";
821
+ occurred_at: string;
822
+ acknowledged_at: string | null;
823
+ payment: PaymentSettledEvent | null;
824
+ delinquency: DelinquencyHostEvent | null;
825
+ product_entitlements: ProductEntitlementsChangedEvent | null;
826
+ order: OrderHostEvent | null;
827
+ customer_network: CustomerNetworkHostEvent | null;
828
+ mandate: MandateHostEvent | null;
829
+ balance: BalanceHostEvent | null;
830
+ };
831
+ export type HostEventLookup = {
832
+ host_events: Record<string, HostEvent | null> | null;
833
+ };
177
834
  export type InvoiceContact = {
178
835
  name: string;
179
836
  email: string;
180
837
  };
838
+ export type InvoiceProfile = {
839
+ net_terms_days: number;
840
+ collection_method: "charge_automatically" | "send_invoice";
841
+ po_number: string;
842
+ tax: Record<string, unknown> | null;
843
+ billing_contacts: InvoiceContact[];
844
+ memo: string;
845
+ };
181
846
  export type Mandate = {
182
847
  id: string;
183
848
  customer_id: string;
@@ -197,11 +862,177 @@ export type Mandate = {
197
862
  accepted_at: string;
198
863
  created_at: string;
199
864
  };
865
+ export type MandateHostEvent = {
866
+ mandate_id: string;
867
+ kind: "card_on_file" | "recurring" | "unscheduled";
868
+ customer_id: string;
869
+ currency: string;
870
+ subscription_id: string | null;
871
+ revoked_at: string;
872
+ };
873
+ export type Matrix = {
874
+ dimension: string;
875
+ cells: Record<string, MatrixCell> | null;
876
+ };
877
+ export type MatrixCell = {
878
+ unit_amount: string;
879
+ maximum_amount?: string;
880
+ };
881
+ export type MerchantCheckoutSettings = {
882
+ embed_origins?: string[];
883
+ };
884
+ export type MerchantConfigurationState = {
885
+ revision: number;
886
+ display_name: string;
887
+ settings: MerchantSettings;
888
+ };
889
+ export type MerchantProfile = {
890
+ logo_url?: string;
891
+ from_email?: string;
892
+ support_url?: string;
893
+ signup_url?: string;
894
+ billing_url?: string;
895
+ };
896
+ export type MerchantSettings = {
897
+ profile?: MerchantProfile;
898
+ collection_threshold?: string;
899
+ monthly_floor?: string;
900
+ billing_period_boundary?: string;
901
+ alert_email?: string;
902
+ reprice_notice_window_days?: number;
903
+ provider_refund_access?: string;
904
+ arrears_grace_days?: number;
905
+ arrears_delinquency_floor?: string;
906
+ checkout_routing?: CheckoutRoutingRule[];
907
+ dunning_policy?: DunningPolicy;
908
+ checkout?: MerchantCheckoutSettings;
909
+ billing_policies?: BillingPolicy[];
910
+ billing_policy_bindings?: BillingPolicyBinding[];
911
+ delegated_invoker_wasted_spend_limits?: BudgetWindow[];
912
+ };
913
+ export type Meter = {
914
+ key: string;
915
+ event_type: string;
916
+ value_property: string;
917
+ aggregation: "count" | "latest" | "max" | "min" | "sum" | "unique_count";
918
+ unit: string;
919
+ group_by: Record<string, string> | null;
920
+ billing_supported: boolean;
921
+ rate_card: MeterRateCard | null;
922
+ revision: number;
923
+ has_activity: boolean;
924
+ last_event_at: string | null;
925
+ created_at: string;
926
+ updated_at: string;
927
+ };
928
+ export type MeterRateCard = {
929
+ product_id: string;
930
+ product_key: string;
931
+ filter: Record<string, string[]> | null;
932
+ price: RatePrice;
933
+ allowance: Allowance | null;
934
+ created_at: string;
935
+ updated_at: string;
936
+ };
937
+ export type MeterRateCardParams = {
938
+ product_id?: string;
939
+ filter?: Record<string, string[]>;
940
+ price?: RatePrice;
941
+ allowance?: Allowance;
942
+ };
943
+ export type MetricsColumn = {
944
+ name: string;
945
+ kind: string;
946
+ unit?: string;
947
+ };
948
+ export type MetricsDimension = {
949
+ name: string;
950
+ description: string;
951
+ values?: string[];
952
+ };
953
+ export type MetricsExample = {
954
+ intent: string;
955
+ query: MetricsQuery;
956
+ };
957
+ export type MetricsLimits = {
958
+ max_buckets: number;
959
+ max_limit: number;
960
+ };
961
+ export type MetricsMeasure = {
962
+ name: string;
963
+ class: string;
964
+ unit: string;
965
+ description: string;
966
+ formula: string;
967
+ dims: string[];
968
+ money?: boolean;
969
+ };
970
+ export type MetricsOrder = {
971
+ measure?: string;
972
+ dimension?: string;
973
+ dir?: string;
974
+ };
975
+ export type MetricsQuery = {
976
+ measures: string[];
977
+ by: string[];
978
+ grain: string;
979
+ range: MetricsRange | null;
980
+ filters: Record<string, string[]> | null;
981
+ order: MetricsOrder[];
982
+ limit: number | null;
983
+ compare: string;
984
+ };
985
+ export type MetricsRange = {
986
+ from?: string;
987
+ to?: string;
988
+ last?: string;
989
+ };
990
+ export type MetricsResult = {
991
+ grain?: string;
992
+ range: MetricsResultRange;
993
+ columns: MetricsColumn[];
994
+ rows: unknown[][];
995
+ compare_range?: MetricsResultRange;
996
+ compare_rows?: unknown[][];
997
+ };
998
+ export type MetricsResultRange = {
999
+ from: string;
1000
+ to: string;
1001
+ };
1002
+ export type MetricsSchema = {
1003
+ measures: MetricsMeasure[];
1004
+ dimensions: MetricsDimension[];
1005
+ grains: string[];
1006
+ deferred: string[];
1007
+ caveats: string[];
1008
+ examples: MetricsExample[];
1009
+ limits: MetricsLimits;
1010
+ query_shape: string;
1011
+ };
1012
+ export type NetworkLink = {
1013
+ link: CustomerLink;
1014
+ merchant: PublicMerchant;
1015
+ };
200
1016
  export type NetworkLinkChallenge = {
201
1017
  id: string;
202
1018
  nonce: string;
203
1019
  expires_at: string;
204
1020
  };
1021
+ export type NetworkOrder = {
1022
+ link_id: string;
1023
+ merchant_id: string;
1024
+ order: Order;
1025
+ };
1026
+ export type NetworkSubscription = {
1027
+ link_id: string;
1028
+ merchant_id: string;
1029
+ subscription: Subscription;
1030
+ };
1031
+ export type NewPriceDraft = {
1032
+ product_key: string;
1033
+ review_text: string;
1034
+ create_price: CreatePriceParams;
1035
+ };
205
1036
  export type NextAction = {
206
1037
  type: string;
207
1038
  url: string | null;
@@ -209,6 +1040,19 @@ export type NextAction = {
209
1040
  psp_id: string | null;
210
1041
  payload: Record<string, string> | null;
211
1042
  };
1043
+ export type NotificationEvent = {
1044
+ id: string;
1045
+ merchant_id: string;
1046
+ customer_id: string;
1047
+ event_type: string;
1048
+ data: unknown | null;
1049
+ created_at: string;
1050
+ action_requested?: boolean;
1051
+ optional?: boolean;
1052
+ };
1053
+ export type NotificationEvents = {
1054
+ data: NotificationEvent[];
1055
+ };
212
1056
  export type Order = {
213
1057
  id: string;
214
1058
  customer_id: string;
@@ -239,6 +1083,23 @@ export type OrderCheckout = {
239
1083
  cancel_url: string | null;
240
1084
  saved_payment_methods: boolean;
241
1085
  };
1086
+ export type OrderCheckoutParams = {
1087
+ ui_mode?: "embedded" | "hosted";
1088
+ success_url?: string;
1089
+ cancel_url?: string;
1090
+ expires_at?: string;
1091
+ saved_payment_methods?: boolean;
1092
+ };
1093
+ export type OrderHostEvent = {
1094
+ order_id: string;
1095
+ customer_id: string;
1096
+ status: "canceled" | "complete" | "expired" | "open" | "processing" | "uncollectible" | "void";
1097
+ payment_status: "processing" | "requires_action" | "requires_payment_method" | "succeeded";
1098
+ total: string;
1099
+ currency: string;
1100
+ number: string | null;
1101
+ payment_id: string | null;
1102
+ };
242
1103
  export type OrderLine = {
243
1104
  id: string;
244
1105
  price_id: string | null;
@@ -323,6 +1184,24 @@ export type OrderUsage = {
323
1184
  billing_contacts: InvoiceContact[];
324
1185
  delinquent: boolean;
325
1186
  };
1187
+ export type PSP = {
1188
+ id: string;
1189
+ key: string;
1190
+ rail: "ccbill" | "nmi" | "solana" | "stripe";
1191
+ environment: string;
1192
+ account_id: string;
1193
+ archived: boolean;
1194
+ open_obligations: number;
1195
+ settings: Record<string, unknown> | null;
1196
+ credentials: Record<string, PSPCredential> | null;
1197
+ revision: number;
1198
+ created_at: string;
1199
+ updated_at: string;
1200
+ };
1201
+ export type PSPCredential = {
1202
+ configured: boolean;
1203
+ validated_at: string | null;
1204
+ };
326
1205
  export type PSPLinkState = {
327
1206
  status: "error" | "linked" | "pending_manual_link" | "sync_disabled";
328
1207
  ids: Record<string, string> | null;
@@ -343,6 +1222,32 @@ export type PSPPaymentConfig = {
343
1222
  status?: string;
344
1223
  retry_after?: number;
345
1224
  };
1225
+ export type PSPRef = {
1226
+ id?: string;
1227
+ key?: string;
1228
+ };
1229
+ export type PSPRefresh = {
1230
+ status: string;
1231
+ job_id: string;
1232
+ };
1233
+ export type PSPRoutingCandidate = {
1234
+ psp: string;
1235
+ rail: "ccbill" | "nmi" | "solana" | "stripe";
1236
+ skip: string | null;
1237
+ };
1238
+ export type PSPRoutingPreview = {
1239
+ policy: string;
1240
+ rule: number | null;
1241
+ psp: string | null;
1242
+ rail: "ccbill" | "nmi" | "solana" | "stripe" | null;
1243
+ mode: string | null;
1244
+ candidates: PSPRoutingCandidate[];
1245
+ };
1246
+ export type PackagePrice = {
1247
+ amount?: string;
1248
+ package_size?: number;
1249
+ free_units?: number;
1250
+ };
346
1251
  export type PayOrderParams = {
347
1252
  payment?: OrderPaymentParams;
348
1253
  expected_total?: string;
@@ -373,6 +1278,41 @@ export type Payment = {
373
1278
  refunds: Payment[];
374
1279
  created_at: string;
375
1280
  };
1281
+ export type PaymentAttempt = {
1282
+ id: string;
1283
+ kind: string;
1284
+ owner: string;
1285
+ card_entry: string;
1286
+ source: string;
1287
+ observed_via: string;
1288
+ category: string;
1289
+ reason: "authentication_required" | "blocked_by_psp" | "call_issuer" | "card_not_supported" | "communication_error" | "currency_not_supported" | "do_not_honor" | "duplicate_transaction" | "expired_card" | "fraudulent" | "gateway_rejected" | "generic_decline" | "incorrect_address" | "incorrect_cvc" | "incorrect_number" | "incorrect_zip" | "insufficient_funds" | "invalid_account" | "invalid_expiry" | "invalid_pin" | "invalid_request" | "issuer_unavailable" | "lost_card" | "merchant_config" | "no_such_issuer" | "over_limit" | "pickup_card" | "processing_error" | "restricted_card" | "retry_later" | "security_violation" | "stolen_card" | "stop_recurring" | "transaction_not_allowed" | "try_again_later" | "unknown" | "update_cardholder_data";
1290
+ action: string;
1291
+ response_code: string;
1292
+ response_text: string;
1293
+ issuer_code: string;
1294
+ issuer_text: string;
1295
+ avs_result: string;
1296
+ cvv_result: string;
1297
+ card: CardDetails | null;
1298
+ card_bin: string;
1299
+ token_type: string;
1300
+ transaction_id: string;
1301
+ rail: string;
1302
+ psp_id: string;
1303
+ customer_id: string;
1304
+ amount: string;
1305
+ currency: string;
1306
+ attempted_at: string;
1307
+ order_id: string | null;
1308
+ cycle_id: string | null;
1309
+ subscription_id: string | null;
1310
+ payment_method_id: string | null;
1311
+ payment_id: string | null;
1312
+ enriched_at: string | null;
1313
+ mandate_id: string | null;
1314
+ sent_initial_transaction_id: string;
1315
+ };
376
1316
  export type PaymentConfig = {
377
1317
  psps: PSPPaymentConfig[];
378
1318
  solana: SolanaPaymentConfig | null;
@@ -406,6 +1346,11 @@ export type PaymentMethodHealth = {
406
1346
  last_charge_outcome: "failed" | "succeeded" | null;
407
1347
  active: boolean;
408
1348
  };
1349
+ export type PaymentMethodRef = {
1350
+ rail?: string;
1351
+ rail_customer_ref?: string;
1352
+ rail_method_ref?: string;
1353
+ };
409
1354
  export type PaymentMethodSubscription = {
410
1355
  id: string;
411
1356
  display_name: string;
@@ -417,16 +1362,41 @@ export type PaymentRecovery = {
417
1362
  blocked_reason?: string;
418
1363
  order_id?: string;
419
1364
  };
1365
+ export type PaymentSettledEvent = {
1366
+ payment_id: string;
1367
+ customer_id: string;
1368
+ order_id?: string;
1369
+ price_id?: string;
1370
+ subscription_id?: string;
1371
+ amount: string;
1372
+ currency: string;
1373
+ };
420
1374
  export type PendingAction = {
421
1375
  psp: string;
422
1376
  action: string;
423
1377
  hint: string;
424
1378
  patch_required: Record<string, Record<string, Record<string, string>>> | null;
425
1379
  };
1380
+ export type PerUnitPrice = {
1381
+ unit_amount?: string;
1382
+ divide_by?: number;
1383
+ round?: "down" | "half_up" | "up";
1384
+ maximum_amount?: string;
1385
+ matrix?: Matrix;
1386
+ };
426
1387
  export type PreviewMyOrderParams = {
427
1388
  lines?: OrderLineParams[];
428
1389
  cart?: boolean;
429
1390
  };
1391
+ export type PreviewOrderParams = {
1392
+ customer_id?: string;
1393
+ lines?: OrderLineParams[];
1394
+ };
1395
+ export type PreviewPSPRoutingParams = {
1396
+ price_id?: string;
1397
+ country?: string;
1398
+ psp?: string;
1399
+ };
430
1400
  export type PreviewSubscriptionChangeParams = {
431
1401
  price_id?: string | null;
432
1402
  quantity?: number | null;
@@ -451,6 +1421,65 @@ export type Price = {
451
1421
  created_at: string;
452
1422
  updated_at: string;
453
1423
  };
1424
+ export type PriceChangeDraft = {
1425
+ product_key: string;
1426
+ price_key: string;
1427
+ current_amount: string;
1428
+ new_amount: string;
1429
+ currency: string;
1430
+ affected_count: number;
1431
+ review_text: string;
1432
+ create_price: CreatePriceParams;
1433
+ migration: CreatePriceMigrationParams | null;
1434
+ };
1435
+ export type PriceKeyMovement = {
1436
+ effective_at: string;
1437
+ archived: boolean;
1438
+ price: Price;
1439
+ };
1440
+ export type PriceMigration = {
1441
+ id: string;
1442
+ from_price_id: string | null;
1443
+ product_key: string | null;
1444
+ price_key: string | null;
1445
+ to_price_id: string;
1446
+ effective_at: string;
1447
+ fallback_policy: "cancel_at_period_end" | "keep_grandfathered";
1448
+ matched: number;
1449
+ skipped: number;
1450
+ scheduled: number;
1451
+ applied: number;
1452
+ canceled: number;
1453
+ blocked: number;
1454
+ created_at: string;
1455
+ canceled_at: string | null;
1456
+ };
1457
+ export type PriceMigrationCancel = {
1458
+ price_migration: PriceMigration;
1459
+ canceled: number;
1460
+ rail_release_required: string[];
1461
+ };
1462
+ export type PriceMigrationOutcome = {
1463
+ subscription_id: string;
1464
+ rail: string;
1465
+ disposition: "applied" | "blocked" | "scheduled" | "skipped";
1466
+ reason: string | null;
1467
+ };
1468
+ export type PriceMigrationPreview = {
1469
+ to_price_id: string | null;
1470
+ effective_at: string;
1471
+ matched: number;
1472
+ scheduled: number;
1473
+ skipped: number;
1474
+ blocked: number;
1475
+ by_rail: Record<string, PriceMigrationRailCounts | null> | null;
1476
+ outcomes: PriceMigrationOutcome[];
1477
+ };
1478
+ export type PriceMigrationRailCounts = {
1479
+ auto: number;
1480
+ requires_action: number;
1481
+ skipped: number;
1482
+ };
454
1483
  export type Product = {
455
1484
  revision: number;
456
1485
  id: string;
@@ -467,6 +1496,34 @@ export type Product = {
467
1496
  created_at: string;
468
1497
  updated_at: string;
469
1498
  };
1499
+ export type ProductAccessGrant = {
1500
+ id: string;
1501
+ customer_id: string;
1502
+ product_id: string;
1503
+ product_key: string;
1504
+ product_name: string;
1505
+ source_type: "grace" | "grant" | "purchase" | "subscription";
1506
+ source_id: string;
1507
+ payment_id: string | null;
1508
+ quantity: number | null;
1509
+ grant_reason: "comp" | "import" | "migration" | "staff" | null;
1510
+ granted_by: string | null;
1511
+ note: string | null;
1512
+ status: string;
1513
+ starts_at: string;
1514
+ ends_at: string | null;
1515
+ revoked_at: string | null;
1516
+ revoke_reason: string | null;
1517
+ created_at: string;
1518
+ updated_at: string;
1519
+ };
1520
+ export type ProductEntitlementsChangedEvent = {
1521
+ product_id: string;
1522
+ product_key: string;
1523
+ added: string[];
1524
+ removed: string[];
1525
+ holders: number;
1526
+ };
470
1527
  export type ProductSummary = {
471
1528
  id: string;
472
1529
  key: string;
@@ -476,6 +1533,13 @@ export type ProductSummary = {
476
1533
  tier_rank: number;
477
1534
  archived: boolean;
478
1535
  };
1536
+ export type ProvisioningToken = {
1537
+ id: string;
1538
+ name: string;
1539
+ declared: boolean;
1540
+ created_at: string;
1541
+ last_used_at: string | null;
1542
+ };
479
1543
  export type PublicConfig = {
480
1544
  capabilities: Capabilities;
481
1545
  currencies: CurrencyUnits[];
@@ -503,9 +1567,114 @@ export type RailDefinition = {
503
1567
  credential_keys: string[];
504
1568
  setting_keys: string[];
505
1569
  };
1570
+ export type RateCard = {
1571
+ ordinal?: number;
1572
+ meter?: string;
1573
+ filter?: Record<string, string[]>;
1574
+ allowance?: Allowance;
1575
+ payment_term?: "in_advance" | "in_arrears";
1576
+ price?: RatePrice;
1577
+ };
1578
+ export type RatePrice = {
1579
+ model: "dynamic" | "flat" | "package" | "per_unit" | "tiered";
1580
+ currency?: string;
1581
+ flat?: FlatPrice;
1582
+ per_unit?: PerUnitPrice;
1583
+ tiered?: TieredPrice;
1584
+ package?: PackagePrice;
1585
+ };
1586
+ export type RateTier = {
1587
+ up_to: number | null;
1588
+ unit_amount?: string;
1589
+ flat_amount?: string;
1590
+ };
1591
+ export type RecordExternalPaymentParams = {
1592
+ order_id?: string;
1593
+ amount?: string;
1594
+ transaction_id?: string;
1595
+ paid_at?: string;
1596
+ };
1597
+ export type RecordUsageBatchParams = {
1598
+ items?: RecordUsageParams[];
1599
+ };
1600
+ export type RecordUsageBatchResult = {
1601
+ items: UsageEventResult[];
1602
+ };
1603
+ export type RecordUsageParams = {
1604
+ customer_id?: string;
1605
+ invoker?: string;
1606
+ invoker_type?: "customer" | "delegated";
1607
+ currency?: string;
1608
+ event_type?: string;
1609
+ dimensions?: Record<string, number>;
1610
+ amount?: string;
1611
+ outcome?: "failed" | "succeeded";
1612
+ resource?: string;
1613
+ metadata?: Record<string, unknown>;
1614
+ source?: string;
1615
+ source_id?: string;
1616
+ occurred_at?: string;
1617
+ };
1618
+ export type RefundPaymentParams = {
1619
+ amount?: string;
1620
+ full?: boolean;
1621
+ reason?: string;
1622
+ revoke_access?: boolean;
1623
+ };
1624
+ export type ReleaseAdmissionBatchParams = {
1625
+ request_ids?: string[];
1626
+ };
1627
+ export type Renewal = {
1628
+ id: string;
1629
+ subscription_id: string;
1630
+ customer_id: string;
1631
+ psp_id: string;
1632
+ rail: string;
1633
+ owner: string;
1634
+ due_at: string;
1635
+ amount: string;
1636
+ currency: string;
1637
+ first_outcome: string;
1638
+ outcome: string;
1639
+ missed_at: string | null;
1640
+ miss_reason: string;
1641
+ collected_at: string | null;
1642
+ recovered_by: string;
1643
+ closes_at: string;
1644
+ attempts: PaymentAttempt[];
1645
+ };
1646
+ export type ResolveFindingParams = {
1647
+ outcome?: "approve" | "ignore";
1648
+ notes?: string;
1649
+ override_params?: unknown;
1650
+ };
506
1651
  export type RetrySubscriptionNowParams = {
507
1652
  payment_method_id?: string;
508
1653
  };
1654
+ export type RevokeCreditGrantParams = {
1655
+ reason?: string;
1656
+ };
1657
+ export type RevokeProductAccessParams = {
1658
+ reason?: string;
1659
+ };
1660
+ export type RunningCharge = {
1661
+ id: string;
1662
+ reference: string;
1663
+ customer_id: string;
1664
+ currency: string;
1665
+ rate_per_hour: string;
1666
+ state: "running" | "stopped";
1667
+ started_at: string;
1668
+ stopped_at: string | null;
1669
+ charged_amount: string;
1670
+ posted_amount: string;
1671
+ as_of: string;
1672
+ overdraft_amount: string;
1673
+ low_balance_amount: string;
1674
+ resource: string | null;
1675
+ created_at: string;
1676
+ updated_at: string;
1677
+ };
509
1678
  export type ScheduledChange = {
510
1679
  price_id: string;
511
1680
  quantity: number | null;
@@ -520,9 +1689,21 @@ export type SetCartLineParams = {
520
1689
  quantity?: number;
521
1690
  amount?: string;
522
1691
  };
1692
+ export type SetDashboardParams = {
1693
+ widgets?: DashboardWidget[];
1694
+ };
523
1695
  export type SetDefaultPaymentMethodParams = {
524
1696
  payment_method_id?: string;
525
1697
  };
1698
+ export type SetMeterParams = {
1699
+ event_type?: string;
1700
+ value_property?: string;
1701
+ aggregation?: "count" | "latest" | "max" | "min" | "sum" | "unique_count";
1702
+ unit?: string;
1703
+ group_by?: Record<string, string>;
1704
+ rate_card?: MeterRateCardParams | null;
1705
+ expected_revision?: number;
1706
+ };
526
1707
  export type SetSubscriptionPaymentMethodParams = {
527
1708
  payment_method_id?: string | null;
528
1709
  };
@@ -531,7 +1712,7 @@ export type SolanaPayGetResponse = {
531
1712
  icon: string;
532
1713
  };
533
1714
  export type SolanaPayPostRequest = {
534
- account?: string;
1715
+ account: string;
535
1716
  };
536
1717
  export type SolanaPayPostResponse = {
537
1718
  transaction: string;
@@ -551,6 +1732,20 @@ export type SolanaPaymentToken = {
551
1732
  preferred: boolean;
552
1733
  recurring_eligible: boolean;
553
1734
  };
1735
+ export type StartRunningChargeParams = {
1736
+ reference?: string;
1737
+ customer_id?: string;
1738
+ currency?: string;
1739
+ rate_per_hour?: string;
1740
+ started_at?: string;
1741
+ minimum_amount?: string;
1742
+ overdraft_amount?: string;
1743
+ low_balance_amount?: string;
1744
+ resource?: string;
1745
+ };
1746
+ export type StopRunningChargeParams = {
1747
+ stopped_at?: string;
1748
+ };
554
1749
  export type StripePortalSession = {
555
1750
  url: string;
556
1751
  };
@@ -641,12 +1836,61 @@ export type SubscriptionRetryNowResult = {
641
1836
  status: string;
642
1837
  replayed: boolean;
643
1838
  };
1839
+ export type TieredPrice = {
1840
+ mode?: "graduated" | "volume";
1841
+ tiers?: RateTier[];
1842
+ };
1843
+ export type TrustLevel = {
1844
+ currency: string;
1845
+ trust_level: string;
1846
+ };
1847
+ export type UpdateAlertWebhookParams = {
1848
+ name?: string | null;
1849
+ url?: string | null;
1850
+ format?: "discord" | "generic" | "slack" | null;
1851
+ enabled?: boolean | null;
1852
+ };
1853
+ export type UpdateCustomerParams = {
1854
+ credit_limits?: CreditLimit[];
1855
+ trust_levels?: TrustLevel[];
1856
+ billing_policy?: string | null;
1857
+ invoice_profile?: InvoiceProfile | null;
1858
+ };
1859
+ export type UpdateMerchantConfigurationParams = {
1860
+ expected_revision?: number | null;
1861
+ settings?: MerchantSettings;
1862
+ display_name?: string;
1863
+ };
1864
+ export type UpdatePSPParams = {
1865
+ expected_revision?: number | null;
1866
+ settings?: Record<string, unknown> | null;
1867
+ credentials?: Record<string, string> | null;
1868
+ retire_webhook_overlap?: boolean;
1869
+ archived?: boolean;
1870
+ allow_last?: boolean;
1871
+ };
644
1872
  export type UpdatePaymentMethodParams = {
645
1873
  exp_month?: number;
646
1874
  exp_year?: number;
647
1875
  billing_details?: BillingDetails;
648
1876
  reusable?: boolean;
649
1877
  };
1878
+ export type UpdatePriceParams = {
1879
+ archived?: boolean | null;
1880
+ psp_links?: Record<string, Record<string, string>>;
1881
+ expected_revision?: number;
1882
+ };
1883
+ export type UpdateProductParams = {
1884
+ display_name?: string | null;
1885
+ description?: string | null;
1886
+ entitlements?: string[];
1887
+ credit_grant?: CreditGrantSpec | null;
1888
+ tier_group?: string | null;
1889
+ tier_rank?: number | null;
1890
+ ownership?: "consumable" | "extend" | "unique" | null;
1891
+ archived?: boolean | null;
1892
+ expected_revision?: number;
1893
+ };
650
1894
  export type Usage = {
651
1895
  customer_id: string;
652
1896
  currency: string;
@@ -656,6 +1900,44 @@ export type Usage = {
656
1900
  rows: UsageRow[];
657
1901
  next_cursor: string | null;
658
1902
  };
1903
+ export type UsageCharge = {
1904
+ meter_key: string;
1905
+ model: "dynamic" | "flat" | "package" | "per_unit" | "tiered";
1906
+ cell: string | null;
1907
+ quantity: number;
1908
+ amount: string;
1909
+ };
1910
+ export type UsageEstimate = {
1911
+ amount?: string;
1912
+ event_type?: string;
1913
+ dimensions?: Record<string, number>;
1914
+ metadata?: Record<string, unknown>;
1915
+ };
1916
+ export type UsageEvent = {
1917
+ id: string;
1918
+ customer_id: string;
1919
+ invoker: string;
1920
+ currency: string;
1921
+ event_type: string;
1922
+ dimensions: Record<string, number> | null;
1923
+ outcome: "failed" | "succeeded";
1924
+ amount: string;
1925
+ forgiven_amount: string;
1926
+ resource: string | null;
1927
+ metadata: Record<string, unknown> | null;
1928
+ source: string;
1929
+ source_id: string;
1930
+ charges: UsageCharge[];
1931
+ balance_transaction_id: string | null;
1932
+ occurred_at: string;
1933
+ created_at: string;
1934
+ replayed: boolean;
1935
+ };
1936
+ export type UsageEventResult = {
1937
+ status: number;
1938
+ event: UsageEvent | null;
1939
+ error: ErrorDetails | null;
1940
+ };
659
1941
  export type UsageRow = {
660
1942
  key: string;
661
1943
  cell: string | null;
@@ -664,3 +1946,7 @@ export type UsageRow = {
664
1946
  quantity: number | null;
665
1947
  dimensions: Record<string, number> | null;
666
1948
  };
1949
+ export type WebhookReceipt = {
1950
+ status: string;
1951
+ code: string | null;
1952
+ };