dodopayments 2.52.0 → 2.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/checkout-sessions.d.mts +40 -8
  11. package/resources/checkout-sessions.d.mts.map +1 -1
  12. package/resources/checkout-sessions.d.ts +40 -8
  13. package/resources/checkout-sessions.d.ts.map +1 -1
  14. package/resources/customers/emails.d.mts +2 -1
  15. package/resources/customers/emails.d.mts.map +1 -1
  16. package/resources/customers/emails.d.ts +2 -1
  17. package/resources/customers/emails.d.ts.map +1 -1
  18. package/resources/index.d.mts +2 -2
  19. package/resources/index.d.mts.map +1 -1
  20. package/resources/index.d.ts +2 -2
  21. package/resources/index.d.ts.map +1 -1
  22. package/resources/index.js.map +1 -1
  23. package/resources/index.mjs.map +1 -1
  24. package/resources/payments.d.mts +10 -0
  25. package/resources/payments.d.mts.map +1 -1
  26. package/resources/payments.d.ts +10 -0
  27. package/resources/payments.d.ts.map +1 -1
  28. package/resources/refunds.d.mts +16 -1
  29. package/resources/refunds.d.mts.map +1 -1
  30. package/resources/refunds.d.ts +16 -1
  31. package/resources/refunds.d.ts.map +1 -1
  32. package/resources/subscriptions.d.mts +42 -6
  33. package/resources/subscriptions.d.mts.map +1 -1
  34. package/resources/subscriptions.d.ts +42 -6
  35. package/resources/subscriptions.d.ts.map +1 -1
  36. package/src/client.ts +11 -1
  37. package/src/resources/checkout-sessions.ts +40 -8
  38. package/src/resources/customers/emails.ts +2 -1
  39. package/src/resources/index.ts +2 -0
  40. package/src/resources/payments.ts +12 -0
  41. package/src/resources/refunds.ts +23 -0
  42. package/src/resources/subscriptions.ts +48 -5
  43. package/src/version.ts +1 -1
  44. package/version.d.mts +1 -1
  45. package/version.d.ts +1 -1
  46. package/version.js +1 -1
  47. package/version.mjs +1 -1
