@flexprice/sdk 2.1.6 → 2.1.9

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 (129) hide show
  1. package/FUNCTIONS.md +2 -2
  2. package/docs/sdk/models/customer-filter.md +1 -0
  3. package/docs/sdk/models/execute-subscription-modify-request.md +7 -6
  4. package/docs/sdk/models/export-metadata-entity-type.md +17 -0
  5. package/docs/sdk/models/export-metadata-field.md +20 -0
  6. package/docs/sdk/models/grouped-invoicing-action.md +15 -0
  7. package/docs/sdk/models/invoice-billing-reason.md +1 -1
  8. package/docs/sdk/models/list-subscription-line-items-response.md +50 -0
  9. package/docs/sdk/models/plan-filter.md +1 -0
  10. package/docs/sdk/models/s3-job-config.md +10 -9
  11. package/docs/sdk/models/scheduled-task-entity-type.md +1 -1
  12. package/docs/sdk/models/sub-modify-grouped-invoicing-params.md +19 -0
  13. package/docs/sdk/models/subscription-inheritance-config.md +6 -5
  14. package/docs/sdk/models/subscription-line-item-filter-order.md +15 -0
  15. package/docs/sdk/models/subscription-line-item-filter.md +34 -0
  16. package/docs/sdk/models/subscription-modify-type.md +2 -2
  17. package/docs/sdk/models/subscription-type.md +1 -1
  18. package/docs/sdk/models/window-size.md +2 -2
  19. package/docs/sdks/scheduledtasks/README.md +2 -2
  20. package/docs/sdks/subscriptions/README.md +74 -2
  21. package/esm/funcs/subscriptions-query-subscription-line-items.d.ts +17 -0
  22. package/esm/funcs/subscriptions-query-subscription-line-items.d.ts.map +1 -0
  23. package/esm/funcs/subscriptions-query-subscription-line-items.js +83 -0
  24. package/esm/funcs/subscriptions-query-subscription-line-items.js.map +1 -0
  25. package/esm/lib/config.d.ts +3 -3
  26. package/esm/lib/config.js +3 -3
  27. package/esm/sdk/models/customer-filter.d.ts +6 -0
  28. package/esm/sdk/models/customer-filter.d.ts.map +1 -1
  29. package/esm/sdk/models/customer-filter.js +1 -0
  30. package/esm/sdk/models/customer-filter.js.map +1 -1
  31. package/esm/sdk/models/execute-subscription-modify-request.d.ts +3 -0
  32. package/esm/sdk/models/execute-subscription-modify-request.d.ts.map +1 -1
  33. package/esm/sdk/models/execute-subscription-modify-request.js +3 -0
  34. package/esm/sdk/models/execute-subscription-modify-request.js.map +1 -1
  35. package/esm/sdk/models/export-metadata-entity-type.d.ts +12 -0
  36. package/esm/sdk/models/export-metadata-entity-type.d.ts.map +1 -0
  37. package/esm/sdk/models/export-metadata-entity-type.js +13 -0
  38. package/esm/sdk/models/export-metadata-entity-type.js.map +1 -0
  39. package/esm/sdk/models/export-metadata-field.d.ts +28 -0
  40. package/esm/sdk/models/export-metadata-field.d.ts.map +1 -0
  41. package/esm/sdk/models/export-metadata-field.js +39 -0
  42. package/esm/sdk/models/export-metadata-field.js.map +1 -0
  43. package/esm/sdk/models/grouped-invoicing-action.d.ts +10 -0
  44. package/esm/sdk/models/grouped-invoicing-action.d.ts.map +1 -0
  45. package/esm/sdk/models/grouped-invoicing-action.js +11 -0
  46. package/esm/sdk/models/grouped-invoicing-action.js.map +1 -0
  47. package/esm/sdk/models/index.d.ts +6 -0
  48. package/esm/sdk/models/index.d.ts.map +1 -1
  49. package/esm/sdk/models/index.js +6 -0
  50. package/esm/sdk/models/index.js.map +1 -1
  51. package/esm/sdk/models/invoice-billing-reason.d.ts +1 -0
  52. package/esm/sdk/models/invoice-billing-reason.d.ts.map +1 -1
  53. package/esm/sdk/models/invoice-billing-reason.js +1 -0
  54. package/esm/sdk/models/invoice-billing-reason.js.map +1 -1
  55. package/esm/sdk/models/list-subscription-line-items-response.d.ts +13 -0
  56. package/esm/sdk/models/list-subscription-line-items-response.d.ts.map +1 -0
  57. package/esm/sdk/models/list-subscription-line-items-response.js +17 -0
  58. package/esm/sdk/models/list-subscription-line-items-response.js.map +1 -0
  59. package/esm/sdk/models/plan-filter.d.ts +6 -0
  60. package/esm/sdk/models/plan-filter.d.ts.map +1 -1
  61. package/esm/sdk/models/plan-filter.js +1 -0
  62. package/esm/sdk/models/plan-filter.js.map +1 -1
  63. package/esm/sdk/models/s3-job-config.d.ts +7 -1
  64. package/esm/sdk/models/s3-job-config.d.ts.map +1 -1
  65. package/esm/sdk/models/s3-job-config.js +5 -0
  66. package/esm/sdk/models/s3-job-config.js.map +1 -1
  67. package/esm/sdk/models/scheduled-task-entity-type.d.ts +1 -0
  68. package/esm/sdk/models/scheduled-task-entity-type.d.ts.map +1 -1
  69. package/esm/sdk/models/scheduled-task-entity-type.js +1 -0
  70. package/esm/sdk/models/scheduled-task-entity-type.js.map +1 -1
  71. package/esm/sdk/models/sub-modify-grouped-invoicing-params.d.ts +20 -0
  72. package/esm/sdk/models/sub-modify-grouped-invoicing-params.d.ts.map +1 -0
  73. package/esm/sdk/models/sub-modify-grouped-invoicing-params.js +21 -0
  74. package/esm/sdk/models/sub-modify-grouped-invoicing-params.js.map +1 -0
  75. package/esm/sdk/models/subscription-inheritance-config.d.ts +26 -0
  76. package/esm/sdk/models/subscription-inheritance-config.d.ts.map +1 -1
  77. package/esm/sdk/models/subscription-inheritance-config.js +2 -0
  78. package/esm/sdk/models/subscription-inheritance-config.js.map +1 -1
  79. package/esm/sdk/models/subscription-line-item-entity-type.d.ts +2 -0
  80. package/esm/sdk/models/subscription-line-item-entity-type.d.ts.map +1 -1
  81. package/esm/sdk/models/subscription-line-item-entity-type.js +2 -0
  82. package/esm/sdk/models/subscription-line-item-entity-type.js.map +1 -1
  83. package/esm/sdk/models/subscription-line-item-filter.d.ts +65 -0
  84. package/esm/sdk/models/subscription-line-item-filter.d.ts.map +1 -0
  85. package/esm/sdk/models/subscription-line-item-filter.js +57 -0
  86. package/esm/sdk/models/subscription-line-item-filter.js.map +1 -0
  87. package/esm/sdk/models/subscription-modify-type.d.ts +1 -0
  88. package/esm/sdk/models/subscription-modify-type.d.ts.map +1 -1
  89. package/esm/sdk/models/subscription-modify-type.js +1 -0
  90. package/esm/sdk/models/subscription-modify-type.js.map +1 -1
  91. package/esm/sdk/models/subscription-type.d.ts +2 -0
  92. package/esm/sdk/models/subscription-type.d.ts.map +1 -1
  93. package/esm/sdk/models/subscription-type.js +2 -0
  94. package/esm/sdk/models/subscription-type.js.map +1 -1
  95. package/esm/sdk/models/window-size.d.ts +1 -1
  96. package/esm/sdk/models/window-size.js +1 -1
  97. package/esm/sdk/models/window-size.js.map +1 -1
  98. package/esm/sdk/subscriptions.d.ts +7 -0
  99. package/esm/sdk/subscriptions.d.ts.map +1 -1
  100. package/esm/sdk/subscriptions.js +10 -0
  101. package/esm/sdk/subscriptions.js.map +1 -1
  102. package/esm/types/primitives.d.ts +1 -1
  103. package/esm/types/primitives.d.ts.map +1 -1
  104. package/esm/types/primitives.js +2 -3
  105. package/esm/types/primitives.js.map +1 -1
  106. package/jsr.json +1 -1
  107. package/package.json +1 -1
  108. package/src/funcs/subscriptions-query-subscription-line-items.ts +172 -0
  109. package/src/lib/config.ts +3 -3
  110. package/src/sdk/models/customer-filter.ts +3 -0
  111. package/src/sdk/models/execute-subscription-modify-request.ts +13 -0
  112. package/src/sdk/models/export-metadata-entity-type.ts +26 -0
  113. package/src/sdk/models/export-metadata-field.ts +88 -0
  114. package/src/sdk/models/grouped-invoicing-action.ts +17 -0
  115. package/src/sdk/models/index.ts +6 -0
  116. package/src/sdk/models/invoice-billing-reason.ts +1 -0
  117. package/src/sdk/models/list-subscription-line-items-response.ts +41 -0
  118. package/src/sdk/models/plan-filter.ts +3 -0
  119. package/src/sdk/models/s3-job-config.ts +20 -1
  120. package/src/sdk/models/scheduled-task-entity-type.ts +1 -0
  121. package/src/sdk/models/sub-modify-grouped-invoicing-params.ts +54 -0
  122. package/src/sdk/models/subscription-inheritance-config.ts +29 -0
  123. package/src/sdk/models/subscription-line-item-entity-type.ts +5 -0
  124. package/src/sdk/models/subscription-line-item-filter.ts +140 -0
  125. package/src/sdk/models/subscription-modify-type.ts +1 -0
  126. package/src/sdk/models/subscription-type.ts +2 -0
  127. package/src/sdk/models/window-size.ts +1 -1
  128. package/src/sdk/subscriptions.ts +18 -0
  129. package/src/types/primitives.ts +2 -4
