dodopayments 2.32.1 → 2.33.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 +25 -0
- package/bin/migration-config.json +17 -17
- package/client.d.mts +15 -15
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -15
- package/client.d.ts.map +1 -1
- package/package.json +1 -1
- package/resources/addons.d.mts +4 -4
- package/resources/addons.d.mts.map +1 -1
- package/resources/addons.d.ts +4 -4
- package/resources/addons.d.ts.map +1 -1
- package/resources/addons.js +6 -6
- package/resources/addons.js.map +1 -1
- package/resources/addons.mjs +6 -6
- package/resources/addons.mjs.map +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/brands.d.mts +1 -1
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +1 -1
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.js +3 -3
- package/resources/brands.js.map +1 -1
- package/resources/brands.mjs +3 -3
- package/resources/brands.mjs.map +1 -1
- package/resources/credit-entitlements/balances.d.mts +69 -69
- package/resources/credit-entitlements/balances.d.mts.map +1 -1
- package/resources/credit-entitlements/balances.d.ts +69 -69
- package/resources/credit-entitlements/balances.d.ts.map +1 -1
- package/resources/credit-entitlements/balances.js +41 -41
- package/resources/credit-entitlements/balances.js.map +1 -1
- package/resources/credit-entitlements/balances.mjs +41 -41
- package/resources/credit-entitlements/balances.mjs.map +1 -1
- package/resources/credit-entitlements/credit-entitlements.d.mts +38 -38
- package/resources/credit-entitlements/credit-entitlements.d.mts.map +1 -1
- package/resources/credit-entitlements/credit-entitlements.d.ts +38 -38
- package/resources/credit-entitlements/credit-entitlements.d.ts.map +1 -1
- package/resources/credit-entitlements/credit-entitlements.js +40 -40
- package/resources/credit-entitlements/credit-entitlements.js.map +1 -1
- package/resources/credit-entitlements/credit-entitlements.mjs +40 -40
- package/resources/credit-entitlements/credit-entitlements.mjs.map +1 -1
- package/resources/credit-entitlements/index.d.mts +2 -2
- package/resources/credit-entitlements/index.d.mts.map +1 -1
- package/resources/credit-entitlements/index.d.ts +2 -2
- package/resources/credit-entitlements/index.d.ts.map +1 -1
- package/resources/customers/customers.d.mts +23 -23
- package/resources/customers/customers.d.mts.map +1 -1
- package/resources/customers/customers.d.ts +23 -23
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +16 -16
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +16 -16
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.d.mts +1 -1
- package/resources/customers/index.d.mts.map +1 -1
- package/resources/customers/index.d.ts +1 -1
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/wallets/index.d.mts +1 -1
- package/resources/customers/wallets/index.d.mts.map +1 -1
- package/resources/customers/wallets/index.d.ts +1 -1
- package/resources/customers/wallets/index.d.ts.map +1 -1
- package/resources/customers/wallets/ledger-entries.d.mts +8 -8
- package/resources/customers/wallets/ledger-entries.d.mts.map +1 -1
- package/resources/customers/wallets/ledger-entries.d.ts +8 -8
- package/resources/customers/wallets/ledger-entries.d.ts.map +1 -1
- package/resources/customers/wallets/ledger-entries.js +3 -3
- package/resources/customers/wallets/ledger-entries.js.map +1 -1
- package/resources/customers/wallets/ledger-entries.mjs +3 -3
- package/resources/customers/wallets/ledger-entries.mjs.map +1 -1
- package/resources/customers/wallets/wallets.d.mts +1 -1
- package/resources/customers/wallets/wallets.d.mts.map +1 -1
- package/resources/customers/wallets/wallets.d.ts +1 -1
- package/resources/customers/wallets/wallets.d.ts.map +1 -1
- package/resources/discounts.d.mts +36 -47
- package/resources/discounts.d.mts.map +1 -1
- package/resources/discounts.d.ts +36 -47
- package/resources/discounts.d.ts.map +1 -1
- package/resources/discounts.js +15 -15
- package/resources/discounts.js.map +1 -1
- package/resources/discounts.mjs +15 -15
- package/resources/discounts.mjs.map +1 -1
- package/resources/disputes.d.mts +1 -1
- package/resources/disputes.d.mts.map +1 -1
- package/resources/disputes.d.ts +1 -1
- package/resources/disputes.d.ts.map +1 -1
- package/resources/disputes.js +3 -3
- package/resources/disputes.js.map +1 -1
- package/resources/disputes.mjs +3 -3
- package/resources/disputes.mjs.map +1 -1
- package/resources/entitlements/entitlements.d.mts +15 -15
- package/resources/entitlements/entitlements.d.mts.map +1 -1
- package/resources/entitlements/entitlements.d.ts +15 -15
- package/resources/entitlements/entitlements.d.ts.map +1 -1
- package/resources/entitlements/entitlements.js +15 -15
- package/resources/entitlements/entitlements.js.map +1 -1
- package/resources/entitlements/entitlements.mjs +15 -15
- package/resources/entitlements/entitlements.mjs.map +1 -1
- package/resources/entitlements/files.d.mts +4 -4
- package/resources/entitlements/files.d.mts.map +1 -1
- package/resources/entitlements/files.d.ts +4 -4
- package/resources/entitlements/files.d.ts.map +1 -1
- package/resources/entitlements/files.js +6 -6
- package/resources/entitlements/files.js.map +1 -1
- package/resources/entitlements/files.mjs +6 -6
- package/resources/entitlements/files.mjs.map +1 -1
- package/resources/entitlements/index.d.mts +1 -1
- package/resources/entitlements/index.d.mts.map +1 -1
- package/resources/entitlements/index.d.ts +1 -1
- package/resources/entitlements/index.d.ts.map +1 -1
- package/resources/index.d.mts +15 -15
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +15 -15
- package/resources/index.d.ts.map +1 -1
- package/resources/invoices/payments.d.mts +1 -1
- package/resources/invoices/payments.d.ts +1 -1
- package/resources/invoices/payments.js +4 -4
- package/resources/invoices/payments.mjs +4 -4
- package/resources/license-key-instances.d.mts +14 -14
- package/resources/license-key-instances.d.mts.map +1 -1
- package/resources/license-key-instances.d.ts +14 -14
- package/resources/license-key-instances.d.ts.map +1 -1
- package/resources/license-key-instances.js +12 -12
- package/resources/license-key-instances.js.map +1 -1
- package/resources/license-key-instances.mjs +12 -12
- package/resources/license-key-instances.mjs.map +1 -1
- package/resources/license-keys.d.mts +38 -38
- package/resources/license-keys.d.mts.map +1 -1
- package/resources/license-keys.d.ts +38 -38
- package/resources/license-keys.d.ts.map +1 -1
- package/resources/license-keys.js +16 -16
- package/resources/license-keys.js.map +1 -1
- package/resources/license-keys.mjs +16 -16
- package/resources/license-keys.mjs.map +1 -1
- package/resources/meters.d.mts +8 -8
- package/resources/meters.d.mts.map +1 -1
- package/resources/meters.d.ts +8 -8
- package/resources/meters.d.ts.map +1 -1
- package/resources/meters.js +3 -3
- package/resources/meters.js.map +1 -1
- package/resources/meters.mjs +3 -3
- package/resources/meters.mjs.map +1 -1
- package/resources/payments.d.mts +38 -32
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +38 -32
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +6 -6
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +6 -6
- package/resources/payments.mjs.map +1 -1
- package/resources/product-collections/groups/groups.d.mts +9 -9
- package/resources/product-collections/groups/groups.d.mts.map +1 -1
- package/resources/product-collections/groups/groups.d.ts +9 -9
- package/resources/product-collections/groups/groups.d.ts.map +1 -1
- package/resources/product-collections/groups/groups.js +7 -7
- package/resources/product-collections/groups/groups.js.map +1 -1
- package/resources/product-collections/groups/groups.mjs +7 -7
- package/resources/product-collections/groups/groups.mjs.map +1 -1
- package/resources/product-collections/groups/index.d.mts +2 -2
- package/resources/product-collections/groups/index.d.ts +2 -2
- package/resources/product-collections/groups/items.d.mts +12 -12
- package/resources/product-collections/groups/items.d.mts.map +1 -1
- package/resources/product-collections/groups/items.d.ts +12 -12
- package/resources/product-collections/groups/items.d.ts.map +1 -1
- package/resources/product-collections/groups/items.js +7 -7
- package/resources/product-collections/groups/items.js.map +1 -1
- package/resources/product-collections/groups/items.mjs +7 -7
- package/resources/product-collections/groups/items.mjs.map +1 -1
- package/resources/product-collections/index.d.mts +2 -2
- package/resources/product-collections/index.d.mts.map +1 -1
- package/resources/product-collections/index.d.ts +2 -2
- package/resources/product-collections/index.d.ts.map +1 -1
- package/resources/product-collections/product-collections.d.mts +86 -11
- package/resources/product-collections/product-collections.d.mts.map +1 -1
- package/resources/product-collections/product-collections.d.ts +86 -11
- package/resources/product-collections/product-collections.d.ts.map +1 -1
- package/resources/product-collections/product-collections.js +11 -11
- package/resources/product-collections/product-collections.js.map +1 -1
- package/resources/product-collections/product-collections.mjs +11 -11
- package/resources/product-collections/product-collections.mjs.map +1 -1
- package/resources/products/index.d.mts +2 -2
- package/resources/products/index.d.mts.map +1 -1
- package/resources/products/index.d.ts +2 -2
- package/resources/products/index.d.ts.map +1 -1
- package/resources/products/products.d.mts +21 -21
- package/resources/products/products.d.mts.map +1 -1
- package/resources/products/products.d.ts +21 -21
- package/resources/products/products.d.ts.map +1 -1
- package/resources/products/products.js +6 -6
- package/resources/products/products.js.map +1 -1
- package/resources/products/products.mjs +6 -6
- package/resources/products/products.mjs.map +1 -1
- package/resources/products/short-links.d.mts +11 -11
- package/resources/products/short-links.d.mts.map +1 -1
- package/resources/products/short-links.d.ts +11 -11
- package/resources/products/short-links.d.ts.map +1 -1
- package/resources/products/short-links.js +6 -6
- package/resources/products/short-links.js.map +1 -1
- package/resources/products/short-links.mjs +6 -6
- package/resources/products/short-links.mjs.map +1 -1
- package/resources/refunds.d.mts +24 -24
- package/resources/refunds.d.mts.map +1 -1
- package/resources/refunds.d.ts +24 -24
- package/resources/refunds.d.ts.map +1 -1
- package/resources/refunds.js +6 -6
- package/resources/refunds.js.map +1 -1
- package/resources/refunds.mjs +6 -6
- package/resources/refunds.mjs.map +1 -1
- package/resources/subscriptions.d.mts +86 -86
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +86 -86
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +23 -23
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +23 -23
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/usage-events.d.mts +61 -61
- package/resources/usage-events.d.mts.map +1 -1
- package/resources/usage-events.d.ts +61 -61
- package/resources/usage-events.d.ts.map +1 -1
- package/resources/usage-events.js +56 -56
- package/resources/usage-events.js.map +1 -1
- package/resources/usage-events.mjs +56 -56
- package/resources/usage-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/webhooks.d.mts +12 -12
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +12 -12
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/resources/webhooks/webhooks.js +15 -15
- package/resources/webhooks/webhooks.js.map +1 -1
- package/resources/webhooks/webhooks.mjs +15 -15
- package/resources/webhooks/webhooks.mjs.map +1 -1
- package/src/client.ts +18 -18
- package/src/resources/addons.ts +13 -13
- package/src/resources/balances.ts +4 -2
- package/src/resources/brands.ts +4 -4
- package/src/resources/credit-entitlements/balances.ts +91 -91
- package/src/resources/credit-entitlements/credit-entitlements.ts +55 -55
- package/src/resources/credit-entitlements/index.ts +3 -3
- package/src/resources/customers/customers.ts +49 -49
- package/src/resources/customers/index.ts +1 -1
- package/src/resources/customers/wallets/index.ts +1 -1
- package/src/resources/customers/wallets/ledger-entries.ts +16 -16
- package/src/resources/customers/wallets/wallets.ts +1 -1
- package/src/resources/discounts.ts +52 -63
- package/src/resources/disputes.ts +4 -4
- package/src/resources/entitlements/entitlements.ts +36 -36
- package/src/resources/entitlements/files.ts +7 -7
- package/src/resources/entitlements/index.ts +1 -1
- package/src/resources/index.ts +18 -18
- package/src/resources/invoices/payments.ts +4 -4
- package/src/resources/license-key-instances.ts +25 -25
- package/src/resources/license-keys.ts +48 -48
- package/src/resources/meters.ts +15 -15
- package/src/resources/payments.ts +66 -59
- package/src/resources/product-collections/groups/groups.ts +16 -16
- package/src/resources/product-collections/groups/index.ts +2 -2
- package/src/resources/product-collections/groups/items.ts +19 -19
- package/src/resources/product-collections/index.ts +2 -2
- package/src/resources/product-collections/product-collections.ts +146 -26
- package/src/resources/products/index.ts +2 -2
- package/src/resources/products/products.ts +33 -33
- package/src/resources/products/short-links.ts +20 -20
- package/src/resources/refunds.ts +36 -36
- package/src/resources/subscriptions.ts +130 -130
- package/src/resources/usage-events.ts +64 -64
- package/src/resources/webhooks/index.ts +1 -1
- package/src/resources/webhooks/webhooks.ts +24 -24
- 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
|
@@ -24,22 +24,6 @@ import { path } from '../../internal/utils/path';
|
|
|
24
24
|
export class ProductCollections extends APIResource {
|
|
25
25
|
groups: GroupsAPI.Groups = new GroupsAPI.Groups(this._client);
|
|
26
26
|
|
|
27
|
-
create(body: ProductCollectionCreateParams, options?: RequestOptions): APIPromise<ProductCollection> {
|
|
28
|
-
return this._client.post('/product-collections', { body, ...options });
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
retrieve(id: string, options?: RequestOptions): APIPromise<ProductCollection> {
|
|
32
|
-
return this._client.get(path`/product-collections/${id}`, options);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
update(id: string, body: ProductCollectionUpdateParams, options?: RequestOptions): APIPromise<void> {
|
|
36
|
-
return this._client.patch(path`/product-collections/${id}`, {
|
|
37
|
-
body,
|
|
38
|
-
...options,
|
|
39
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
27
|
list(
|
|
44
28
|
query: ProductCollectionListParams | null | undefined = {},
|
|
45
29
|
options?: RequestOptions,
|
|
@@ -51,6 +35,14 @@ export class ProductCollections extends APIResource {
|
|
|
51
35
|
);
|
|
52
36
|
}
|
|
53
37
|
|
|
38
|
+
create(body: ProductCollectionCreateParams, options?: RequestOptions): APIPromise<ProductCollection> {
|
|
39
|
+
return this._client.post('/product-collections', { body, ...options });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ProductCollection> {
|
|
43
|
+
return this._client.get(path`/product-collections/${id}`, options);
|
|
44
|
+
}
|
|
45
|
+
|
|
54
46
|
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
55
47
|
return this._client.delete(path`/product-collections/${id}`, {
|
|
56
48
|
...options,
|
|
@@ -58,8 +50,12 @@ export class ProductCollections extends APIResource {
|
|
|
58
50
|
});
|
|
59
51
|
}
|
|
60
52
|
|
|
61
|
-
|
|
62
|
-
return this._client.
|
|
53
|
+
update(id: string, body: ProductCollectionUpdateParams, options?: RequestOptions): APIPromise<void> {
|
|
54
|
+
return this._client.patch(path`/product-collections/${id}`, {
|
|
55
|
+
body,
|
|
56
|
+
...options,
|
|
57
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
58
|
+
});
|
|
63
59
|
}
|
|
64
60
|
|
|
65
61
|
updateImages(
|
|
@@ -70,6 +66,10 @@ export class ProductCollections extends APIResource {
|
|
|
70
66
|
const { force_update } = params ?? {};
|
|
71
67
|
return this._client.put(path`/product-collections/${id}/images`, { query: { force_update }, ...options });
|
|
72
68
|
}
|
|
69
|
+
|
|
70
|
+
unarchive(id: string, options?: RequestOptions): APIPromise<ProductCollectionUnarchiveResponse> {
|
|
71
|
+
return this._client.post(path`/product-collections/${id}/unarchive`, options);
|
|
72
|
+
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export type ProductCollectionListResponsesDefaultPageNumberPagination =
|
|
@@ -111,10 +111,50 @@ export interface ProductCollection {
|
|
|
111
111
|
*/
|
|
112
112
|
description?: string | null;
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Default effective_at setting for subscription plan downgrades (null = inherit
|
|
116
|
+
* from business)
|
|
117
|
+
*/
|
|
118
|
+
effective_at_on_downgrade?: 'immediately' | 'next_billing_date' | null;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Default effective_at setting for subscription plan upgrades (null = inherit from
|
|
122
|
+
* business)
|
|
123
|
+
*/
|
|
124
|
+
effective_at_on_upgrade?: 'immediately' | 'next_billing_date' | null;
|
|
125
|
+
|
|
114
126
|
/**
|
|
115
127
|
* URL of the collection image
|
|
116
128
|
*/
|
|
117
129
|
image?: string | null;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Default behavior for subscription plan changes on payment failure (null =
|
|
133
|
+
* inherit from business)
|
|
134
|
+
*/
|
|
135
|
+
on_payment_failure?: 'prevent_change' | 'apply_change' | null;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Default proration billing mode for subscription plan downgrades (null = inherit
|
|
139
|
+
* from business)
|
|
140
|
+
*/
|
|
141
|
+
proration_billing_mode_on_downgrade?:
|
|
142
|
+
| 'prorated_immediately'
|
|
143
|
+
| 'full_immediately'
|
|
144
|
+
| 'difference_immediately'
|
|
145
|
+
| 'do_not_bill'
|
|
146
|
+
| null;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Default proration billing mode for subscription plan upgrades (null = inherit
|
|
150
|
+
* from business)
|
|
151
|
+
*/
|
|
152
|
+
proration_billing_mode_on_upgrade?:
|
|
153
|
+
| 'prorated_immediately'
|
|
154
|
+
| 'full_immediately'
|
|
155
|
+
| 'difference_immediately'
|
|
156
|
+
| 'do_not_bill'
|
|
157
|
+
| null;
|
|
118
158
|
}
|
|
119
159
|
|
|
120
160
|
export interface ProductCollectionListResponse {
|
|
@@ -183,6 +223,18 @@ export interface ProductCollectionUpdateImagesResponse {
|
|
|
183
223
|
image_id?: string | null;
|
|
184
224
|
}
|
|
185
225
|
|
|
226
|
+
export interface ProductCollectionListParams extends DefaultPageNumberPaginationParams {
|
|
227
|
+
/**
|
|
228
|
+
* List archived collections
|
|
229
|
+
*/
|
|
230
|
+
archived?: boolean;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Filter by Brand id
|
|
234
|
+
*/
|
|
235
|
+
brand_id?: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
186
238
|
export interface ProductCollectionCreateParams {
|
|
187
239
|
/**
|
|
188
240
|
* Groups of products in this collection
|
|
@@ -203,6 +255,46 @@ export interface ProductCollectionCreateParams {
|
|
|
203
255
|
* Optional description of the product collection
|
|
204
256
|
*/
|
|
205
257
|
description?: string | null;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Default effective_at setting for subscription plan downgrades (NULL = inherit
|
|
261
|
+
* from business)
|
|
262
|
+
*/
|
|
263
|
+
effective_at_on_downgrade?: 'immediately' | 'next_billing_date' | null;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Default effective_at setting for subscription plan upgrades (NULL = inherit from
|
|
267
|
+
* business)
|
|
268
|
+
*/
|
|
269
|
+
effective_at_on_upgrade?: 'immediately' | 'next_billing_date' | null;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Default behavior for subscription plan changes on payment failure (NULL =
|
|
273
|
+
* inherit from business)
|
|
274
|
+
*/
|
|
275
|
+
on_payment_failure?: 'prevent_change' | 'apply_change' | null;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Default proration billing mode for subscription plan downgrades (NULL = inherit
|
|
279
|
+
* from business)
|
|
280
|
+
*/
|
|
281
|
+
proration_billing_mode_on_downgrade?:
|
|
282
|
+
| 'prorated_immediately'
|
|
283
|
+
| 'full_immediately'
|
|
284
|
+
| 'difference_immediately'
|
|
285
|
+
| 'do_not_bill'
|
|
286
|
+
| null;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Default proration billing mode for subscription plan upgrades (NULL = inherit
|
|
290
|
+
* from business)
|
|
291
|
+
*/
|
|
292
|
+
proration_billing_mode_on_upgrade?:
|
|
293
|
+
| 'prorated_immediately'
|
|
294
|
+
| 'full_immediately'
|
|
295
|
+
| 'difference_immediately'
|
|
296
|
+
| 'do_not_bill'
|
|
297
|
+
| null;
|
|
206
298
|
}
|
|
207
299
|
|
|
208
300
|
export interface ProductCollectionUpdateParams {
|
|
@@ -216,6 +308,18 @@ export interface ProductCollectionUpdateParams {
|
|
|
216
308
|
*/
|
|
217
309
|
description?: string | null;
|
|
218
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Effective_at setting for downgrades: Some(Some(val)) = set, Some(None) = clear
|
|
313
|
+
* (inherit), None = no change
|
|
314
|
+
*/
|
|
315
|
+
effective_at_on_downgrade?: 'immediately' | 'next_billing_date' | null;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Effective_at setting for upgrades: Some(Some(val)) = set, Some(None) = clear
|
|
319
|
+
* (inherit), None = no change
|
|
320
|
+
*/
|
|
321
|
+
effective_at_on_upgrade?: 'immediately' | 'next_billing_date' | null;
|
|
322
|
+
|
|
219
323
|
/**
|
|
220
324
|
* Optional new order for groups (array of group UUIDs in desired order)
|
|
221
325
|
*/
|
|
@@ -230,18 +334,34 @@ export interface ProductCollectionUpdateParams {
|
|
|
230
334
|
* Optional new name for the collection
|
|
231
335
|
*/
|
|
232
336
|
name?: string | null;
|
|
233
|
-
}
|
|
234
337
|
|
|
235
|
-
export interface ProductCollectionListParams extends DefaultPageNumberPaginationParams {
|
|
236
338
|
/**
|
|
237
|
-
*
|
|
339
|
+
* On payment failure behavior: Some(Some(val)) = set, Some(None) = clear
|
|
340
|
+
* (inherit), None = no change
|
|
238
341
|
*/
|
|
239
|
-
|
|
342
|
+
on_payment_failure?: 'prevent_change' | 'apply_change' | null;
|
|
240
343
|
|
|
241
344
|
/**
|
|
242
|
-
*
|
|
345
|
+
* Proration billing mode for downgrades: Some(Some(val)) = set, Some(None) = clear
|
|
346
|
+
* (inherit), None = no change
|
|
243
347
|
*/
|
|
244
|
-
|
|
348
|
+
proration_billing_mode_on_downgrade?:
|
|
349
|
+
| 'prorated_immediately'
|
|
350
|
+
| 'full_immediately'
|
|
351
|
+
| 'difference_immediately'
|
|
352
|
+
| 'do_not_bill'
|
|
353
|
+
| null;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Proration billing mode for upgrades: Some(Some(val)) = set, Some(None) = clear
|
|
357
|
+
* (inherit), None = no change
|
|
358
|
+
*/
|
|
359
|
+
proration_billing_mode_on_upgrade?:
|
|
360
|
+
| 'prorated_immediately'
|
|
361
|
+
| 'full_immediately'
|
|
362
|
+
| 'difference_immediately'
|
|
363
|
+
| 'do_not_bill'
|
|
364
|
+
| null;
|
|
245
365
|
}
|
|
246
366
|
|
|
247
367
|
export interface ProductCollectionUpdateImagesParams {
|
|
@@ -260,9 +380,9 @@ export declare namespace ProductCollections {
|
|
|
260
380
|
type ProductCollectionUnarchiveResponse as ProductCollectionUnarchiveResponse,
|
|
261
381
|
type ProductCollectionUpdateImagesResponse as ProductCollectionUpdateImagesResponse,
|
|
262
382
|
type ProductCollectionListResponsesDefaultPageNumberPagination as ProductCollectionListResponsesDefaultPageNumberPagination,
|
|
383
|
+
type ProductCollectionListParams as ProductCollectionListParams,
|
|
263
384
|
type ProductCollectionCreateParams as ProductCollectionCreateParams,
|
|
264
385
|
type ProductCollectionUpdateParams as ProductCollectionUpdateParams,
|
|
265
|
-
type ProductCollectionListParams as ProductCollectionListParams,
|
|
266
386
|
type ProductCollectionUpdateImagesParams as ProductCollectionUpdateImagesParams,
|
|
267
387
|
};
|
|
268
388
|
|
|
@@ -272,7 +392,7 @@ export declare namespace ProductCollections {
|
|
|
272
392
|
type ProductCollectionGroupDetails as ProductCollectionGroupDetails,
|
|
273
393
|
type ProductCollectionGroupResponse as ProductCollectionGroupResponse,
|
|
274
394
|
type GroupCreateParams as GroupCreateParams,
|
|
275
|
-
type GroupUpdateParams as GroupUpdateParams,
|
|
276
395
|
type GroupDeleteParams as GroupDeleteParams,
|
|
396
|
+
type GroupUpdateParams as GroupUpdateParams,
|
|
277
397
|
};
|
|
278
398
|
}
|
|
@@ -16,9 +16,9 @@ export {
|
|
|
16
16
|
type ProductEntitlementSummary,
|
|
17
17
|
type ProductListResponse,
|
|
18
18
|
type ProductUpdateFilesResponse,
|
|
19
|
+
type ProductListParams,
|
|
19
20
|
type ProductCreateParams,
|
|
20
21
|
type ProductUpdateParams,
|
|
21
|
-
type ProductListParams,
|
|
22
22
|
type ProductUpdateFilesParams,
|
|
23
23
|
type ProductListResponsesDefaultPageNumberPagination,
|
|
24
24
|
} from './products';
|
|
@@ -26,7 +26,7 @@ export {
|
|
|
26
26
|
ShortLinks,
|
|
27
27
|
type ShortLinkCreateResponse,
|
|
28
28
|
type ShortLinkListResponse,
|
|
29
|
-
type ShortLinkCreateParams,
|
|
30
29
|
type ShortLinkListParams,
|
|
30
|
+
type ShortLinkCreateParams,
|
|
31
31
|
type ShortLinkListResponsesDefaultPageNumberPagination,
|
|
32
32
|
} from './short-links';
|
|
@@ -31,6 +31,16 @@ export class Products extends APIResource {
|
|
|
31
31
|
images: ImagesAPI.Images = new ImagesAPI.Images(this._client);
|
|
32
32
|
shortLinks: ShortLinksAPI.ShortLinks = new ShortLinksAPI.ShortLinks(this._client);
|
|
33
33
|
|
|
34
|
+
list(
|
|
35
|
+
query: ProductListParams | null | undefined = {},
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): PagePromise<ProductListResponsesDefaultPageNumberPagination, ProductListResponse> {
|
|
38
|
+
return this._client.getAPIList('/products', DefaultPageNumberPagination<ProductListResponse>, {
|
|
39
|
+
query,
|
|
40
|
+
...options,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
create(body: ProductCreateParams, options?: RequestOptions): APIPromise<Product> {
|
|
35
45
|
return this._client.post('/products', { body, ...options });
|
|
36
46
|
}
|
|
@@ -47,16 +57,6 @@ export class Products extends APIResource {
|
|
|
47
57
|
});
|
|
48
58
|
}
|
|
49
59
|
|
|
50
|
-
list(
|
|
51
|
-
query: ProductListParams | null | undefined = {},
|
|
52
|
-
options?: RequestOptions,
|
|
53
|
-
): PagePromise<ProductListResponsesDefaultPageNumberPagination, ProductListResponse> {
|
|
54
|
-
return this._client.getAPIList('/products', DefaultPageNumberPagination<ProductListResponse>, {
|
|
55
|
-
query,
|
|
56
|
-
...options,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
60
|
archive(id: string, options?: RequestOptions): APIPromise<void> {
|
|
61
61
|
return this._client.delete(path`/products/${id}`, {
|
|
62
62
|
...options,
|
|
@@ -797,6 +797,27 @@ export interface ProductUpdateFilesResponse {
|
|
|
797
797
|
url: string;
|
|
798
798
|
}
|
|
799
799
|
|
|
800
|
+
export interface ProductListParams extends DefaultPageNumberPaginationParams {
|
|
801
|
+
/**
|
|
802
|
+
* List archived products
|
|
803
|
+
*/
|
|
804
|
+
archived?: boolean;
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* filter by Brand id
|
|
808
|
+
*/
|
|
809
|
+
brand_id?: string;
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Filter products by pricing type:
|
|
813
|
+
*
|
|
814
|
+
* - `true`: Show only recurring pricing products (e.g. subscriptions)
|
|
815
|
+
* - `false`: Show only one-time price products
|
|
816
|
+
* - `null` or absent: Show both types of products
|
|
817
|
+
*/
|
|
818
|
+
recurring?: boolean;
|
|
819
|
+
}
|
|
820
|
+
|
|
800
821
|
export interface ProductCreateParams {
|
|
801
822
|
/**
|
|
802
823
|
* Name of the product
|
|
@@ -1008,27 +1029,6 @@ export namespace ProductUpdateParams {
|
|
|
1008
1029
|
}
|
|
1009
1030
|
}
|
|
1010
1031
|
|
|
1011
|
-
export interface ProductListParams extends DefaultPageNumberPaginationParams {
|
|
1012
|
-
/**
|
|
1013
|
-
* List archived products
|
|
1014
|
-
*/
|
|
1015
|
-
archived?: boolean;
|
|
1016
|
-
|
|
1017
|
-
/**
|
|
1018
|
-
* filter by Brand id
|
|
1019
|
-
*/
|
|
1020
|
-
brand_id?: string;
|
|
1021
|
-
|
|
1022
|
-
/**
|
|
1023
|
-
* Filter products by pricing type:
|
|
1024
|
-
*
|
|
1025
|
-
* - `true`: Show only recurring pricing products (e.g. subscriptions)
|
|
1026
|
-
* - `false`: Show only one-time price products
|
|
1027
|
-
* - `null` or absent: Show both types of products
|
|
1028
|
-
*/
|
|
1029
|
-
recurring?: boolean;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
1032
|
export interface ProductUpdateFilesParams {
|
|
1033
1033
|
file_name: string;
|
|
1034
1034
|
}
|
|
@@ -1052,9 +1052,9 @@ export declare namespace Products {
|
|
|
1052
1052
|
type ProductListResponse as ProductListResponse,
|
|
1053
1053
|
type ProductUpdateFilesResponse as ProductUpdateFilesResponse,
|
|
1054
1054
|
type ProductListResponsesDefaultPageNumberPagination as ProductListResponsesDefaultPageNumberPagination,
|
|
1055
|
+
type ProductListParams as ProductListParams,
|
|
1055
1056
|
type ProductCreateParams as ProductCreateParams,
|
|
1056
1057
|
type ProductUpdateParams as ProductUpdateParams,
|
|
1057
|
-
type ProductListParams as ProductListParams,
|
|
1058
1058
|
type ProductUpdateFilesParams as ProductUpdateFilesParams,
|
|
1059
1059
|
};
|
|
1060
1060
|
|
|
@@ -1069,7 +1069,7 @@ export declare namespace Products {
|
|
|
1069
1069
|
type ShortLinkCreateResponse as ShortLinkCreateResponse,
|
|
1070
1070
|
type ShortLinkListResponse as ShortLinkListResponse,
|
|
1071
1071
|
type ShortLinkListResponsesDefaultPageNumberPagination as ShortLinkListResponsesDefaultPageNumberPagination,
|
|
1072
|
-
type ShortLinkCreateParams as ShortLinkCreateParams,
|
|
1073
1072
|
type ShortLinkListParams as ShortLinkListParams,
|
|
1073
|
+
type ShortLinkCreateParams as ShortLinkCreateParams,
|
|
1074
1074
|
};
|
|
1075
1075
|
}
|
|
@@ -11,18 +11,6 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
11
11
|
import { path } from '../../internal/utils/path';
|
|
12
12
|
|
|
13
13
|
export class ShortLinks extends APIResource {
|
|
14
|
-
/**
|
|
15
|
-
* Gives a Short Checkout URL with custom slug for a product. Uses a Static
|
|
16
|
-
* Checkout URL under the hood.
|
|
17
|
-
*/
|
|
18
|
-
create(
|
|
19
|
-
id: string,
|
|
20
|
-
body: ShortLinkCreateParams,
|
|
21
|
-
options?: RequestOptions,
|
|
22
|
-
): APIPromise<ShortLinkCreateResponse> {
|
|
23
|
-
return this._client.post(path`/products/${id}/short_links`, { body, ...options });
|
|
24
|
-
}
|
|
25
|
-
|
|
26
14
|
/**
|
|
27
15
|
* Lists all short links created by the business.
|
|
28
16
|
*/
|
|
@@ -36,6 +24,18 @@ export class ShortLinks extends APIResource {
|
|
|
36
24
|
{ query, ...options },
|
|
37
25
|
);
|
|
38
26
|
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Gives a Short Checkout URL with custom slug for a product. Uses a Static
|
|
30
|
+
* Checkout URL under the hood.
|
|
31
|
+
*/
|
|
32
|
+
create(
|
|
33
|
+
id: string,
|
|
34
|
+
body: ShortLinkCreateParams,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<ShortLinkCreateResponse> {
|
|
37
|
+
return this._client.post(path`/products/${id}/short_links`, { body, ...options });
|
|
38
|
+
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export type ShortLinkListResponsesDefaultPageNumberPagination =
|
|
@@ -75,6 +75,13 @@ export interface ShortLinkListResponse {
|
|
|
75
75
|
short_url: string;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
export interface ShortLinkListParams extends DefaultPageNumberPaginationParams {
|
|
79
|
+
/**
|
|
80
|
+
* Filter by product ID
|
|
81
|
+
*/
|
|
82
|
+
product_id?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
78
85
|
export interface ShortLinkCreateParams {
|
|
79
86
|
/**
|
|
80
87
|
* Slug for the short link.
|
|
@@ -87,19 +94,12 @@ export interface ShortLinkCreateParams {
|
|
|
87
94
|
static_checkout_params?: { [key: string]: string } | null;
|
|
88
95
|
}
|
|
89
96
|
|
|
90
|
-
export interface ShortLinkListParams extends DefaultPageNumberPaginationParams {
|
|
91
|
-
/**
|
|
92
|
-
* Filter by product ID
|
|
93
|
-
*/
|
|
94
|
-
product_id?: string;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
97
|
export declare namespace ShortLinks {
|
|
98
98
|
export {
|
|
99
99
|
type ShortLinkCreateResponse as ShortLinkCreateResponse,
|
|
100
100
|
type ShortLinkListResponse as ShortLinkListResponse,
|
|
101
101
|
type ShortLinkListResponsesDefaultPageNumberPagination as ShortLinkListResponsesDefaultPageNumberPagination,
|
|
102
|
-
type ShortLinkCreateParams as ShortLinkCreateParams,
|
|
103
102
|
type ShortLinkListParams as ShortLinkListParams,
|
|
103
|
+
type ShortLinkCreateParams as ShortLinkCreateParams,
|
|
104
104
|
};
|
|
105
105
|
}
|
package/src/resources/refunds.ts
CHANGED
|
@@ -14,14 +14,6 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
14
14
|
import { path } from '../internal/utils/path';
|
|
15
15
|
|
|
16
16
|
export class Refunds extends APIResource {
|
|
17
|
-
create(body: RefundCreateParams, options?: RequestOptions): APIPromise<Refund> {
|
|
18
|
-
return this._client.post('/refunds', { body, ...options });
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
retrieve(refundID: string, options?: RequestOptions): APIPromise<Refund> {
|
|
22
|
-
return this._client.get(path`/refunds/${refundID}`, options);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
17
|
list(
|
|
26
18
|
query: RefundListParams | null | undefined = {},
|
|
27
19
|
options?: RequestOptions,
|
|
@@ -31,6 +23,14 @@ export class Refunds extends APIResource {
|
|
|
31
23
|
...options,
|
|
32
24
|
});
|
|
33
25
|
}
|
|
26
|
+
|
|
27
|
+
create(body: RefundCreateParams, options?: RequestOptions): APIPromise<Refund> {
|
|
28
|
+
return this._client.post('/refunds', { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
retrieve(refundID: string, options?: RequestOptions): APIPromise<Refund> {
|
|
32
|
+
return this._client.get(path`/refunds/${refundID}`, options);
|
|
33
|
+
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export interface Refund {
|
|
@@ -92,6 +92,33 @@ export interface Refund {
|
|
|
92
92
|
|
|
93
93
|
export type RefundStatus = 'succeeded' | 'failed' | 'pending' | 'review';
|
|
94
94
|
|
|
95
|
+
export interface RefundListParams extends DefaultPageNumberPaginationParams {
|
|
96
|
+
/**
|
|
97
|
+
* Get events after this created time
|
|
98
|
+
*/
|
|
99
|
+
created_at_gte?: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Get events created before this time
|
|
103
|
+
*/
|
|
104
|
+
created_at_lte?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Filter by customer_id
|
|
108
|
+
*/
|
|
109
|
+
customer_id?: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Filter by status
|
|
113
|
+
*/
|
|
114
|
+
status?: 'succeeded' | 'failed' | 'pending' | 'review';
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Filter by subscription id
|
|
118
|
+
*/
|
|
119
|
+
subscription_id?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
95
122
|
export interface RefundCreateParams {
|
|
96
123
|
/**
|
|
97
124
|
* The unique identifier of the payment to be refunded.
|
|
@@ -133,39 +160,12 @@ export namespace RefundCreateParams {
|
|
|
133
160
|
}
|
|
134
161
|
}
|
|
135
162
|
|
|
136
|
-
export interface RefundListParams extends DefaultPageNumberPaginationParams {
|
|
137
|
-
/**
|
|
138
|
-
* Get events after this created time
|
|
139
|
-
*/
|
|
140
|
-
created_at_gte?: string;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Get events created before this time
|
|
144
|
-
*/
|
|
145
|
-
created_at_lte?: string;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Filter by customer_id
|
|
149
|
-
*/
|
|
150
|
-
customer_id?: string;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Filter by status
|
|
154
|
-
*/
|
|
155
|
-
status?: 'succeeded' | 'failed' | 'pending' | 'review';
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Filter by subscription id
|
|
159
|
-
*/
|
|
160
|
-
subscription_id?: string;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
163
|
export declare namespace Refunds {
|
|
164
164
|
export {
|
|
165
165
|
type Refund as Refund,
|
|
166
166
|
type RefundStatus as RefundStatus,
|
|
167
|
-
type RefundCreateParams as RefundCreateParams,
|
|
168
167
|
type RefundListParams as RefundListParams,
|
|
168
|
+
type RefundCreateParams as RefundCreateParams,
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
|