dodopayments 2.42.2 → 2.44.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/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/checkout-sessions.d.mts +17 -1
- package/resources/checkout-sessions.d.mts.map +1 -1
- package/resources/checkout-sessions.d.ts +17 -1
- package/resources/checkout-sessions.d.ts.map +1 -1
- package/resources/credit-entitlements/balances.d.mts +3 -1
- package/resources/credit-entitlements/balances.d.mts.map +1 -1
- package/resources/credit-entitlements/balances.d.ts +3 -1
- package/resources/credit-entitlements/balances.d.ts.map +1 -1
- package/resources/discounts.d.mts +155 -6
- package/resources/discounts.d.mts.map +1 -1
- package/resources/discounts.d.ts +155 -6
- package/resources/discounts.d.ts.map +1 -1
- package/resources/discounts.js +1 -1
- package/resources/discounts.mjs +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/payments.d.mts +8 -2
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +8 -2
- package/resources/payments.d.ts.map +1 -1
- package/resources/products/products.d.mts +10 -0
- package/resources/products/products.d.mts.map +1 -1
- package/resources/products/products.d.ts +10 -0
- package/resources/products/products.d.ts.map +1 -1
- package/resources/products/products.js.map +1 -1
- package/resources/products/products.mjs.map +1 -1
- package/resources/subscriptions.d.mts +17 -0
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +17 -0
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/webhook-events.d.mts +69 -2
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +69 -2
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhook-events.js.map +1 -1
- package/resources/webhook-events.mjs.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 +824 -3
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +824 -3
- 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 +10 -0
- package/src/resources/checkout-sessions.ts +19 -1
- package/src/resources/credit-entitlements/balances.ts +3 -1
- package/src/resources/discounts.ts +179 -6
- package/src/resources/index.ts +5 -0
- package/src/resources/payments.ts +153 -2
- package/src/resources/products/products.ts +12 -0
- package/src/resources/subscriptions.ts +20 -0
- package/src/resources/webhook-events.ts +85 -1
- package/src/resources/webhooks/index.ts +5 -0
- package/src/resources/webhooks/webhooks.ts +1101 -75
- 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
|
@@ -354,7 +354,9 @@ export interface Payment {
|
|
|
354
354
|
error_code?: string | null;
|
|
355
355
|
|
|
356
356
|
/**
|
|
357
|
-
* An error message if the payment failed
|
|
357
|
+
* An error message if the payment failed. When `error_code` is a recognised
|
|
358
|
+
* unified code, this is the merchant-facing headline + recommended action (Payment
|
|
359
|
+
* Details copy) rather than the raw connector text.
|
|
358
360
|
*/
|
|
359
361
|
error_message?: string | null;
|
|
360
362
|
|
|
@@ -519,7 +521,6 @@ export type PaymentMethodTypes =
|
|
|
519
521
|
| 'sepa'
|
|
520
522
|
| 'sepa_bank_transfer'
|
|
521
523
|
| 'sofort'
|
|
522
|
-
| 'sunbit'
|
|
523
524
|
| 'swish'
|
|
524
525
|
| 'touch_n_go'
|
|
525
526
|
| 'trustly'
|
|
@@ -758,6 +759,156 @@ export interface PaymentListParams extends DefaultPageNumberPaginationParams {
|
|
|
758
759
|
*/
|
|
759
760
|
created_at_lte?: string;
|
|
760
761
|
|
|
762
|
+
/**
|
|
763
|
+
* Filter by currency
|
|
764
|
+
*/
|
|
765
|
+
currency?:
|
|
766
|
+
| 'AED'
|
|
767
|
+
| 'ALL'
|
|
768
|
+
| 'AMD'
|
|
769
|
+
| 'ANG'
|
|
770
|
+
| 'AOA'
|
|
771
|
+
| 'ARS'
|
|
772
|
+
| 'AUD'
|
|
773
|
+
| 'AWG'
|
|
774
|
+
| 'AZN'
|
|
775
|
+
| 'BAM'
|
|
776
|
+
| 'BBD'
|
|
777
|
+
| 'BDT'
|
|
778
|
+
| 'BGN'
|
|
779
|
+
| 'BHD'
|
|
780
|
+
| 'BIF'
|
|
781
|
+
| 'BMD'
|
|
782
|
+
| 'BND'
|
|
783
|
+
| 'BOB'
|
|
784
|
+
| 'BRL'
|
|
785
|
+
| 'BSD'
|
|
786
|
+
| 'BWP'
|
|
787
|
+
| 'BYN'
|
|
788
|
+
| 'BZD'
|
|
789
|
+
| 'CAD'
|
|
790
|
+
| 'CHF'
|
|
791
|
+
| 'CLP'
|
|
792
|
+
| 'CNY'
|
|
793
|
+
| 'COP'
|
|
794
|
+
| 'CRC'
|
|
795
|
+
| 'CUP'
|
|
796
|
+
| 'CVE'
|
|
797
|
+
| 'CZK'
|
|
798
|
+
| 'DJF'
|
|
799
|
+
| 'DKK'
|
|
800
|
+
| 'DOP'
|
|
801
|
+
| 'DZD'
|
|
802
|
+
| 'EGP'
|
|
803
|
+
| 'ETB'
|
|
804
|
+
| 'EUR'
|
|
805
|
+
| 'FJD'
|
|
806
|
+
| 'FKP'
|
|
807
|
+
| 'GBP'
|
|
808
|
+
| 'GEL'
|
|
809
|
+
| 'GHS'
|
|
810
|
+
| 'GIP'
|
|
811
|
+
| 'GMD'
|
|
812
|
+
| 'GNF'
|
|
813
|
+
| 'GTQ'
|
|
814
|
+
| 'GYD'
|
|
815
|
+
| 'HKD'
|
|
816
|
+
| 'HNL'
|
|
817
|
+
| 'HRK'
|
|
818
|
+
| 'HTG'
|
|
819
|
+
| 'HUF'
|
|
820
|
+
| 'IDR'
|
|
821
|
+
| 'ILS'
|
|
822
|
+
| 'INR'
|
|
823
|
+
| 'IQD'
|
|
824
|
+
| 'JMD'
|
|
825
|
+
| 'JOD'
|
|
826
|
+
| 'JPY'
|
|
827
|
+
| 'KES'
|
|
828
|
+
| 'KGS'
|
|
829
|
+
| 'KHR'
|
|
830
|
+
| 'KMF'
|
|
831
|
+
| 'KRW'
|
|
832
|
+
| 'KWD'
|
|
833
|
+
| 'KYD'
|
|
834
|
+
| 'KZT'
|
|
835
|
+
| 'LAK'
|
|
836
|
+
| 'LBP'
|
|
837
|
+
| 'LKR'
|
|
838
|
+
| 'LRD'
|
|
839
|
+
| 'LSL'
|
|
840
|
+
| 'LYD'
|
|
841
|
+
| 'MAD'
|
|
842
|
+
| 'MDL'
|
|
843
|
+
| 'MGA'
|
|
844
|
+
| 'MKD'
|
|
845
|
+
| 'MMK'
|
|
846
|
+
| 'MNT'
|
|
847
|
+
| 'MOP'
|
|
848
|
+
| 'MRU'
|
|
849
|
+
| 'MUR'
|
|
850
|
+
| 'MVR'
|
|
851
|
+
| 'MWK'
|
|
852
|
+
| 'MXN'
|
|
853
|
+
| 'MYR'
|
|
854
|
+
| 'MZN'
|
|
855
|
+
| 'NAD'
|
|
856
|
+
| 'NGN'
|
|
857
|
+
| 'NIO'
|
|
858
|
+
| 'NOK'
|
|
859
|
+
| 'NPR'
|
|
860
|
+
| 'NZD'
|
|
861
|
+
| 'OMR'
|
|
862
|
+
| 'PAB'
|
|
863
|
+
| 'PEN'
|
|
864
|
+
| 'PGK'
|
|
865
|
+
| 'PHP'
|
|
866
|
+
| 'PKR'
|
|
867
|
+
| 'PLN'
|
|
868
|
+
| 'PYG'
|
|
869
|
+
| 'QAR'
|
|
870
|
+
| 'RON'
|
|
871
|
+
| 'RSD'
|
|
872
|
+
| 'RUB'
|
|
873
|
+
| 'RWF'
|
|
874
|
+
| 'SAR'
|
|
875
|
+
| 'SBD'
|
|
876
|
+
| 'SCR'
|
|
877
|
+
| 'SEK'
|
|
878
|
+
| 'SGD'
|
|
879
|
+
| 'SHP'
|
|
880
|
+
| 'SLE'
|
|
881
|
+
| 'SLL'
|
|
882
|
+
| 'SOS'
|
|
883
|
+
| 'SRD'
|
|
884
|
+
| 'SSP'
|
|
885
|
+
| 'STN'
|
|
886
|
+
| 'SVC'
|
|
887
|
+
| 'SZL'
|
|
888
|
+
| 'THB'
|
|
889
|
+
| 'TND'
|
|
890
|
+
| 'TOP'
|
|
891
|
+
| 'TRY'
|
|
892
|
+
| 'TTD'
|
|
893
|
+
| 'TWD'
|
|
894
|
+
| 'TZS'
|
|
895
|
+
| 'UAH'
|
|
896
|
+
| 'UGX'
|
|
897
|
+
| 'USD'
|
|
898
|
+
| 'UYU'
|
|
899
|
+
| 'UZS'
|
|
900
|
+
| 'VES'
|
|
901
|
+
| 'VND'
|
|
902
|
+
| 'VUV'
|
|
903
|
+
| 'WST'
|
|
904
|
+
| 'XAF'
|
|
905
|
+
| 'XCD'
|
|
906
|
+
| 'XOF'
|
|
907
|
+
| 'XPF'
|
|
908
|
+
| 'YER'
|
|
909
|
+
| 'ZAR'
|
|
910
|
+
| 'ZMW';
|
|
911
|
+
|
|
761
912
|
/**
|
|
762
913
|
* Filter by customer id
|
|
763
914
|
*/
|
|
@@ -583,6 +583,18 @@ export namespace Price {
|
|
|
583
583
|
*/
|
|
584
584
|
tax_inclusive?: boolean | null;
|
|
585
585
|
|
|
586
|
+
/**
|
|
587
|
+
* Amount charged today for a paid trial, in the price currency's minor units.
|
|
588
|
+
* Requires `trial_period_days > 0`. Omit or null for a free trial (the default).
|
|
589
|
+
*/
|
|
590
|
+
trial_amount?: number | null;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Whether discount codes reduce the trial charge. Defaults to false. Only
|
|
594
|
+
* meaningful when a paid trial is configured.
|
|
595
|
+
*/
|
|
596
|
+
trial_apply_discounts?: boolean | null;
|
|
597
|
+
|
|
586
598
|
/**
|
|
587
599
|
* Number of days for the trial period. A value of `0` indicates no trial period.
|
|
588
600
|
*/
|
|
@@ -677,6 +677,13 @@ export interface Subscription {
|
|
|
677
677
|
* Tax identifier provided for this subscription (if applicable)
|
|
678
678
|
*/
|
|
679
679
|
tax_id?: string | null;
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Per-unit trial amount after discounts, snapshotted at subscription creation
|
|
683
|
+
* (price currency minor units, pre-quantity, pre-tax). Null for a free trial or no
|
|
684
|
+
* trial.
|
|
685
|
+
*/
|
|
686
|
+
trial_amount?: number | null;
|
|
680
687
|
}
|
|
681
688
|
|
|
682
689
|
export type SubscriptionStatus = 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired';
|
|
@@ -819,6 +826,12 @@ export interface SubscriptionCreateResponse {
|
|
|
819
826
|
* URL to checkout page
|
|
820
827
|
*/
|
|
821
828
|
payment_link?: string | null;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Per-unit trial amount after discounts, in the price currency's minor units
|
|
832
|
+
* (pre-quantity, pre-tax). Null for a free trial or no trial.
|
|
833
|
+
*/
|
|
834
|
+
trial_amount?: number | null;
|
|
822
835
|
}
|
|
823
836
|
|
|
824
837
|
export namespace SubscriptionCreateResponse {
|
|
@@ -980,6 +993,13 @@ export interface SubscriptionListResponse {
|
|
|
980
993
|
* Tax identifier provided for this subscription (if applicable)
|
|
981
994
|
*/
|
|
982
995
|
tax_id?: string | null;
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Per-unit trial amount after discounts, snapshotted at subscription creation
|
|
999
|
+
* (price currency minor units, pre-quantity, pre-tax). Null for a free trial or no
|
|
1000
|
+
* trial.
|
|
1001
|
+
*/
|
|
1002
|
+
trial_amount?: number | null;
|
|
983
1003
|
}
|
|
984
1004
|
|
|
985
1005
|
export namespace SubscriptionListResponse {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as DisputesAPI from './disputes';
|
|
5
5
|
import * as LicenseKeysAPI from './license-keys';
|
|
6
|
+
import * as MiscAPI from './misc';
|
|
6
7
|
import * as PaymentsAPI from './payments';
|
|
7
8
|
import * as RefundsAPI from './refunds';
|
|
8
9
|
import * as SubscriptionsAPI from './subscriptions';
|
|
@@ -39,7 +40,7 @@ export type WebhookEventType =
|
|
|
39
40
|
| 'subscription.updated'
|
|
40
41
|
| 'subscription.update_payment_method'
|
|
41
42
|
| 'license_key.created'
|
|
42
|
-
| 'payout.
|
|
43
|
+
| 'payout.created'
|
|
43
44
|
| 'payout.on_hold'
|
|
44
45
|
| 'payout.in_progress'
|
|
45
46
|
| 'payout.failed'
|
|
@@ -74,6 +75,7 @@ export interface WebhookPayload {
|
|
|
74
75
|
| WebhookPayload.Refund
|
|
75
76
|
| WebhookPayload.Dispute
|
|
76
77
|
| WebhookPayload.LicenseKey
|
|
78
|
+
| WebhookPayload.Payout
|
|
77
79
|
| WebhookPayload.CreditLedgerEntry
|
|
78
80
|
| WebhookPayload.CreditBalanceLow
|
|
79
81
|
| WebhookPayload.AbandonedCheckout
|
|
@@ -116,6 +118,88 @@ export namespace WebhookPayload {
|
|
|
116
118
|
payload_type: 'LicenseKey';
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
export interface Payout {
|
|
122
|
+
/**
|
|
123
|
+
* The total amount of the payout.
|
|
124
|
+
*/
|
|
125
|
+
amount: number;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The unique identifier of the business associated with the payout.
|
|
129
|
+
*/
|
|
130
|
+
business_id: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a
|
|
134
|
+
* future release.
|
|
135
|
+
*/
|
|
136
|
+
chargebacks: number;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The timestamp when the payout was created, in UTC.
|
|
140
|
+
*/
|
|
141
|
+
created_at: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The currency of the payout, represented as an ISO 4217 currency code.
|
|
145
|
+
*/
|
|
146
|
+
currency: MiscAPI.Currency;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The fee charged for processing the payout.
|
|
150
|
+
*/
|
|
151
|
+
fee: number;
|
|
152
|
+
|
|
153
|
+
payload_type: 'Payout';
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The payment method used for the payout (e.g., bank transfer, card, etc.).
|
|
157
|
+
*/
|
|
158
|
+
payment_method: string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The unique identifier of the payout.
|
|
162
|
+
*/
|
|
163
|
+
payout_id: string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a
|
|
167
|
+
* future release.
|
|
168
|
+
*/
|
|
169
|
+
refunds: number;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The current status of the payout.
|
|
173
|
+
*/
|
|
174
|
+
status: 'not_initiated' | 'in_progress' | 'on_hold' | 'failed' | 'success';
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a
|
|
178
|
+
* future release.
|
|
179
|
+
*/
|
|
180
|
+
tax: number;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The timestamp when the payout was last updated, in UTC.
|
|
184
|
+
*/
|
|
185
|
+
updated_at: string;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* The name of the payout recipient or purpose.
|
|
189
|
+
*/
|
|
190
|
+
name?: string | null;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The URL of the document associated with the payout.
|
|
194
|
+
*/
|
|
195
|
+
payout_document_url?: string | null;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Any additional remarks or notes associated with the payout.
|
|
199
|
+
*/
|
|
200
|
+
remarks?: string | null;
|
|
201
|
+
}
|
|
202
|
+
|
|
119
203
|
/**
|
|
120
204
|
* Response for a ledger entry
|
|
121
205
|
*/
|
|
@@ -34,6 +34,11 @@ export {
|
|
|
34
34
|
type PaymentFailedWebhookEvent,
|
|
35
35
|
type PaymentProcessingWebhookEvent,
|
|
36
36
|
type PaymentSucceededWebhookEvent,
|
|
37
|
+
type PayoutCreatedWebhookEvent,
|
|
38
|
+
type PayoutFailedWebhookEvent,
|
|
39
|
+
type PayoutInProgressWebhookEvent,
|
|
40
|
+
type PayoutOnHoldWebhookEvent,
|
|
41
|
+
type PayoutSuccessWebhookEvent,
|
|
37
42
|
type RefundFailedWebhookEvent,
|
|
38
43
|
type RefundSucceededWebhookEvent,
|
|
39
44
|
type SubscriptionActiveWebhookEvent,
|