@flexprice/sdk 2.1.24 → 2.1.26

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 (231) hide show
  1. package/docs/sdk/models/billing-period-behaviour.md +17 -0
  2. package/docs/sdk/models/billing-period-config.md +18 -0
  3. package/docs/sdk/models/create-entitlement-request.md +22 -21
  4. package/docs/sdk/models/create-entity-integration-mapping-request.md +1 -1
  5. package/docs/sdk/models/credit-grant-application-response.md +1 -1
  6. package/docs/sdk/models/entitlement-grant-allocation-behavior.md +17 -0
  7. package/docs/sdk/models/entitlement-grant-duration-unit.md +1 -1
  8. package/docs/sdk/models/entitlement-response.md +34 -33
  9. package/docs/sdk/models/entity-change-behaviour.md +2 -2
  10. package/docs/sdk/models/entity-change-policy.md +4 -4
  11. package/docs/sdk/models/entity-change-result.md +6 -6
  12. package/docs/sdk/models/integration-entity-type.md +2 -2
  13. package/docs/sdk/models/invoice-sync-settings.md +6 -3
  14. package/docs/sdk/models/link-integration-mapping-request.md +1 -1
  15. package/docs/sdk/models/list-usage-records-response.md +16 -0
  16. package/docs/sdk/models/metadata-custom-field-source.md +17 -0
  17. package/docs/sdk/models/metadata-custom-field.md +17 -0
  18. package/docs/sdk/models/on-pending-schedule-policy.md +15 -0
  19. package/docs/sdk/models/plan-price-sync-status-response.md +17 -0
  20. package/docs/sdk/models/plan-response.md +1 -0
  21. package/docs/sdk/models/price-feature-response.md +15 -0
  22. package/docs/sdk/models/price-response.md +1 -0
  23. package/docs/sdk/models/service-period-custom-fields.md +16 -0
  24. package/docs/sdk/models/subscription-change-billing-period-result.md +18 -0
  25. package/docs/sdk/models/subscription-change-conflict-policies.md +15 -0
  26. package/docs/sdk/models/subscription-change-entity-type.md +17 -0
  27. package/docs/sdk/models/subscription-change-v2-request.md +11 -7
  28. package/docs/sdk/models/subscription-change-v2-response.md +16 -11
  29. package/docs/sdk/models/update-entitlement-request.md +1 -0
  30. package/docs/sdk/models/usage-record-filter-order.md +15 -0
  31. package/docs/sdk/models/usage-record-filter.md +31 -0
  32. package/docs/sdk/models/usage-record-response.md +33 -0
  33. package/docs/sdk/models/usage-record-sync-entry.md +20 -0
  34. package/docs/sdks/costs/README.md +0 -72
  35. package/docs/sdks/integrations/README.md +4 -4
  36. package/docs/sdks/prices/README.md +1 -1
  37. package/docs/sdks/subscriptions/README.md +8 -0
  38. package/docs/sdks/usagerecords/README.md +78 -0
  39. package/esm/funcs/prices-get-price-by-lookup-key.js +1 -1
  40. package/esm/funcs/prices-get-price-by-lookup-key.js.map +1 -1
  41. package/esm/funcs/subscriptions-execute-subscription-plan-change-v2.d.ts +8 -0
  42. package/esm/funcs/subscriptions-execute-subscription-plan-change-v2.d.ts.map +1 -1
  43. package/esm/funcs/subscriptions-execute-subscription-plan-change-v2.js +8 -0
  44. package/esm/funcs/subscriptions-execute-subscription-plan-change-v2.js.map +1 -1
  45. package/esm/funcs/usage-records-post-usage-records-search.d.ts +17 -0
  46. package/esm/funcs/usage-records-post-usage-records-search.d.ts.map +1 -0
  47. package/esm/funcs/{costs-get-detailed-cost-analytics-v2.js → usage-records-post-usage-records-search.js} +8 -8
  48. package/esm/funcs/usage-records-post-usage-records-search.js.map +1 -0
  49. package/esm/lib/config.d.ts +3 -3
  50. package/esm/lib/config.js +3 -3
  51. package/esm/sdk/costs.d.ts +0 -7
  52. package/esm/sdk/costs.d.ts.map +1 -1
  53. package/esm/sdk/costs.js +0 -10
  54. package/esm/sdk/costs.js.map +1 -1
  55. package/esm/sdk/models/billing-period-behaviour.d.ts +13 -0
  56. package/esm/sdk/models/billing-period-behaviour.d.ts.map +1 -0
  57. package/esm/sdk/models/billing-period-behaviour.js +14 -0
  58. package/esm/sdk/models/billing-period-behaviour.js.map +1 -0
  59. package/esm/sdk/models/billing-period-config.d.ts +20 -0
  60. package/esm/sdk/models/billing-period-config.d.ts.map +1 -0
  61. package/esm/sdk/models/billing-period-config.js +25 -0
  62. package/esm/sdk/models/billing-period-config.js.map +1 -0
  63. package/esm/sdk/models/create-entitlement-request.d.ts +3 -0
  64. package/esm/sdk/models/create-entitlement-request.d.ts.map +1 -1
  65. package/esm/sdk/models/create-entitlement-request.js +3 -0
  66. package/esm/sdk/models/create-entitlement-request.js.map +1 -1
  67. package/esm/sdk/models/credit-grant-application-response.d.ts +1 -1
  68. package/esm/sdk/models/credit-grant-application-response.js +1 -1
  69. package/esm/sdk/models/entitlement-grant-allocation-behavior.d.ts +12 -0
  70. package/esm/sdk/models/entitlement-grant-allocation-behavior.d.ts.map +1 -0
  71. package/esm/sdk/models/entitlement-grant-allocation-behavior.js +13 -0
  72. package/esm/sdk/models/entitlement-grant-allocation-behavior.js.map +1 -0
  73. package/esm/sdk/models/entitlement-grant-duration-unit.d.ts +1 -0
  74. package/esm/sdk/models/entitlement-grant-duration-unit.d.ts.map +1 -1
  75. package/esm/sdk/models/entitlement-grant-duration-unit.js +1 -0
  76. package/esm/sdk/models/entitlement-grant-duration-unit.js.map +1 -1
  77. package/esm/sdk/models/entitlement-response.d.ts +3 -1
  78. package/esm/sdk/models/entitlement-response.d.ts.map +1 -1
  79. package/esm/sdk/models/entitlement-response.js +4 -1
  80. package/esm/sdk/models/entitlement-response.js.map +1 -1
  81. package/esm/sdk/models/entity-change-behaviour.d.ts +1 -0
  82. package/esm/sdk/models/entity-change-behaviour.d.ts.map +1 -1
  83. package/esm/sdk/models/entity-change-behaviour.js +1 -0
  84. package/esm/sdk/models/entity-change-behaviour.js.map +1 -1
  85. package/esm/sdk/models/entity-change-policy.d.ts +3 -0
  86. package/esm/sdk/models/entity-change-policy.d.ts.map +1 -1
  87. package/esm/sdk/models/entity-change-policy.js.map +1 -1
  88. package/esm/sdk/models/entity-change-result.d.ts +2 -2
  89. package/esm/sdk/models/entity-change-result.d.ts.map +1 -1
  90. package/esm/sdk/models/entity-change-result.js +2 -2
  91. package/esm/sdk/models/entity-change-result.js.map +1 -1
  92. package/esm/sdk/models/index.d.ts +16 -0
  93. package/esm/sdk/models/index.d.ts.map +1 -1
  94. package/esm/sdk/models/index.js +16 -0
  95. package/esm/sdk/models/index.js.map +1 -1
  96. package/esm/sdk/models/integration-entity-type.d.ts +1 -0
  97. package/esm/sdk/models/integration-entity-type.d.ts.map +1 -1
  98. package/esm/sdk/models/integration-entity-type.js +1 -0
  99. package/esm/sdk/models/integration-entity-type.js.map +1 -1
  100. package/esm/sdk/models/invoice-sync-settings.d.ts +19 -0
  101. package/esm/sdk/models/invoice-sync-settings.d.ts.map +1 -1
  102. package/esm/sdk/models/invoice-sync-settings.js +8 -0
  103. package/esm/sdk/models/invoice-sync-settings.js.map +1 -1
  104. package/esm/sdk/models/list-usage-records-response.d.ts +13 -0
  105. package/esm/sdk/models/list-usage-records-response.d.ts.map +1 -0
  106. package/esm/sdk/models/list-usage-records-response.js +17 -0
  107. package/esm/sdk/models/list-usage-records-response.js.map +1 -0
  108. package/esm/sdk/models/metadata-custom-field-source.d.ts +10 -0
  109. package/esm/sdk/models/metadata-custom-field-source.d.ts.map +1 -0
  110. package/esm/sdk/models/metadata-custom-field-source.js +11 -0
  111. package/esm/sdk/models/metadata-custom-field-source.js.map +1 -0
  112. package/esm/sdk/models/metadata-custom-field.d.ts +13 -0
  113. package/esm/sdk/models/metadata-custom-field.d.ts.map +1 -0
  114. package/esm/sdk/models/metadata-custom-field.js +22 -0
  115. package/esm/sdk/models/metadata-custom-field.js.map +1 -0
  116. package/esm/sdk/models/on-pending-schedule-policy.d.ts +10 -0
  117. package/esm/sdk/models/on-pending-schedule-policy.d.ts.map +1 -0
  118. package/esm/sdk/models/on-pending-schedule-policy.js +11 -0
  119. package/esm/sdk/models/on-pending-schedule-policy.js.map +1 -0
  120. package/esm/sdk/models/plan-price-sync-status-response.d.ts +12 -0
  121. package/esm/sdk/models/plan-price-sync-status-response.d.ts.map +1 -0
  122. package/esm/sdk/models/plan-price-sync-status-response.js +22 -0
  123. package/esm/sdk/models/plan-price-sync-status-response.js.map +1 -0
  124. package/esm/sdk/models/plan-response.d.ts +2 -0
  125. package/esm/sdk/models/plan-response.d.ts.map +1 -1
  126. package/esm/sdk/models/plan-response.js +3 -0
  127. package/esm/sdk/models/plan-response.js.map +1 -1
  128. package/esm/sdk/models/price-feature-response.d.ts +11 -0
  129. package/esm/sdk/models/price-feature-response.d.ts.map +1 -0
  130. package/esm/sdk/models/price-feature-response.js +20 -0
  131. package/esm/sdk/models/price-feature-response.js.map +1 -0
  132. package/esm/sdk/models/price-response.d.ts +2 -0
  133. package/esm/sdk/models/price-response.d.ts.map +1 -1
  134. package/esm/sdk/models/price-response.js +2 -0
  135. package/esm/sdk/models/price-response.js.map +1 -1
  136. package/esm/sdk/models/service-period-custom-fields.d.ts +11 -0
  137. package/esm/sdk/models/service-period-custom-fields.d.ts.map +1 -0
  138. package/esm/sdk/models/service-period-custom-fields.js +21 -0
  139. package/esm/sdk/models/service-period-custom-fields.js.map +1 -0
  140. package/esm/sdk/models/subscription-change-billing-period-result.d.ts +14 -0
  141. package/esm/sdk/models/subscription-change-billing-period-result.d.ts.map +1 -0
  142. package/esm/sdk/models/subscription-change-billing-period-result.js +25 -0
  143. package/esm/sdk/models/subscription-change-billing-period-result.js.map +1 -0
  144. package/esm/sdk/models/subscription-change-conflict-policies.d.ts +13 -0
  145. package/esm/sdk/models/subscription-change-conflict-policies.d.ts.map +1 -0
  146. package/esm/sdk/models/subscription-change-conflict-policies.js +18 -0
  147. package/esm/sdk/models/subscription-change-conflict-policies.js.map +1 -0
  148. package/esm/sdk/models/subscription-change-entity-type.d.ts +13 -0
  149. package/esm/sdk/models/subscription-change-entity-type.d.ts.map +1 -0
  150. package/esm/sdk/models/subscription-change-entity-type.js +14 -0
  151. package/esm/sdk/models/subscription-change-entity-type.js.map +1 -0
  152. package/esm/sdk/models/subscription-change-v2-request.d.ts +12 -0
  153. package/esm/sdk/models/subscription-change-v2-request.d.ts.map +1 -1
  154. package/esm/sdk/models/subscription-change-v2-request.js +12 -0
  155. package/esm/sdk/models/subscription-change-v2-request.js.map +1 -1
  156. package/esm/sdk/models/subscription-change-v2-response.d.ts +18 -0
  157. package/esm/sdk/models/subscription-change-v2-response.d.ts.map +1 -1
  158. package/esm/sdk/models/subscription-change-v2-response.js +11 -0
  159. package/esm/sdk/models/subscription-change-v2-response.js.map +1 -1
  160. package/esm/sdk/models/update-entitlement-request.d.ts +3 -0
  161. package/esm/sdk/models/update-entitlement-request.d.ts.map +1 -1
  162. package/esm/sdk/models/update-entitlement-request.js +3 -0
  163. package/esm/sdk/models/update-entitlement-request.js.map +1 -1
  164. package/esm/sdk/models/usage-record-filter.d.ts +67 -0
  165. package/esm/sdk/models/usage-record-filter.d.ts.map +1 -0
  166. package/esm/sdk/models/usage-record-filter.js +49 -0
  167. package/esm/sdk/models/usage-record-filter.js.map +1 -0
  168. package/esm/sdk/models/usage-record-response.d.ts +32 -0
  169. package/esm/sdk/models/usage-record-response.d.ts.map +1 -0
  170. package/esm/sdk/models/usage-record-response.js +50 -0
  171. package/esm/sdk/models/usage-record-response.js.map +1 -0
  172. package/esm/sdk/models/usage-record-sync-entry.d.ts +32 -0
  173. package/esm/sdk/models/usage-record-sync-entry.d.ts.map +1 -0
  174. package/esm/sdk/models/usage-record-sync-entry.js +28 -0
  175. package/esm/sdk/models/usage-record-sync-entry.js.map +1 -0
  176. package/esm/sdk/sdk.d.ts +3 -0
  177. package/esm/sdk/sdk.d.ts.map +1 -1
  178. package/esm/sdk/sdk.js +5 -0
  179. package/esm/sdk/sdk.js.map +1 -1
  180. package/esm/sdk/subscriptions.d.ts +8 -0
  181. package/esm/sdk/subscriptions.d.ts.map +1 -1
  182. package/esm/sdk/subscriptions.js +8 -0
  183. package/esm/sdk/subscriptions.js.map +1 -1
  184. package/esm/sdk/usage-records.d.ts +12 -0
  185. package/esm/sdk/usage-records.d.ts.map +1 -0
  186. package/esm/sdk/usage-records.js +18 -0
  187. package/esm/sdk/usage-records.js.map +1 -0
  188. package/jsr.json +1 -1
  189. package/package.json +1 -1
  190. package/src/funcs/prices-get-price-by-lookup-key.ts +1 -1
  191. package/src/funcs/subscriptions-execute-subscription-plan-change-v2.ts +8 -0
  192. package/src/funcs/{costs-get-detailed-cost-analytics-v2.ts → usage-records-post-usage-records-search.ts} +12 -12
  193. package/src/lib/config.ts +3 -3
  194. package/src/sdk/costs.ts +0 -18
  195. package/src/sdk/models/billing-period-behaviour.ts +25 -0
  196. package/src/sdk/models/billing-period-config.ts +57 -0
  197. package/src/sdk/models/create-entitlement-request.ts +10 -0
  198. package/src/sdk/models/credit-grant-application-response.ts +2 -2
  199. package/src/sdk/models/entitlement-grant-allocation-behavior.ts +26 -0
  200. package/src/sdk/models/entitlement-grant-duration-unit.ts +1 -0
  201. package/src/sdk/models/entitlement-response.ts +11 -2
  202. package/src/sdk/models/entity-change-behaviour.ts +1 -0
  203. package/src/sdk/models/entity-change-policy.ts +3 -0
  204. package/src/sdk/models/entity-change-result.ts +5 -5
  205. package/src/sdk/models/index.ts +16 -0
  206. package/src/sdk/models/integration-entity-type.ts +1 -0
  207. package/src/sdk/models/invoice-sync-settings.ts +35 -0
  208. package/src/sdk/models/list-usage-records-response.ts +41 -0
  209. package/src/sdk/models/metadata-custom-field-source.ts +21 -0
  210. package/src/sdk/models/metadata-custom-field.ts +47 -0
  211. package/src/sdk/models/on-pending-schedule-policy.ts +19 -0
  212. package/src/sdk/models/plan-price-sync-status-response.ts +44 -0
  213. package/src/sdk/models/plan-response.ts +9 -0
  214. package/src/sdk/models/price-feature-response.ts +43 -0
  215. package/src/sdk/models/price-response.ts +6 -0
  216. package/src/sdk/models/service-period-custom-fields.ts +42 -0
  217. package/src/sdk/models/subscription-change-billing-period-result.ts +52 -0
  218. package/src/sdk/models/subscription-change-conflict-policies.ts +44 -0
  219. package/src/sdk/models/subscription-change-entity-type.ts +24 -0
  220. package/src/sdk/models/subscription-change-v2-request.ts +35 -0
  221. package/src/sdk/models/subscription-change-v2-response.ts +33 -0
  222. package/src/sdk/models/update-entitlement-request.ts +10 -0
  223. package/src/sdk/models/usage-record-filter.ts +130 -0
  224. package/src/sdk/models/usage-record-response.ts +93 -0
  225. package/src/sdk/models/usage-record-sync-entry.ts +70 -0
  226. package/src/sdk/sdk.ts +6 -0
  227. package/src/sdk/subscriptions.ts +8 -0
  228. package/src/sdk/usage-records.ts +27 -0
  229. package/esm/funcs/costs-get-detailed-cost-analytics-v2.d.ts +0 -17
  230. package/esm/funcs/costs-get-detailed-cost-analytics-v2.d.ts.map +0 -1
  231. package/esm/funcs/costs-get-detailed-cost-analytics-v2.js.map +0 -1
