dodopayments 2.25.0 → 2.26.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 +33 -0
- package/client.d.mts +3 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -3
- package/client.d.ts.map +1 -1
- package/client.js +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/balances.d.mts +2 -2
- package/resources/balances.d.mts.map +1 -1
- package/resources/balances.d.ts +2 -2
- package/resources/balances.d.ts.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/payouts/breakup/breakup.d.mts +38 -0
- package/resources/payouts/breakup/breakup.d.mts.map +1 -0
- package/resources/payouts/breakup/breakup.d.ts +38 -0
- package/resources/payouts/breakup/breakup.d.ts.map +1 -0
- package/resources/payouts/breakup/breakup.js +27 -0
- package/resources/payouts/breakup/breakup.js.map +1 -0
- package/resources/payouts/breakup/breakup.mjs +22 -0
- package/resources/payouts/breakup/breakup.mjs.map +1 -0
- package/resources/payouts/breakup/details.d.mts +72 -0
- package/resources/payouts/breakup/details.d.mts.map +1 -0
- package/resources/payouts/breakup/details.d.ts +72 -0
- package/resources/payouts/breakup/details.d.ts.map +1 -0
- package/resources/payouts/breakup/details.js +33 -0
- package/resources/payouts/breakup/details.js.map +1 -0
- package/resources/payouts/breakup/details.mjs +29 -0
- package/resources/payouts/breakup/details.mjs.map +1 -0
- package/resources/payouts/breakup/index.d.mts +3 -0
- package/resources/payouts/breakup/index.d.mts.map +1 -0
- package/resources/payouts/breakup/index.d.ts +3 -0
- package/resources/payouts/breakup/index.d.ts.map +1 -0
- package/resources/payouts/breakup/index.js +9 -0
- package/resources/payouts/breakup/index.js.map +1 -0
- package/resources/payouts/breakup/index.mjs +4 -0
- package/resources/payouts/breakup/index.mjs.map +1 -0
- package/resources/payouts/breakup.d.mts +2 -0
- package/resources/payouts/breakup.d.mts.map +1 -0
- package/resources/payouts/breakup.d.ts +2 -0
- package/resources/payouts/breakup.d.ts.map +1 -0
- package/resources/payouts/breakup.js +6 -0
- package/resources/payouts/breakup.js.map +1 -0
- package/resources/payouts/breakup.mjs +3 -0
- package/resources/payouts/breakup.mjs.map +1 -0
- package/resources/payouts/index.d.mts +3 -0
- package/resources/payouts/index.d.mts.map +1 -0
- package/resources/payouts/index.d.ts +3 -0
- package/resources/payouts/index.d.ts.map +1 -0
- package/resources/payouts/index.js +9 -0
- package/resources/payouts/index.js.map +1 -0
- package/resources/payouts/index.mjs +4 -0
- package/resources/payouts/index.mjs.map +1 -0
- package/resources/payouts/payouts.d.mts +88 -0
- package/resources/payouts/payouts.d.mts.map +1 -0
- package/resources/payouts/payouts.d.ts +88 -0
- package/resources/payouts/payouts.d.ts.map +1 -0
- package/resources/payouts/payouts.js +24 -0
- package/resources/payouts/payouts.js.map +1 -0
- package/resources/payouts/payouts.mjs +19 -0
- package/resources/payouts/payouts.mjs.map +1 -0
- package/resources/payouts.d.mts +1 -83
- package/resources/payouts.d.mts.map +1 -1
- package/resources/payouts.d.ts +1 -83
- package/resources/payouts.d.ts.map +1 -1
- package/resources/payouts.js +2 -12
- package/resources/payouts.js.map +1 -1
- package/resources/payouts.mjs +1 -10
- package/resources/payouts.mjs.map +1 -1
- package/resources/subscriptions.d.mts +1 -0
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +1 -0
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/webhook-events.d.mts +20 -2
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +20 -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 +259 -3
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +259 -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 +14 -6
- package/src/resources/balances.ts +6 -2
- package/src/resources/index.ts +5 -1
- package/src/resources/payouts/breakup/breakup.ts +61 -0
- package/src/resources/payouts/breakup/details.ts +111 -0
- package/src/resources/payouts/breakup/index.ts +9 -0
- package/src/resources/payouts/breakup.ts +3 -0
- package/src/resources/payouts/index.ts +9 -0
- package/src/resources/payouts/payouts.ts +129 -0
- package/src/resources/payouts.ts +1 -119
- package/src/resources/subscriptions.ts +6 -0
- package/src/resources/webhook-events.ts +42 -2
- package/src/resources/webhooks/index.ts +4 -0
- package/src/resources/webhooks/webhooks.ts +348 -0
- 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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as DetailsAPI from './details';
|
|
5
|
+
import {
|
|
6
|
+
DetailListParams,
|
|
7
|
+
DetailListResponse,
|
|
8
|
+
DetailListResponsesDefaultPageNumberPagination,
|
|
9
|
+
Details,
|
|
10
|
+
} from './details';
|
|
11
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
12
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
13
|
+
import { path } from '../../../internal/utils/path';
|
|
14
|
+
|
|
15
|
+
export class Breakup extends APIResource {
|
|
16
|
+
details: DetailsAPI.Details = new DetailsAPI.Details(this._client);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Returns the breakdown of a payout by event type (payments, refunds, disputes,
|
|
20
|
+
* fees, etc.) in the payout's currency. Each amount is proportionally allocated
|
|
21
|
+
* based on USD equivalent values, ensuring the total sums exactly to the payout
|
|
22
|
+
* amount.
|
|
23
|
+
*/
|
|
24
|
+
retrieve(payoutID: string, options?: RequestOptions): APIPromise<BreakupRetrieveResponse> {
|
|
25
|
+
return this._client.get(path`/payouts/${payoutID}/breakup`, options);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type BreakupRetrieveResponse = Array<BreakupRetrieveResponse.BreakupRetrieveResponseItem>;
|
|
30
|
+
|
|
31
|
+
export namespace BreakupRetrieveResponse {
|
|
32
|
+
/**
|
|
33
|
+
* Payout breakup aggregated by event type, with amounts in the payout's currency.
|
|
34
|
+
*/
|
|
35
|
+
export interface BreakupRetrieveResponseItem {
|
|
36
|
+
/**
|
|
37
|
+
* The type of balance ledger event (e.g., "payment", "refund", "dispute",
|
|
38
|
+
* "payment_fees").
|
|
39
|
+
*/
|
|
40
|
+
event_type: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Total amount for this event type in the payout's currency (in smallest currency
|
|
44
|
+
* unit, e.g., cents).
|
|
45
|
+
*/
|
|
46
|
+
total: number;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
Breakup.Details = Details;
|
|
51
|
+
|
|
52
|
+
export declare namespace Breakup {
|
|
53
|
+
export { type BreakupRetrieveResponse as BreakupRetrieveResponse };
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
Details as Details,
|
|
57
|
+
type DetailListResponse as DetailListResponse,
|
|
58
|
+
type DetailListResponsesDefaultPageNumberPagination as DetailListResponsesDefaultPageNumberPagination,
|
|
59
|
+
type DetailListParams as DetailListParams,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import {
|
|
6
|
+
DefaultPageNumberPagination,
|
|
7
|
+
type DefaultPageNumberPaginationParams,
|
|
8
|
+
PagePromise,
|
|
9
|
+
} from '../../../core/pagination';
|
|
10
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
11
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
12
|
+
import { path } from '../../../internal/utils/path';
|
|
13
|
+
|
|
14
|
+
export class Details extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Returns paginated individual balance ledger entries for a payout, with each
|
|
17
|
+
* entry's amount pro-rated into the payout's currency. Supports pagination via
|
|
18
|
+
* `page_size` (default 10, max 100) and `page_number` (default 0) query
|
|
19
|
+
* parameters.
|
|
20
|
+
*/
|
|
21
|
+
list(
|
|
22
|
+
payoutID: string,
|
|
23
|
+
query: DetailListParams | null | undefined = {},
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): PagePromise<DetailListResponsesDefaultPageNumberPagination, DetailListResponse> {
|
|
26
|
+
return this._client.getAPIList(
|
|
27
|
+
path`/payouts/${payoutID}/breakup/details`,
|
|
28
|
+
DefaultPageNumberPagination<DetailListResponse>,
|
|
29
|
+
{ query, ...options },
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Downloads the complete payout breakup as a CSV file. Each row represents a
|
|
35
|
+
* balance ledger entry with columns: Ledger ID, Event Type, Original Amount,
|
|
36
|
+
* Original Currency, Reference Object ID, Description, Created At, USD Equivalent
|
|
37
|
+
* Amount, and Payout Currency Amount.
|
|
38
|
+
*/
|
|
39
|
+
downloadCsv(payoutID: string, options?: RequestOptions): APIPromise<void> {
|
|
40
|
+
return this._client.get(path`/payouts/${payoutID}/breakup/details/csv`, {
|
|
41
|
+
...options,
|
|
42
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type DetailListResponsesDefaultPageNumberPagination = DefaultPageNumberPagination<DetailListResponse>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Individual balance ledger entry for a payout, with amounts pro-rated into the
|
|
51
|
+
* payout's currency.
|
|
52
|
+
*/
|
|
53
|
+
export interface DetailListResponse {
|
|
54
|
+
/**
|
|
55
|
+
* Unique identifier of the balance ledger entry.
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Timestamp when this entry was created.
|
|
61
|
+
*/
|
|
62
|
+
created_at: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The type of balance ledger event (e.g., "payment", "refund", "dispute",
|
|
66
|
+
* "payment_fees").
|
|
67
|
+
*/
|
|
68
|
+
event_type: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Original amount in the original currency (in smallest currency unit, e.g.,
|
|
72
|
+
* cents).
|
|
73
|
+
*/
|
|
74
|
+
original_amount: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Original currency as ISO 4217 code (e.g., "USD", "EUR").
|
|
78
|
+
*/
|
|
79
|
+
original_currency: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Amount in the payout's currency (in smallest currency unit). Uses cumulative
|
|
83
|
+
* rounding to ensure sum matches payout total exactly.
|
|
84
|
+
*/
|
|
85
|
+
payout_currency_amount: number;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* USD equivalent of the original amount (in cents).
|
|
89
|
+
*/
|
|
90
|
+
usd_equivalent_amount: number;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Human-readable description of the transaction.
|
|
94
|
+
*/
|
|
95
|
+
description?: string | null;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* ID of the related object (e.g., payment ID, refund ID) if applicable.
|
|
99
|
+
*/
|
|
100
|
+
reference_object_id?: string | null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface DetailListParams extends DefaultPageNumberPaginationParams {}
|
|
104
|
+
|
|
105
|
+
export declare namespace Details {
|
|
106
|
+
export {
|
|
107
|
+
type DetailListResponse as DetailListResponse,
|
|
108
|
+
type DetailListResponsesDefaultPageNumberPagination as DetailListResponsesDefaultPageNumberPagination,
|
|
109
|
+
type DetailListParams as DetailListParams,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Breakup, type BreakupRetrieveResponse } from './breakup';
|
|
4
|
+
export {
|
|
5
|
+
Details,
|
|
6
|
+
type DetailListResponse,
|
|
7
|
+
type DetailListParams,
|
|
8
|
+
type DetailListResponsesDefaultPageNumberPagination,
|
|
9
|
+
} from './details';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Breakup, type BreakupRetrieveResponse } from './breakup/index';
|
|
4
|
+
export {
|
|
5
|
+
Payouts,
|
|
6
|
+
type PayoutListResponse,
|
|
7
|
+
type PayoutListParams,
|
|
8
|
+
type PayoutListResponsesDefaultPageNumberPagination,
|
|
9
|
+
} from './payouts';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as MiscAPI from '../misc';
|
|
5
|
+
import * as BreakupAPI from './breakup/breakup';
|
|
6
|
+
import { Breakup, BreakupRetrieveResponse } from './breakup/breakup';
|
|
7
|
+
import {
|
|
8
|
+
DefaultPageNumberPagination,
|
|
9
|
+
type DefaultPageNumberPaginationParams,
|
|
10
|
+
PagePromise,
|
|
11
|
+
} from '../../core/pagination';
|
|
12
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
13
|
+
|
|
14
|
+
export class Payouts extends APIResource {
|
|
15
|
+
breakup: BreakupAPI.Breakup = new BreakupAPI.Breakup(this._client);
|
|
16
|
+
|
|
17
|
+
list(
|
|
18
|
+
query: PayoutListParams | null | undefined = {},
|
|
19
|
+
options?: RequestOptions,
|
|
20
|
+
): PagePromise<PayoutListResponsesDefaultPageNumberPagination, PayoutListResponse> {
|
|
21
|
+
return this._client.getAPIList('/payouts', DefaultPageNumberPagination<PayoutListResponse>, {
|
|
22
|
+
query,
|
|
23
|
+
...options,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type PayoutListResponsesDefaultPageNumberPagination = DefaultPageNumberPagination<PayoutListResponse>;
|
|
29
|
+
|
|
30
|
+
export interface PayoutListResponse {
|
|
31
|
+
/**
|
|
32
|
+
* The total amount of the payout.
|
|
33
|
+
*/
|
|
34
|
+
amount: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The unique identifier of the business associated with the payout.
|
|
38
|
+
*/
|
|
39
|
+
business_id: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated The total value of chargebacks associated with the payout.
|
|
43
|
+
*/
|
|
44
|
+
chargebacks: number;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The timestamp when the payout was created, in UTC.
|
|
48
|
+
*/
|
|
49
|
+
created_at: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The currency of the payout, represented as an ISO 4217 currency code.
|
|
53
|
+
*/
|
|
54
|
+
currency: MiscAPI.Currency;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The fee charged for processing the payout.
|
|
58
|
+
*/
|
|
59
|
+
fee: number;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The payment method used for the payout (e.g., bank transfer, card, etc.).
|
|
63
|
+
*/
|
|
64
|
+
payment_method: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The unique identifier of the payout.
|
|
68
|
+
*/
|
|
69
|
+
payout_id: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated The total value of refunds associated with the payout.
|
|
73
|
+
*/
|
|
74
|
+
refunds: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The current status of the payout.
|
|
78
|
+
*/
|
|
79
|
+
status: 'not_initiated' | 'in_progress' | 'on_hold' | 'failed' | 'success';
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated The tax applied to the payout.
|
|
83
|
+
*/
|
|
84
|
+
tax: number;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The timestamp when the payout was last updated, in UTC.
|
|
88
|
+
*/
|
|
89
|
+
updated_at: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The name of the payout recipient or purpose.
|
|
93
|
+
*/
|
|
94
|
+
name?: string | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The URL of the document associated with the payout.
|
|
98
|
+
*/
|
|
99
|
+
payout_document_url?: string | null;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Any additional remarks or notes associated with the payout.
|
|
103
|
+
*/
|
|
104
|
+
remarks?: string | null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface PayoutListParams extends DefaultPageNumberPaginationParams {
|
|
108
|
+
/**
|
|
109
|
+
* Get payouts created after this time (inclusive)
|
|
110
|
+
*/
|
|
111
|
+
created_at_gte?: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get payouts created before this time (inclusive)
|
|
115
|
+
*/
|
|
116
|
+
created_at_lte?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
Payouts.Breakup = Breakup;
|
|
120
|
+
|
|
121
|
+
export declare namespace Payouts {
|
|
122
|
+
export {
|
|
123
|
+
type PayoutListResponse as PayoutListResponse,
|
|
124
|
+
type PayoutListResponsesDefaultPageNumberPagination as PayoutListResponsesDefaultPageNumberPagination,
|
|
125
|
+
type PayoutListParams as PayoutListParams,
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export { Breakup as Breakup, type BreakupRetrieveResponse as BreakupRetrieveResponse };
|
|
129
|
+
}
|
package/src/resources/payouts.ts
CHANGED
|
@@ -1,121 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import * as MiscAPI from './misc';
|
|
5
|
-
import {
|
|
6
|
-
DefaultPageNumberPagination,
|
|
7
|
-
type DefaultPageNumberPaginationParams,
|
|
8
|
-
PagePromise,
|
|
9
|
-
} from '../core/pagination';
|
|
10
|
-
import { RequestOptions } from '../internal/request-options';
|
|
11
|
-
|
|
12
|
-
export class Payouts extends APIResource {
|
|
13
|
-
list(
|
|
14
|
-
query: PayoutListParams | null | undefined = {},
|
|
15
|
-
options?: RequestOptions,
|
|
16
|
-
): PagePromise<PayoutListResponsesDefaultPageNumberPagination, PayoutListResponse> {
|
|
17
|
-
return this._client.getAPIList('/payouts', DefaultPageNumberPagination<PayoutListResponse>, {
|
|
18
|
-
query,
|
|
19
|
-
...options,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type PayoutListResponsesDefaultPageNumberPagination = DefaultPageNumberPagination<PayoutListResponse>;
|
|
25
|
-
|
|
26
|
-
export interface PayoutListResponse {
|
|
27
|
-
/**
|
|
28
|
-
* The total amount of the payout.
|
|
29
|
-
*/
|
|
30
|
-
amount: number;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* The unique identifier of the business associated with the payout.
|
|
34
|
-
*/
|
|
35
|
-
business_id: string;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated The total value of chargebacks associated with the payout.
|
|
39
|
-
*/
|
|
40
|
-
chargebacks: number;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The timestamp when the payout was created, in UTC.
|
|
44
|
-
*/
|
|
45
|
-
created_at: string;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The currency of the payout, represented as an ISO 4217 currency code.
|
|
49
|
-
*/
|
|
50
|
-
currency: MiscAPI.Currency;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* The fee charged for processing the payout.
|
|
54
|
-
*/
|
|
55
|
-
fee: number;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* The payment method used for the payout (e.g., bank transfer, card, etc.).
|
|
59
|
-
*/
|
|
60
|
-
payment_method: string;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The unique identifier of the payout.
|
|
64
|
-
*/
|
|
65
|
-
payout_id: string;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated The total value of refunds associated with the payout.
|
|
69
|
-
*/
|
|
70
|
-
refunds: number;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* The current status of the payout.
|
|
74
|
-
*/
|
|
75
|
-
status: 'not_initiated' | 'in_progress' | 'on_hold' | 'failed' | 'success';
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @deprecated The tax applied to the payout.
|
|
79
|
-
*/
|
|
80
|
-
tax: number;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* The timestamp when the payout was last updated, in UTC.
|
|
84
|
-
*/
|
|
85
|
-
updated_at: string;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* The name of the payout recipient or purpose.
|
|
89
|
-
*/
|
|
90
|
-
name?: string | null;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* The URL of the document associated with the payout.
|
|
94
|
-
*/
|
|
95
|
-
payout_document_url?: string | null;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Any additional remarks or notes associated with the payout.
|
|
99
|
-
*/
|
|
100
|
-
remarks?: string | null;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface PayoutListParams extends DefaultPageNumberPaginationParams {
|
|
104
|
-
/**
|
|
105
|
-
* Get payouts created after this time (inclusive)
|
|
106
|
-
*/
|
|
107
|
-
created_at_gte?: string;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Get payouts created before this time (inclusive)
|
|
111
|
-
*/
|
|
112
|
-
created_at_lte?: string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export declare namespace Payouts {
|
|
116
|
-
export {
|
|
117
|
-
type PayoutListResponse as PayoutListResponse,
|
|
118
|
-
type PayoutListResponsesDefaultPageNumberPagination as PayoutListResponsesDefaultPageNumberPagination,
|
|
119
|
-
type PayoutListParams as PayoutListParams,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
3
|
+
export * from './payouts/index';
|
|
@@ -1265,6 +1265,12 @@ export interface SubscriptionUpdateParams {
|
|
|
1265
1265
|
*/
|
|
1266
1266
|
cancel_at_next_billing_date?: boolean | null;
|
|
1267
1267
|
|
|
1268
|
+
cancel_reason?:
|
|
1269
|
+
| 'cancelled_by_customer'
|
|
1270
|
+
| 'cancelled_by_merchant'
|
|
1271
|
+
| 'cancelled_by_merchant_send_dunning'
|
|
1272
|
+
| null;
|
|
1273
|
+
|
|
1268
1274
|
/**
|
|
1269
1275
|
* Update credit entitlement cart settings
|
|
1270
1276
|
*/
|
|
@@ -48,7 +48,13 @@ export type WebhookEventType =
|
|
|
48
48
|
| 'credit.rollover_forfeited'
|
|
49
49
|
| 'credit.overage_charged'
|
|
50
50
|
| 'credit.manual_adjustment'
|
|
51
|
-
| 'credit.balance_low'
|
|
51
|
+
| 'credit.balance_low'
|
|
52
|
+
| 'abandoned_checkout.detected'
|
|
53
|
+
| 'abandoned_checkout.recovered'
|
|
54
|
+
| 'dunning.started'
|
|
55
|
+
| 'dunning.recovered'
|
|
56
|
+
| 'acr.email'
|
|
57
|
+
| 'dunning.email';
|
|
52
58
|
|
|
53
59
|
export interface WebhookPayload {
|
|
54
60
|
business_id: string;
|
|
@@ -63,7 +69,9 @@ export interface WebhookPayload {
|
|
|
63
69
|
| WebhookPayload.Dispute
|
|
64
70
|
| WebhookPayload.LicenseKey
|
|
65
71
|
| WebhookPayload.CreditLedgerEntry
|
|
66
|
-
| WebhookPayload.CreditBalanceLow
|
|
72
|
+
| WebhookPayload.CreditBalanceLow
|
|
73
|
+
| WebhookPayload.AbandonedCheckout
|
|
74
|
+
| WebhookPayload.DunningAttempt;
|
|
67
75
|
|
|
68
76
|
/**
|
|
69
77
|
* The timestamp of when the event occurred (not necessarily the same of when it
|
|
@@ -127,6 +135,38 @@ export namespace WebhookPayload {
|
|
|
127
135
|
|
|
128
136
|
threshold_percent: number;
|
|
129
137
|
}
|
|
138
|
+
|
|
139
|
+
export interface AbandonedCheckout {
|
|
140
|
+
abandoned_at: string;
|
|
141
|
+
|
|
142
|
+
abandonment_reason: 'payment_failed' | 'checkout_incomplete';
|
|
143
|
+
|
|
144
|
+
customer_id: string;
|
|
145
|
+
|
|
146
|
+
payload_type: 'AbandonedCheckout';
|
|
147
|
+
|
|
148
|
+
payment_id: string;
|
|
149
|
+
|
|
150
|
+
status: 'abandoned' | 'recovering' | 'recovered' | 'exhausted' | 'opted_out';
|
|
151
|
+
|
|
152
|
+
recovered_payment_id?: string | null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface DunningAttempt {
|
|
156
|
+
created_at: string;
|
|
157
|
+
|
|
158
|
+
customer_id: string;
|
|
159
|
+
|
|
160
|
+
payload_type: 'DunningAttempt';
|
|
161
|
+
|
|
162
|
+
status: 'recovering' | 'recovered' | 'exhausted';
|
|
163
|
+
|
|
164
|
+
subscription_id: string;
|
|
165
|
+
|
|
166
|
+
trigger_state: 'on_hold' | 'cancelled';
|
|
167
|
+
|
|
168
|
+
payment_id?: string | null;
|
|
169
|
+
}
|
|
130
170
|
}
|
|
131
171
|
|
|
132
172
|
export declare namespace WebhookEvents {
|
|
@@ -5,6 +5,8 @@ export {
|
|
|
5
5
|
Webhooks,
|
|
6
6
|
type WebhookDetails,
|
|
7
7
|
type WebhookRetrieveSecretResponse,
|
|
8
|
+
type AbandonedCheckoutDetectedWebhookEvent,
|
|
9
|
+
type AbandonedCheckoutRecoveredWebhookEvent,
|
|
8
10
|
type CreditAddedWebhookEvent,
|
|
9
11
|
type CreditBalanceLowWebhookEvent,
|
|
10
12
|
type CreditDeductedWebhookEvent,
|
|
@@ -20,6 +22,8 @@ export {
|
|
|
20
22
|
type DisputeLostWebhookEvent,
|
|
21
23
|
type DisputeOpenedWebhookEvent,
|
|
22
24
|
type DisputeWonWebhookEvent,
|
|
25
|
+
type DunningRecoveredWebhookEvent,
|
|
26
|
+
type DunningStartedWebhookEvent,
|
|
23
27
|
type LicenseKeyCreatedWebhookEvent,
|
|
24
28
|
type PaymentCancelledWebhookEvent,
|
|
25
29
|
type PaymentFailedWebhookEvent,
|