package/FUNCTIONS.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Standalone Functions
2
2
 
3
3
  > [!NOTE]
4
- > This section is useful if you are using a bundler and targetting browsers and
4
+ > This section is useful if you are using a bundler and targeting browsers and
5
5
  > runtimes where the size of an application affects performance and load times.
6
6
 
7
7
  Every method in this SDK is also available as a standalone function. This
8
- alternative API is suitable when targetting the browser or serverless runtimes
8
+ alternative API is suitable when targeting the browser or serverless runtimes
9
9
  and using a bundler to build your application since all unused functionality
10
10
  will be tree-shaken away. This includes code for unused methods, Zod schemas,
11
11
  encoding helpers and response handlers. The result is dramatically smaller
@@ -20,6 +20,7 @@ let value: CustomerFilter = {};
20
20
  | `externalIds` | *string*[] | :heavy_minus_sign: | N/A |
21
21
  | `filters` | [models.FilterCondition](../../sdk/models/filter-condition.md)[] | :heavy_minus_sign: | N/A |
22
22
  | `limit` | *number* | :heavy_minus_sign: | N/A |
23
+ | `metadata` | Record<string, *string*> | :heavy_minus_sign: | N/A |
23
24
  | `offset` | *number* | :heavy_minus_sign: | N/A |
