dodopayments 2.35.0 → 2.37.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 (88) hide show
  1. package/CHANGELOG.md +5 -1805
  2. package/package.json +1 -1
  3. package/resources/balances.d.mts +2 -2
  4. package/resources/balances.d.mts.map +1 -1
  5. package/resources/balances.d.ts +2 -2
  6. package/resources/balances.d.ts.map +1 -1
  7. package/resources/checkout-sessions.d.mts +7 -0
  8. package/resources/checkout-sessions.d.mts.map +1 -1
  9. package/resources/checkout-sessions.d.ts +7 -0
  10. package/resources/checkout-sessions.d.ts.map +1 -1
  11. package/resources/credit-entitlements/balances.d.mts +4 -0
  12. package/resources/credit-entitlements/balances.d.mts.map +1 -1
  13. package/resources/credit-entitlements/balances.d.ts +4 -0
  14. package/resources/credit-entitlements/balances.d.ts.map +1 -1
  15. package/resources/disputes.d.mts +16 -0
  16. package/resources/disputes.d.mts.map +1 -1
  17. package/resources/disputes.d.ts +16 -0
  18. package/resources/disputes.d.ts.map +1 -1
  19. package/resources/entitlements/entitlements.d.mts +12 -0
  20. package/resources/entitlements/entitlements.d.mts.map +1 -1
  21. package/resources/entitlements/entitlements.d.ts +12 -0
  22. package/resources/entitlements/entitlements.d.ts.map +1 -1
  23. package/resources/entitlements/entitlements.js.map +1 -1
  24. package/resources/entitlements/entitlements.mjs.map +1 -1
  25. package/resources/entitlements/grants.d.mts +9 -0
  26. package/resources/entitlements/grants.d.mts.map +1 -1
  27. package/resources/entitlements/grants.d.ts +9 -0
  28. package/resources/entitlements/grants.d.ts.map +1 -1
  29. package/resources/entitlements/grants.js.map +1 -1
  30. package/resources/entitlements/grants.mjs.map +1 -1
  31. package/resources/license-keys.d.mts +6 -2
  32. package/resources/license-keys.d.mts.map +1 -1
  33. package/resources/license-keys.d.ts +6 -2
  34. package/resources/license-keys.d.ts.map +1 -1
  35. package/resources/payments.d.mts +27 -4
  36. package/resources/payments.d.mts.map +1 -1
  37. package/resources/payments.d.ts +27 -4
  38. package/resources/payments.d.ts.map +1 -1
  39. package/resources/payouts/breakup/breakup.d.mts +2 -2
  40. package/resources/payouts/breakup/breakup.d.ts +2 -2
  41. package/resources/payouts/breakup/details.d.mts +5 -4
  42. package/resources/payouts/breakup/details.d.mts.map +1 -1
  43. package/resources/payouts/breakup/details.d.ts +5 -4
  44. package/resources/payouts/breakup/details.d.ts.map +1 -1
  45. package/resources/products/products.d.mts +19 -2
  46. package/resources/products/products.d.mts.map +1 -1
  47. package/resources/products/products.d.ts +19 -2
  48. package/resources/products/products.d.ts.map +1 -1
  49. package/resources/products/products.js.map +1 -1
  50. package/resources/products/products.mjs.map +1 -1
  51. package/resources/refunds.d.mts +4 -0
  52. package/resources/refunds.d.mts.map +1 -1
  53. package/resources/refunds.d.ts +4 -0
  54. package/resources/refunds.d.ts.map +1 -1
  55. package/resources/subscriptions.d.mts +26 -5
  56. package/resources/subscriptions.d.mts.map +1 -1
  57. package/resources/subscriptions.d.ts +26 -5
  58. package/resources/subscriptions.d.ts.map +1 -1
  59. package/resources/webhook-events.d.mts +12 -0
  60. package/resources/webhook-events.d.mts.map +1 -1
  61. package/resources/webhook-events.d.ts +12 -0
  62. package/resources/webhook-events.d.ts.map +1 -1
  63. package/resources/webhooks/webhooks.d.mts +40 -0
  64. package/resources/webhooks/webhooks.d.mts.map +1 -1
  65. package/resources/webhooks/webhooks.d.ts +40 -0
  66. package/resources/webhooks/webhooks.d.ts.map +1 -1
  67. package/resources/webhooks/webhooks.js.map +1 -1
  68. package/resources/webhooks/webhooks.mjs.map +1 -1
  69. package/src/resources/balances.ts +4 -2
  70. package/src/resources/checkout-sessions.ts +8 -0
  71. package/src/resources/credit-entitlements/balances.ts +5 -0
  72. package/src/resources/disputes.ts +19 -0
  73. package/src/resources/entitlements/entitlements.ts +14 -0
  74. package/src/resources/entitlements/grants.ts +11 -0
  75. package/src/resources/license-keys.ts +7 -2
  76. package/src/resources/payments.ts +31 -4
  77. package/src/resources/payouts/breakup/breakup.ts +2 -2
  78. package/src/resources/payouts/breakup/details.ts +5 -4
  79. package/src/resources/products/products.ts +22 -2
  80. package/src/resources/refunds.ts +5 -0
  81. package/src/resources/subscriptions.ts +28 -5
  82. package/src/resources/webhook-events.ts +15 -0
  83. package/src/resources/webhooks/webhooks.ts +50 -0
  84. package/src/version.ts +1 -1
  85. package/version.d.mts +1 -1
  86. package/version.d.ts +1 -1
  87. package/version.js +1 -1
  88. package/version.mjs +1 -1
