dodopayments 2.48.0 → 2.50.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.
- package/CHANGELOG.md +16 -0
- package/bin/migration-config.json +70 -0
- package/client.d.mts +7 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -4
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/balances.d.mts +3 -2
- package/resources/balances.d.mts.map +1 -1
- package/resources/balances.d.ts +3 -2
- package/resources/balances.d.ts.map +1 -1
- package/resources/blocklist/blocklist.d.mts +10 -0
- package/resources/blocklist/blocklist.d.mts.map +1 -0
- package/resources/blocklist/blocklist.d.ts +10 -0
- package/resources/blocklist/blocklist.d.ts.map +1 -0
- package/resources/blocklist/blocklist.js +17 -0
- package/resources/blocklist/blocklist.js.map +1 -0
- package/resources/blocklist/blocklist.mjs +12 -0
- package/resources/blocklist/blocklist.mjs.map +1 -0
- package/resources/blocklist/customers/customers.d.mts +161 -0
- package/resources/blocklist/customers/customers.d.mts.map +1 -0
- package/resources/blocklist/customers/customers.d.ts +161 -0
- package/resources/blocklist/customers/customers.d.ts.map +1 -0
- package/resources/blocklist/customers/customers.js +38 -0
- package/resources/blocklist/customers/customers.js.map +1 -0
- package/resources/blocklist/customers/customers.mjs +33 -0
- package/resources/blocklist/customers/customers.mjs.map +1 -0
- package/resources/blocklist/customers/index.d.mts +3 -0
- package/resources/blocklist/customers/index.d.mts.map +1 -0
- package/resources/blocklist/customers/index.d.ts +3 -0
- package/resources/blocklist/customers/index.d.ts.map +1 -0
- package/resources/blocklist/customers/index.js +9 -0
- package/resources/blocklist/customers/index.js.map +1 -0
- package/resources/blocklist/customers/index.mjs +4 -0
- package/resources/blocklist/customers/index.mjs.map +1 -0
- package/resources/blocklist/customers/notes.d.mts +34 -0
- package/resources/blocklist/customers/notes.d.mts.map +1 -0
- package/resources/blocklist/customers/notes.d.ts +34 -0
- package/resources/blocklist/customers/notes.d.ts.map +1 -0
- package/resources/blocklist/customers/notes.js +17 -0
- package/resources/blocklist/customers/notes.js.map +1 -0
- package/resources/blocklist/customers/notes.mjs +13 -0
- package/resources/blocklist/customers/notes.mjs.map +1 -0
- package/resources/blocklist/customers.d.mts +2 -0
- package/resources/blocklist/customers.d.mts.map +1 -0
- package/resources/blocklist/customers.d.ts +2 -0
- package/resources/blocklist/customers.d.ts.map +1 -0
- package/resources/blocklist/customers.js +6 -0
- package/resources/blocklist/customers.js.map +1 -0
- package/resources/blocklist/customers.mjs +3 -0
- package/resources/blocklist/customers.mjs.map +1 -0
- package/resources/blocklist/index.d.mts +3 -0
- package/resources/blocklist/index.d.mts.map +1 -0
- package/resources/blocklist/index.d.ts +3 -0
- package/resources/blocklist/index.d.ts.map +1 -0
- package/resources/blocklist/index.js +9 -0
- package/resources/blocklist/index.js.map +1 -0
- package/resources/blocklist/index.mjs +4 -0
- package/resources/blocklist/index.mjs.map +1 -0
- package/resources/blocklist.d.mts +2 -0
- package/resources/blocklist.d.mts.map +1 -0
- package/resources/blocklist.d.ts +2 -0
- package/resources/blocklist.d.ts.map +1 -0
- package/resources/blocklist.js +6 -0
- package/resources/blocklist.js.map +1 -0
- package/resources/blocklist.mjs +3 -0
- package/resources/blocklist.mjs.map +1 -0
- package/resources/checkout-sessions.d.mts +5 -0
- package/resources/checkout-sessions.d.mts.map +1 -1
- package/resources/checkout-sessions.d.ts +5 -0
- package/resources/checkout-sessions.d.ts.map +1 -1
- package/resources/credit-entitlements/balances.d.mts +7 -4
- package/resources/credit-entitlements/balances.d.mts.map +1 -1
- package/resources/credit-entitlements/balances.d.ts +7 -4
- package/resources/credit-entitlements/balances.d.ts.map +1 -1
- package/resources/credit-entitlements/balances.js +1 -0
- package/resources/credit-entitlements/balances.js.map +1 -1
- package/resources/credit-entitlements/balances.mjs +1 -0
- package/resources/credit-entitlements/balances.mjs.map +1 -1
- package/resources/customers/customers.d.mts +14 -0
- package/resources/customers/customers.d.mts.map +1 -1
- package/resources/customers/customers.d.ts +14 -0
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +4 -0
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +4 -0
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/emails.d.mts +169 -0
- package/resources/customers/emails.d.mts.map +1 -0
- package/resources/customers/emails.d.ts +169 -0
- package/resources/customers/emails.d.ts.map +1 -0
- package/resources/customers/emails.js +48 -0
- package/resources/customers/emails.js.map +1 -0
- package/resources/customers/emails.mjs +44 -0
- package/resources/customers/emails.mjs.map +1 -0
- package/resources/customers/index.d.mts +1 -0
- package/resources/customers/index.d.mts.map +1 -1
- package/resources/customers/index.d.ts +1 -0
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/index.js +3 -1
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs +1 -0
- package/resources/customers/index.mjs.map +1 -1
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/payments.d.mts +64 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +64 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +21 -0
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +21 -0
- package/resources/payments.mjs.map +1 -1
- package/resources/products/products.d.mts +54 -13
- package/resources/products/products.d.mts.map +1 -1
- package/resources/products/products.d.ts +54 -13
- package/resources/products/products.d.ts.map +1 -1
- package/resources/products/products.js +0 -1
- package/resources/products/products.js.map +1 -1
- package/resources/products/products.mjs +0 -1
- package/resources/products/products.mjs.map +1 -1
- package/resources/subscriptions.d.mts +18 -3
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +18 -3
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/webhook-events.d.mts +12 -2
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +12 -2
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhooks/index.d.mts +1 -1
- package/resources/webhooks/index.d.mts.map +1 -1
- package/resources/webhooks/index.d.ts +1 -1
- package/resources/webhooks/index.d.ts.map +1 -1
- package/resources/webhooks/index.js.map +1 -1
- package/resources/webhooks/index.mjs.map +1 -1
- package/resources/webhooks/webhooks.d.mts +543 -51
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +543 -51
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/resources/webhooks/webhooks.js.map +1 -1
- package/resources/webhooks/webhooks.mjs.map +1 -1
- package/src/client.ts +11 -0
- package/src/resources/balances.ts +8 -2
- package/src/resources/blocklist/blocklist.ts +37 -0
- package/src/resources/blocklist/customers/customers.ts +254 -0
- package/src/resources/blocklist/customers/index.ts +21 -0
- package/src/resources/blocklist/customers/notes.ts +62 -0
- package/src/resources/blocklist/customers.ts +3 -0
- package/src/resources/blocklist/index.ts +15 -0
- package/src/resources/blocklist.ts +3 -0
- package/src/resources/checkout-sessions.ts +6 -0
- package/src/resources/credit-entitlements/balances.ts +8 -4
- package/src/resources/customers/customers.ts +38 -0
- package/src/resources/customers/emails.ts +238 -0
- package/src/resources/customers/index.ts +11 -0
- package/src/resources/index.ts +4 -0
- package/src/resources/payments.ts +84 -0
- package/src/resources/products/products.ts +62 -16
- package/src/resources/subscriptions.ts +22 -2
- package/src/resources/webhook-events.ts +13 -1
- package/src/resources/webhooks/index.ts +1 -0
- package/src/resources/webhooks/webhooks.ts +575 -48
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -526,6 +526,12 @@ export interface Subscription {
|
|
|
526
526
|
*/
|
|
527
527
|
customer: PaymentsAPI.CustomerLimitedDetails;
|
|
528
528
|
|
|
529
|
+
/**
|
|
530
|
+
* Whether a payment method is on file. False while a card-optional subscription
|
|
531
|
+
* waits for the customer to add one.
|
|
532
|
+
*/
|
|
533
|
+
has_payment_method: boolean;
|
|
534
|
+
|
|
529
535
|
/**
|
|
530
536
|
* Additional custom data associated with the subscription
|
|
531
537
|
*/
|
|
@@ -695,7 +701,8 @@ export type SubscriptionStatus =
|
|
|
695
701
|
| 'paused'
|
|
696
702
|
| 'cancelled'
|
|
697
703
|
| 'failed'
|
|
698
|
-
| 'expired'
|
|
704
|
+
| 'expired'
|
|
705
|
+
| 'past_due';
|
|
699
706
|
|
|
700
707
|
/**
|
|
701
708
|
* Unit of a duration count (e.g. license-key validity period).
|
|
@@ -822,6 +829,12 @@ export interface SubscriptionCreateResponse {
|
|
|
822
829
|
*/
|
|
823
830
|
payment_id: string;
|
|
824
831
|
|
|
832
|
+
/**
|
|
833
|
+
* False when the customer can start this subscription with no card. True for every
|
|
834
|
+
* other subscription.
|
|
835
|
+
*/
|
|
836
|
+
payment_method_required: boolean;
|
|
837
|
+
|
|
825
838
|
/**
|
|
826
839
|
* Tax will be added to the amount and charged to the customer on each billing
|
|
827
840
|
* cycle
|
|
@@ -913,6 +926,12 @@ export interface SubscriptionListResponse {
|
|
|
913
926
|
*/
|
|
914
927
|
discounts: Array<SubscriptionListResponse.Discount>;
|
|
915
928
|
|
|
929
|
+
/**
|
|
930
|
+
* Whether a payment method is on file. False while a card-optional subscription
|
|
931
|
+
* waits for the customer to add one.
|
|
932
|
+
*/
|
|
933
|
+
has_payment_method: boolean;
|
|
934
|
+
|
|
916
935
|
/**
|
|
917
936
|
* Additional custom data associated with the subscription
|
|
918
937
|
*/
|
|
@@ -1392,7 +1411,7 @@ export interface SubscriptionListParams extends DefaultPageNumberPaginationParam
|
|
|
1392
1411
|
/**
|
|
1393
1412
|
* Filter by status
|
|
1394
1413
|
*/
|
|
1395
|
-
status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired';
|
|
1414
|
+
status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due';
|
|
1396
1415
|
}
|
|
1397
1416
|
|
|
1398
1417
|
export interface SubscriptionCreateParams {
|
|
@@ -1548,6 +1567,7 @@ export interface SubscriptionUpdateParams {
|
|
|
1548
1567
|
| 'cancelled_by_customer'
|
|
1549
1568
|
| 'cancelled_by_merchant'
|
|
1550
1569
|
| 'cancelled_by_merchant_send_dunning'
|
|
1570
|
+
| 'cancelled_by_merchant_grace_period_expired'
|
|
1551
1571
|
| 'dodo_team'
|
|
1552
1572
|
| null;
|
|
1553
1573
|
|
|
@@ -32,6 +32,7 @@ export type WebhookEventType =
|
|
|
32
32
|
| 'subscription.active'
|
|
33
33
|
| 'subscription.renewed'
|
|
34
34
|
| 'subscription.on_hold'
|
|
35
|
+
| 'subscription.past_due'
|
|
35
36
|
| 'subscription.paused'
|
|
36
37
|
| 'subscription.unpaused'
|
|
37
38
|
| 'subscription.cancelled'
|
|
@@ -105,6 +106,17 @@ export namespace WebhookPayload {
|
|
|
105
106
|
*/
|
|
106
107
|
export interface Subscription extends SubscriptionsAPI.Subscription {
|
|
107
108
|
payload_type: 'Subscription';
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Time when the grace period ends. The subscription moves to `on_hold` or to
|
|
112
|
+
* `cancelled` at this time.
|
|
113
|
+
*
|
|
114
|
+
* Read in the same query as the rest of the payload, so it always comes from the
|
|
115
|
+
* row snapshot that produced `status`. It is set whenever the subscription sits in
|
|
116
|
+
* a window at that moment. A delayed event of another type therefore carries the
|
|
117
|
+
* deadline too, next to a `past_due` status.
|
|
118
|
+
*/
|
|
119
|
+
past_due_ends_at?: string | null;
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
export interface Refund extends RefundsAPI.Refund {
|
|
@@ -270,7 +282,7 @@ export namespace WebhookPayload {
|
|
|
270
282
|
|
|
271
283
|
subscription_id: string;
|
|
272
284
|
|
|
273
|
-
trigger_state: 'on_hold' | 'cancelled';
|
|
285
|
+
trigger_state: 'on_hold' | 'cancelled' | 'past_due';
|
|
274
286
|
|
|
275
287
|
payment_id?: string | null;
|
|
276
288
|
}
|
|
@@ -46,6 +46,7 @@ export {
|
|
|
46
46
|
type SubscriptionExpiredWebhookEvent,
|
|
47
47
|
type SubscriptionFailedWebhookEvent,
|
|
48
48
|
type SubscriptionOnHoldWebhookEvent,
|
|
49
|
+
type SubscriptionPastDueWebhookEvent,
|
|
49
50
|
type SubscriptionPausedWebhookEvent,
|
|
50
51
|
type SubscriptionPlanChangedWebhookEvent,
|
|
51
52
|
type SubscriptionRenewedWebhookEvent,
|