@@ -193,8 +193,10 @@ export interface CheckoutSessionFlags {
193
193
  redirect_immediately?: boolean;
194
194
 
195
195
  /**
196
- * If true, the customer must give the name on the card to pay by card. The
197
- * checkout page enforces this. Other payment methods ignore it.
196
+ * If true, the customer must give the name on the card to pay by card. Apple Pay
197
+ * and Google Pay also collect the payer name, and the payment stores it as the
198
+ * card holder name. The checkout page enforces this. Other payment methods ignore
199
+ * it.
198
200
  *
199
201
  * Default is false
200
202
  */
@@ -257,7 +259,14 @@ export interface CheckoutSessionRequest {
257
259
  billing_address?: CheckoutSessionBillingAddress | null;
258
260
 
259
261
  /**
260
- * This field is ingored if adaptive pricing is disabled
262
+ * The currency to charge the customer in.
263
+ *
264
+ * Adaptive pricing must be enabled for the business. The customer then pays in
265
+ * this currency. If you do not set it, the currency comes from the billing
266
+ * country.
267
+ *
268
+ * If adaptive pricing is disabled, the API discards this field. The currency then
269
+ * comes from the product price, or from the billing country.
261
270
  */
262
271
  billing_currency?: MiscAPI.Currency | null;
263
272
 
@@ -332,8 +341,11 @@ export interface CheckoutSessionRequest {
332
341
  /**
333
342
  * If true, only zipcode is required when confirm is true; other address fields
334
343
  * remain optional
344
+ *
345
+ * Default is true when `feature_flags.single_page` is true. Otherwise, default is
346
+ * false.
335
347
  */
336
- minimal_address?: boolean;
348
+ minimal_address?: boolean | null;
337
349
 
338
350
  /**
339
351
  * Optional payment method ID to use for this checkout session. Only allowed when
@@ -1067,7 +1079,14 @@ export interface CheckoutSessionCreateParams {
1067
1079
  billing_address?: CheckoutSessionBillingAddress | null;
1068
1080
 
1069
1081
  /**
1070
- * This field is ingored if adaptive pricing is disabled
1082
+ * The currency to charge the customer in.
1083
+ *
1084
+ * Adaptive pricing must be enabled for the business. The customer then pays in
1085
+ * this currency. If you do not set it, the currency comes from the billing
1086
+ * country.
1087
+ *
1088
+ * If adaptive pricing is disabled, the API discards this field. The currency then
1089
+ * comes from the product price, or from the billing country.
1071
1090
  */
1072
1091
  billing_currency?: MiscAPI.Currency | null;
1073
1092
 
@@ -1142,8 +1161,11 @@ export interface CheckoutSessionCreateParams {
1142
1161
  /**
1143
1162
  * If true, only zipcode is required when confirm is true; other address fields
1144
1163
  * remain optional
1164
+ *
1165
+ * Default is true when `feature_flags.single_page` is true. Otherwise, default is
1166
+ * false.
1145
1167
  */
1146
- minimal_address?: boolean;
1168
+ minimal_address?: boolean | null;
1147
1169
 
1148
1170
  /**
1149
1171
  * Optional payment method ID to use for this checkout session. Only allowed when
@@ -1204,7 +1226,14 @@ export interface CheckoutSessionPreviewParams {
1204
1226
  billing_address?: CheckoutSessionBillingAddress | null;
1205
1227
 
1206
1228
  /**
1207
- * This field is ingored if adaptive pricing is disabled
1229
+ * The currency to charge the customer in.
1230
+ *
1231
+ * Adaptive pricing must be enabled for the business. The customer then pays in
1232
+ * this currency. If you do not set it, the currency comes from the billing
1233
+ * country.
1234
+ *
1235
+ * If adaptive pricing is disabled, the API discards this field. The currency then
1236
+ * comes from the product price, or from the billing country.
1208
1237
  */
1209
1238
  billing_currency?: MiscAPI.Currency | null;
1210
1239
 
@@ -1279,8 +1308,11 @@ export interface CheckoutSessionPreviewParams {
1279
1308
  /**
1280
1309
  * If true, only zipcode is required when confirm is true; other address fields
1281
1310
  * remain optional
1311
+ *
1312
+ * Default is true when `feature_flags.single_page` is true. Otherwise, default is
1313
+ * false.
1282
1314
  */
1283
- minimal_address?: boolean;
1315
+ minimal_address?: boolean | null;
1284
1316
 
1285
1317
  /**
1286
1318
  * Optional payment method ID to use for this checkout session. Only allowed when
@@ -191,7 +191,8 @@ export type EmailLogStatus = 'sent' | 'delivered' | 'failed' | 'complained' | 'b
191
191
  */
192
192
  export interface EmailPolicies {
193
193
  /**
194
- * A permanent failure was recorded, so the same address would be a no-op.
194
+ * A permanent failure was recorded, so a send to the same address delivers
195
+ * nothing. It is false for a suppressed address that a resend can clear.
195
196
  */
196
197
  requires_different_address: boolean;
197
198
 
@@ -224,6 +224,7 @@ export {
224
224
  export {
225
225
  Refunds,
226
226
  type Refund,
227
+ type RefundNetworkReferenceType,
227
228
  type RefundStatus,
228
229
  type RefundListParams,
229
230
  type RefundCreateParams,
@@ -239,6 +240,7 @@ export {
239
240
  type OnDemandSubscription,
240
241
  type ScheduledPlanChange,
241
242
  type Subscription,
243
+ type SubscriptionCancelledBy,
242
244
  type SubscriptionStatus,
243
245
  type TimeInterval,
244
246
  type UpdateSubscriptionPlanReq,
@@ -691,6 +691,18 @@ export interface RefundListItem {
691
691
  */
692
692
  currency?: MiscAPI.Currency | null;
693
693
 
694
+ /**
695
+ * The reference number that the card network or the bank gives to the refund. The
696
+ * customer can give this number to their bank to trace the refund. It is null
697
+ * until the payment processor sends it.
698
+ */
699
+ network_reference?: string | null;
700
+
701
+ /**
702
+ * The kind of `network_reference`: ARN, STAN or RRN.
703
+ */
704
+ network_reference_type?: RefundsAPI.RefundNetworkReferenceType | null;
705
+
694
706
  /**
695
707
  * The reason provided for the refund, if any. Optional.
696
708
  */
@@ -114,12 +114,34 @@ export interface Refund {
114
114
  */
115
115
  currency?: MiscAPI.Currency | null;
116
116
 
117
+ /**
118
+ * The reference number that the card network or the bank gives to the refund. The
119
+ * customer can give this number to their bank to trace the refund. It is null
120
+ * until the payment processor sends it.
121
+ */
122
+ network_reference?: string | null;
123
+
124
+ /**
125
+ * The kind of `network_reference`: ARN, STAN or RRN.
126
+ */
127
+ network_reference_type?: RefundNetworkReferenceType | null;
128
+
117
129
  /**
118
130
  * The reason provided for the refund, if any. Optional.
119
131
  */
120
132
  reason?: string | null;
121
133
  }
122
134
 
135
+ /**
136
+ * The kind of reference number that the card network or the bank gives to a
137
+ * refund.
138
+ */
139
+ export type RefundNetworkReferenceType =
140
+ | 'acquirer_reference_number'
141
+ | 'system_trace_audit_number'
142
+ | 'retrieval_reference_number'
143
+ | 'other';
144
+
123
145
  export type RefundStatus = 'succeeded' | 'failed' | 'pending' | 'review';
124
146
 
125
147
  export interface RefundListParams extends DefaultPageNumberPaginationParams {
@@ -193,6 +215,7 @@ export namespace RefundCreateParams {
193
215
  export declare namespace Refunds {
194
216
  export {
195
217
  type Refund as Refund,
218
+ type RefundNetworkReferenceType as RefundNetworkReferenceType,
196
219
  type RefundStatus as RefundStatus,
197
220
  type RefundListParams as RefundListParams,
198
221
  type RefundCreateParams as RefundCreateParams,
@@ -634,6 +634,12 @@ export interface Subscription {
634
634
  */
635
635
  cancelled_at?: string | null;
636
636
 
637
+ /**
638
+ * The caller that cancelled the subscription or scheduled its cancel. `null` when
639
+ * no caller is known, for example when the system cancelled the subscription.
640
+ */
641
+ cancelled_by?: SubscriptionCancelledBy | null;
642
+
637
643
  /**
638
644
  * Customer's responses to custom fields collected during checkout
639
645
  */
@@ -694,6 +700,28 @@ export interface Subscription {
694
700
  trial_amount?: number | null;
695
701
  }
696
702
 
703
+ /**
704
+ * The caller that cancelled a subscription or scheduled its cancel.
705
+ */
706
+ export interface SubscriptionCancelledBy {
707
+ /**
708
+ * The kind of caller.
709
+ */
710
+ actor_type: 'customer' | 'merchant_user' | 'api_key' | 'dodo_team';
711
+
712
+ /**
713
+ * Email of the customer or of the dashboard user. `null` for an API key or the
714
+ * Dodo Payments team.
715
+ */
716
+ email?: string | null;
717
+
718
+ /**
719
+ * Name of the customer or of the dashboard user. `null` for an API key or the Dodo
720
+ * Payments team.
721
+ */
722
+ name?: string | null;
723
+ }
724
+
697
725
  export type SubscriptionStatus =
698
726
  | 'pending'
699
727
  | 'active'
@@ -1014,6 +1042,12 @@ export interface SubscriptionListResponse {
1014
1042
  */
1015
1043
  cancelled_at?: string | null;
1016
1044
 
1045
+ /**
1046
+ * The caller that cancelled the subscription or scheduled its cancel. `null` when
1047
+ * no caller is known, for example when the system cancelled the subscription.
1048
+ */
1049
+ cancelled_by?: SubscriptionCancelledBy | null;
1050
+
1017
1051
  /**
1018
1052
  * Business / legal name associated with the tax id (B2B). When set this is used on
1019
1053
  * the invoice in place of the customer's personal name.
@@ -1225,14 +1259,22 @@ export namespace SubscriptionPreviewChangePlanResponse {
1225
1259
  currency: MiscAPI.Currency;
1226
1260
 
1227
1261
  /**
1228
- * Net credit movement in the smallest currency unit (e.g. cents). **Negative** –
1229
- * credits were deducted from the customer's balance to offset the charge (typical
1230
- * on upgrades). **Positive** – credits were added to the customer's balance,
1231
- * either from a downgrade proration refund or from topping-up the wallet to meet a
1232
- * gateway minimum-charge threshold. **Zero** – no credit movement occurred.
1262
+ * Net credit movement in the smallest unit of `customer_credits_currency` (e.g.
1263
+ * cents). Read `customer_credits_currency` for the currency. It can differ from
1264
+ * `currency`. **Negative** – credits were deducted from the customer's balance to
1265
+ * offset the charge (typical on upgrades). **Positive** – credits were added to
1266
+ * the customer's balance, either from a downgrade proration refund or from
1267
+ * topping-up the wallet to meet a gateway minimum-charge threshold. **Zero** – no
1268
+ * credit movement occurred.
1233
1269
  */
1234
1270
  customer_credits: number;
1235
1271
 
1272
+ /**
1273
+ * This field gives the currency of `customer_credits`. The credit wallet uses the
1274
+ * subscription currency.
1275
+ */
1276
+ customer_credits_currency: MiscAPI.Currency;
1277
+
1236
1278
  settlement_amount: number;
1237
1279
 
1238
1280
  settlement_currency: MiscAPI.Currency;
@@ -1989,6 +2031,7 @@ export declare namespace Subscriptions {
1989
2031
  type OnDemandSubscription as OnDemandSubscription,
1990
2032
  type ScheduledPlanChange as ScheduledPlanChange,
1991
2033
  type Subscription as Subscription,
2034
+ type SubscriptionCancelledBy as SubscriptionCancelledBy,
1992
2035
  type SubscriptionStatus as SubscriptionStatus,
1993
2036
  type TimeInterval as TimeInterval,
1994
2037
  type UpdateSubscriptionPlanReq as UpdateSubscriptionPlanReq,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.52.0'; // x-release-please-version
1
+ export const VERSION = '2.53.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.52.0";
1
+ export declare const VERSION = "2.53.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.52.0";
1
+ export declare const VERSION = "2.53.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.52.0'; // x-release-please-version
4
+ exports.VERSION = '2.53.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.52.0'; // x-release-please-version
1
+ export const VERSION = '2.53.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map