dodopayments 2.36.0 → 2.38.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 (84) hide show
  1. package/CHANGELOG.md +3 -1775
  2. package/package.json +1 -1
  3. package/resources/checkout-sessions.d.mts +7 -0
  4. package/resources/checkout-sessions.d.mts.map +1 -1
  5. package/resources/checkout-sessions.d.ts +7 -0
  6. package/resources/checkout-sessions.d.ts.map +1 -1
  7. package/resources/credit-entitlements/balances.d.mts +4 -0
  8. package/resources/credit-entitlements/balances.d.mts.map +1 -1
  9. package/resources/credit-entitlements/balances.d.ts +4 -0
  10. package/resources/credit-entitlements/balances.d.ts.map +1 -1
  11. package/resources/customers/customers.d.mts +1 -1
  12. package/resources/customers/customers.d.ts +1 -1
  13. package/resources/disputes.d.mts +11 -1
  14. package/resources/disputes.d.mts.map +1 -1
  15. package/resources/disputes.d.ts +11 -1
  16. package/resources/disputes.d.ts.map +1 -1
  17. package/resources/entitlements/entitlements.d.mts +6 -8
  18. package/resources/entitlements/entitlements.d.mts.map +1 -1
  19. package/resources/entitlements/entitlements.d.ts +6 -8
  20. package/resources/entitlements/entitlements.d.ts.map +1 -1
  21. package/resources/entitlements/entitlements.js.map +1 -1
  22. package/resources/entitlements/entitlements.mjs.map +1 -1
  23. package/resources/entitlements/grants.d.mts +4 -4
  24. package/resources/entitlements/grants.d.mts.map +1 -1
  25. package/resources/entitlements/grants.d.ts +4 -4
  26. package/resources/entitlements/grants.d.ts.map +1 -1
  27. package/resources/license-keys.d.mts +4 -0
  28. package/resources/license-keys.d.mts.map +1 -1
  29. package/resources/license-keys.d.ts +4 -0
  30. package/resources/license-keys.d.ts.map +1 -1
  31. package/resources/payments.d.mts +10 -9
  32. package/resources/payments.d.mts.map +1 -1
  33. package/resources/payments.d.ts +10 -9
  34. package/resources/payments.d.ts.map +1 -1
  35. package/resources/payouts/breakup/breakup.d.mts +2 -2
  36. package/resources/payouts/breakup/breakup.d.ts +2 -2
  37. package/resources/payouts/breakup/details.d.mts +5 -4
  38. package/resources/payouts/breakup/details.d.mts.map +1 -1
  39. package/resources/payouts/breakup/details.d.ts +5 -4
  40. package/resources/payouts/breakup/details.d.ts.map +1 -1
  41. package/resources/products/products.d.mts +24 -2
  42. package/resources/products/products.d.mts.map +1 -1
  43. package/resources/products/products.d.ts +24 -2
  44. package/resources/products/products.d.ts.map +1 -1
  45. package/resources/products/products.js.map +1 -1
  46. package/resources/products/products.mjs.map +1 -1
  47. package/resources/refunds.d.mts +4 -0
  48. package/resources/refunds.d.mts.map +1 -1
  49. package/resources/refunds.d.ts +4 -0
  50. package/resources/refunds.d.ts.map +1 -1
  51. package/resources/subscriptions.d.mts +17 -5
  52. package/resources/subscriptions.d.mts.map +1 -1
  53. package/resources/subscriptions.d.ts +17 -5
  54. package/resources/subscriptions.d.ts.map +1 -1
  55. package/resources/webhook-events.d.mts +12 -0
  56. package/resources/webhook-events.d.mts.map +1 -1
  57. package/resources/webhook-events.d.ts +12 -0
  58. package/resources/webhook-events.d.ts.map +1 -1
  59. package/resources/webhooks/webhooks.d.mts +40 -0
  60. package/resources/webhooks/webhooks.d.mts.map +1 -1
  61. package/resources/webhooks/webhooks.d.ts +40 -0
  62. package/resources/webhooks/webhooks.d.ts.map +1 -1
  63. package/resources/webhooks/webhooks.js.map +1 -1
  64. package/resources/webhooks/webhooks.mjs.map +1 -1
  65. package/src/resources/checkout-sessions.ts +8 -0
  66. package/src/resources/credit-entitlements/balances.ts +5 -0
  67. package/src/resources/customers/customers.ts +1 -1
  68. package/src/resources/disputes.ts +13 -1
  69. package/src/resources/entitlements/entitlements.ts +6 -8
  70. package/src/resources/entitlements/grants.ts +5 -13
  71. package/src/resources/license-keys.ts +5 -0
  72. package/src/resources/payments.ts +10 -9
  73. package/src/resources/payouts/breakup/breakup.ts +2 -2
  74. package/src/resources/payouts/breakup/details.ts +5 -4
  75. package/src/resources/products/products.ts +28 -2
  76. package/src/resources/refunds.ts +5 -0
  77. package/src/resources/subscriptions.ts +18 -5
  78. package/src/resources/webhook-events.ts +15 -0
  79. package/src/resources/webhooks/webhooks.ts +50 -0
  80. package/src/version.ts +1 -1
  81. package/version.d.mts +1 -1
  82. package/version.d.ts +1 -1
  83. package/version.js +1 -1
  84. package/version.mjs +1 -1
