@flexprice/sdk 2.1.38 → 2.1.39

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 (74) hide show
  1. package/docs/sdk/models/invoice-billing-reason.md +2 -2
  2. package/docs/sdk/models/pause-subscription-request-request.md +19 -0
  3. package/docs/sdk/models/pause-subscription-request.md +19 -0
  4. package/docs/sdk/models/pause-subscription-response.md +127 -0
  5. package/docs/sdk/models/resume-subscription-request-request.md +19 -0
  6. package/docs/sdk/models/resume-subscription-request.md +18 -0
  7. package/docs/sdk/models/resume-subscription-response.md +127 -0
  8. package/docs/sdk/models/subscription-pause-response.md +35 -0
  9. package/docs/sdks/subscriptions/README.md +146 -0
  10. package/esm/funcs/subscriptions-pause-subscription.d.ts +17 -0
  11. package/esm/funcs/subscriptions-pause-subscription.d.ts.map +1 -0
  12. package/esm/funcs/subscriptions-pause-subscription.js +93 -0
  13. package/esm/funcs/subscriptions-pause-subscription.js.map +1 -0
  14. package/esm/funcs/subscriptions-resume-subscription.d.ts +17 -0
  15. package/esm/funcs/subscriptions-resume-subscription.d.ts.map +1 -0
  16. package/esm/funcs/subscriptions-resume-subscription.js +93 -0
  17. package/esm/funcs/subscriptions-resume-subscription.js.map +1 -0
  18. package/esm/lib/config.d.ts +2 -2
  19. package/esm/lib/config.js +2 -2
  20. package/esm/sdk/models/index.d.ts +7 -0
  21. package/esm/sdk/models/index.d.ts.map +1 -1
  22. package/esm/sdk/models/index.js +7 -0
  23. package/esm/sdk/models/index.js.map +1 -1
  24. package/esm/sdk/models/invoice-billing-reason.d.ts +2 -0
  25. package/esm/sdk/models/invoice-billing-reason.d.ts.map +1 -1
  26. package/esm/sdk/models/invoice-billing-reason.js +2 -0
  27. package/esm/sdk/models/invoice-billing-reason.js.map +1 -1
  28. package/esm/sdk/models/pause-subscription-op.d.ts +21 -0
  29. package/esm/sdk/models/pause-subscription-op.d.ts.map +1 -0
  30. package/esm/sdk/models/pause-subscription-op.js +14 -0
  31. package/esm/sdk/models/pause-subscription-op.js.map +1 -0
  32. package/esm/sdk/models/pause-subscription-request.d.ts +37 -0
  33. package/esm/sdk/models/pause-subscription-request.d.ts.map +1 -0
  34. package/esm/sdk/models/pause-subscription-request.js +20 -0
  35. package/esm/sdk/models/pause-subscription-request.js.map +1 -0
  36. package/esm/sdk/models/pause-subscription-response.d.ts +19 -0
  37. package/esm/sdk/models/pause-subscription-response.d.ts.map +1 -0
  38. package/esm/sdk/models/pause-subscription-response.js +17 -0
  39. package/esm/sdk/models/pause-subscription-response.js.map +1 -0
  40. package/esm/sdk/models/resume-subscription-op.d.ts +21 -0
  41. package/esm/sdk/models/resume-subscription-op.d.ts.map +1 -0
  42. package/esm/sdk/models/resume-subscription-op.js +14 -0
  43. package/esm/sdk/models/resume-subscription-op.js.map +1 -0
  44. package/esm/sdk/models/resume-subscription-request.d.ts +28 -0
  45. package/esm/sdk/models/resume-subscription-request.d.ts.map +1 -0
  46. package/esm/sdk/models/resume-subscription-request.js +19 -0
  47. package/esm/sdk/models/resume-subscription-request.js.map +1 -0
  48. package/esm/sdk/models/resume-subscription-response.d.ts +19 -0
  49. package/esm/sdk/models/resume-subscription-response.d.ts.map +1 -0
  50. package/esm/sdk/models/resume-subscription-response.js +17 -0
  51. package/esm/sdk/models/resume-subscription-response.js.map +1 -0
  52. package/esm/sdk/models/subscription-pause-response.d.ts +64 -0
  53. package/esm/sdk/models/subscription-pause-response.d.ts.map +1 -0
  54. package/esm/sdk/models/subscription-pause-response.js +55 -0
  55. package/esm/sdk/models/subscription-pause-response.js.map +1 -0
  56. package/esm/sdk/subscriptions.d.ts +14 -0
  57. package/esm/sdk/subscriptions.d.ts.map +1 -1
  58. package/esm/sdk/subscriptions.js +20 -0
  59. package/esm/sdk/subscriptions.js.map +1 -1
  60. package/jsr.json +1 -1
  61. package/package.json +1 -1
  62. package/src/funcs/subscriptions-pause-subscription.ts +187 -0
  63. package/src/funcs/subscriptions-resume-subscription.ts +187 -0
  64. package/src/lib/config.ts +2 -2
  65. package/src/sdk/models/index.ts +7 -0
  66. package/src/sdk/models/invoice-billing-reason.ts +2 -0
  67. package/src/sdk/models/pause-subscription-op.ts +46 -0
  68. package/src/sdk/models/pause-subscription-request.ts +64 -0
  69. package/src/sdk/models/pause-subscription-response.ts +47 -0
  70. package/src/sdk/models/resume-subscription-op.ts +46 -0
  71. package/src/sdk/models/resume-subscription-request.ts +54 -0
  72. package/src/sdk/models/resume-subscription-response.ts +47 -0
  73. package/src/sdk/models/subscription-pause-response.ts +123 -0
  74. package/src/sdk/subscriptions.ts +40 -0