24
25
  | `order` | [models.CustomerFilterOrder](../../sdk/models/customer-filter-order.md) | :heavy_minus_sign: | N/A |
25
26
  | `sort` | [models.SortCondition](../../sdk/models/sort-condition.md)[] | :heavy_minus_sign: | N/A |
@@ -6,14 +6,15 @@
6
6
  import { ExecuteSubscriptionModifyRequest } from "@flexprice/sdk/sdk/models";
7
7
 
8
8
  let value: ExecuteSubscriptionModifyRequest = {
9
- type: "quantity_change",
9
+ type: "grouped_invoicing",
10
10
  };
11
11
  ```
12
12
 
13
13
  ## Fields
14
14
 
15
- | Field | Type | Required | Description |
16
- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
17
- | `inheritanceParams` | [models.SubModifyInheritanceRequest](../../sdk/models/sub-modify-inheritance-request.md) | :heavy_minus_sign: | N/A |
18
- | `quantityChangeParams` | [models.SubModifyQuantityChangeRequest](../../sdk/models/sub-modify-quantity-change-request.md) | :heavy_minus_sign: | N/A |
19
- | `type` | [models.SubscriptionModifyType](../../sdk/models/subscription-modify-type.md) | :heavy_check_mark: | N/A |
15
+ | Field | Type | Required | Description |
16
+ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
17
+ | `groupedInvoicingParams` | [models.SubModifyGroupedInvoicingParams](../../sdk/models/sub-modify-grouped-invoicing-params.md) | :heavy_minus_sign: | N/A |
18
+ | `inheritanceParams` | [models.SubModifyInheritanceRequest](../../sdk/models/sub-modify-inheritance-request.md) | :heavy_minus_sign: | N/A |
19
+ | `quantityChangeParams` | [models.SubModifyQuantityChangeRequest](../../sdk/models/sub-modify-quantity-change-request.md) | :heavy_minus_sign: | N/A |
20
+ | `type` | [models.SubscriptionModifyType](../../sdk/models/subscription-modify-type.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,17 @@
1
+ # ExportMetadataEntityType
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { ExportMetadataEntityType } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: ExportMetadataEntityType = "wallet";
9
+
10
+ // Open enum: unrecognized values are captured as Unrecognized<string>
11
+ ```
12
+
13
+ ## Values
14
+
15
+ ```typescript
16
+ "customer" | "wallet" | Unrecognized<string>
17
+ ```
@@ -0,0 +1,20 @@
1
+ # ExportMetadataField
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { ExportMetadataField } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: ExportMetadataField = {
9
+ entityType: "customer",
10
+ fieldKey: "<value>",
11
+ };
12
+ ```
13
+
14
+ ## Fields
15
+
16
+ | Field | Type | Required | Description |
17
+ | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
18
+ | `columnName` | *string* | :heavy_minus_sign: | CSV column header to be shown in the exported file |
19
+ | `entityType` | [models.ExportMetadataEntityType](../../sdk/models/export-metadata-entity-type.md) | :heavy_check_mark: | N/A |
20
+ | `fieldKey` | *string* | :heavy_check_mark: | metadata key to look up |
@@ -0,0 +1,15 @@
1
+ # GroupedInvoicingAction
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { GroupedInvoicingAction } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: GroupedInvoicingAction = "remove";
9
+ ```
10
+
11
+ ## Values
12
+
13
+ ```typescript
14
+ "add" | "remove"
15
+ ```
@@ -11,5 +11,5 @@ let value: InvoiceBillingReason = "SUBSCRIPTION_CYCLE";
11
11
  ## Values
