@usehercules/sdk 1.12.2 → 1.13.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 +36 -0
- package/package.json +1 -1
- package/resources/commerce/commerce.d.mts +2 -6
- package/resources/commerce/commerce.d.mts.map +1 -1
- package/resources/commerce/commerce.d.ts +2 -6
- package/resources/commerce/commerce.d.ts.map +1 -1
- package/resources/commerce/commerce.js +2 -6
- package/resources/commerce/commerce.js.map +1 -1
- package/resources/commerce/commerce.mjs +2 -6
- package/resources/commerce/commerce.mjs.map +1 -1
- package/resources/commerce/coupons.d.mts +3 -2
- package/resources/commerce/coupons.d.mts.map +1 -1
- package/resources/commerce/coupons.d.ts +3 -2
- package/resources/commerce/coupons.d.ts.map +1 -1
- package/resources/commerce/customers.d.mts +264 -1
- package/resources/commerce/customers.d.mts.map +1 -1
- package/resources/commerce/customers.d.ts +264 -1
- package/resources/commerce/customers.d.ts.map +1 -1
- package/resources/commerce/customers.js +81 -2
- package/resources/commerce/customers.js.map +1 -1
- package/resources/commerce/customers.mjs +79 -1
- package/resources/commerce/customers.mjs.map +1 -1
- package/resources/commerce/features.d.mts +3 -7
- package/resources/commerce/features.d.mts.map +1 -1
- package/resources/commerce/features.d.ts +3 -7
- package/resources/commerce/features.d.ts.map +1 -1
- package/resources/commerce/index.d.mts +1 -2
- package/resources/commerce/index.d.mts.map +1 -1
- package/resources/commerce/index.d.ts +1 -2
- package/resources/commerce/index.d.ts.map +1 -1
- package/resources/commerce/index.js +5 -7
- package/resources/commerce/index.js.map +1 -1
- package/resources/commerce/index.mjs +1 -2
- package/resources/commerce/index.mjs.map +1 -1
- package/resources/commerce/products/products.d.mts +11 -11
- package/resources/commerce/products/products.d.mts.map +1 -1
- package/resources/commerce/products/products.d.ts +11 -11
- package/resources/commerce/products/products.d.ts.map +1 -1
- package/resources/commerce/products/products.js +2 -2
- package/resources/commerce/products/products.mjs +2 -2
- package/resources/commerce/products/resources.d.mts +2 -2
- package/resources/commerce/products/resources.d.mts.map +1 -1
- package/resources/commerce/products/resources.d.ts +2 -2
- package/resources/commerce/products/resources.d.ts.map +1 -1
- package/resources/commerce/products/variants.d.mts +6 -6
- package/resources/commerce/products/variants.d.mts.map +1 -1
- package/resources/commerce/products/variants.d.ts +6 -6
- package/resources/commerce/products/variants.d.ts.map +1 -1
- package/resources/commerce/products/variants.js +1 -1
- package/resources/commerce/products/variants.mjs +1 -1
- package/resources/content/assets.d.mts +3 -3
- package/resources/content/assets.d.mts.map +1 -1
- package/resources/content/assets.d.ts +3 -3
- package/resources/content/assets.d.ts.map +1 -1
- package/src/resources/commerce/commerce.ts +11 -19
- package/src/resources/commerce/coupons.ts +3 -2
- package/src/resources/commerce/customers.ts +340 -1
- package/src/resources/commerce/features.ts +3 -8
- package/src/resources/commerce/index.ts +1 -2
- package/src/resources/commerce/products/products.ts +11 -11
- package/src/resources/commerce/products/resources.ts +2 -2
- package/src/resources/commerce/products/variants.ts +6 -6
- package/src/resources/content/assets.ts +3 -3
- 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
- package/resources/commerce/customers/balance-transactions.d.mts +0 -4
- package/resources/commerce/customers/balance-transactions.d.mts.map +0 -1
- package/resources/commerce/customers/balance-transactions.d.ts +0 -4
- package/resources/commerce/customers/balance-transactions.d.ts.map +0 -1
- package/resources/commerce/customers/balance-transactions.js +0 -9
- package/resources/commerce/customers/balance-transactions.js.map +0 -1
- package/resources/commerce/customers/balance-transactions.mjs +0 -5
- package/resources/commerce/customers/balance-transactions.mjs.map +0 -1
- package/resources/commerce/customers/customers.d.mts +0 -482
- package/resources/commerce/customers/customers.d.mts.map +0 -1
- package/resources/commerce/customers/customers.d.ts +0 -482
- package/resources/commerce/customers/customers.d.ts.map +0 -1
- package/resources/commerce/customers/customers.js +0 -93
- package/resources/commerce/customers/customers.js.map +0 -1
- package/resources/commerce/customers/customers.mjs +0 -88
- package/resources/commerce/customers/customers.mjs.map +0 -1
- package/resources/commerce/customers/index.d.mts +0 -3
- package/resources/commerce/customers/index.d.mts.map +0 -1
- package/resources/commerce/customers/index.d.ts +0 -3
- package/resources/commerce/customers/index.d.ts.map +0 -1
- package/resources/commerce/customers/index.js +0 -9
- package/resources/commerce/customers/index.js.map +0 -1
- package/resources/commerce/customers/index.mjs +0 -4
- package/resources/commerce/customers/index.mjs.map +0 -1
- package/resources/commerce/subscription-groups.d.mts +0 -4
- package/resources/commerce/subscription-groups.d.mts.map +0 -1
- package/resources/commerce/subscription-groups.d.ts +0 -4
- package/resources/commerce/subscription-groups.d.ts.map +0 -1
- package/resources/commerce/subscription-groups.js +0 -9
- package/resources/commerce/subscription-groups.js.map +0 -1
- package/resources/commerce/subscription-groups.mjs +0 -5
- package/resources/commerce/subscription-groups.mjs.map +0 -1
- package/src/resources/commerce/customers/balance-transactions.ts +0 -5
- package/src/resources/commerce/customers/customers.ts +0 -616
- package/src/resources/commerce/customers/index.ts +0 -15
- package/src/resources/commerce/subscription-groups.ts +0 -5
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { BalanceTransactions } from "./balance-transactions.js";
|
|
2
|
-
export { Customers, type Customer, type CustomerAddress, type CustomerBillingPortalResponse, type CustomerGetResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, type CustomerBillingPortalParams, type CustomersCursorIDPage, } from "./customers.js";
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/commerce/customers/index.ts"],"names":[],"mappings":"OAEO,EAAE,mBAAmB,EAAE;OACvB,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,GAC3B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Customers = exports.BalanceTransactions = void 0;
|
|
5
|
-
var balance_transactions_1 = require("./balance-transactions.js");
|
|
6
|
-
Object.defineProperty(exports, "BalanceTransactions", { enumerable: true, get: function () { return balance_transactions_1.BalanceTransactions; } });
|
|
7
|
-
var customers_1 = require("./customers.js");
|
|
8
|
-
Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return customers_1.Customers; } });
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/commerce/customers/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kEAA6D;AAApD,2HAAA,mBAAmB,OAAA;AAC5B,4CAWqB;AAVnB,sGAAA,SAAS,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/commerce/customers/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,mBAAmB,EAAE;OACvB,EACL,SAAS,GAUV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-groups.d.mts","sourceRoot":"","sources":["../../src/resources/commerce/subscription-groups.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;AAEtB,qBAAa,kBAAmB,SAAQ,WAAW;CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-groups.d.ts","sourceRoot":"","sources":["../../src/resources/commerce/subscription-groups.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;AAEtB,qBAAa,kBAAmB,SAAQ,WAAW;CAAG"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.SubscriptionGroups = void 0;
|
|
5
|
-
const resource_1 = require("../../core/resource.js");
|
|
6
|
-
class SubscriptionGroups extends resource_1.APIResource {
|
|
7
|
-
}
|
|
8
|
-
exports.SubscriptionGroups = SubscriptionGroups;
|
|
9
|
-
//# sourceMappingURL=subscription-groups.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-groups.js","sourceRoot":"","sources":["../../src/resources/commerce/subscription-groups.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,MAAa,kBAAmB,SAAQ,sBAAW;CAAG;AAAtD,gDAAsD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-groups.mjs","sourceRoot":"","sources":["../../src/resources/commerce/subscription-groups.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAEtB,MAAM,OAAO,kBAAmB,SAAQ,WAAW;CAAG"}
|
|
@@ -1,616 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as BalanceTransactionsAPI from './balance-transactions';
|
|
5
|
-
import { BalanceTransactions } from './balance-transactions';
|
|
6
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
7
|
-
import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../../core/pagination';
|
|
8
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
9
|
-
import { path } from '../../../internal/utils/path';
|
|
10
|
-
|
|
11
|
-
export class Customers extends APIResource {
|
|
12
|
-
balanceTransactions: BalanceTransactionsAPI.BalanceTransactions =
|
|
13
|
-
new BalanceTransactionsAPI.BalanceTransactions(this._client);
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Creates a new billable customer. A customer represents the entity in your app
|
|
17
|
-
* that will be charged—typically a user, organization, or project. Hercules
|
|
18
|
-
* recommends creating a customer immediately after creating the corresponding
|
|
19
|
-
* entity in your app.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```ts
|
|
23
|
-
* const customer = await client.commerce.customers.create();
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
create(body: CustomerCreateParams | null | undefined = {}, options?: RequestOptions): APIPromise<Customer> {
|
|
27
|
-
return this._client.post('/v1/commerce/customers', { body, ...options });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Updates an existing customer. Use this to modify contact information or billing
|
|
32
|
-
* address. Only provided fields are updated; omitted fields remain unchanged.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const customer = await client.commerce.customers.update(
|
|
37
|
-
* 'cus_1234567890',
|
|
38
|
-
* );
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
update(
|
|
42
|
-
customerID: string,
|
|
43
|
-
body: CustomerUpdateParams | null | undefined = {},
|
|
44
|
-
options?: RequestOptions,
|
|
45
|
-
): APIPromise<Customer> {
|
|
46
|
-
return this._client.patch(path`/v1/commerce/customers/${customerID}`, { body, ...options });
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Retrieves a paginated list of all customers. Customers are the billable entities
|
|
51
|
-
* in your app—typically users, organizations, or projects.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* // Automatically fetches more pages as needed.
|
|
56
|
-
* for await (const customer of client.commerce.customers.list()) {
|
|
57
|
-
* // ...
|
|
58
|
-
* }
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
list(
|
|
62
|
-
query: CustomerListParams | null | undefined = {},
|
|
63
|
-
options?: RequestOptions,
|
|
64
|
-
): PagePromise<CustomersCursorIDPage, Customer> {
|
|
65
|
-
return this._client.getAPIList('/v1/commerce/customers', CursorIDPage<Customer>, { query, ...options });
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Generates a URL to a hosted billing portal where the customer can view invoices,
|
|
70
|
-
* update payment methods, and manage billing details. Redirect the customer to the
|
|
71
|
-
* returned URL.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```ts
|
|
75
|
-
* const response =
|
|
76
|
-
* await client.commerce.customers.billingPortal(
|
|
77
|
-
* 'cus_1234567890',
|
|
78
|
-
* );
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
billingPortal(
|
|
82
|
-
customerID: string,
|
|
83
|
-
body: CustomerBillingPortalParams | null | undefined = {},
|
|
84
|
-
options?: RequestOptions,
|
|
85
|
-
): APIPromise<CustomerBillingPortalResponse> {
|
|
86
|
-
return this._client.post(path`/v1/commerce/customers/${customerID}/billing_portal`, { body, ...options });
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Retrieves a customer by ID. Returns the customer object including contact
|
|
91
|
-
* information, billing address, active subscriptions, recent invoices, and saved
|
|
92
|
-
* payment methods.
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```ts
|
|
96
|
-
* const customer = await client.commerce.customers.get(
|
|
97
|
-
* 'cus_1234567890',
|
|
98
|
-
* );
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
get(customerID: string, options?: RequestOptions): APIPromise<CustomerGetResponse> {
|
|
102
|
-
return this._client.get(path`/v1/commerce/customers/${customerID}`, options);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export type CustomersCursorIDPage = CursorIDPage<Customer>;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* A billable customer. Represents the entity in your app that will be
|
|
110
|
-
* charged—typically a user, organization, or project.
|
|
111
|
-
*/
|
|
112
|
-
export interface Customer {
|
|
113
|
-
/**
|
|
114
|
-
* Unique identifier for the customer
|
|
115
|
-
*/
|
|
116
|
-
id: string;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Timestamp when the customer was created
|
|
120
|
-
*/
|
|
121
|
-
created: string;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The customer's billing address
|
|
125
|
-
*/
|
|
126
|
-
address?: CustomerAddress | null;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* The customer's email address for receipts and notifications
|
|
130
|
-
*/
|
|
131
|
-
email?: string | null;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* The customer's full name
|
|
135
|
-
*/
|
|
136
|
-
name?: string | null;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* The customer's phone number
|
|
140
|
-
*/
|
|
141
|
-
phone?: string | null;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* The customer's billing address
|
|
146
|
-
*/
|
|
147
|
-
export interface CustomerAddress {
|
|
148
|
-
/**
|
|
149
|
-
* City name
|
|
150
|
-
*/
|
|
151
|
-
city?: string | null;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Two-letter ISO country code
|
|
155
|
-
*/
|
|
156
|
-
country?: string | null;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Street address line 1
|
|
160
|
-
*/
|
|
161
|
-
line1?: string | null;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Street address line 2 (apartment, suite, etc.)
|
|
165
|
-
*/
|
|
166
|
-
line2?: string | null;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Postal or ZIP code
|
|
170
|
-
*/
|
|
171
|
-
postal_code?: string | null;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* State, province, or region
|
|
175
|
-
*/
|
|
176
|
-
state?: string | null;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Response containing the billing portal URL
|
|
181
|
-
*/
|
|
182
|
-
export interface CustomerBillingPortalResponse {
|
|
183
|
-
/**
|
|
184
|
-
* URL to redirect the customer to for the billing portal
|
|
185
|
-
*/
|
|
186
|
-
url: string;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* A billable customer with detailed subscription, invoice, and payment method
|
|
191
|
-
* information.
|
|
192
|
-
*/
|
|
193
|
-
export interface CustomerGetResponse {
|
|
194
|
-
/**
|
|
195
|
-
* Unique identifier for the customer
|
|
196
|
-
*/
|
|
197
|
-
id: string;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Timestamp when the customer was created
|
|
201
|
-
*/
|
|
202
|
-
created: string;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* The customer's billing address
|
|
206
|
-
*/
|
|
207
|
-
address?: CustomerAddress | null;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Current customer balance in cents (negative = credit available to apply to
|
|
211
|
-
* future invoices)
|
|
212
|
-
*/
|
|
213
|
-
balance?: number;
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* The customer's email address for receipts and notifications
|
|
217
|
-
*/
|
|
218
|
-
email?: string | null;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Customer's recent invoices (up to 10)
|
|
222
|
-
*/
|
|
223
|
-
invoices?: Array<CustomerGetResponse.Invoice>;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* The customer's full name
|
|
227
|
-
*/
|
|
228
|
-
name?: string | null;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Customer's saved payment methods
|
|
232
|
-
*/
|
|
233
|
-
payment_methods?: Array<CustomerGetResponse.PaymentMethod>;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* The customer's phone number
|
|
237
|
-
*/
|
|
238
|
-
phone?: string | null;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Customer's active subscriptions
|
|
242
|
-
*/
|
|
243
|
-
subscriptions?: Array<CustomerGetResponse.Subscription>;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export namespace CustomerGetResponse {
|
|
247
|
-
/**
|
|
248
|
-
* An invoice for a customer
|
|
249
|
-
*/
|
|
250
|
-
export interface Invoice {
|
|
251
|
-
/**
|
|
252
|
-
* Unique identifier for the invoice
|
|
253
|
-
*/
|
|
254
|
-
id: string;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Total amount due in cents
|
|
258
|
-
*/
|
|
259
|
-
amount_due: number;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Amount already paid in cents
|
|
263
|
-
*/
|
|
264
|
-
amount_paid: number;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Amount remaining to be paid in cents
|
|
268
|
-
*/
|
|
269
|
-
amount_remaining: number;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Timestamp when the invoice was created
|
|
273
|
-
*/
|
|
274
|
-
created: string;
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Currency code (e.g., 'usd')
|
|
278
|
-
*/
|
|
279
|
-
currency: string;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Subtotal before tax in cents
|
|
283
|
-
*/
|
|
284
|
-
subtotal: number;
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Total amount in cents
|
|
288
|
-
*/
|
|
289
|
-
total: number;
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* When the invoice is due
|
|
293
|
-
*/
|
|
294
|
-
due_date?: string | null;
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* URL to view the invoice online
|
|
298
|
-
*/
|
|
299
|
-
hosted_invoice_url?: string | null;
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* URL to download the invoice PDF
|
|
303
|
-
*/
|
|
304
|
-
invoice_pdf?: string | null;
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Invoice number for display
|
|
308
|
-
*/
|
|
309
|
-
number?: string | null;
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* When the invoice was paid, if applicable
|
|
313
|
-
*/
|
|
314
|
-
paid_at?: string | null;
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* End of the billing period
|
|
318
|
-
*/
|
|
319
|
-
period_end?: string | null;
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Start of the billing period
|
|
323
|
-
*/
|
|
324
|
-
period_start?: string | null;
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Current status of the invoice
|
|
328
|
-
*/
|
|
329
|
-
status?: 'draft' | 'open' | 'paid' | 'void' | 'uncollectible' | null;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* A saved payment method for a customer
|
|
334
|
-
*/
|
|
335
|
-
export interface PaymentMethod {
|
|
336
|
-
/**
|
|
337
|
-
* Unique identifier for the payment method
|
|
338
|
-
*/
|
|
339
|
-
id: string;
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Timestamp when the payment method was added
|
|
343
|
-
*/
|
|
344
|
-
created: string;
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Whether this is the default payment method
|
|
348
|
-
*/
|
|
349
|
-
is_default: boolean;
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Type of payment method
|
|
353
|
-
*/
|
|
354
|
-
type: 'card' | 'us_bank_account' | 'sepa_debit' | 'link' | 'other';
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Card details, if payment method is a card
|
|
358
|
-
*/
|
|
359
|
-
card?: PaymentMethod.Card | null;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export namespace PaymentMethod {
|
|
363
|
-
/**
|
|
364
|
-
* Card details, if payment method is a card
|
|
365
|
-
*/
|
|
366
|
-
export interface Card {
|
|
367
|
-
/**
|
|
368
|
-
* Card brand (e.g., 'visa', 'mastercard')
|
|
369
|
-
*/
|
|
370
|
-
brand: string;
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Expiration month (1-12)
|
|
374
|
-
*/
|
|
375
|
-
exp_month: number;
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Expiration year (4 digits)
|
|
379
|
-
*/
|
|
380
|
-
exp_year: number;
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Last 4 digits of the card number
|
|
384
|
-
*/
|
|
385
|
-
last4: string;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* A customer subscription to a product
|
|
391
|
-
*/
|
|
392
|
-
export interface Subscription {
|
|
393
|
-
/**
|
|
394
|
-
* Unique identifier for the subscription
|
|
395
|
-
*/
|
|
396
|
-
id: string;
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Whether the subscription will cancel at period end
|
|
400
|
-
*/
|
|
401
|
-
cancel_at_period_end: boolean;
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Timestamp when the subscription was created
|
|
405
|
-
*/
|
|
406
|
-
created: string;
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* End of the current billing period
|
|
410
|
-
*/
|
|
411
|
-
current_period_end: string;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Start of the current billing period
|
|
415
|
-
*/
|
|
416
|
-
current_period_start: string;
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* The product this subscription is for
|
|
420
|
-
*/
|
|
421
|
-
product: Subscription.Product;
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* Current status of the subscription
|
|
425
|
-
*/
|
|
426
|
-
status:
|
|
427
|
-
| 'active'
|
|
428
|
-
| 'canceled'
|
|
429
|
-
| 'incomplete'
|
|
430
|
-
| 'incomplete_expired'
|
|
431
|
-
| 'past_due'
|
|
432
|
-
| 'paused'
|
|
433
|
-
| 'trialing'
|
|
434
|
-
| 'unpaid';
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* When the subscription was canceled, if applicable
|
|
438
|
-
*/
|
|
439
|
-
canceled_at?: string | null;
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* End of trial period, if applicable
|
|
443
|
-
*/
|
|
444
|
-
trial_end?: string | null;
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Start of trial period, if applicable
|
|
448
|
-
*/
|
|
449
|
-
trial_start?: string | null;
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* The variant (tier/plan) of this subscription, if applicable
|
|
453
|
-
*/
|
|
454
|
-
variant?: Subscription.Variant | null;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
export namespace Subscription {
|
|
458
|
-
/**
|
|
459
|
-
* The product this subscription is for
|
|
460
|
-
*/
|
|
461
|
-
export interface Product {
|
|
462
|
-
/**
|
|
463
|
-
* Unique identifier for the product
|
|
464
|
-
*/
|
|
465
|
-
id: string;
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Product name
|
|
469
|
-
*/
|
|
470
|
-
name: string;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/**
|
|
474
|
-
* The variant (tier/plan) of this subscription, if applicable
|
|
475
|
-
*/
|
|
476
|
-
export interface Variant {
|
|
477
|
-
/**
|
|
478
|
-
* Unique identifier for the variant
|
|
479
|
-
*/
|
|
480
|
-
id: string;
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Variant name
|
|
484
|
-
*/
|
|
485
|
-
name: string;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
export interface CustomerCreateParams {
|
|
491
|
-
/**
|
|
492
|
-
* Optional custom ID for the customer. Must start with 'cus\_'. If not provided,
|
|
493
|
-
* one will be generated.
|
|
494
|
-
*/
|
|
495
|
-
id?: string;
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* The customer's billing address
|
|
499
|
-
*/
|
|
500
|
-
address?: CustomerAddress;
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* The customer's email address for receipts and notifications
|
|
504
|
-
*/
|
|
505
|
-
email?: string;
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* The customer's full name
|
|
509
|
-
*/
|
|
510
|
-
name?: string;
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* The customer's phone number
|
|
514
|
-
*/
|
|
515
|
-
phone?: string;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
export interface CustomerUpdateParams {
|
|
519
|
-
/**
|
|
520
|
-
* The customer's billing address
|
|
521
|
-
*/
|
|
522
|
-
address?: CustomerAddress;
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* The customer's email address for receipts and notifications
|
|
526
|
-
*/
|
|
527
|
-
email?: string;
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* The customer's full name
|
|
531
|
-
*/
|
|
532
|
-
name?: string;
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* The customer's phone number
|
|
536
|
-
*/
|
|
537
|
-
phone?: string;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
export interface CustomerListParams extends CursorIDPageParams {
|
|
541
|
-
/**
|
|
542
|
-
* Filter by creation date. Accepts an object with gt, gte, lt, lte operators using
|
|
543
|
-
* Unix timestamps.
|
|
544
|
-
*/
|
|
545
|
-
created?: CustomerListParams.Created;
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* Filter by exact email address match.
|
|
549
|
-
*/
|
|
550
|
-
email?: string;
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* Search query to filter customers. Searches across name, email, and ID fields
|
|
554
|
-
* (case-insensitive).
|
|
555
|
-
*/
|
|
556
|
-
query?: string;
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* Sort order for customers. Prefix with '-' for descending order. Valid values:
|
|
560
|
-
* name, -name, email, -email, created, -created. Default: -created (newest first).
|
|
561
|
-
*/
|
|
562
|
-
sort?: string;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
export namespace CustomerListParams {
|
|
566
|
-
/**
|
|
567
|
-
* Filter by creation date. Accepts an object with gt, gte, lt, lte operators using
|
|
568
|
-
* Unix timestamps.
|
|
569
|
-
*/
|
|
570
|
-
export interface Created {
|
|
571
|
-
/**
|
|
572
|
-
* Greater than (Unix timestamp)
|
|
573
|
-
*/
|
|
574
|
-
gt?: number;
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* Greater than or equal to (Unix timestamp)
|
|
578
|
-
*/
|
|
579
|
-
gte?: number;
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Less than (Unix timestamp)
|
|
583
|
-
*/
|
|
584
|
-
lt?: number;
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Less than or equal to (Unix timestamp)
|
|
588
|
-
*/
|
|
589
|
-
lte?: number;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
export interface CustomerBillingPortalParams {
|
|
594
|
-
/**
|
|
595
|
-
* URL to redirect the customer to after they exit the billing portal
|
|
596
|
-
*/
|
|
597
|
-
return_url?: string;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
Customers.BalanceTransactions = BalanceTransactions;
|
|
601
|
-
|
|
602
|
-
export declare namespace Customers {
|
|
603
|
-
export {
|
|
604
|
-
type Customer as Customer,
|
|
605
|
-
type CustomerAddress as CustomerAddress,
|
|
606
|
-
type CustomerBillingPortalResponse as CustomerBillingPortalResponse,
|
|
607
|
-
type CustomerGetResponse as CustomerGetResponse,
|
|
608
|
-
type CustomersCursorIDPage as CustomersCursorIDPage,
|
|
609
|
-
type CustomerCreateParams as CustomerCreateParams,
|
|
610
|
-
type CustomerUpdateParams as CustomerUpdateParams,
|
|
611
|
-
type CustomerListParams as CustomerListParams,
|
|
612
|
-
type CustomerBillingPortalParams as CustomerBillingPortalParams,
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
export { BalanceTransactions as BalanceTransactions };
|
|
616
|
-
}
|