@@ -5,11 +5,11 @@
5
5
  ```typescript
6
6
  import { InvoiceBillingReason } from "@flexprice/sdk/sdk/models";
7
7
 
8
- let value: InvoiceBillingReason = "SUBSCRIPTION_UPDATE";
8
+ let value: InvoiceBillingReason = "SUBSCRIPTION_TRIAL_END";
9
9
  ```
10
10
 
11
11
  ## Values
12
12
 
13
13
  ```typescript
14
- "SUBSCRIPTION_CREATE" | "SUBSCRIPTION_CYCLE" | "SUBSCRIPTION_UPDATE" | "SUBSCRIPTION_TRIAL_END" | "SUBSCRIPTION_TRIAL_START" | "PRORATION" | "MANUAL" | "AUTO_INVOICE_THRESHOLD" | "WALLET_AUTO_TOPUP"
14
+ "SUBSCRIPTION_CREATE" | "SUBSCRIPTION_CYCLE" | "SUBSCRIPTION_UPDATE" | "SUBSCRIPTION_TRIAL_END" | "SUBSCRIPTION_TRIAL_START" | "PRORATION" | "MANUAL" | "AUTO_INVOICE_THRESHOLD" | "WALLET_AUTO_TOPUP" | "SUBSCRIPTION_PAUSED" | "SUBSCRIPTION_RESUME"
15
15
  ```