12
12
 
13
13
  ```typescript
14
- "SUBSCRIPTION_CREATE" | "SUBSCRIPTION_CYCLE" | "SUBSCRIPTION_UPDATE" | "SUBSCRIPTION_TRIAL_END" | "PRORATION" | "MANUAL"
14
+ "SUBSCRIPTION_CREATE" | "SUBSCRIPTION_CYCLE" | "SUBSCRIPTION_UPDATE" | "SUBSCRIPTION_TRIAL_END" | "SUBSCRIPTION_TRIAL_START" | "PRORATION" | "MANUAL"
15
15
  ```
@@ -0,0 +1,50 @@
1
+ # ListSubscriptionLineItemsResponse
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { ListSubscriptionLineItemsResponse } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: ListSubscriptionLineItemsResponse = {
9
+ items: [
10
+ {
11
+ price: {
12
+ addon: {
13
+ prices: [
14
+ {
15
+ addon: {},
16
+ meter: {
17
+ createdAt: new Date("2024-03-20T15:04:05Z"),
18
+ eventName: "api_request",
19
+ id: "550e8400-e29b-41d4-a716-446655440000",
20
+ name: "API Usage Meter",
21
+ status: "published",
22
+ tenantId: "tenant123",
23
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
24
+ },
25
+ plan: {},
26
+ },
27
+ ],
28
+ },
29
+ meter: {
30
+ createdAt: new Date("2024-03-20T15:04:05Z"),
31
+ eventName: "api_request",
32
+ id: "550e8400-e29b-41d4-a716-446655440000",
33
+ name: "API Usage Meter",
34
+ status: "published",
35
+ tenantId: "tenant123",
36
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
37
+ },
38
+ plan: {},
39
+ },
40
+ },
41
+ ],
42
+ };
43
+ ```
44
+
45
+ ## Fields
46
+
47
+ | Field | Type | Required | Description |
48
+ | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
49
+ | `items` | [models.SubscriptionLineItemResponse](../../sdk/models/subscription-line-item-response.md)[] | :heavy_minus_sign: | N/A |
50
+ | `pagination` | [models.PaginationResponse](../../sdk/models/pagination-response.md) | :heavy_minus_sign: | N/A |
@@ -17,6 +17,7 @@ let value: PlanFilter = {};
17
17
  | `filters` | [models.FilterCondition](../../sdk/models/filter-condition.md)[] | :heavy_minus_sign: | filters allows complex filtering based on multiple fields |
18
18
  | `limit` | *number* | :heavy_minus_sign: | N/A |
19
19
  | `lookupKey` | *string* | :heavy_minus_sign: | N/A |
20
+ | `metadata` | Record<string, *string*> | :heavy_minus_sign: | N/A |
20
21
  | `offset` | *number* | :heavy_minus_sign: | N/A |
21
22
  | `order` | [models.PlanFilterOrder](../../sdk/models/plan-filter-order.md) | :heavy_minus_sign: | N/A |
22
23
  | `planIds` | *string*[] | :heavy_minus_sign: | N/A |
@@ -10,12 +10,13 @@ let value: S3JobConfig = {};
10
10
 
11
11
  ## Fields
12
12
 
13
- | Field | Type | Required | Description |
14
- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
15
- | `bucket` | *string* | :heavy_minus_sign: | S3 bucket name |
16
- | `compression` | [models.S3CompressionType](../../sdk/models/s3-compression-type.md) | :heavy_minus_sign: | N/A |
17
- | `encryption` | [models.S3EncryptionType](../../sdk/models/s3-encryption-type.md) | :heavy_minus_sign: | N/A |
18
- | `endpointUrl` | *string* | :heavy_minus_sign: | Custom S3 endpoint URL (e.g., "http://minio:9000" for MinIO) |
19
- | `keyPrefix` | *string* | :heavy_minus_sign: | Optional prefix for S3 keys (e.g., "flexprice-exports/") |
20
- | `region` | *string* | :heavy_minus_sign: | AWS region (e.g., "us-west-2") |
21
- | `usePathStyle` | *boolean* | :heavy_minus_sign: | Use path-style addressing instead of virtual-hosted-style (required for MinIO) |
13
+ | Field | Type | Required | Description |
14
+ | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
15
+ | `bucket` | *string* | :heavy_minus_sign: | S3 bucket name |
16
+ | `compression` | [models.S3CompressionType](../../sdk/models/s3-compression-type.md) | :heavy_minus_sign: | N/A |
17
+ | `encryption` | [models.S3EncryptionType](../../sdk/models/s3-encryption-type.md) | :heavy_minus_sign: | N/A |
18
+ | `endpointUrl` | *string* | :heavy_minus_sign: | Custom S3 endpoint URL (e.g., "http://minio:9000" for MinIO) |
19
+ | `exportMetadataFields` | [models.ExportMetadataField](../../sdk/models/export-metadata-field.md)[] | :heavy_minus_sign: | Optional user-selected metadata columns |
20
+ | `keyPrefix` | *string* | :heavy_minus_sign: | Optional prefix for S3 keys (e.g., "flexprice-exports/") |
21
+ | `region` | *string* | :heavy_minus_sign: | AWS region (e.g., "us-west-2") |
22
+ | `usePathStyle` | *boolean* | :heavy_minus_sign: | Use path-style addressing (required for MinIO) |
@@ -13,5 +13,5 @@ let value: ScheduledTaskEntityType = "invoice";
13
13
  ## Values
14
14
 
15
15
  ```typescript