@@ -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
  */
@@ -785,6 +791,12 @@ export interface ProductListResponse {
785
791
  */
786
792
  price_detail?: Price | null;
787
793
 
794
+ /**
795
+ * Pricing mode for localized pricing. NULL means base-only (no localized rules
796
+ * apply).
797
+ */
798
+ pricing_mode?: 'by_currency' | 'by_country' | null;
799
+
788
800
  /**
789
801
  * Indicates if the price is tax inclusive
790
802
  */
@@ -845,7 +857,7 @@ export interface ProductCreateParams {
845
857
  brand_id?: string | null;
846
858
 
847
859
  /**
848
- * Optional credit entitlements to attach (max 3)
860
+ * Optional credit entitlements to attach (max 5)
849
861
  */
850
862
  credit_entitlements?: Array<AttachCreditEntitlement> | null;
851
863
 
@@ -862,7 +874,7 @@ export interface ProductCreateParams {
862
874
  digital_product_delivery?: ProductCreateParams.DigitalProductDelivery | null;
863
875
 
864
876
  /**
865
- * Optional entitlements to attach to this product (max 20)
877
+ * Optional entitlements to attach to this product (max 50)
866
878
  */
867
879
  entitlements?: Array<AttachProductEntitlement> | null;
868
880
 
@@ -898,6 +910,13 @@ export interface ProductCreateParams {
898
910
  * Additional metadata for the product
899
911
  */
900
912
  metadata?: { [key: string]: string };
913
+
914
+ /**
915
+ * Pricing mode for localized pricing. When set, rules from
916
+ * /products/{id}/localized-prices apply at checkout. NULL means base-only
917
+ * (existing behavior).
918
+ */
919
+ pricing_mode?: 'by_currency' | 'by_country' | null;
901
920
  }
902
921
 
903
922
  export namespace ProductCreateParams {
@@ -999,6 +1018,13 @@ export interface ProductUpdateParams {
999
1018
  */
1000
1019
  price?: Price | null;
1001
1020
 
1021
+ /**
1022
+ * Update the pricing mode. Omit to leave unchanged; set to null to clear (which
1023
+ * archives all active localized rules for this product). Changing to a different
1024
+ * non-null mode also archives any rules whose mode doesn't match the new mode.
1025
+ */
1026
+ pricing_mode?: 'by_currency' | 'by_country' | null;
1027
+
1002
1028
  /**
1003
1029
  * Tax category of the product.
1004
1030
  */
@@ -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
  }
@@ -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.36.0'; // x-release-please-version
1
+ export const VERSION = '2.38.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.36.0";
1
+ export declare const VERSION = "2.38.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.36.0";
1
+ export declare const VERSION = "2.38.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.36.0'; // x-release-please-version
4
+ exports.VERSION = '2.38.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.36.0'; // x-release-please-version
1
+ export const VERSION = '2.38.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map