@@ -0,0 +1,19 @@
1
+ # PauseSubscriptionRequestRequest
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { PauseSubscriptionRequestRequest } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: PauseSubscriptionRequestRequest = {
9
+ id: "<id>",
10
+ body: {},
11
+ };
12
+ ```
13
+
14
+ ## Fields
15
+
16
+ | Field | Type | Required | Description |
17
+ | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
18
+ | `id` | *string* | :heavy_check_mark: | Subscription ID |
19
+ | `body` | [models.PauseSubscriptionRequest](../../sdk/models/pause-subscription-request.md) | :heavy_check_mark: | Pause subscription request |
@@ -0,0 +1,19 @@
1
+ # PauseSubscriptionRequest
2
+
3
+ Pauses an active subscription now. Usage and arrear fixed charges up to the pause are billed on a closing invoice.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { PauseSubscriptionRequest } from "@flexprice/sdk/sdk/models";
9
+
10
+ let value: PauseSubscriptionRequest = {};
11
+ ```
12
+
13
+ ## Fields
14
+
15
+ | Field | Type | Required | Description |
16
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
17
+ | `metadata` | Record<string, *string*> | :heavy_minus_sign: | Metadata stored on the pause<br/>@Example {"requested_by": "customer", "channel": "support_ticket"} |
18
+ | `prorationBehavior` | [models.ProrationBehavior](../../sdk/models/proration-behavior.md) | :heavy_minus_sign: | N/A |
19
+ | `reason` | *string* | :heavy_minus_sign: | Reason for pausing the subscription<br/>@Description Optional reason for the pause. Maximum 255 characters<br/>@Example "Customer requested temporary suspension" |
@@ -0,0 +1,127 @@
1
+ # PauseSubscriptionResponse
2
+
3
+ The paused subscription and its pause
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { PauseSubscriptionResponse } from "@flexprice/sdk/sdk/models";
9
+
10
+ let value: PauseSubscriptionResponse = {
11
+ subscription: {
12
+ couponAssociations: [
13
+ {
14
+ subscriptionLineItem: {
15
+ price: {
16
+ addon: {
17
+ prices: [
18
+ {
19
+ addon: {},
20
+ meter: {
21
+ createdAt: new Date("2024-03-20T15:04:05Z"),
22
+ eventName: "api_request",
23
+ id: "550e8400-e29b-41d4-a716-446655440000",
24
+ name: "API Usage Meter",
25
+ status: "published",
26
+ tenantId: "tenant123",
27
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
28
+ },
29
+ plan: {},
30
+ },
31
+ ],
32
+ },
33
+ meter: {
34
+ createdAt: new Date("2024-03-20T15:04:05Z"),
35
+ eventName: "api_request",
36
+ id: "550e8400-e29b-41d4-a716-446655440000",
37
+ name: "API Usage Meter",
38
+ status: "published",
39
+ tenantId: "tenant123",
40
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
41
+ },
42
+ plan: {},
43
+ },
44
+ },
45
+ },
46
+ ],
47
+ entitlements: [
48
+ {
49
+ feature: {
50
+ meter: {
51
+ createdAt: new Date("2024-03-20T15:04:05Z"),
52
+ eventName: "api_request",
53
+ id: "550e8400-e29b-41d4-a716-446655440000",
54
+ name: "API Usage Meter",
55
+ status: "published",
56
+ tenantId: "tenant123",
57
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
58
+ },
59
+ },
60
+ },
61
+ ],
62
+ latestInvoice: {
63
+ subscription: {
64
+ couponAssociations: [
65
+ {
66
+ subscriptionLineItem: {
67
+ price: {
68
+ addon: {
69
+ prices: [
70
+ {
71
+ addon: {},
72
+ meter: {
73
+ createdAt: new Date("2024-03-20T15:04:05Z"),
74
+ eventName: "api_request",
75
+ id: "550e8400-e29b-41d4-a716-446655440000",
76
+ name: "API Usage Meter",
77
+ status: "published",
78
+ tenantId: "tenant123",
79
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
80
+ },
81
+ plan: {},
82
+ },
83
+ ],
84
+ },
85
+ meter: {
86
+ createdAt: new Date("2024-03-20T15:04:05Z"),
87
+ eventName: "api_request",
88
+ id: "550e8400-e29b-41d4-a716-446655440000",
89
+ name: "API Usage Meter",
90
+ status: "published",
91
+ tenantId: "tenant123",
92
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
93
+ },
94
+ plan: {},
95
+ },
96
+ },
97
+ },
98
+ ],
99
+ entitlements: [
100
+ {
101
+ feature: {
102
+ meter: {
103
+ createdAt: new Date("2024-03-20T15:04:05Z"),
104
+ eventName: "api_request",
105
+ id: "550e8400-e29b-41d4-a716-446655440000",
106
+ name: "API Usage Meter",
107
+ status: "published",
108
+ tenantId: "tenant123",
109
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
110
+ },
111
+ },
112
+ },
113
+ ],
114
+ plan: {},
115
+ },
116
+ },
117
+ plan: {},
118
+ },
119
+ };
120
+ ```
121
+
122
+ ## Fields
123
+
124
+ | Field | Type | Required | Description |
125
+ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
126
+ | `pause` | [models.SubscriptionPauseResponse](../../sdk/models/subscription-pause-response.md) | :heavy_minus_sign: | Response object containing subscription pause information |
127
+ | `subscription` | [models.SubscriptionResponse](../../sdk/models/subscription-response.md) | :heavy_minus_sign: | N/A |
@@ -0,0 +1,19 @@
1
+ # ResumeSubscriptionRequestRequest
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { ResumeSubscriptionRequestRequest } from "@flexprice/sdk/sdk/models";
7
+
8
+ let value: ResumeSubscriptionRequestRequest = {
9
+ id: "<id>",
10
+ body: {},
11
+ };
12
+ ```
13
+
14
+ ## Fields
15
+
16
+ | Field | Type | Required | Description |
17
+ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
18
+ | `id` | *string* | :heavy_check_mark: | Subscription ID |
19
+ | `body` | [models.ResumeSubscriptionRequest](../../sdk/models/resume-subscription-request.md) | :heavy_check_mark: | Resume subscription request |
@@ -0,0 +1,18 @@
1
+ # ResumeSubscriptionRequest
2
+
3
+ Resumes a paused subscription now. The billing anchor is kept, so the first period runs from the resume time to the next billing date.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { ResumeSubscriptionRequest } from "@flexprice/sdk/sdk/models";
9
+
10
+ let value: ResumeSubscriptionRequest = {};
11
+ ```
12
+
13
+ ## Fields
14
+
15
+ | Field | Type | Required | Description |
16
+ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
17
+ | `metadata` | Record<string, *string*> | :heavy_minus_sign: | Metadata merged into the pause<br/>@Example {"resumed_by": "admin"} |
18
+ | `prorationBehavior` | [models.ProrationBehavior](../../sdk/models/proration-behavior.md) | :heavy_minus_sign: | N/A |
@@ -0,0 +1,127 @@
1
+ # ResumeSubscriptionResponse
2
+
3
+ The resumed subscription and the pause it ended
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { ResumeSubscriptionResponse } from "@flexprice/sdk/sdk/models";
9
+
10
+ let value: ResumeSubscriptionResponse = {
11
+ subscription: {
12
+ couponAssociations: [
13
+ {
14
+ subscriptionLineItem: {
15
+ price: {
16
+ addon: {
17
+ prices: [
18
+ {
19
+ addon: {},
20
+ meter: {
21
+ createdAt: new Date("2024-03-20T15:04:05Z"),
22
+ eventName: "api_request",
23
+ id: "550e8400-e29b-41d4-a716-446655440000",
24
+ name: "API Usage Meter",
25
+ status: "published",
26
+ tenantId: "tenant123",
27
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
28
+ },
29
+ plan: {},
30
+ },
31
+ ],
32
+ },
33
+ meter: {
34
+ createdAt: new Date("2024-03-20T15:04:05Z"),
35
+ eventName: "api_request",
36
+ id: "550e8400-e29b-41d4-a716-446655440000",
37
+ name: "API Usage Meter",
38
+ status: "published",
39
+ tenantId: "tenant123",
40
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
41
+ },
42
+ plan: {},
43
+ },
44
+ },
45
+ },
46
+ ],
47
+ entitlements: [
48
+ {
49
+ feature: {
50
+ meter: {
51
+ createdAt: new Date("2024-03-20T15:04:05Z"),
52
+ eventName: "api_request",
53
+ id: "550e8400-e29b-41d4-a716-446655440000",
54
+ name: "API Usage Meter",
55
+ status: "published",
56
+ tenantId: "tenant123",
57
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
58
+ },
59
+ },
60
+ },
61
+ ],
62
+ latestInvoice: {
63
+ subscription: {
64
+ couponAssociations: [
65
+ {
66
+ subscriptionLineItem: {
67
+ price: {
68
+ addon: {
69
+ prices: [
70
+ {
71
+ addon: {},
72
+ meter: {
73
+ createdAt: new Date("2024-03-20T15:04:05Z"),
74
+ eventName: "api_request",
75
+ id: "550e8400-e29b-41d4-a716-446655440000",
76
+ name: "API Usage Meter",
77
+ status: "published",
78
+ tenantId: "tenant123",
79
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
80
+ },
81
+ plan: {},
82
+ },
83
+ ],
84
+ },
85
+ meter: {
86
+ createdAt: new Date("2024-03-20T15:04:05Z"),
87
+ eventName: "api_request",
88
+ id: "550e8400-e29b-41d4-a716-446655440000",
89
+ name: "API Usage Meter",
90
+ status: "published",
91
+ tenantId: "tenant123",
92
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
93
+ },
94
+ plan: {},
95
+ },
96
+ },
97
+ },
98
+ ],
99
+ entitlements: [
100
+ {
101
+ feature: {
102
+ meter: {
103
+ createdAt: new Date("2024-03-20T15:04:05Z"),
104
+ eventName: "api_request",
105
+ id: "550e8400-e29b-41d4-a716-446655440000",
106
+ name: "API Usage Meter",
107
+ status: "published",
108
+ tenantId: "tenant123",
109
+ updatedAt: new Date("2024-03-20T15:04:05Z"),
110
+ },
111
+ },
112
+ },
113
+ ],
114
+ plan: {},
115
+ },
116
+ },
117
+ plan: {},
118
+ },
119
+ };
120
+ ```
121
+
122
+ ## Fields
123
+
124
+ | Field | Type | Required | Description |
125
+ | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
126
+ | `pause` | [models.SubscriptionPauseResponse](../../sdk/models/subscription-pause-response.md) | :heavy_minus_sign: | Response object containing subscription pause information |
127
+ | `subscription` | [models.SubscriptionResponse](../../sdk/models/subscription-response.md) | :heavy_minus_sign: | N/A |
@@ -0,0 +1,35 @@
1
+ # SubscriptionPauseResponse
2
+
3
+ Response object containing subscription pause information
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { SubscriptionPauseResponse } from "@flexprice/sdk/sdk/models";
9
+
10
+ let value: SubscriptionPauseResponse = {};
11
+ ```
12
+
13
+ ## Fields
14
+
15
+ | Field | Type | Required | Description |
16
+ | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
17
+ | `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A |
18
+ | `createdBy` | *string* | :heavy_minus_sign: | N/A |
19
+ | `environmentId` | *string* | :heavy_minus_sign: | EnvironmentID is the environment identifier for the pause |
20
+ | `id` | *string* | :heavy_minus_sign: | ID is the unique identifier for the subscription pause |
21
+ | `metadata` | Record<string, *string*> | :heavy_minus_sign: | N/A |
22
+ | `originalPeriodEnd` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | OriginalPeriodEnd is the end of the billing period when the pause was created |
23
+ | `originalPeriodStart` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | OriginalPeriodStart is the start of the billing period when the pause was created |
24
+ | `pauseEnd` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | PauseEnd is when the pause will end (null for indefinite) |
25
+ | `pauseMode` | [models.PauseMode](../../sdk/models/pause-mode.md) | :heavy_minus_sign: | N/A |
26
+ | `pauseStart` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | PauseStart is when the pause actually started |
27
+ | `pauseStatus` | [models.PauseStatus](../../sdk/models/pause-status.md) | :heavy_minus_sign: | N/A |
28
+ | `reason` | *string* | :heavy_minus_sign: | Reason is the reason for pausing |
29
+ | `resumeMode` | [models.ResumeMode](../../sdk/models/resume-mode.md) | :heavy_minus_sign: | N/A |
30
+ | `resumedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | ResumedAt is when the pause was actually ended (if manually resumed) |
31
+ | `status` | [models.Status](../../sdk/models/status.md) | :heavy_minus_sign: | N/A |
32
+ | `subscriptionId` | *string* | :heavy_minus_sign: | SubscriptionID is the identifier for the subscription |
33
+ | `tenantId` | *string* | :heavy_minus_sign: | N/A |
34
+ | `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A |
35
+ | `updatedBy` | *string* | :heavy_minus_sign: | N/A |
@@ -29,6 +29,8 @@
29
29
  * [createSubscriptionLineItem](#createsubscriptionlineitem) - Create subscription line item
30
30
  * [executeSubscriptionModify](#executesubscriptionmodify) - Execute subscription modification
31
31
  * [previewSubscriptionModify](#previewsubscriptionmodify) - Preview subscription modification
32
+ * [pauseSubscription](#pausesubscription) - Pause subscription
33
+ * [resumeSubscription](#resumesubscription) - Resume subscription
32
34
  * [listSubscriptionSchedules](#listsubscriptionschedules) - List subscription schedules
33
35
  * [getSubscriptionV2](#getsubscriptionv2) - Get subscription (V2)
34
36
 
@@ -1911,6 +1913,150 @@ run();
1911
1913
  | models.ErrorsErrorResponse | 500 | application/json |
1912
1914
  | models.SDKError | 4XX, 5XX | \*/\* |
1913
1915
 
1916
+ ## pauseSubscription
1917
+
1918
+ Use when a customer stops temporarily. Pauses an active subscription now: usage and arrear fixed charges up to the pause are billed on a closing invoice, and every paused period after it gets a $0 skipped invoice.
1919
+
1920
+ ### Example Usage
1921
+
1922
+ <!-- UsageSnippet language="typescript" operationID="pauseSubscription" method="post" path="/subscriptions/{id}/pause" -->
1923
+ ```typescript
1924
+ import { Flexprice } from "@flexprice/sdk";
1925
+
1926
+ const flexprice = new Flexprice({
1927
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
1928
+ });
1929
+
1930
+ async function run() {
1931
+ const result = await flexprice.subscriptions.pauseSubscription("<id>", {});
1932
+
1933
+ console.log(result);
1934
+ }
1935
+
1936
+ run();
1937
+ ```
1938
+
1939
+ ### Standalone function
1940
+
1941
+ The standalone function version of this method:
1942
+
1943
+ ```typescript
1944
+ import { FlexpriceCore } from "@flexprice/sdk/core.js";
1945
+ import { subscriptionsPauseSubscription } from "@flexprice/sdk/funcs/subscriptions-pause-subscription.js";
1946
+
1947
+ // Use `FlexpriceCore` for best tree-shaking performance.
1948
+ // You can create one instance of it to use across an application.
1949
+ const flexprice = new FlexpriceCore({
1950
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
1951
+ });
1952
+
1953
+ async function run() {
1954
+ const res = await subscriptionsPauseSubscription(flexprice, "<id>", {});
1955
+ if (res.ok) {
1956
+ const { value: result } = res;
1957
+ console.log(result);
1958
+ } else {
1959
+ console.log("subscriptionsPauseSubscription failed:", res.error);
1960
+ }
1961
+ }
1962
+
1963
+ run();
1964
+ ```
1965
+
1966
+ ### Parameters
1967
+
1968
+ | Parameter | Type | Required | Description |
1969
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1970
+ | `id` | *string* | :heavy_check_mark: | Subscription ID |
1971
+ | `body` | [models.PauseSubscriptionRequest](../../sdk/models/pause-subscription-request.md) | :heavy_check_mark: | Pause subscription request |
1972
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1973
+ | `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. |
1974
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1975
+
1976
+ ### Response
1977
+
1978
+ **Promise\<[models.PauseSubscriptionResponse](../../sdk/models/pause-subscription-response.md)\>**
1979
+
1980
+ ### Errors
1981
+
1982
+ | Error Type | Status Code | Content Type |
1983
+ | -------------------------- | -------------------------- | -------------------------- |
1984
+ | models.ErrorsErrorResponse | 400, 404 | application/json |
1985
+ | models.ErrorsErrorResponse | 500 | application/json |
1986
+ | models.SDKError | 4XX, 5XX | \*/\* |
1987
+
1988
+ ## resumeSubscription
1989
+
1990
+ Use when a paused customer comes back. Resumes a paused subscription now on its existing billing anchor: the first period runs from the resume to the next billing date and its advance charges are invoiced at once.
1991
+
1992
+ ### Example Usage
1993
+
1994
+ <!-- UsageSnippet language="typescript" operationID="resumeSubscription" method="post" path="/subscriptions/{id}/resume" -->
1995
+ ```typescript
1996
+ import { Flexprice } from "@flexprice/sdk";
1997
+
1998
+ const flexprice = new Flexprice({
1999
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
2000
+ });
2001
+
2002
+ async function run() {
2003
+ const result = await flexprice.subscriptions.resumeSubscription("<id>", {});
2004
+
2005
+ console.log(result);
2006
+ }
2007
+
2008
+ run();
2009
+ ```
2010
+
2011
+ ### Standalone function
2012
+
2013
+ The standalone function version of this method:
2014
+
2015
+ ```typescript
2016
+ import { FlexpriceCore } from "@flexprice/sdk/core.js";
2017
+ import { subscriptionsResumeSubscription } from "@flexprice/sdk/funcs/subscriptions-resume-subscription.js";
2018
+
2019
+ // Use `FlexpriceCore` for best tree-shaking performance.
2020
+ // You can create one instance of it to use across an application.
2021
+ const flexprice = new FlexpriceCore({
2022
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
2023
+ });
2024
+
2025
+ async function run() {
2026
+ const res = await subscriptionsResumeSubscription(flexprice, "<id>", {});
2027
+ if (res.ok) {
2028
+ const { value: result } = res;
2029
+ console.log(result);
2030
+ } else {
2031
+ console.log("subscriptionsResumeSubscription failed:", res.error);
2032
+ }
2033
+ }
2034
+
2035
+ run();
2036
+ ```
2037
+
2038
+ ### Parameters
2039
+
2040
+ | Parameter | Type | Required | Description |
2041
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
2042
+ | `id` | *string* | :heavy_check_mark: | Subscription ID |
2043
+ | `body` | [models.ResumeSubscriptionRequest](../../sdk/models/resume-subscription-request.md) | :heavy_check_mark: | Resume subscription request |
2044
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
2045
+ | `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. |
2046
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
2047
+
2048
+ ### Response
2049
+
2050
+ **Promise\<[models.ResumeSubscriptionResponse](../../sdk/models/resume-subscription-response.md)\>**
2051
+
2052
+ ### Errors
2053
+
2054
+ | Error Type | Status Code | Content Type |
2055
+ | -------------------------- | -------------------------- | -------------------------- |
2056
+ | models.ErrorsErrorResponse | 400, 404 | application/json |
2057
+ | models.ErrorsErrorResponse | 500 | application/json |
2058
+ | models.SDKError | 4XX, 5XX | \*/\* |
2059
+
1914
2060
  ## listSubscriptionSchedules
1915
2061
 
1916
2062
  Use when listing scheduled changes for a subscription (e.g. upcoming plan change or renewal). Returns all schedules for that subscription.
@@ -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
+ * Pause subscription
12
+ *
13
+ * @remarks
14
+ * Use when a customer stops temporarily. Pauses an active subscription now: usage and arrear fixed charges up to the pause are billed on a closing invoice, and every paused period after it gets a $0 skipped invoice.
15
+ */
16
+ export declare function subscriptionsPauseSubscription(client: FlexpriceCore, id: string, body: models.PauseSubscriptionRequest, options?: RequestOptions): APIPromise<Result<models.PauseSubscriptionResponse, models.ErrorsErrorResponse | FlexPriceError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
17
+ //# sourceMappingURL=subscriptions-pause-subscription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions-pause-subscription.d.ts","sourceRoot":"","sources":["../../src/funcs/subscriptions-pause-subscription.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,8BAA8B,CAC5C,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,CAAC,wBAAwB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,yBAAyB,EAC9B,MAAM,CAAC,mBAAmB,GAC1B,cAAc,GACd,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAOA"}