@paygentic/sdk 0.10.4 → 0.10.6

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 (173) hide show
  1. package/dist/commonjs/funcs/pricesUpdate.d.ts +3 -0
  2. package/dist/commonjs/funcs/pricesUpdate.d.ts.map +1 -1
  3. package/dist/commonjs/funcs/pricesUpdate.js +3 -0
  4. package/dist/commonjs/funcs/pricesUpdate.js.map +1 -1
  5. package/dist/commonjs/funcs/testClocksAdvance.d.ts +1 -1
  6. package/dist/commonjs/funcs/testClocksAdvance.js +1 -1
  7. package/dist/commonjs/lib/config.d.ts +2 -2
  8. package/dist/commonjs/lib/config.js +2 -2
  9. package/dist/commonjs/models/changereason.d.ts +3 -2
  10. package/dist/commonjs/models/changereason.d.ts.map +1 -1
  11. package/dist/commonjs/models/changereason.js +2 -1
  12. package/dist/commonjs/models/changereason.js.map +1 -1
  13. package/dist/commonjs/models/editsubscriptionintervalsrequestunion.d.ts +3 -3
  14. package/dist/commonjs/models/errors/deletecustomer.d.ts +8 -0
  15. package/dist/commonjs/models/errors/deletecustomer.d.ts.map +1 -1
  16. package/dist/commonjs/models/errors/deletecustomer.js +3 -0
  17. package/dist/commonjs/models/errors/deletecustomer.js.map +1 -1
  18. package/dist/commonjs/models/errors/deletefee.d.ts +8 -0
  19. package/dist/commonjs/models/errors/deletefee.d.ts.map +1 -1
  20. package/dist/commonjs/models/errors/deletefee.js +3 -0
  21. package/dist/commonjs/models/errors/deletefee.js.map +1 -1
  22. package/dist/commonjs/models/errors/deleteprice.d.ts +8 -0
  23. package/dist/commonjs/models/errors/deleteprice.d.ts.map +1 -1
  24. package/dist/commonjs/models/errors/deleteprice.js +3 -0
  25. package/dist/commonjs/models/errors/deleteprice.js.map +1 -1
  26. package/dist/commonjs/models/errors/error.d.ts +8 -0
  27. package/dist/commonjs/models/errors/error.d.ts.map +1 -1
  28. package/dist/commonjs/models/errors/error.js +3 -0
  29. package/dist/commonjs/models/errors/error.js.map +1 -1
  30. package/dist/commonjs/models/errors/recordinvoicepayment.d.ts +8 -0
  31. package/dist/commonjs/models/errors/recordinvoicepayment.d.ts.map +1 -1
  32. package/dist/commonjs/models/errors/recordinvoicepayment.js +3 -0
  33. package/dist/commonjs/models/errors/recordinvoicepayment.js.map +1 -1
  34. package/dist/commonjs/models/errors/retrypaymentresponseerror.d.ts +8 -0
  35. package/dist/commonjs/models/errors/retrypaymentresponseerror.d.ts.map +1 -1
  36. package/dist/commonjs/models/errors/retrypaymentresponseerror.js +3 -0
  37. package/dist/commonjs/models/errors/retrypaymentresponseerror.js.map +1 -1
  38. package/dist/commonjs/models/errors/updateprice.d.ts +8 -0
  39. package/dist/commonjs/models/errors/updateprice.d.ts.map +1 -1
  40. package/dist/commonjs/models/errors/updateprice.js +3 -0
  41. package/dist/commonjs/models/errors/updateprice.js.map +1 -1
  42. package/dist/commonjs/models/errors/validationerror.d.ts +8 -0
  43. package/dist/commonjs/models/errors/validationerror.d.ts.map +1 -1
  44. package/dist/commonjs/models/errors/validationerror.js +3 -0
  45. package/dist/commonjs/models/errors/validationerror.js.map +1 -1
  46. package/dist/commonjs/models/operations/createsubscription.d.ts +1 -1
  47. package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts +1 -1
  48. package/dist/commonjs/models/operations/getcostsummary.d.ts +1 -1
  49. package/dist/commonjs/models/operations/listbillablemetricevents.d.ts +1 -1
  50. package/dist/commonjs/models/operations/terminatesubscription.d.ts +1 -1
  51. package/dist/commonjs/models/operations/updateprice.d.ts +0 -24
  52. package/dist/commonjs/models/operations/updateprice.d.ts.map +1 -1
  53. package/dist/commonjs/models/operations/updateprice.js +1 -12
  54. package/dist/commonjs/models/operations/updateprice.js.map +1 -1
  55. package/dist/commonjs/models/permission.d.ts +5 -0
  56. package/dist/commonjs/models/permission.d.ts.map +1 -1
  57. package/dist/commonjs/models/permission.js +5 -0
  58. package/dist/commonjs/models/permission.js.map +1 -1
  59. package/dist/commonjs/models/retrypaymentresponse.d.ts +4 -0
  60. package/dist/commonjs/models/retrypaymentresponse.d.ts.map +1 -1
  61. package/dist/commonjs/models/retrypaymentresponse.js +1 -0
  62. package/dist/commonjs/models/retrypaymentresponse.js.map +1 -1
  63. package/dist/commonjs/models/subscription.d.ts +1 -0
  64. package/dist/commonjs/models/subscription.d.ts.map +1 -1
  65. package/dist/commonjs/models/subscription.js +1 -0
  66. package/dist/commonjs/models/subscription.js.map +1 -1
  67. package/dist/commonjs/models/subscriptionintervalchange.d.ts +1 -1
  68. package/dist/commonjs/sdk/prices.d.ts +3 -0
  69. package/dist/commonjs/sdk/prices.d.ts.map +1 -1
  70. package/dist/commonjs/sdk/prices.js +3 -0
  71. package/dist/commonjs/sdk/prices.js.map +1 -1
  72. package/dist/commonjs/sdk/testclocks.d.ts +1 -1
  73. package/dist/commonjs/sdk/testclocks.js +1 -1
  74. package/dist/esm/funcs/pricesUpdate.d.ts +3 -0
  75. package/dist/esm/funcs/pricesUpdate.d.ts.map +1 -1
  76. package/dist/esm/funcs/pricesUpdate.js +3 -0
  77. package/dist/esm/funcs/pricesUpdate.js.map +1 -1
  78. package/dist/esm/funcs/testClocksAdvance.d.ts +1 -1
  79. package/dist/esm/funcs/testClocksAdvance.js +1 -1
  80. package/dist/esm/lib/config.d.ts +2 -2
  81. package/dist/esm/lib/config.js +2 -2
  82. package/dist/esm/models/changereason.d.ts +3 -2
  83. package/dist/esm/models/changereason.d.ts.map +1 -1
  84. package/dist/esm/models/changereason.js +2 -1
  85. package/dist/esm/models/changereason.js.map +1 -1
  86. package/dist/esm/models/editsubscriptionintervalsrequestunion.d.ts +3 -3
  87. package/dist/esm/models/errors/deletecustomer.d.ts +8 -0
  88. package/dist/esm/models/errors/deletecustomer.d.ts.map +1 -1
  89. package/dist/esm/models/errors/deletecustomer.js +3 -0
  90. package/dist/esm/models/errors/deletecustomer.js.map +1 -1
  91. package/dist/esm/models/errors/deletefee.d.ts +8 -0
  92. package/dist/esm/models/errors/deletefee.d.ts.map +1 -1
  93. package/dist/esm/models/errors/deletefee.js +3 -0
  94. package/dist/esm/models/errors/deletefee.js.map +1 -1
  95. package/dist/esm/models/errors/deleteprice.d.ts +8 -0
  96. package/dist/esm/models/errors/deleteprice.d.ts.map +1 -1
  97. package/dist/esm/models/errors/deleteprice.js +3 -0
  98. package/dist/esm/models/errors/deleteprice.js.map +1 -1
  99. package/dist/esm/models/errors/error.d.ts +8 -0
  100. package/dist/esm/models/errors/error.d.ts.map +1 -1
  101. package/dist/esm/models/errors/error.js +3 -0
  102. package/dist/esm/models/errors/error.js.map +1 -1
  103. package/dist/esm/models/errors/recordinvoicepayment.d.ts +8 -0
  104. package/dist/esm/models/errors/recordinvoicepayment.d.ts.map +1 -1
  105. package/dist/esm/models/errors/recordinvoicepayment.js +3 -0
  106. package/dist/esm/models/errors/recordinvoicepayment.js.map +1 -1
  107. package/dist/esm/models/errors/retrypaymentresponseerror.d.ts +8 -0
  108. package/dist/esm/models/errors/retrypaymentresponseerror.d.ts.map +1 -1
  109. package/dist/esm/models/errors/retrypaymentresponseerror.js +3 -0
  110. package/dist/esm/models/errors/retrypaymentresponseerror.js.map +1 -1
  111. package/dist/esm/models/errors/updateprice.d.ts +8 -0
  112. package/dist/esm/models/errors/updateprice.d.ts.map +1 -1
  113. package/dist/esm/models/errors/updateprice.js +3 -0
  114. package/dist/esm/models/errors/updateprice.js.map +1 -1
  115. package/dist/esm/models/errors/validationerror.d.ts +8 -0
  116. package/dist/esm/models/errors/validationerror.d.ts.map +1 -1
  117. package/dist/esm/models/errors/validationerror.js +3 -0
  118. package/dist/esm/models/errors/validationerror.js.map +1 -1
  119. package/dist/esm/models/operations/createsubscription.d.ts +1 -1
  120. package/dist/esm/models/operations/getbillablemetricmeter.d.ts +1 -1
  121. package/dist/esm/models/operations/getcostsummary.d.ts +1 -1
  122. package/dist/esm/models/operations/listbillablemetricevents.d.ts +1 -1
  123. package/dist/esm/models/operations/terminatesubscription.d.ts +1 -1
  124. package/dist/esm/models/operations/updateprice.d.ts +0 -24
  125. package/dist/esm/models/operations/updateprice.d.ts.map +1 -1
  126. package/dist/esm/models/operations/updateprice.js +0 -11
  127. package/dist/esm/models/operations/updateprice.js.map +1 -1
  128. package/dist/esm/models/permission.d.ts +5 -0
  129. package/dist/esm/models/permission.d.ts.map +1 -1
  130. package/dist/esm/models/permission.js +5 -0
  131. package/dist/esm/models/permission.js.map +1 -1
  132. package/dist/esm/models/retrypaymentresponse.d.ts +4 -0
  133. package/dist/esm/models/retrypaymentresponse.d.ts.map +1 -1
  134. package/dist/esm/models/retrypaymentresponse.js +1 -0
  135. package/dist/esm/models/retrypaymentresponse.js.map +1 -1
  136. package/dist/esm/models/subscription.d.ts +1 -0
  137. package/dist/esm/models/subscription.d.ts.map +1 -1
  138. package/dist/esm/models/subscription.js +1 -0
  139. package/dist/esm/models/subscription.js.map +1 -1
  140. package/dist/esm/models/subscriptionintervalchange.d.ts +1 -1
  141. package/dist/esm/sdk/prices.d.ts +3 -0
  142. package/dist/esm/sdk/prices.d.ts.map +1 -1
  143. package/dist/esm/sdk/prices.js +3 -0
  144. package/dist/esm/sdk/prices.js.map +1 -1
  145. package/dist/esm/sdk/testclocks.d.ts +1 -1
  146. package/dist/esm/sdk/testclocks.js +1 -1
  147. package/jsr.json +1 -1
  148. package/package.json +1 -1
  149. package/src/funcs/pricesUpdate.ts +3 -0
  150. package/src/funcs/testClocksAdvance.ts +1 -1
  151. package/src/lib/config.ts +2 -2
  152. package/src/models/changereason.ts +3 -2
  153. package/src/models/editsubscriptionintervalsrequestunion.ts +3 -3
  154. package/src/models/errors/deletecustomer.ts +10 -0
  155. package/src/models/errors/deletefee.ts +10 -0
  156. package/src/models/errors/deleteprice.ts +10 -0
  157. package/src/models/errors/error.ts +10 -0
  158. package/src/models/errors/recordinvoicepayment.ts +10 -0
  159. package/src/models/errors/retrypaymentresponseerror.ts +10 -0
  160. package/src/models/errors/updateprice.ts +10 -0
  161. package/src/models/errors/validationerror.ts +10 -0
  162. package/src/models/operations/createsubscription.ts +1 -1
  163. package/src/models/operations/getbillablemetricmeter.ts +1 -1
  164. package/src/models/operations/getcostsummary.ts +1 -1
  165. package/src/models/operations/listbillablemetricevents.ts +1 -1
  166. package/src/models/operations/terminatesubscription.ts +1 -1
  167. package/src/models/operations/updateprice.ts +0 -30
  168. package/src/models/permission.ts +5 -0
  169. package/src/models/retrypaymentresponse.ts +5 -0
  170. package/src/models/subscription.ts +1 -0
  171. package/src/models/subscriptionintervalchange.ts +1 -1
  172. package/src/sdk/prices.ts +3 -0
  173. package/src/sdk/testclocks.ts +1 -1