@@ -0,0 +1,12 @@
1
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as models from "./models/index.js";
3
+ export declare class UsageRecords extends ClientSDK {
4
+ /**
5
+ * List usage records
6
+ *
7
+ * @remarks
8
+ * Lists usage records. Also accepts filters/sort for a filtered query.
9
+ */
10
+ postUsageRecordsSearch(request: models.UsageRecordFilter, options?: RequestOptions): Promise<models.ListUsageRecordsResponse>;
11
+ }
12
+ //# sourceMappingURL=usage-records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage-records.d.ts","sourceRoot":"","sources":["../../src/sdk/usage-records.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,qBAAa,YAAa,SAAQ,SAAS;IACzC;;;;;OAKG;IACG,sBAAsB,CAC1B,OAAO,EAAE,MAAM,CAAC,iBAAiB,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAM1C;CACF"}
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { usageRecordsPostUsageRecordsSearch } from "../funcs/usage-records-post-usage-records-search.js";
5
+ import { ClientSDK } from "../lib/sdks.js";
6
+ import { unwrapAsync } from "../types/fp.js";
7
+ export class UsageRecords extends ClientSDK {
8
+ /**
9
+ * List usage records
10
+ *
11
+ * @remarks
12
+ * Lists usage records. Also accepts filters/sort for a filtered query.
13
+ */
14
+ async postUsageRecordsSearch(request, options) {
15
+ return unwrapAsync(usageRecordsPostUsageRecordsSearch(this, request, options));
16
+ }
17
+ }
18
+ //# sourceMappingURL=usage-records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage-records.js","sourceRoot":"","sources":["../../src/sdk/usage-records.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qDAAqD,CAAC;AACzG,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,OAAO,YAAa,SAAQ,SAAS;IACzC;;;;;OAKG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAAiC,EACjC,OAAwB,EACkB;QAC1C,OAAO,WAAW,CAAC,kCAAkC,CACnD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;CACF"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@flexprice/sdk",
5
- "version": "2.1.24",
5
+ "version": "2.1.26",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./sdk/models": "./src/sdk/models/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexprice/sdk",
3
- "version": "2.1.24",
3
+ "version": "2.1.26",
4
4
  "author": "FlexPrice",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -168,7 +168,7 @@ async function $do(
168
168
  | SDKValidationError
169
169
  >(
170
170
  M.json(200, models.PriceResponse$inboundSchema),
171
- M.jsonErr(400, models.ErrorsErrorResponse$inboundSchema),
171
+ M.jsonErr([400, 404], models.ErrorsErrorResponse$inboundSchema),
172
172
  M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
173
173
  M.fail("4XX"),
174
174
  M.fail("5XX"),
@@ -31,6 +31,14 @@ import { Result } from "../types/fp.js";
31
31
  *
32
32
  * @remarks
33
33
  * Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.
34
+ *
35
+ * change_at controls timing. Omitted or 'immediate' applies the change now. 'end_of_period' records a pending schedule that executes at the subscription's current period end: the response returns is_scheduled, schedule_id and scheduled_at instead of a completed change, and nothing is swapped or billed until the boundary.
36
+ *
37
+ * scheduled_at is resolved from the subscription's current period end at request time. If that period end is already in the past (a backdated start date, a resumed pause, or worker downtime can all leave a subscription behind), the change is due immediately and fires on the next billing scan rather than a period away — inspect scheduled_at to see this.
38
+ *
39
+ * Only one plan change may be pending per subscription. By default (on_conflict_policies.on_pending_schedule = 'reject') a second request returns 400; cancel the existing schedule via POST /subscriptions/schedules/{schedule_id}/cancel first. Pending schedules are listable via GET /subscriptions/{id}/schedules.
40
+ *
41
+ * Set on_conflict_policies.on_pending_schedule to 'supersede' to replace the queued change instead: the pending schedule is cancelled and this request applied in the same transaction, so both land or neither does. The cancelled schedule ids are returned in superseded_schedules, and preview reports the same list without writing.
34
42
  */
35
43
  export function subscriptionsExecuteSubscriptionPlanChangeV2(
36
44
  client: FlexpriceCore,
@@ -27,18 +27,18 @@ import { APICall, APIPromise } from "../types/async.js";
27
27
  import { Result } from "../types/fp.js";
28
28
 
29
29
  /**
30
- * Get combined revenue and cost analytics (V2)
30
+ * List usage records
31
31
  *
32
32
  * @remarks
33
- * Use when you need the same revenue/cost/ROI analytics but computed from the costsheet usage-tracking pipeline (e.g. for consistency with usage-based cost data).
33
+ * Lists usage records. Also accepts filters/sort for a filtered query.
34
34
  */
35
- export function costsGetDetailedCostAnalyticsV2(
35
+ export function usageRecordsPostUsageRecordsSearch(
36
36
  client: FlexpriceCore,
37
- request: models.GetCostAnalyticsRequest,
37
+ request: models.UsageRecordFilter,
38
38
  options?: RequestOptions,
39
39
  ): APIPromise<
40
40
  Result<
41
- models.GetDetailedCostAnalyticsResponse,
41
+ models.ListUsageRecordsResponse,
42
42
  | models.ErrorsErrorResponse
43
43
  | FlexPriceError
44
44
  | ResponseValidationError
@@ -59,12 +59,12 @@ export function costsGetDetailedCostAnalyticsV2(
59
59
 
60
60
  async function $do(
61
61
  client: FlexpriceCore,
62
- request: models.GetCostAnalyticsRequest,
62
+ request: models.UsageRecordFilter,
63
63
  options?: RequestOptions,
64
64
  ): Promise<
65
65
  [
66
66
  Result<
67
- models.GetDetailedCostAnalyticsResponse,
67
+ models.ListUsageRecordsResponse,
68
68
  | models.ErrorsErrorResponse
69
69
  | FlexPriceError
70
70
  | ResponseValidationError
@@ -80,7 +80,7 @@ async function $do(
80
80
  > {
81
81
  const parsed = safeParse(
82
82
  request,
83
- (value) => z.parse(models.GetCostAnalyticsRequest$outboundSchema, value),
83
+ (value) => z.parse(models.UsageRecordFilter$outboundSchema, value),
84
84
  "Input validation failed",
85
85
  );
86
86
  if (!parsed.ok) {
@@ -89,7 +89,7 @@ async function $do(
89
89
  const payload = parsed.value;
90
90
  const body = encodeJSON("body", payload, { explode: true });
91
91
 
92
- const path = pathToFunc("/costs/analytics-v2")();
92
+ const path = pathToFunc("/usage-records/search")();
93
93
 
94
94
  const headers = new Headers(compactMap({
95
95
  "Content-Type": "application/json",
@@ -103,7 +103,7 @@ async function $do(
103
103
  const context = {
104
104
  options: client._options,
105
105
  baseURL: options?.serverURL ?? client._baseURL ?? "",
106
- operationID: "getDetailedCostAnalyticsV2",
106
+ operationID: "post_/usage-records/search",
107
107
  oAuth2Scopes: null,
108
108
 
109
109
  resolvedSecurity: requestSecurity,
@@ -147,7 +147,7 @@ async function $do(
147
147
  };
148
148
 
149
149
  const [result] = await M.match<
150
- models.GetDetailedCostAnalyticsResponse,
150
+ models.ListUsageRecordsResponse,
151
151
  | models.ErrorsErrorResponse
152
152
  | FlexPriceError
153
153
  | ResponseValidationError
@@ -158,7 +158,7 @@ async function $do(
158
158
  | UnexpectedClientError
159
159
  | SDKValidationError
160
160
  >(
161
- M.json(200, models.GetDetailedCostAnalyticsResponse$inboundSchema),
161
+ M.json(200, models.ListUsageRecordsResponse$inboundSchema),
162
162
  M.jsonErr(400, models.ErrorsErrorResponse$inboundSchema),
163
163
  M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
164
164
  M.fail("4XX"),
package/src/lib/config.ts CHANGED
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "1.0",
68
- sdkVersion: "2.1.24",
69
- genVersion: "2.931.0",
70
- userAgent: "speakeasy-sdk/typescript 2.1.24 2.931.0 1.0 @flexprice/sdk",
68
+ sdkVersion: "2.1.26",
69
+ genVersion: "2.932.9",
70
+ userAgent: "speakeasy-sdk/typescript 2.1.26 2.932.9 1.0 @flexprice/sdk",
71
71
  } as const;
package/src/sdk/costs.ts CHANGED
@@ -6,7 +6,6 @@ import { costsCreateCostsheet } from "../funcs/costs-create-costsheet.js";
6
6
  import { costsDeleteCostsheet } from "../funcs/costs-delete-costsheet.js";
7
7
  import { costsGetActiveCostsheet } from "../funcs/costs-get-active-costsheet.js";
8
8
  import { costsGetCostsheet } from "../funcs/costs-get-costsheet.js";
9
- import { costsGetDetailedCostAnalyticsV2 } from "../funcs/costs-get-detailed-cost-analytics-v2.js";
10
9
  import { costsGetDetailedCostAnalytics } from "../funcs/costs-get-detailed-cost-analytics.js";
11
10
  import { costsQueryCostsheet } from "../funcs/costs-query-costsheet.js";
12
11
  import { costsUpdateCostsheet } from "../funcs/costs-update-costsheet.js";
@@ -64,23 +63,6 @@ export class Costs extends ClientSDK {
64
63
  ));
65
64
  }
66
65
 
67
- /**
68
- * Get combined revenue and cost analytics (V2)
69
- *
70
- * @remarks
71
- * Use when you need the same revenue/cost/ROI analytics but computed from the costsheet usage-tracking pipeline (e.g. for consistency with usage-based cost data).
72
- */
73
- async getDetailedCostAnalyticsV2(
74
- request: models.GetCostAnalyticsRequest,
75
- options?: RequestOptions,
76
- ): Promise<models.GetDetailedCostAnalyticsResponse> {
77
- return unwrapAsync(costsGetDetailedCostAnalyticsV2(
78
- this,
79
- request,
80
- options,
81
- ));
82
- }
83
-
84
66
  /**
85
67
  * Query costsheets
86
68
  *
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import * as openEnums from "../../types/enums.js";
7
+ import { OpenEnum } from "../../types/enums.js";
8
+
9
+ export const BillingPeriodBehaviour = {
10
+ Unchanged: "unchanged",
11
+ AnchorAtEffect: "anchor_at_effect",
12
+ AnchorAtConfig: "anchor_at_config",
13
+ } as const;
14
+ export type BillingPeriodBehaviour = OpenEnum<typeof BillingPeriodBehaviour>;
15
+
16
+ /** @internal */
17
+ export const BillingPeriodBehaviour$inboundSchema: z.ZodMiniType<
18
+ BillingPeriodBehaviour,
19
+ unknown
20
+ > = openEnums.inboundSchema(BillingPeriodBehaviour);
21
+ /** @internal */
22
+ export const BillingPeriodBehaviour$outboundSchema: z.ZodMiniType<
23
+ string,
24
+ BillingPeriodBehaviour
25
+ > = openEnums.outboundSchema(BillingPeriodBehaviour);
@@ -0,0 +1,57 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { BillingCycle, BillingCycle$outboundSchema } from "./billing-cycle.js";
8
+ import {
9
+ BillingPeriod,
10
+ BillingPeriod$outboundSchema,
11
+ } from "./billing-period.js";
12
+
13
+ export type BillingPeriodConfig = {
14
+ billingAnchor?: Date | undefined;
15
+ billingCycle?: BillingCycle | undefined;
16
+ billingPeriodCount?: number | undefined;
17
+ billingPeriodUnit?: BillingPeriod | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export type BillingPeriodConfig$Outbound = {
22
+ billing_anchor?: string | undefined;
23
+ billing_cycle?: string | undefined;
24
+ billing_period_count?: number | undefined;
25
+ billing_period_unit?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const BillingPeriodConfig$outboundSchema: z.ZodMiniType<
30
+ BillingPeriodConfig$Outbound,
31
+ BillingPeriodConfig
32
+ > = z.pipe(
33
+ z.object({
34
+ billingAnchor: z.optional(
35
+ z.pipe(z.date(), z.transform(v => v.toISOString())),
36
+ ),
37
+ billingCycle: z.optional(BillingCycle$outboundSchema),
38
+ billingPeriodCount: z.optional(z.int()),
39
+ billingPeriodUnit: z.optional(BillingPeriod$outboundSchema),
40
+ }),
41
+ z.transform((v) => {
42
+ return remap$(v, {
43
+ billingAnchor: "billing_anchor",
44
+ billingCycle: "billing_cycle",
45
+ billingPeriodCount: "billing_period_count",
46
+ billingPeriodUnit: "billing_period_unit",
47
+ });
48
+ }),
49
+ );
50
+
51
+ export function billingPeriodConfigToJSON(
52
+ billingPeriodConfig: BillingPeriodConfig,
53
+ ): string {
54
+ return JSON.stringify(
55
+ BillingPeriodConfig$outboundSchema.parse(billingPeriodConfig),
56
+ );
57
+ }
@@ -12,6 +12,10 @@ import {
12
12
  EntitlementEntityType,
13
13
  EntitlementEntityType$outboundSchema,
14
14
  } from "./entitlement-entity-type.js";
15
+ import {
16
+ EntitlementGrantAllocationBehavior,
17
+ EntitlementGrantAllocationBehavior$outboundSchema,
18
+ } from "./entitlement-grant-allocation-behavior.js";
15
19
  import {
16
20
  EntitlementGrantDurationUnit,
17
21
  EntitlementGrantDurationUnit$outboundSchema,
@@ -34,6 +38,7 @@ export type CreateEntitlementRequest = {
34
38
  entityType?: EntitlementEntityType | undefined;
35
39
  featureId: string;
36
40
  featureType: FeatureType;
41
+ grantAllocationBehavior?: EntitlementGrantAllocationBehavior | undefined;
37
42
  grantDurationUnit?: EntitlementGrantDurationUnit | undefined;
38
43
  grantDurationValue?: number | undefined;
39
44
  grantMeasure?: EntitlementGrantMeasure | undefined;
@@ -57,6 +62,7 @@ export type CreateEntitlementRequest$Outbound = {
57
62
  entity_type?: string | undefined;
58
63
  feature_id: string;
59
64
  feature_type: string;
65
+ grant_allocation_behavior?: string | undefined;
60
66
  grant_duration_unit?: string | undefined;
61
67
  grant_duration_value?: number | undefined;
62
68
  grant_measure?: string | undefined;
@@ -84,6 +90,9 @@ export const CreateEntitlementRequest$outboundSchema: z.ZodMiniType<
84
90
  entityType: z.optional(EntitlementEntityType$outboundSchema),
85
91
  featureId: z.string(),
86
92
  featureType: FeatureType$outboundSchema,
93
+ grantAllocationBehavior: z.optional(
94
+ EntitlementGrantAllocationBehavior$outboundSchema,
95
+ ),
87
96
  grantDurationUnit: z.optional(EntitlementGrantDurationUnit$outboundSchema),
88
97
  grantDurationValue: z.optional(z.int()),
89
98
  grantMeasure: z.optional(EntitlementGrantMeasure$outboundSchema),
@@ -106,6 +115,7 @@ export const CreateEntitlementRequest$outboundSchema: z.ZodMiniType<
106
115
  entityType: "entity_type",
107
116
  featureId: "feature_id",
108
117
  featureType: "feature_type",
118
+ grantAllocationBehavior: "grant_allocation_behavior",
109
119
  grantDurationUnit: "grant_duration_unit",
110
120
  grantDurationValue: "grant_duration_value",
111
121
  grantMeasure: "grant_measure",
@@ -29,7 +29,7 @@ export type CreditGrantApplicationResponse = {
29
29
  createdAt?: Date | undefined;
30
30
  createdBy?: string | undefined;
31
31
  creditGrantId?: string | undefined;
32
- credits?: number | undefined;
32
+ credits?: string | undefined;
33
33
  environmentId?: string | undefined;
34
34
  failureReason?: string | undefined;
35
35
  id?: string | undefined;
@@ -61,7 +61,7 @@ export const CreditGrantApplicationResponse$inboundSchema: z.ZodMiniType<
61
61
  created_at: types.optional(types.date()),
62
62
  created_by: types.optional(types.string()),
63
63
  credit_grant_id: types.optional(types.string()),
64
- credits: types.optional(types.number()),
64
+ credits: types.optional(types.string()),
65
65
  environment_id: types.optional(types.string()),
66
66
  failure_reason: types.optional(types.string()),
67
67
  id: types.optional(types.string()),
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import * as openEnums from "../../types/enums.js";
7
+ import { OpenEnum } from "../../types/enums.js";
8
+
9
+ export const EntitlementGrantAllocationBehavior = {
10
+ FirstUsage: "first_usage",
11
+ UnitStart: "unit_start",
12
+ } as const;
13
+ export type EntitlementGrantAllocationBehavior = OpenEnum<
14
+ typeof EntitlementGrantAllocationBehavior
15
+ >;
16
+
17
+ /** @internal */
18
+ export const EntitlementGrantAllocationBehavior$inboundSchema: z.ZodMiniType<
19
+ EntitlementGrantAllocationBehavior,
20
+ unknown
21
+ > = openEnums.inboundSchema(EntitlementGrantAllocationBehavior);
22
+ /** @internal */
23
+ export const EntitlementGrantAllocationBehavior$outboundSchema: z.ZodMiniType<
24
+ string,
25
+ EntitlementGrantAllocationBehavior
26
+ > = openEnums.outboundSchema(EntitlementGrantAllocationBehavior);
@@ -10,6 +10,7 @@ export const EntitlementGrantDurationUnit = {
10
10
  Hour: "hour",
11
11
  Day: "day",
12
12
  Week: "week",
13
+ SubscriptionPeriod: "subscription_period",
13
14
  } as const;
14
15
  export type EntitlementGrantDurationUnit = OpenEnum<
15
16
  typeof EntitlementGrantDurationUnit
@@ -19,6 +19,10 @@ import {
19
19
  EntitlementEntityType,
20
20
  EntitlementEntityType$inboundSchema,
21
21
  } from "./entitlement-entity-type.js";
22
+ import {
23
+ EntitlementGrantAllocationBehavior,
24
+ EntitlementGrantAllocationBehavior$inboundSchema,
25
+ } from "./entitlement-grant-allocation-behavior.js";
22
26
  import {
23
27
  EntitlementGrantDurationUnit,
24
28
  EntitlementGrantDurationUnit$inboundSchema,
@@ -54,10 +58,11 @@ export type EntitlementResponse = {
54
58
  feature?: FeatureResponse | undefined;
55
59
  featureId?: string | undefined;
56
60
  featureType?: FeatureType | undefined;
61
+ grantAllocationBehavior?: EntitlementGrantAllocationBehavior | undefined;
57
62
  grantDurationUnit?: EntitlementGrantDurationUnit | undefined;
58
63
  grantDurationValue?: number | undefined;
59
64
  grantMeasure?: EntitlementGrantMeasure | undefined;
60
- grantQuota?: number | undefined;
65
+ grantQuota?: string | undefined;
61
66
  id?: string | undefined;
62
67
  isEnabled?: boolean | undefined;
63
68
  isSoftLimit?: boolean | undefined;
@@ -96,12 +101,15 @@ export const EntitlementResponse$inboundSchema: z.ZodMiniType<
96
101
  feature: types.optional(FeatureResponse$inboundSchema),
97
102
  feature_id: types.optional(types.string()),
98
103
  feature_type: types.optional(FeatureType$inboundSchema),
104
+ grant_allocation_behavior: types.optional(
105
+ EntitlementGrantAllocationBehavior$inboundSchema,
106
+ ),
99
107
  grant_duration_unit: types.optional(
100
108
  EntitlementGrantDurationUnit$inboundSchema,
101
109
  ),
102
110
  grant_duration_value: types.optional(types.number()),
103
111
  grant_measure: types.optional(EntitlementGrantMeasure$inboundSchema),
104
- grant_quota: types.optional(types.number()),
112
+ grant_quota: types.optional(types.string()),
105
113
  id: types.optional(types.string()),
106
114
  is_enabled: types.optional(types.boolean()),
107
115
  is_soft_limit: types.optional(types.boolean()),
@@ -132,6 +140,7 @@ export const EntitlementResponse$inboundSchema: z.ZodMiniType<
132
140
  "environment_id": "environmentId",
133
141
  "feature_id": "featureId",
134
142
  "feature_type": "featureType",
143
+ "grant_allocation_behavior": "grantAllocationBehavior",
135
144
  "grant_duration_unit": "grantDurationUnit",
136
145
  "grant_duration_value": "grantDurationValue",
137
146
  "grant_measure": "grantMeasure",
@@ -9,6 +9,7 @@ import { OpenEnum } from "../../types/enums.js";
9
9
  export const EntityChangeBehaviour = {
10
10
  Carry: "carry",
11
11
  Drop: "drop",
12
+ Add: "add",
12
13
  } as const;
13
14
  export type EntityChangeBehaviour = OpenEnum<typeof EntityChangeBehaviour>;
14
15
 
@@ -13,6 +13,9 @@ export type EntityChangePolicy = {
13
13
  defaultBehaviour?: EntityChangeBehaviour | undefined;
14
14
  /**
15
15
  * Overrides is keyed by addon_associations.id (instance), not catalogue addon_id.
16
+ *
17
+ * @remarks
18
+ * That is the id an EntityChangeResult reports as EntityID.
16
19
  */
17
20
  overrides?: { [k: string]: EntityChangeBehaviour } | undefined;
18
21
  };
@@ -13,14 +13,14 @@ import {
13
13
  } from "./entity-change-behaviour.js";
14
14
  import { SDKValidationError } from "./sdk-validation-error.js";
15
15
  import {
16
- SubscriptionLineItemEntityType,
17
- SubscriptionLineItemEntityType$inboundSchema,
18
- } from "./subscription-line-item-entity-type.js";
16
+ SubscriptionChangeEntityType,
17
+ SubscriptionChangeEntityType$inboundSchema,
18
+ } from "./subscription-change-entity-type.js";
19
19
 
20
20
  export type EntityChangeResult = {
21
21
  behaviour?: EntityChangeBehaviour | undefined;
22
22
  entityId?: string | undefined;
23
- entityType?: SubscriptionLineItemEntityType | undefined;
23
+ entityType?: SubscriptionChangeEntityType | undefined;
24
24
  referenceId?: string | undefined;
25
25
  };
26
26
 
@@ -32,7 +32,7 @@ export const EntityChangeResult$inboundSchema: z.ZodMiniType<
32
32
  z.object({
33
33
  behaviour: types.optional(EntityChangeBehaviour$inboundSchema),
34
34
  entity_id: types.optional(types.string()),
35
- entity_type: types.optional(SubscriptionLineItemEntityType$inboundSchema),
35
+ entity_type: types.optional(SubscriptionChangeEntityType$inboundSchema),
36
36
  reference_id: types.optional(types.string()),
37
37
  }),
38
38
  z.transform((v) => {
@@ -43,6 +43,8 @@ export * from "./billing-cadence.js";
43
43
  export * from "./billing-cycle-info.js";
44
44
  export * from "./billing-cycle.js";
45
45
  export * from "./billing-model.js";
46
+ export * from "./billing-period-behaviour.js";
47
+ export * from "./billing-period-config.js";
46
48
  export * from "./billing-period-info.js";
47
49
  export * from "./billing-period.js";
48
50
  export * from "./billing-tier.js";
@@ -193,6 +195,7 @@ export * from "./duration-unit.js";
193
195
  export * from "./entitlement-aggregation-mode.js";
194
196
  export * from "./entitlement-entity-type.js";
195
197
  export * from "./entitlement-filter.js";
198
+ export * from "./entitlement-grant-allocation-behavior.js";
196
199
  export * from "./entitlement-grant-duration-unit.js";
197
200
  export * from "./entitlement-grant-measure.js";
198
201
  export * from "./entitlement-response.js";
@@ -366,12 +369,15 @@ export * from "./list-tasks-response.js";
366
369
  export * from "./list-tax-associations-op.js";
367
370
  export * from "./list-tax-associations-response.js";
368
371
  export * from "./list-tax-rates-response.js";
372
+ export * from "./list-usage-records-response.js";
369
373
  export * from "./list-users-response.js";
370
374
  export * from "./list-wallet-transactions-response.js";
371
375
  export * from "./list-workflows-response.js";
372
376
  export * from "./matched-meter.js";
373
377
  export * from "./matched-price.js";
374
378
  export * from "./matched-subscription-line-item.js";
379
+ export * from "./metadata-custom-field-source.js";
380
+ export * from "./metadata-custom-field.js";
375
381
  export * from "./meter-aggregation.js";
376
382
  export * from "./meter-filter.js";
377
383
  export * from "./meter-matching-result.js";
@@ -381,6 +387,7 @@ export * from "./meter-usage-attribution.js";
381
387
  export * from "./models-temporal-workflow-result.js";
382
388
  export * from "./modify-subscription-line-item.js";
383
389
  export * from "./modify-subscription-params.js";
390
+ export * from "./on-pending-schedule-policy.js";
384
391
  export * from "./override-entitlement-request.js";
385
392
  export * from "./override-line-item-request.js";
386
393
  export * from "./pagination-response.js";
@@ -398,6 +405,7 @@ export * from "./payment-response.js";
398
405
  export * from "./payment-status.js";
399
406
  export * from "./payment-terms.js";
400
407
  export * from "./plan-filter.js";
408
+ export * from "./plan-price-sync-status-response.js";
401
409
  export * from "./plan-response.js";
402
410
  export * from "./plan-summary.js";
403
411
  export * from "./plan.js";
@@ -406,6 +414,7 @@ export * from "./preview-subscription-change-op.js";
406
414
  export * from "./preview-subscription-modify-op.js";
407
415
  export * from "./preview-subscription-plan-change-v2-op.js";
408
416
  export * from "./price-entity-type.js";
417
+ export * from "./price-feature-response.js";
409
418
  export * from "./price-filter.js";
410
419
  export * from "./price-jsonb-transform-quantity.js";
411
420
  export * from "./price-lookup-result.js";
@@ -452,6 +461,7 @@ export * from "./secret-provider.js";
452
461
  export * from "./secret-response.js";
453
462
  export * from "./secret-type.js";
454
463
  export * from "./security.js";
464
+ export * from "./service-period-custom-fields.js";
455
465
  export * from "./sort-condition.js";
456
466
  export * from "./sort-direction.js";
457
467
  export * from "./source-usage-item.js";
@@ -466,7 +476,10 @@ export * from "./sub-modify-quantity-change-request.js";
466
476
  export * from "./sub-modify-tax-action.js";
467
477
  export * from "./sub-modify-tax-params.js";
468
478
  export * from "./sub-modify-trial-end-request.js";
479
+ export * from "./subscription-change-billing-period-result.js";
480
+ export * from "./subscription-change-conflict-policies.js";
469
481
  export * from "./subscription-change-entity-policies.js";
482
+ export * from "./subscription-change-entity-type.js";
470
483
  export * from "./subscription-change-execute-response.js";
471
484
  export * from "./subscription-change-preview-response.js";
472
485
  export * from "./subscription-change-request.js";
@@ -583,6 +596,9 @@ export * from "./update-wallet-request.js";
583
596
  export * from "./usage-analytic-item.js";
584
597
  export * from "./usage-analytic-point.js";
585
598
  export * from "./usage-breakdown-item.js";
599
+ export * from "./usage-record-filter.js";
600
+ export * from "./usage-record-response.js";
601
+ export * from "./usage-record-sync-entry.js";
586
602
  export * from "./usage-result.js";
587
603
  export * from "./user-filter.js";
588
604
  export * from "./user-response.js";
@@ -18,6 +18,7 @@ export const IntegrationEntityType = {
18
18
  ItemPrice: "item_price",
19
19
  Price: "price",
20
20
  InvoiceLineItem: "invoice_line_item",
21
+ SubscriptionLineItem: "subscription_line_item",
21
22
  } as const;
22
23
  export type IntegrationEntityType = OpenEnum<typeof IntegrationEntityType>;
23
24
 
@@ -11,10 +11,35 @@ import {
11
11
  BillingPeriod,
12
12
  BillingPeriod$inboundSchema,
13
13
  } from "./billing-period.js";
14
+ import {
15
+ MetadataCustomField,
16
+ MetadataCustomField$inboundSchema,
17
+ } from "./metadata-custom-field.js";
14
18
  import { SDKValidationError } from "./sdk-validation-error.js";
19
+ import {
20
+ ServicePeriodCustomFields,
21
+ ServicePeriodCustomFields$inboundSchema,
22
+ } from "./service-period-custom-fields.js";
15
23
 
16
24
  export type InvoiceSyncSettings = {
25
+ /**
26
+ * MetadataCustomFields copies metadata values onto Zoho invoice custom fields
27
+ *
28
+ * @remarks
29
+ * verbatim.
30
+ */
31
+ metadataCustomFields?: Array<MetadataCustomField> | undefined;
17
32
  normalizeFixedTo?: BillingPeriod | undefined;
33
+ servicePeriodCustomFields?: ServicePeriodCustomFields | undefined;
34
+ /**
35
+ * SubmitForApproval submits the synced invoice into the merchant's Zoho Books approval
36
+ *
37
+ * @remarks
38
+ * flow before recording payment. Zoho rejects payments on draft invoices, and merchants
39
+ * configure a Zoho auto-approval rule for FlexPrice-sent invoices, so we submit, wait for
40
+ * that rule to fire, then pay.
41
+ */
42
+ submitForApproval?: boolean | undefined;
18
43
  };
19
44
 
20
45
  /** @internal */
@@ -23,11 +48,21 @@ export const InvoiceSyncSettings$inboundSchema: z.ZodMiniType<
23
48
  unknown
24
49
  > = z.pipe(
25
50
  z.object({
51
+ metadata_custom_fields: types.optional(
52
+ z.array(MetadataCustomField$inboundSchema),
53
+ ),
26
54
  normalize_fixed_to: types.optional(BillingPeriod$inboundSchema),
55
+ service_period_custom_fields: types.optional(
56
+ ServicePeriodCustomFields$inboundSchema,
57
+ ),
58
+ submit_for_approval: types.optional(types.boolean()),
27
59
  }),
28
60
  z.transform((v) => {
29
61
  return remap$(v, {
62
+ "metadata_custom_fields": "metadataCustomFields",
30
63
  "normalize_fixed_to": "normalizeFixedTo",
64
+ "service_period_custom_fields": "servicePeriodCustomFields",
65
+ "submit_for_approval": "submitForApproval",
31
66
  });
32
67
  }),
33
68
  );