16
- "events" | "invoice" | "credit_topups" | "credit_usage" | Unrecognized<string>
16
+ "events" | "invoice" | "credit_topups" | "credit_usage" | "usage_analytics" | Unrecognized<string>
17
17
  ```
@@ -0,0 +1,19 @@
1
+ # SubModifyGroupedInvoicingParams
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { SubModifyGroupedInvoicingParams } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: SubModifyGroupedInvoicingParams = {
9
+ action: "remove",
10
+ };
11
+ ```
12
+
13
+ ## Fields
14
+
15
+ | Field | Type | Required | Description |
16
+ | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
17
+ | `action` | [models.GroupedInvoicingAction](../../sdk/models/grouped-invoicing-action.md) | :heavy_check_mark: | N/A |
18
+ | `childSubscriptionIds` | *string*[] | :heavy_minus_sign: | N/A |
19
+ | `parentSubscriptionId` | *string* | :heavy_minus_sign: | ParentSubscriptionID is required for action 'add'. |
@@ -10,8 +10,9 @@ let value: SubscriptionInheritanceConfig = {};
10
10
 
11
11
  ## Fields
12
12
 
13
- | Field | Type | Required | Description |
14
- | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
15
- | `externalCustomerIdsToInheritSubscription` | *string*[] | :heavy_minus_sign: | N/A |
16
- | `invoicingCustomerExternalId` | *string* | :heavy_minus_sign: | N/A |
17
- | `parentSubscriptionId` | *string* | :heavy_minus_sign: | N/A |
13
+ | Field | Type | Required | Description |
14
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15
+ | `externalCustomerIdsToInheritSubscription` | *string*[] | :heavy_minus_sign: | ExternalCustomerIDsToInheritSubscription: child customer external IDs for which<br/>inherited skeleton subscriptions will be created. Only valid for parent behavior. |
16
+ | `invoicingCustomerExternalId` | *string* | :heavy_minus_sign: | InvoicingCustomerExternalID sets a different billing recipient (external ID).<br/>Required for delegated; rejected for inherited; optional for others. |
17
+ | `parentSubscriptionId` | *string* | :heavy_minus_sign: | ParentSubscriptionID links this subscription to an existing parent.<br/>Required for inherited and grouped_invoicing; rejected for standalone, delegated, parent. |
18
+ | `subscriptionsIdsForGroupedInvoicing` | *string*[] | :heavy_minus_sign: | SubscriptionsIDsForGroupedInvoicing: existing standalone subscription IDs to convert to<br/>grouped_invoicing under this parent at creation time. Only valid for parent behavior. |
@@ -0,0 +1,15 @@
1
+ # SubscriptionLineItemFilterOrder
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { SubscriptionLineItemFilterOrder } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: SubscriptionLineItemFilterOrder = "asc";
9
+ ```
10
+
11
+ ## Values
12
+
13
+ ```typescript
14
+ "asc" | "desc"
15
+ ```
@@ -0,0 +1,34 @@
1
+ # SubscriptionLineItemFilter
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { SubscriptionLineItemFilter } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: SubscriptionLineItemFilter = {};
9
+ ```
10
+
11
+ ## Fields
12
+
13
+ | Field | Type | Required | Description |
14
+ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
15
+ | `activeFilter` | *boolean* | :heavy_minus_sign: | N/A |
16
+ | `addonAssociationIds` | *string*[] | :heavy_minus_sign: | N/A |
17
+ | `billingPeriods` | *string*[] | :heavy_minus_sign: | N/A |
18
+ | `currencies` | *string*[] | :heavy_minus_sign: | N/A |
19
+ | `currentPeriodStart` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A |
20
+ | `customerIds` | *string*[] | :heavy_minus_sign: | N/A |
21
+ | `endTime` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A |
22
+ | `entityIds` | *string*[] | :heavy_minus_sign: | N/A |
23
+ | `entityType` | [models.SubscriptionLineItemEntityType](../../sdk/models/subscription-line-item-entity-type.md) | :heavy_minus_sign: | N/A |
24
+ | `expand` | *string* | :heavy_minus_sign: | N/A |
25
+ | `filters` | [models.FilterCondition](../../sdk/models/filter-condition.md)[] | :heavy_minus_sign: | N/A |
26
+ | `limit` | *number* | :heavy_minus_sign: | N/A |
27
+ | `meterIds` | *string*[] | :heavy_minus_sign: | N/A |
28
+ | `offset` | *number* | :heavy_minus_sign: | N/A |
29
+ | `order` | [models.SubscriptionLineItemFilterOrder](../../sdk/models/subscription-line-item-filter-order.md) | :heavy_minus_sign: | N/A |
30
+ | `priceIds` | *string*[] | :heavy_minus_sign: | N/A |
31
+ | `sort` | [models.SortCondition](../../sdk/models/sort-condition.md)[] | :heavy_minus_sign: | N/A |
32
+ | `startTime` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A |
33
+ | `status` | [models.Status](../../sdk/models/status.md) | :heavy_minus_sign: | N/A |
34
+ | `subscriptionIds` | *string*[] | :heavy_minus_sign: | Specific filters |
@@ -5,11 +5,11 @@
5
5
  ```typescript
6
6
  import { SubscriptionModifyType } from "@flexprice/sdk/sdk/models";
7
7
 
8
- let value: SubscriptionModifyType = "quantity_change";
8
+ let value: SubscriptionModifyType = "grouped_invoicing";
9
9
  ```