@@ -34,6 +34,10 @@ export type ErrorTData = {
34
34
  * Present on a 403 from the authorization check. The permissions the caller needs for this request.
35
35
  */
36
36
  requiredPermissions?: Array<string> | undefined;
37
+ /**
38
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
39
+ */
40
+ requestId?: string | undefined;
37
41
  };
38
42
 
39
43
  /**
@@ -60,6 +64,10 @@ export class ErrorT extends PaygenticError {
60
64
  * Present on a 403 from the authorization check. The permissions the caller needs for this request.
61
65
  */
62
66
  requiredPermissions?: Array<string> | undefined;
67
+ /**
68
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
69
+ */
70
+ requestId?: string | undefined;
63
71
 
64
72
  /** The original data that was passed to this error instance. */
65
73
  data$: ErrorTData;
@@ -78,6 +86,7 @@ export class ErrorT extends PaygenticError {
78
86
  if (err.requiredPermissions != null) {
79
87
  this.requiredPermissions = err.requiredPermissions;
80
88
  }
89
+ if (err.requestId != null) this.requestId = err.requestId;
81
90
 
82
91
  this.name = "ErrorT";
83
92
  }
@@ -92,6 +101,7 @@ export const ErrorT$inboundSchema: z.ZodType<ErrorT, z.ZodTypeDef, unknown> = z
92
101
  details: z.record(z.any()).optional(),