@@ -232,6 +232,13 @@ export interface Payment {
232
232
  */
233
233
  payment_id: string;
234
234
 
235
+ /**
236
+ * Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
237
+ * merchant's own Hyperswitch connector); `dodo` for everything Dodo processed
238
+ * itself.
239
+ */
240
+ payment_provider: 'stripe' | 'adyen' | 'dodo';
241
+
235
242
  /**
236
243
  * List of refunds issued for this payment
237
244
  */
@@ -259,8 +266,9 @@ export interface Payment {
259
266
  settlement_currency: MiscAPI.Currency;
260
267
 
261
268
  /**
262
- * Total amount charged to the customer including tax, in smallest currency unit
263
- * (e.g. cents)
269
+ * Total amount charged to the customer including tax, in the currency's smallest
270
+ * unit (e.g. cents for USD, yen for JPY, fils for KWD — see the currency's decimal
271
+ * places)
264
272
  */
265
273
  total_amount: number;
266
274
 
@@ -374,7 +382,8 @@ export interface Payment {
374
382
  subscription_id?: string | null;
375
383
 
376
384
  /**
377
- * Amount of tax collected in smallest currency unit (e.g. cents)
385
+ * Amount of tax collected in the currency's smallest unit (e.g. cents for USD, yen
386
+ * for JPY, fils for KWD)
378
387
  */
379
388
  tax?: number | null;
380
389
 
@@ -576,7 +585,8 @@ export interface PaymentCreateResponse {
576
585
  payment_id: string;
577
586
 
578
587
  /**
579
- * Total amount of the payment in smallest currency unit (e.g. cents)
588
+ * Total amount of the payment in the currency's smallest unit (cents for USD, yen
589
+ * for JPY, fils for KWD)
580
590
  */
581
591
  total_amount: number;
582
592
 
@@ -623,8 +633,25 @@ export interface PaymentListResponse {
623
633
 
624
634
  payment_id: string;
625
635
 
636
+ /**
637
+ * Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
638
+ * merchant's own Hyperswitch connector); `dodo` for everything Dodo processed
639
+ * itself.
640
+ */
641
+ payment_provider: 'stripe' | 'adyen' | 'dodo';
642
+
626
643
  total_amount: number;
627
644
 
645
+ /**
646
+ * The last four digits of the card
647
+ */
648
+ card_last_four?: string | null;
649
+
650
+ /**
651
+ * Card network like VISA, MASTERCARD etc.
652
+ */
653
+ card_network?: string | null;
654
+
628
655
  /**
629
656
  * The most recent dispute status for this payment. None if no disputes exist.
630
657
  */
@@ -40,8 +40,8 @@ export namespace BreakupRetrieveResponse {
40
40
  event_type: string;
41
41
 
42
42
  /**
43
- * Total amount for this event type in the payout's currency (in smallest currency
44
- * unit, e.g., cents).
43
+ * Total amount for this event type in the payout's currency, in that currency's
44
+ * smallest unit (cents for USD, yen for JPY, fils for KWD).
45
45
  */
46
46
  total: number;
47
47
  }
@@ -68,8 +68,8 @@ export interface DetailListResponse {
68
68
  event_type: string;
69
69
 
70
70
  /**
71
- * Original amount in the original currency (in smallest currency unit, e.g.,
72
- * cents).
71
+ * Original amount in the original currency, in that currency's smallest unit
72
+ * (cents for USD, yen for JPY, fils for KWD).
73
73
  */
74
74
  original_amount: number;
75
75
 
@@ -79,8 +79,9 @@ export interface DetailListResponse {
79
79
  original_currency: string;
80
80
 
81
81
  /**
82
- * Amount in the payout's currency (in smallest currency unit). Uses cumulative
83
- * rounding to ensure sum matches payout total exactly.
82
+ * Amount in the payout's currency, in that currency's smallest unit (cents for
83
+ * USD, yen for JPY, fils for KWD). Uses cumulative rounding to ensure sum matches
84
+ * payout total exactly.
84
85
  */
85
86
  payout_currency_amount: number;
86
87
 
@@ -673,6 +673,12 @@ export interface Product {
673
673
  */
674
674
  name?: string | null;
675
675
 
676
+ /**
677
+ * Pricing mode for localized pricing. NULL means base-only (no localized rules
678
+ * apply).
679
+ */
680
+ pricing_mode?: 'by_currency' | 'by_country' | null;
681
+
676
682
  /**
677
683
  * The product collection ID this product belongs to, if any
678
684
  */
@@ -845,7 +851,7 @@ export interface ProductCreateParams {
845
851
  brand_id?: string | null;
846
852
 
847
853
  /**
848
- * Optional credit entitlements to attach (max 3)
854
+ * Optional credit entitlements to attach (max 5)
849
855
  */
850
856
  credit_entitlements?: Array<AttachCreditEntitlement> | null;
851
857
 
@@ -862,7 +868,7 @@ export interface ProductCreateParams {
862
868
  digital_product_delivery?: ProductCreateParams.DigitalProductDelivery | null;
863
869
 
864
870
  /**
865
- * Optional entitlements to attach to this product (max 20)
871
+ * Optional entitlements to attach to this product (max 50)
866
872
  */
867
873
  entitlements?: Array<AttachProductEntitlement> | null;
868
874
 
@@ -898,6 +904,13 @@ export interface ProductCreateParams {
898
904
  * Additional metadata for the product
899
905
  */
900
906
  metadata?: { [key: string]: string };
907
+
908
+ /**
909
+ * Pricing mode for localized pricing. When set, rules from
910
+ * /products/{id}/localized-prices apply at checkout. NULL means base-only
911
+ * (existing behavior).
912
+ */
913
+ pricing_mode?: 'by_currency' | 'by_country' | null;
901
914
  }
902
915
 
903
916
  export namespace ProductCreateParams {
@@ -999,6 +1012,13 @@ export interface ProductUpdateParams {
999
1012
  */
1000
1013
  price?: Price | null;
1001
1014
 
1015
+ /**
1016
+ * Update the pricing mode. Omit to leave unchanged; set to null to clear (which
1017
+ * archives all active localized rules for this product). Changing to a different
1018
+ * non-null mode also archives any rules whose mode doesn't match the new mode.
1019
+ */
1020
+ pricing_mode?: 'by_currency' | 'by_country' | null;
1021
+
1002
1022
  /**
1003
1023
  * Tax category of the product.
1004
1024
  */
@@ -34,6 +34,11 @@ export class Refunds extends APIResource {
34
34
  }
35
35
 
36
36
  export interface Refund {
37
+ /**
38
+ * Brand id this refund belongs to
39
+ */
40
+ brand_id: string;
41
+
37
42
  /**
38
43
  * The unique identifier of the business issuing the refund.
39
44
  */
@@ -396,6 +396,11 @@ export interface Subscription {
396
396
  */
397
397
  billing: PaymentsAPI.BillingAddress;
398
398
 
399
+ /**
400
+ * Brand id this subscription belongs to
401
+ */
402
+ brand_id: string;
403
+
399
404
  /**
400
405
  * Indicates if the subscription will cancel at the next billing date
401
406
  */
@@ -473,8 +478,8 @@ export interface Subscription {
473
478
  quantity: number;
474
479
 
475
480
  /**
476
- * Amount charged before tax for each recurring payment in smallest currency unit
477
- * (e.g. cents)
481
+ * Amount charged before tax for each recurring payment in the currency's smallest
482
+ * unit (cents for USD, yen for JPY, fils for KWD)
478
483
  */
479
484
  recurring_pre_tax_amount: number;
480
485
 
@@ -793,8 +798,8 @@ export interface SubscriptionListResponse {
793
798
  quantity: number;
794
799
 
795
800
  /**
796
- * Amount charged before tax for each recurring payment in smallest currency unit
797
- * (e.g. cents)
801
+ * Amount charged before tax for each recurring payment in the currency's smallest
802
+ * unit (cents for USD, yen for JPY, fils for KWD)
798
803
  */
799
804
  recurring_pre_tax_amount: number;
800
805
 
@@ -1001,6 +1006,13 @@ export namespace SubscriptionPreviewChangePlanResponse {
1001
1006
  export interface Summary {
1002
1007
  currency: MiscAPI.Currency;
1003
1008
 
1009
+ /**
1010
+ * Net credit movement in the smallest currency unit (e.g. cents). **Negative** –
1011
+ * credits were deducted from the customer's balance to offset the charge (typical
1012
+ * on upgrades). **Positive** – credits were added to the customer's balance,
1013
+ * either from a downgrade proration refund or from topping-up the wallet to meet a
1014
+ * gateway minimum-charge threshold. **Zero** – no credit movement occurred.
1015
+ */
1004
1016
  customer_credits: number;
1005
1017
 
1006
1018
  settlement_amount: number;
@@ -1130,7 +1142,8 @@ export namespace SubscriptionRetrieveUsageHistoryResponse {
1130
1142
  price_per_unit: string;
1131
1143
 
1132
1144
  /**
1133
- * Total price charged for this meter in smallest currency unit (cents)
1145
+ * Total price charged for this meter in the currency's smallest unit (cents for
1146
+ * USD, yen for JPY, fils for KWD)
1134
1147
  */
1135
1148
  total_price: number;
1136
1149
  }
@@ -1553,6 +1566,16 @@ export namespace SubscriptionUpdatePaymentMethodParams {
1553
1566
  export interface New {
1554
1567
  type: 'new';
1555
1568
 
1569
+ /**
1570
+ * List of payment methods allowed during checkout.
1571
+ *
1572
+ * Customers will **never** see payment methods that are **not** in this list.
1573
+ * However, adding a method here **does not guarantee** customers will see it.
1574
+ * Availability still depends on other factors (e.g., customer location, merchant
1575
+ * settings).
1576
+ */
1577
+ allowed_payment_method_types?: Array<PaymentsAPI.PaymentMethodTypes> | null;
1578
+
1556
1579
  return_url?: string | null;
1557
1580
  }
1558
1581
 
@@ -125,6 +125,11 @@ export namespace WebhookPayload {
125
125
  export interface CreditBalanceLow {
126
126
  available_balance: string;
127
127
 
128
+ /**
129
+ * Brand id this credit entitlement belongs to
130
+ */
131
+ brand_id: string;
132
+
128
133
  credit_entitlement_id: string;
129
134
 
130
135
  credit_entitlement_name: string;
@@ -147,6 +152,11 @@ export namespace WebhookPayload {
147
152
 
148
153
  abandonment_reason: 'payment_failed' | 'checkout_incomplete';
149
154
 
155
+ /**
156
+ * Brand id this abandoned checkout belongs to
157
+ */
158
+ brand_id: string;
159
+
150
160
  customer_id: string;
151
161
 
152
162
  payload_type: 'AbandonedCheckout';
@@ -159,6 +169,11 @@ export namespace WebhookPayload {
159
169
  }
160
170
 
161
171
  export interface DunningAttempt {
172
+ /**
173
+ * Brand id this dunning attempt belongs to
174
+ */
175
+ brand_id: string;
176
+
162
177
  created_at: string;
163
178
 
164
179
  customer_id: string;
@@ -177,6 +177,11 @@ export namespace AbandonedCheckoutDetectedWebhookEvent {
177
177
 
178
178
  abandonment_reason: 'payment_failed' | 'checkout_incomplete';
179
179
 
180
+ /**
181
+ * Brand id this abandoned checkout belongs to
182
+ */
183
+ brand_id: string;
184
+
180
185
  customer_id: string;
181
186
 
182
187
  payment_id: string;
@@ -220,6 +225,11 @@ export namespace AbandonedCheckoutRecoveredWebhookEvent {
220
225
 
221
226
  abandonment_reason: 'payment_failed' | 'checkout_incomplete';
222
227
 
228
+ /**
229
+ * Brand id this abandoned checkout belongs to
230
+ */
231
+ brand_id: string;
232
+
223
233
  customer_id: string;
224
234
 
225
235
  payment_id: string;
@@ -281,6 +291,11 @@ export namespace CreditBalanceLowWebhookEvent {
281
291
  export interface Data {
282
292
  available_balance: string;
283
293
 
294
+ /**
295
+ * Brand id this credit entitlement belongs to
296
+ */
297
+ brand_id: string;
298
+
284
299
  credit_entitlement_id: string;
285
300
 
286
301
  credit_entitlement_name: string;
@@ -611,6 +626,11 @@ export namespace DunningRecoveredWebhookEvent {
611
626
  * Webhook payload for dunning.started and dunning.recovered events
612
627
  */
613
628
  export interface Data {
629
+ /**
630
+ * Brand id this dunning attempt belongs to
631
+ */
632
+ brand_id: string;
633
+
614
634
  created_at: string;
615
635
 
616
636
  customer_id: string;
@@ -652,6 +672,11 @@ export namespace DunningStartedWebhookEvent {
652
672
  * Webhook payload for dunning.started and dunning.recovered events
653
673
  */
654
674
  export interface Data {
675
+ /**
676
+ * Brand id this dunning attempt belongs to
677
+ */
678
+ brand_id: string;
679
+
655
680
  created_at: string;
656
681
 
657
682
  customer_id: string;
@@ -1100,6 +1125,11 @@ export namespace AbandonedCheckoutDetectedWebhookEvent {
1100
1125
 
1101
1126
  abandonment_reason: 'payment_failed' | 'checkout_incomplete';
1102
1127
 
1128
+ /**
1129
+ * Brand id this abandoned checkout belongs to
1130
+ */
1131
+ brand_id: string;
1132
+
1103
1133
  customer_id: string;
1104
1134
 
1105
1135
  payment_id: string;
@@ -1143,6 +1173,11 @@ export namespace AbandonedCheckoutRecoveredWebhookEvent {
1143
1173
 
1144
1174
  abandonment_reason: 'payment_failed' | 'checkout_incomplete';
1145
1175
 
1176
+ /**
1177
+ * Brand id this abandoned checkout belongs to
1178
+ */
1179
+ brand_id: string;
1180
+
1146
1181
  customer_id: string;
1147
1182
 
1148
1183
  payment_id: string;
@@ -1204,6 +1239,11 @@ export namespace CreditBalanceLowWebhookEvent {
1204
1239
  export interface Data {
1205
1240
  available_balance: string;
1206
1241
 
1242
+ /**
1243
+ * Brand id this credit entitlement belongs to
1244
+ */
1245
+ brand_id: string;
1246
+
1207
1247
  credit_entitlement_id: string;
1208
1248
 
1209
1249
  credit_entitlement_name: string;
@@ -1534,6 +1574,11 @@ export namespace DunningRecoveredWebhookEvent {
1534
1574
  * Webhook payload for dunning.started and dunning.recovered events
1535
1575
  */
1536
1576
  export interface Data {
1577
+ /**
1578
+ * Brand id this dunning attempt belongs to
1579
+ */
1580
+ brand_id: string;
1581
+
1537
1582
  created_at: string;
1538
1583
 
1539
1584
  customer_id: string;
@@ -1575,6 +1620,11 @@ export namespace DunningStartedWebhookEvent {
1575
1620
  * Webhook payload for dunning.started and dunning.recovered events
1576
1621
  */
1577
1622
  export interface Data {
1623
+ /**
1624
+ * Brand id this dunning attempt belongs to
1625
+ */
1626
+ brand_id: string;
1627
+
1578
1628
  created_at: string;
1579
1629
 
1580
1630
  customer_id: string;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.35.0'; // x-release-please-version
1
+ export const VERSION = '2.37.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.35.0";
1
+ export declare const VERSION = "2.37.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.35.0";
1
+ export declare const VERSION = "2.37.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.35.0'; // x-release-please-version
4
+ exports.VERSION = '2.37.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.35.0'; // x-release-please-version
1
+ export const VERSION = '2.37.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map