10
10
 
11
11
  ## Values
12
12
 
13
13
  ```typescript
14
- "inheritance" | "quantity_change"
14
+ "inheritance" | "quantity_change" | "grouped_invoicing"
15
15
  ```
@@ -13,5 +13,5 @@ let value: SubscriptionType = "inherited";
13
13
  ## Values
14
14
 
15
15
  ```typescript
16
- "standalone" | "parent" | "inherited" | Unrecognized<string>
16
+ "standalone" | "delegated_invoicing" | "parent" | "inherited" | "grouped_invoicing" | Unrecognized<string>
17
17
  ```
@@ -5,7 +5,7 @@
5
5
  ```typescript
6
6
  import { WindowSize } from "@flexprice/sdk/sdk/models";
7
7
 
8
- let value: WindowSize = "12HOUR";
8
+ let value: WindowSize = "6HOUR";
9
9
 
10
10
  // Open enum: unrecognized values are captured as Unrecognized<string>
11
11
  ```
@@ -13,5 +13,5 @@ let value: WindowSize = "12HOUR";
13
13
  ## Values
14
14
 
15
15
  ```typescript
16
- "MINUTE" | "15MIN" | "30MIN" | "HOUR" | "3HOUR" | "6HOUR" | "12HOUR" | "DAY" | "WEEK" | "MONTH" | Unrecognized<string>
16
+ "MONTH" | "MINUTE" | "15MIN" | "30MIN" | "HOUR" | "3HOUR" | "6HOUR" | "12HOUR" | "DAY" | "WEEK" | Unrecognized<string>
17
17
  ```