93
102
  reason: models.AuthorizationDenialReason$inboundSchema.optional(),
94
103
  requiredPermissions: z.array(z.string()).optional(),
104
+ requestId: z.string().optional(),
95
105
  request$: z.instanceof(Request),
96
106
  response$: z.instanceof(Response),
97
107
  body$: z.string(),
@@ -34,6 +34,10 @@ export type UnprocessableEntityErrorData = {
34
34
  * Present on a 403 from the authorization check. The permissions the caller needs for this request.
35
35
  */
36
36
  requiredPermissions?: Array<string> | undefined;
37
+ /**
38
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
39
+ */
40
+ requestId?: string | undefined;
37
41
  };
38
42
 
39
43
  /**
@@ -60,6 +64,10 @@ export class UnprocessableEntityError extends PaygenticError {
60
64
  * Present on a 403 from the authorization check. The permissions the caller needs for this request.
61
65
  */
62
66
  requiredPermissions?: Array<string> | undefined;
67
+ /**
68
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
69
+ */
70
+ requestId?: string | undefined;
63
71
 
64
72
  /** The original data that was passed to this error instance. */
65
73
  data$: UnprocessableEntityErrorData;
@@ -78,6 +86,7 @@ export class UnprocessableEntityError extends PaygenticError {
78
86
  if (err.requiredPermissions != null) {
79
87
  this.requiredPermissions = err.requiredPermissions;
80
88
  }
89
+ if (err.requestId != null) this.requestId = err.requestId;
81
90
 
82
91
  this.name = "UnprocessableEntityError";
83
92
  }