@@ -101,7 +101,7 @@ const flexprice = new Flexprice({
101
101
  async function run() {
102
102
  const result = await flexprice.scheduledTasks.createScheduledTask({
103
103
  connectionId: "<id>",
104
- entityType: "credit_topups",
104
+ entityType: "credit_usage",
105
105
  interval: "custom",
106
106
  jobConfig: {},
107
107
  });
@@ -129,7 +129,7 @@ const flexprice = new FlexpriceCore({
129
129
  async function run() {
130
130
  const res = await scheduledTasksCreateScheduledTask(flexprice, {
131
131
  connectionId: "<id>",
132
- entityType: "credit_topups",
132
+ entityType: "credit_usage",
133
133
  interval: "custom",
134
134
  jobConfig: {},
135
135
  });
@@ -7,6 +7,7 @@
7
7
  * [createSubscription](#createsubscription) - Create subscription
8
8
  * [addSubscriptionAddon](#addsubscriptionaddon) - Add addon to subscription
9
9
  * [removeSubscriptionAddon](#removesubscriptionaddon) - Remove addon from subscription
10
+ * [querySubscriptionLineItems](#querysubscriptionlineitems) - Search subscription line items
10
11
  * [updateSubscriptionLineItem](#updatesubscriptionlineitem) - Update subscription line item
11
12
  * [deleteSubscriptionLineItem](#deletesubscriptionlineitem) - Delete subscription line item
12
13
  * [querySubscription](#querysubscription) - Query subscriptions
@@ -260,6 +261,77 @@ run();
260
261
  | models.ErrorsErrorResponse | 500 | application/json |
261
262
  | models.SDKError | 4XX, 5XX | \*/\* |
262
263
 
264
+ ## querySubscriptionLineItems
265
+
266
+ List subscription line items with a JSON filter (subscription, customer, price, pagination, expand=prices, etc.).
267
+
268
+ ### Example Usage
269
+
270
+ <!-- UsageSnippet language="typescript" operationID="querySubscriptionLineItems" method="post" path="/subscriptions/lineitems/search" -->
271
+ ```typescript
272
+ import { Flexprice } from "@flexprice/sdk";
273
+
274
+ const flexprice = new Flexprice({
275
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
276
+ });
277
+
278
+ async function run() {
279
+ const result = await flexprice.subscriptions.querySubscriptionLineItems({});
280
+
281
+ console.log(result);
282
+ }
283
+
284
+ run();
285
+ ```
286
+
287
+ ### Standalone function
288
+
289
+ The standalone function version of this method:
290
+
291
+ ```typescript
292
+ import { FlexpriceCore } from "@flexprice/sdk/core.js";
293
+ import { subscriptionsQuerySubscriptionLineItems } from "@flexprice/sdk/funcs/subscriptions-query-subscription-line-items.js";
294
+
295
+ // Use `FlexpriceCore` for best tree-shaking performance.
296
+ // You can create one instance of it to use across an application.
297
+ const flexprice = new FlexpriceCore({
298
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
299
+ });
300
+
301
+ async function run() {
302
+ const res = await subscriptionsQuerySubscriptionLineItems(flexprice, {});
303
+ if (res.ok) {
304
+ const { value: result } = res;
305
+ console.log(result);
306
+ } else {
307
+ console.log("subscriptionsQuerySubscriptionLineItems failed:", res.error);
308
+ }
309
+ }
310
+
311
+ run();
312
+ ```
313
+
314
+ ### Parameters
315
+
316
+ | Parameter | Type | Required | Description |
317
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
318
+ | `request` | [models.SubscriptionLineItemFilter](../../sdk/models/subscription-line-item-filter.md) | :heavy_check_mark: | The request object to use for the request. |
319
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
320
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
321
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
322
+
323
+ ### Response
324
+
325
+ **Promise\<[models.ListSubscriptionLineItemsResponse](../../sdk/models/list-subscription-line-items-response.md)\>**
326
+
327
+ ### Errors
328
+
329
+ | Error Type | Status Code | Content Type |
330
+ | -------------------------- | -------------------------- | -------------------------- |
331
+ | models.ErrorsErrorResponse | 400 | application/json |
332
+ | models.ErrorsErrorResponse | 500 | application/json |
333
+ | models.SDKError | 4XX, 5XX | \*/\* |
334
+
263
335
  ## updateSubscriptionLineItem
264
336
 
265
337
  Use when changing a subscription line item (e.g. quantity or price). Implemented by ending the current line and creating a new one for clean billing.
@@ -1397,7 +1469,7 @@ const flexprice = new Flexprice({
1397
1469
 
1398
1470
  async function run() {
1399
1471
  const result = await flexprice.subscriptions.previewSubscriptionModify("<id>", {
1400
- type: "quantity_change",
1472
+ type: "grouped_invoicing",
1401
1473
  });
1402
1474
 
1403
1475
  console.log(result);
@@ -1422,7 +1494,7 @@ const flexprice = new FlexpriceCore({
1422
1494
 
1423
1495
  async function run() {
1424
1496
  const res = await subscriptionsPreviewSubscriptionModify(flexprice, "<id>", {
1425
- type: "quantity_change",
1497
+ type: "grouped_invoicing",
1426
1498
  });
1427
1499
  if (res.ok) {
1428
1500
  const { value: result } = res;
@@ -0,0 +1,17 @@
1
+ import { FlexpriceCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { FlexPriceError } from "../sdk/models/flex-price-error.js";
4
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../sdk/models/http-client-errors.js";
5
+ import * as models from "../sdk/models/index.js";
6
+ import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
7
+ import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
8
+ import { APIPromise } from "../types/async.js";
9
+ import { Result } from "../types/fp.js";
10
+ /**
11
+ * Search subscription line items
12
+ *
13
+ * @remarks
14
+ * List subscription line items with a JSON filter (subscription, customer, price, pagination, expand=prices, etc.).
15
+ */
16
+ export declare function subscriptionsQuerySubscriptionLineItems(client: FlexpriceCore, request: models.SubscriptionLineItemFilter, options?: RequestOptions): APIPromise<Result<models.ListSubscriptionLineItemsResponse, models.ErrorsErrorResponse | FlexPriceError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
17
+ //# sourceMappingURL=subscriptions-query-subscription-line-items.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions-query-subscription-line-items.d.ts","sourceRoot":"","sources":["../../src/funcs/subscriptions-query-subscription-line-items.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAM3C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,CAAC,0BAA0B,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,iCAAiC,EACtC,MAAM,CAAC,mBAAmB,GAC1B,cAAc,GACd,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { encodeJSON } from "../lib/encodings.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import * as models from "../sdk/models/index.js";
13
+ import { APIPromise } from "../types/async.js";
14
+ /**
15
+ * Search subscription line items
16
+ *
17
+ * @remarks
18
+ * List subscription line items with a JSON filter (subscription, customer, price, pagination, expand=prices, etc.).
19
+ */
20
+ export function subscriptionsQuerySubscriptionLineItems(client, request, options) {
21
+ return new APIPromise($do(client, request, options));
22
+ }
23
+ async function $do(client, request, options) {
24
+ const parsed = safeParse(request, (value) => z.parse(models.SubscriptionLineItemFilter$outboundSchema, value), "Input validation failed");
25
+ if (!parsed.ok) {
26
+ return [parsed, { status: "invalid" }];
27
+ }
28
+ const payload = parsed.value;
29
+ const body = encodeJSON("body", payload, { explode: true });
30
+ const path = pathToFunc("/subscriptions/lineitems/search")();
31
+ const headers = new Headers(compactMap({
32
+ "Content-Type": "application/json",
33
+ Accept: "application/json",
34
+ }));
35
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
36
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
37
+ const requestSecurity = resolveGlobalSecurity(securityInput);
38
+ const context = {
39
+ options: client._options,
40
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
41
+ operationID: "querySubscriptionLineItems",
42
+ oAuth2Scopes: null,
43
+ resolvedSecurity: requestSecurity,
44
+ securitySource: client._options.apiKeyAuth,
45
+ retryConfig: options?.retries
46
+ || client._options.retryConfig
47
+ || { strategy: "none" },
48
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
49
+ };
50
+ const requestRes = client._createRequest(context, {
51
+ security: requestSecurity,
52
+ method: "POST",
53
+ baseURL: options?.serverURL,
54
+ path: path,
55
+ headers: headers,
56
+ body: body,
57
+ userAgent: client._options.userAgent,
58
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
59
+ }, options);
60
+ if (!requestRes.ok) {
61
+ return [requestRes, { status: "invalid" }];
62
+ }
63
+ const req = requestRes.value;
64
+ const doResult = await client._do(req, {
65
+ context,
66
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
67
+ retryConfig: context.retryConfig,
68
+ retryCodes: context.retryCodes,
69
+ });
70
+ if (!doResult.ok) {
71
+ return [doResult, { status: "request-error", request: req }];
72
+ }
73
+ const response = doResult.value;
74
+ const responseFields = {
75
+ HttpMeta: { Response: response, Request: req },
76
+ };
77
+ const [result] = await M.match(M.json(200, models.ListSubscriptionLineItemsResponse$inboundSchema), M.jsonErr(400, models.ErrorsErrorResponse$inboundSchema), M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
78
+ if (!result.ok) {
79
+ return [result, { status: "complete", request: req, response }];
80
+ }
81
+ return [result, { status: "complete", request: req, response }];
82
+ }
83
+ //# sourceMappingURL=subscriptions-query-subscription-line-items.js.map