@@ -95,6 +104,7 @@ export const UnprocessableEntityError$inboundSchema: z.ZodType<
95
104
  details: z.record(z.any()).optional(),
96
105
  reason: models.AuthorizationDenialReason$inboundSchema.optional(),
97
106
  requiredPermissions: z.array(z.string()).optional(),
107
+ requestId: z.string().optional(),
98
108
  request$: z.instanceof(Request),
99
109
  response$: z.instanceof(Response),
100
110
  body$: z.string(),
@@ -30,6 +30,10 @@ export type RetryPaymentResponseErrorData = {
30
30
  * Why a payment retry did not collect the money.
31
31
  */
32
32
  error?: models.RetryPaymentError | undefined;
33
+ /**
34
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
35
+ */
36
+ requestId?: string | undefined;
33
37
  };
34
38
 
35
39
  /**
@@ -56,6 +60,10 @@ export class RetryPaymentResponseError extends PaygenticError {
56
60
  * Why a payment retry did not collect the money.
57
61
  */
58
62
  error?: models.RetryPaymentError | undefined;
63
+ /**
64
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
65
+ */
66
+ requestId?: string | undefined;
59
67
 
60
68
  /** The original data that was passed to this error instance. */
61
69
  data$: RetryPaymentResponseErrorData;
@@ -73,6 +81,7 @@ export class RetryPaymentResponseError extends PaygenticError {
73
81
  this.invoiceId = err.invoiceId;
74
82
  if (err.paymentIntentId != null) this.paymentIntentId = err.paymentIntentId;
75
83
  if (err.error != null) this.error = err.error;
84
+ if (err.requestId != null) this.requestId = err.requestId;
76
85
 
77
86
  this.name = "RetryPaymentResponseError";
78
87
  }
@@ -89,6 +98,7 @@ export const RetryPaymentResponseError$inboundSchema: z.ZodType<
89
98
  invoiceId: z.string(),
90
99
  paymentIntentId: z.string().optional(),
91
100
  error: models.RetryPaymentError$inboundSchema.optional(),
101
+ requestId: z.string().optional(),
92
102
  request$: z.instanceof(Request),
93
103
  response$: z.instanceof(Response),
94
104
  body$: z.string(),
@@ -10,6 +10,10 @@ import { PaygenticError } from "./paygenticerror.js";
10
10
  * Price cannot be restructured because a subscription still bills it directly
11
11
  */
12
12
  export type UpdatePriceConflictErrorData = {
13
+ /**
14
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
15
+ */
16
+ requestId?: string | undefined;
13
17
  error?: string | undefined;
14
18
  message: string;
15
19
  /**
@@ -23,6 +27,10 @@ export type UpdatePriceConflictErrorData = {
23
27
  * Price cannot be restructured because a subscription still bills it directly
24
28
  */
25
29
  export class UpdatePriceConflictError extends PaygenticError {
30
+ /**
31
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
32
+ */
33
+ requestId?: string | undefined;
26
34
  error?: string | undefined;
27
35
  /**
28
36
  * Machine-readable conflict code. Open set: a new code may appear, so branch on the ones you handle and treat anything else as an unhandled conflict.
@@ -40,6 +48,7 @@ export class UpdatePriceConflictError extends PaygenticError {
40
48
  const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
41
49
  super(message, httpMeta);
42
50
  this.data$ = err;
51
+ if (err.requestId != null) this.requestId = err.requestId;
43
52
  if (err.error != null) this.error = err.error;
44
53
  this.code = err.code;
45
54
  if (err.details != null) this.details = err.details;
@@ -54,6 +63,7 @@ export const UpdatePriceConflictError$inboundSchema: z.ZodType<
54
63
  z.ZodTypeDef,
55
64
  unknown
56
65
  > = z.object({
66
+ requestId: z.string().optional(),
57
67
  error: z.string().optional(),
58
68
  message: z.string(),
59
69
  code: z.string(),
@@ -19,6 +19,10 @@ export type ValidationErrorData = {
19
19
  * Array of field-specific validation errors
20
20
  */
21
21
  errors: Array<models.ErrorT>;
22
+ /**
23
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
24
+ */
25
+ requestId?: string | undefined;
22
26
  };
23
27
 
24
28
  export class ValidationError extends PaygenticError {
@@ -30,6 +34,10 @@ export class ValidationError extends PaygenticError {
30
34
  * Array of field-specific validation errors
31
35
  */
32
36
  errors: Array<models.ErrorT>;
37
+ /**
38
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
39
+ */
40
+ requestId?: string | undefined;
33
41
 
34
42
  /** The original data that was passed to this error instance. */
35
43
  data$: ValidationErrorData;
@@ -43,6 +51,7 @@ export class ValidationError extends PaygenticError {
43
51
  this.data$ = err;
44
52
  if (err.error != null) this.error = err.error;
45
53
  this.errors = err.errors;
54
+ if (err.requestId != null) this.requestId = err.requestId;
46
55
 
47
56
  this.name = "ValidationError";
48
57
  }
@@ -57,6 +66,7 @@ export const ValidationError$inboundSchema: z.ZodType<
57
66
  error: models.ErrorEnum$inboundSchema.default("validation_error"),
58
67
  message: z.string(),
59
68
  errors: z.array(z.lazy(() => models.ErrorT$inboundSchema)),
69
+ requestId: z.string().optional(),
60
70
  request$: z.instanceof(Request),
61
71
  response$: z.instanceof(Response),
62
72
  body$: z.string(),
@@ -130,7 +130,7 @@ export type CreateSubscriptionRequest = {
130
130
  */
131
131
  metadata?: { [k: string]: models.SubscriptionMetadata } | undefined;
132
132
  /**
133
- * Why a change was made. `correction` fixes data to match what was agreed; `migration` moves a contract from another system; `commercial` is a real change to the deal. Defaults to `unspecified`.
133
+ * Why a change was made. `correction` repairs data that was entered wrong; `migration` moves a contract from another system; `commercial` is a real change to the deal; `contractual` applies a step the original contract scheduled, such as an annual uplift. Defaults to `unspecified`.
134
134
  */
135
135
  changeReason?: models.ChangeReason | undefined;
136
136
  /**
@@ -28,7 +28,7 @@ export type GetBillableMetricMeterRequest = {
28
28
  */
29
29
  from: Date;
30
30
  /**
31
- * End of query window (ISO 8601)
31
+ * End of query window (ISO 8601). At most 403 days after `from`.
32
32
  */
33
33
  to: Date;
34
34
  /**
@@ -32,7 +32,7 @@ export type GetCostSummaryRequest = {
32
32
  */
33
33
  from: Date;
34
34
  /**
35
- * End of the query window, excluded: the read counts from <= t < to (ISO 8601). Required together with 'from'.
35
+ * End of the query window, excluded: the read counts from <= t < to (ISO 8601). Required together with 'from'. At most 403 days after `from`.
36
36
  */
37
37
  to: Date;
38
38
  /**
@@ -11,7 +11,7 @@ export type ListBillableMetricEventsRequest = {
11
11
  */
12
12
  from: Date;
13
13
  /**
14
- * End of query window (ISO 8601)
14
+ * End of query window (ISO 8601). At most 403 days after `from`.
15
15
  */
16
16
  to: Date;
17
17
  /**
@@ -12,7 +12,7 @@ export type TerminateSubscriptionRequestBody = {
12
12
  */
13
13
  reason: string;
14
14
  /**
15
- * Why a change was made. `correction` fixes data to match what was agreed; `migration` moves a contract from another system; `commercial` is a real change to the deal. Defaults to `unspecified`.
15
+ * Why a change was made. `correction` repairs data that was entered wrong; `migration` moves a contract from another system; `commercial` is a real change to the deal; `contractual` applies a step the original contract scheduled, such as an annual uplift. Defaults to `unspecified`.
16
16
  */
17
17
  changeReason?: models.ChangeReason | undefined;
18
18
  };
@@ -5,23 +5,10 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../../types/fp.js";
10
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
10
  import * as models from "../index.js";
12
11
 
13
- /**
14
- * Billing timing preference: 'in_advance' (prepaid — charged upfront or drawn from a prepaid commitment) or 'in_arrears' (charged at period end).
15
- */
16
- export const UpdatePricePaymentTerm = {
17
- InArrears: "in_arrears",
18
- InAdvance: "in_advance",
19
- } as const;
20
- /**
21
- * Billing timing preference: 'in_advance' (prepaid — charged upfront or drawn from a prepaid commitment) or 'in_arrears' (charged at period end).
22
- */
23
- export type UpdatePricePaymentTerm = ClosedEnum<typeof UpdatePricePaymentTerm>;
24
-
25
12
  export type UpdatePriceRequestBody = {
26
13
  /**
27
14
  * Unique identifier for a billable metric
@@ -44,14 +31,6 @@ export type UpdatePriceRequestBody = {
44
31
  */
45
32
  model?: models.PriceModelInput | undefined;
46
33
  properties?: models.PriceProperties | undefined;
47
- /**
48
- * Billing timing preference: 'in_advance' (prepaid — charged upfront or drawn from a prepaid commitment) or 'in_arrears' (charged at period end).
49
- */
50
- paymentTerm?: UpdatePricePaymentTerm | undefined;
51
- /**
52
- * ISO 8601 duration for recurring fees (e.g., 'P1M' for monthly, 'P1Y' for yearly, or 'P0D' for one-time)
53
- */
54
- billingCadence?: string | null | undefined;
55
34
  /**
56
35
  * Feature to associate. Set to null to remove existing feature. Omit to leave unchanged.
57
36
  */
@@ -92,11 +71,6 @@ export type UpdatePriceDetails = {
92
71
  subscriptionCount?: number | undefined;
93
72
  };
94
73
 
95
- /** @internal */
96
- export const UpdatePricePaymentTerm$outboundSchema: z.ZodNativeEnum<
97
- typeof UpdatePricePaymentTerm
98
- > = z.nativeEnum(UpdatePricePaymentTerm);
99
-
100
74
  /** @internal */
101
75
  export type UpdatePriceRequestBody$Outbound = {
102
76
  billableMetricId?: string | undefined;
@@ -105,8 +79,6 @@ export type UpdatePriceRequestBody$Outbound = {
105
79
  invoiceDisplayGroup?: string | null | undefined;
106
80
  model?: string | undefined;
107
81
  properties?: models.PriceProperties$Outbound | undefined;
108
- paymentTerm?: string | undefined;
109
- billingCadence?: string | null | undefined;
110
82
  feature?: models.PriceFeatureInput$Outbound | null | undefined;
111
83
  grantDiscountEnabled?: boolean | undefined;
112
84
  isObligation?: boolean | undefined;
@@ -127,8 +99,6 @@ export const UpdatePriceRequestBody$outboundSchema: z.ZodType<
127
99
  invoiceDisplayGroup: z.nullable(z.string()).optional(),
128
100
  model: models.PriceModelInput$outboundSchema.optional(),
129
101
  properties: models.PriceProperties$outboundSchema.optional(),
130
- paymentTerm: UpdatePricePaymentTerm$outboundSchema.optional(),
131
- billingCadence: z.nullable(z.string()).optional(),
132
102
  feature: z.nullable(models.PriceFeatureInput$outboundSchema).optional(),
133
103
  grantDiscountEnabled: z.boolean().optional(),
134
104
  isObligation: z.boolean().optional(),
@@ -38,6 +38,8 @@ export const Permission = {
38
38
  PortalSessionsRead: "portalSessions:read",
39
39
  PlatformUsersRead: "platformUsers:read",
40
40
  PlatformAdminRead: "platformAdmin:read",
41
+ LoginLockoutRead: "loginLockout:read",
42
+ PlatformSystemRead: "platformSystem:read",
41
43
  OrganizationCreationRead: "organizationCreation:read",
42
44
  ComplianceRead: "compliance:read",
43
45
  TaxSettingsRead: "taxSettings:read",
@@ -81,6 +83,8 @@ export const Permission = {
81
83
  PortalSessionsWrite: "portalSessions:write",
82
84
  PlatformUsersWrite: "platformUsers:write",
83
85
  PlatformAdminWrite: "platformAdmin:write",
86
+ LoginLockoutWrite: "loginLockout:write",
87
+ PlatformSystemWrite: "platformSystem:write",
84
88
  OrganizationCreationWrite: "organizationCreation:write",
85
89
  ComplianceWrite: "compliance:write",
86
90
  TaxSettingsWrite: "taxSettings:write",
@@ -97,6 +101,7 @@ export const Permission = {
97
101
  EventsWrite: "events:write",
98
102
  InvoicesIssue: "invoices:issue",
99
103
  InvoicesVoid: "invoices:void",
104
+ InvoicesTransition: "invoices:transition",
100
105
  PaymentsRefund: "payments:refund",
101
106
  OrganizationDelete: "organization:delete",
102
107
  OwnershipTransfer: "ownership:transfer",
@@ -49,6 +49,10 @@ export type RetryPaymentResponse = {
49
49
  * Why a payment retry did not collect the money.
50
50
  */
51
51
  error?: RetryPaymentError | undefined;
52
+ /**
53
+ * Identifies this request in our logs. Include it when you contact support. Also sent in the `request-id` response header.
54
+ */
55
+ requestId?: string | undefined;
52
56
  };
53
57
 
54
58
  /** @internal */
@@ -67,6 +71,7 @@ export const RetryPaymentResponse$inboundSchema: z.ZodType<
67
71
  invoiceId: z.string(),
68
72
  paymentIntentId: z.string().optional(),
69
73
  error: RetryPaymentError$inboundSchema.optional(),
74
+ requestId: z.string().optional(),
70
75
  });
71
76
 
72
77
  export function retryPaymentResponseFromJSON(
@@ -136,6 +136,7 @@ export const TerminationChangeReason = {
136
136
  Correction: "correction",
137
137
  Migration: "migration",
138
138
  Unspecified: "unspecified",
139
+ Contractual: "contractual",
139
140
  } as const;
140
141
  /**
141
142
  * Why the subscription was terminated. Null while it is not terminated.
@@ -24,7 +24,7 @@ export type SubscriptionIntervalChange = {
24
24
  merchantId: string;
25
25
  subscriptionId: string;
26
26
  /**
27
- * Why a change was made. `correction` fixes data to match what was agreed; `migration` moves a contract from another system; `commercial` is a real change to the deal. Defaults to `unspecified`.
27
+ * Why a change was made. `correction` repairs data that was entered wrong; `migration` moves a contract from another system; `commercial` is a real change to the deal; `contractual` applies a step the original contract scheduled, such as an annual uplift. Defaults to `unspecified`.
28
28
  */
29
29
  changeReason: ChangeReason;
30
30
  description: string | null;
package/src/sdk/prices.ts CHANGED
@@ -57,6 +57,9 @@ export class Prices extends ClientSDK {
57
57
 
58
58
  /**
59
59
  * Update
60
+ *
61
+ * @remarks
62
+ * Updates a price. `paymentTerm` and `billingCadence` are fixed when the price is created: a request that sends either one is refused with a 400. To change them, create a new price.
60
63
  */
61
64
  async update(
62
65
  request: operations.UpdatePriceRequest,
@@ -68,7 +68,7 @@ export class TestClocks extends ClientSDK {
68
68
  * Advance
69
69
  *
70
70
  * @remarks
71
- * Advances the test clock's current time. You can either specify a new absolute time or advance by a duration.
71
+ * Advances the test clock's current time. You can either specify a new absolute time or advance by a duration. A clock moves forward only, and at most 1 year per call: a time earlier than the clock's current time, or more than 1 year after it, returns 400. To move further, advance more than once.
72
72
  */
73
73
  async advance(
74
74
  request: operations.AdvanceTestClockRequest,