@stigg/typescript 0.1.0-beta.47 → 0.1.0-beta.49
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/package.json +1 -1
- package/resources/v1/contracts.d.mts +1618 -0
- package/resources/v1/contracts.d.mts.map +1 -0
- package/resources/v1/contracts.d.ts +1618 -0
- package/resources/v1/contracts.d.ts.map +1 -0
- package/resources/v1/contracts.js +108 -0
- package/resources/v1/contracts.js.map +1 -0
- package/resources/v1/contracts.mjs +104 -0
- package/resources/v1/contracts.mjs.map +1 -0
- package/resources/v1/customers/customers.d.mts +342 -1
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +342 -1
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +41 -0
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +41 -0
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +1 -1
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/index.d.mts +2 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +12 -0
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +12 -0
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/v1.d.mts +6 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/contracts.ts +3228 -0
- package/src/resources/v1/customers/customers.ts +573 -0
- package/src/resources/v1/customers/index.ts +5 -0
- package/src/resources/v1/index.ts +19 -0
- package/src/resources/v1/subscriptions/subscriptions.ts +15 -0
- package/src/resources/v1/v1.ts +42 -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,1618 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from "../../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
|
+
export declare class Contracts extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a contract for a customer together with all of its (custom)
|
|
8
|
+
* subscriptions in a single atomic operation. Every new subscription is created
|
|
9
|
+
* inside one transaction — any validation or creation failure rolls the whole
|
|
10
|
+
* contract back. Each subscription entry is either a new subscription to create or
|
|
11
|
+
* a reference to an existing custom subscription. Returns the created contract.
|
|
12
|
+
*/
|
|
13
|
+
create(params: ContractCreateParams, options?: RequestOptions): APIPromise<ContractCreateResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves a single contract by its ID, enriched with a preview of its upcoming
|
|
16
|
+
* (next) invoice when one is available. Returns 404 when no contract with that ID
|
|
17
|
+
* exists in the environment.
|
|
18
|
+
*/
|
|
19
|
+
retrieve(id: string, params?: ContractRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<ContractRetrieveResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Updates a contract's metadata (name, PO number, activation dates) and optionally
|
|
22
|
+
* re-links its subscriptions. Best-effort re-syncs the change to the connected
|
|
23
|
+
* billing provider.
|
|
24
|
+
*/
|
|
25
|
+
update(id: string, params: ContractUpdateParams, options?: RequestOptions): APIPromise<ContractUpdateResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves a cursor-paginated list of contracts in the environment, fetched live
|
|
28
|
+
* from the connected billing provider. Each contract is enriched with a preview of
|
|
29
|
+
* its upcoming (next) invoice when one is available. Returns an empty list when no
|
|
30
|
+
* billing provider is connected. Supports filtering by customer external ID,
|
|
31
|
+
* state, and name.
|
|
32
|
+
*/
|
|
33
|
+
list(params?: ContractListParams | null | undefined, options?: RequestOptions): PagePromise<ContractListResponsesMyCursorIDPage, ContractListResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Deletes a contract: cancels the contract in the connected billing provider and
|
|
36
|
+
* cancels every subscription linked to it.
|
|
37
|
+
*/
|
|
38
|
+
delete(id: string, params?: ContractDeleteParams | null | undefined, options?: RequestOptions): APIPromise<ContractDeleteResponse>;
|
|
39
|
+
}
|
|
40
|
+
export type ContractListResponsesMyCursorIDPage = MyCursorIDPage<ContractListResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Response object
|
|
43
|
+
*/
|
|
44
|
+
export interface ContractCreateResponse {
|
|
45
|
+
/**
|
|
46
|
+
* A billing contract as reported by the connected billing provider.
|
|
47
|
+
*/
|
|
48
|
+
data: ContractCreateResponse.Data;
|
|
49
|
+
}
|
|
50
|
+
export declare namespace ContractCreateResponse {
|
|
51
|
+
/**
|
|
52
|
+
* A billing contract as reported by the connected billing provider.
|
|
53
|
+
*/
|
|
54
|
+
interface Data {
|
|
55
|
+
/**
|
|
56
|
+
* The persisted Stigg contract id (matches a subscription’s contractId; present
|
|
57
|
+
* for Stigg-managed contracts)
|
|
58
|
+
*/
|
|
59
|
+
id: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* The date the contract activation ends
|
|
62
|
+
*/
|
|
63
|
+
activationEndDate: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* The date the contract becomes active
|
|
66
|
+
*/
|
|
67
|
+
activationStartDate: string | null;
|
|
68
|
+
/**
|
|
69
|
+
* The billing provider (Received) contract ID; null until the contract has synced
|
|
70
|
+
* to the billing provider
|
|
71
|
+
*/
|
|
72
|
+
billingId: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* The Stigg contract ref ID (the key used to fetch/update/delete this contract)
|
|
75
|
+
*/
|
|
76
|
+
contractId: string;
|
|
77
|
+
/**
|
|
78
|
+
* The date the contract was created
|
|
79
|
+
*/
|
|
80
|
+
createdAt: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* The external identifier of the customer the contract belongs to
|
|
83
|
+
*/
|
|
84
|
+
customerExternalId: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* The external identifier of the contract
|
|
87
|
+
*/
|
|
88
|
+
externalId: string;
|
|
89
|
+
/**
|
|
90
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
91
|
+
* or null when none exists
|
|
92
|
+
*/
|
|
93
|
+
latestInvoice: Data.LatestInvoice | null;
|
|
94
|
+
/**
|
|
95
|
+
* The contract name (the purchase-order number when set, otherwise the
|
|
96
|
+
* contract/customer name)
|
|
97
|
+
*/
|
|
98
|
+
name: string | null;
|
|
99
|
+
/**
|
|
100
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
101
|
+
*/
|
|
102
|
+
nextInvoice: Data.NextInvoice | null;
|
|
103
|
+
/**
|
|
104
|
+
* Purchase-order number, when set on the contract
|
|
105
|
+
*/
|
|
106
|
+
poNumber: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* The Stigg contract ref ID (present for Stigg-managed contracts; the key used to
|
|
109
|
+
* update/delete)
|
|
110
|
+
*/
|
|
111
|
+
refId: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* The current state of the contract
|
|
114
|
+
*/
|
|
115
|
+
state: 'DRAFT' | 'ACTIVE' | 'CANCELED' | 'END_BILLING';
|
|
116
|
+
/**
|
|
117
|
+
* The custom subscriptions attached to this contract (empty when none)
|
|
118
|
+
*/
|
|
119
|
+
subscriptions: Array<Data.Subscription>;
|
|
120
|
+
}
|
|
121
|
+
namespace Data {
|
|
122
|
+
/**
|
|
123
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
124
|
+
* or null when none exists
|
|
125
|
+
*/
|
|
126
|
+
interface LatestInvoice {
|
|
127
|
+
/**
|
|
128
|
+
* Invoice billing ID
|
|
129
|
+
*/
|
|
130
|
+
billingId: string;
|
|
131
|
+
/**
|
|
132
|
+
* Invoice creation date
|
|
133
|
+
*/
|
|
134
|
+
createdAt: string;
|
|
135
|
+
/**
|
|
136
|
+
* Whether payment requires action
|
|
137
|
+
*/
|
|
138
|
+
requiresAction: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Invoice status
|
|
141
|
+
*/
|
|
142
|
+
status: 'OPEN' | 'CANCELED' | 'PAID';
|
|
143
|
+
/**
|
|
144
|
+
* Amount due
|
|
145
|
+
*/
|
|
146
|
+
amountDue?: number | null;
|
|
147
|
+
/**
|
|
148
|
+
* Billing reason
|
|
149
|
+
*/
|
|
150
|
+
billingReason?: 'BILLING_CYCLE' | 'SUBSCRIPTION_CREATION' | 'SUBSCRIPTION_UPDATE' | 'MANUAL' | 'MINIMUM_INVOICE_AMOUNT_EXCEEDED' | 'OTHER' | null;
|
|
151
|
+
/**
|
|
152
|
+
* Invoice currency
|
|
153
|
+
*/
|
|
154
|
+
currency?: string | null;
|
|
155
|
+
/**
|
|
156
|
+
* Invoice PDF URL
|
|
157
|
+
*/
|
|
158
|
+
pdfUrl?: string | null;
|
|
159
|
+
/**
|
|
160
|
+
* Total amount
|
|
161
|
+
*/
|
|
162
|
+
total?: number | null;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
166
|
+
*/
|
|
167
|
+
interface NextInvoice {
|
|
168
|
+
/**
|
|
169
|
+
* The total amount of the upcoming invoice
|
|
170
|
+
*/
|
|
171
|
+
amount: NextInvoice.Amount;
|
|
172
|
+
/**
|
|
173
|
+
* The date the upcoming invoice is due
|
|
174
|
+
*/
|
|
175
|
+
dueDate: string | null;
|
|
176
|
+
/**
|
|
177
|
+
* The end of the billing period the upcoming invoice covers
|
|
178
|
+
*/
|
|
179
|
+
periodEnd: string | null;
|
|
180
|
+
/**
|
|
181
|
+
* The start of the billing period the upcoming invoice covers
|
|
182
|
+
*/
|
|
183
|
+
periodStart: string | null;
|
|
184
|
+
}
|
|
185
|
+
namespace NextInvoice {
|
|
186
|
+
/**
|
|
187
|
+
* The total amount of the upcoming invoice
|
|
188
|
+
*/
|
|
189
|
+
interface Amount {
|
|
190
|
+
/**
|
|
191
|
+
* The price amount
|
|
192
|
+
*/
|
|
193
|
+
amount: number;
|
|
194
|
+
/**
|
|
195
|
+
* ISO 4217 currency code
|
|
196
|
+
*/
|
|
197
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* A custom subscription attached to a contract.
|
|
202
|
+
*/
|
|
203
|
+
interface Subscription {
|
|
204
|
+
/**
|
|
205
|
+
* Display name of the subscription plan
|
|
206
|
+
*/
|
|
207
|
+
planDisplayName: string | null;
|
|
208
|
+
/**
|
|
209
|
+
* Display name of the product the subscription plan belongs to
|
|
210
|
+
*/
|
|
211
|
+
productDisplayName: string | null;
|
|
212
|
+
/**
|
|
213
|
+
* The subscription ref ID (use it to deep-link to the subscription)
|
|
214
|
+
*/
|
|
215
|
+
subscriptionId: string;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Response object
|
|
221
|
+
*/
|
|
222
|
+
export interface ContractRetrieveResponse {
|
|
223
|
+
/**
|
|
224
|
+
* A billing contract as reported by the connected billing provider.
|
|
225
|
+
*/
|
|
226
|
+
data: ContractRetrieveResponse.Data;
|
|
227
|
+
}
|
|
228
|
+
export declare namespace ContractRetrieveResponse {
|
|
229
|
+
/**
|
|
230
|
+
* A billing contract as reported by the connected billing provider.
|
|
231
|
+
*/
|
|
232
|
+
interface Data {
|
|
233
|
+
/**
|
|
234
|
+
* The persisted Stigg contract id (matches a subscription’s contractId; present
|
|
235
|
+
* for Stigg-managed contracts)
|
|
236
|
+
*/
|
|
237
|
+
id: string | null;
|
|
238
|
+
/**
|
|
239
|
+
* The date the contract activation ends
|
|
240
|
+
*/
|
|
241
|
+
activationEndDate: string | null;
|
|
242
|
+
/**
|
|
243
|
+
* The date the contract becomes active
|
|
244
|
+
*/
|
|
245
|
+
activationStartDate: string | null;
|
|
246
|
+
/**
|
|
247
|
+
* The billing provider (Received) contract ID; null until the contract has synced
|
|
248
|
+
* to the billing provider
|
|
249
|
+
*/
|
|
250
|
+
billingId: string | null;
|
|
251
|
+
/**
|
|
252
|
+
* The Stigg contract ref ID (the key used to fetch/update/delete this contract)
|
|
253
|
+
*/
|
|
254
|
+
contractId: string;
|
|
255
|
+
/**
|
|
256
|
+
* The date the contract was created
|
|
257
|
+
*/
|
|
258
|
+
createdAt: string | null;
|
|
259
|
+
/**
|
|
260
|
+
* The external identifier of the customer the contract belongs to
|
|
261
|
+
*/
|
|
262
|
+
customerExternalId: string | null;
|
|
263
|
+
/**
|
|
264
|
+
* The external identifier of the contract
|
|
265
|
+
*/
|
|
266
|
+
externalId: string;
|
|
267
|
+
/**
|
|
268
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
269
|
+
* or null when none exists
|
|
270
|
+
*/
|
|
271
|
+
latestInvoice: Data.LatestInvoice | null;
|
|
272
|
+
/**
|
|
273
|
+
* The contract name (the purchase-order number when set, otherwise the
|
|
274
|
+
* contract/customer name)
|
|
275
|
+
*/
|
|
276
|
+
name: string | null;
|
|
277
|
+
/**
|
|
278
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
279
|
+
*/
|
|
280
|
+
nextInvoice: Data.NextInvoice | null;
|
|
281
|
+
/**
|
|
282
|
+
* Purchase-order number, when set on the contract
|
|
283
|
+
*/
|
|
284
|
+
poNumber: string | null;
|
|
285
|
+
/**
|
|
286
|
+
* The Stigg contract ref ID (present for Stigg-managed contracts; the key used to
|
|
287
|
+
* update/delete)
|
|
288
|
+
*/
|
|
289
|
+
refId: string | null;
|
|
290
|
+
/**
|
|
291
|
+
* The current state of the contract
|
|
292
|
+
*/
|
|
293
|
+
state: 'DRAFT' | 'ACTIVE' | 'CANCELED' | 'END_BILLING';
|
|
294
|
+
/**
|
|
295
|
+
* The custom subscriptions attached to this contract (empty when none)
|
|
296
|
+
*/
|
|
297
|
+
subscriptions: Array<Data.Subscription>;
|
|
298
|
+
}
|
|
299
|
+
namespace Data {
|
|
300
|
+
/**
|
|
301
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
302
|
+
* or null when none exists
|
|
303
|
+
*/
|
|
304
|
+
interface LatestInvoice {
|
|
305
|
+
/**
|
|
306
|
+
* Invoice billing ID
|
|
307
|
+
*/
|
|
308
|
+
billingId: string;
|
|
309
|
+
/**
|
|
310
|
+
* Invoice creation date
|
|
311
|
+
*/
|
|
312
|
+
createdAt: string;
|
|
313
|
+
/**
|
|
314
|
+
* Whether payment requires action
|
|
315
|
+
*/
|
|
316
|
+
requiresAction: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Invoice status
|
|
319
|
+
*/
|
|
320
|
+
status: 'OPEN' | 'CANCELED' | 'PAID';
|
|
321
|
+
/**
|
|
322
|
+
* Amount due
|
|
323
|
+
*/
|
|
324
|
+
amountDue?: number | null;
|
|
325
|
+
/**
|
|
326
|
+
* Billing reason
|
|
327
|
+
*/
|
|
328
|
+
billingReason?: 'BILLING_CYCLE' | 'SUBSCRIPTION_CREATION' | 'SUBSCRIPTION_UPDATE' | 'MANUAL' | 'MINIMUM_INVOICE_AMOUNT_EXCEEDED' | 'OTHER' | null;
|
|
329
|
+
/**
|
|
330
|
+
* Invoice currency
|
|
331
|
+
*/
|
|
332
|
+
currency?: string | null;
|
|
333
|
+
/**
|
|
334
|
+
* Invoice PDF URL
|
|
335
|
+
*/
|
|
336
|
+
pdfUrl?: string | null;
|
|
337
|
+
/**
|
|
338
|
+
* Total amount
|
|
339
|
+
*/
|
|
340
|
+
total?: number | null;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
344
|
+
*/
|
|
345
|
+
interface NextInvoice {
|
|
346
|
+
/**
|
|
347
|
+
* The total amount of the upcoming invoice
|
|
348
|
+
*/
|
|
349
|
+
amount: NextInvoice.Amount;
|
|
350
|
+
/**
|
|
351
|
+
* The date the upcoming invoice is due
|
|
352
|
+
*/
|
|
353
|
+
dueDate: string | null;
|
|
354
|
+
/**
|
|
355
|
+
* The end of the billing period the upcoming invoice covers
|
|
356
|
+
*/
|
|
357
|
+
periodEnd: string | null;
|
|
358
|
+
/**
|
|
359
|
+
* The start of the billing period the upcoming invoice covers
|
|
360
|
+
*/
|
|
361
|
+
periodStart: string | null;
|
|
362
|
+
}
|
|
363
|
+
namespace NextInvoice {
|
|
364
|
+
/**
|
|
365
|
+
* The total amount of the upcoming invoice
|
|
366
|
+
*/
|
|
367
|
+
interface Amount {
|
|
368
|
+
/**
|
|
369
|
+
* The price amount
|
|
370
|
+
*/
|
|
371
|
+
amount: number;
|
|
372
|
+
/**
|
|
373
|
+
* ISO 4217 currency code
|
|
374
|
+
*/
|
|
375
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* A custom subscription attached to a contract.
|
|
380
|
+
*/
|
|
381
|
+
interface Subscription {
|
|
382
|
+
/**
|
|
383
|
+
* Display name of the subscription plan
|
|
384
|
+
*/
|
|
385
|
+
planDisplayName: string | null;
|
|
386
|
+
/**
|
|
387
|
+
* Display name of the product the subscription plan belongs to
|
|
388
|
+
*/
|
|
389
|
+
productDisplayName: string | null;
|
|
390
|
+
/**
|
|
391
|
+
* The subscription ref ID (use it to deep-link to the subscription)
|
|
392
|
+
*/
|
|
393
|
+
subscriptionId: string;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Response object
|
|
399
|
+
*/
|
|
400
|
+
export interface ContractUpdateResponse {
|
|
401
|
+
/**
|
|
402
|
+
* A billing contract as reported by the connected billing provider.
|
|
403
|
+
*/
|
|
404
|
+
data: ContractUpdateResponse.Data;
|
|
405
|
+
}
|
|
406
|
+
export declare namespace ContractUpdateResponse {
|
|
407
|
+
/**
|
|
408
|
+
* A billing contract as reported by the connected billing provider.
|
|
409
|
+
*/
|
|
410
|
+
interface Data {
|
|
411
|
+
/**
|
|
412
|
+
* The persisted Stigg contract id (matches a subscription’s contractId; present
|
|
413
|
+
* for Stigg-managed contracts)
|
|
414
|
+
*/
|
|
415
|
+
id: string | null;
|
|
416
|
+
/**
|
|
417
|
+
* The date the contract activation ends
|
|
418
|
+
*/
|
|
419
|
+
activationEndDate: string | null;
|
|
420
|
+
/**
|
|
421
|
+
* The date the contract becomes active
|
|
422
|
+
*/
|
|
423
|
+
activationStartDate: string | null;
|
|
424
|
+
/**
|
|
425
|
+
* The billing provider (Received) contract ID; null until the contract has synced
|
|
426
|
+
* to the billing provider
|
|
427
|
+
*/
|
|
428
|
+
billingId: string | null;
|
|
429
|
+
/**
|
|
430
|
+
* The Stigg contract ref ID (the key used to fetch/update/delete this contract)
|
|
431
|
+
*/
|
|
432
|
+
contractId: string;
|
|
433
|
+
/**
|
|
434
|
+
* The date the contract was created
|
|
435
|
+
*/
|
|
436
|
+
createdAt: string | null;
|
|
437
|
+
/**
|
|
438
|
+
* The external identifier of the customer the contract belongs to
|
|
439
|
+
*/
|
|
440
|
+
customerExternalId: string | null;
|
|
441
|
+
/**
|
|
442
|
+
* The external identifier of the contract
|
|
443
|
+
*/
|
|
444
|
+
externalId: string;
|
|
445
|
+
/**
|
|
446
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
447
|
+
* or null when none exists
|
|
448
|
+
*/
|
|
449
|
+
latestInvoice: Data.LatestInvoice | null;
|
|
450
|
+
/**
|
|
451
|
+
* The contract name (the purchase-order number when set, otherwise the
|
|
452
|
+
* contract/customer name)
|
|
453
|
+
*/
|
|
454
|
+
name: string | null;
|
|
455
|
+
/**
|
|
456
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
457
|
+
*/
|
|
458
|
+
nextInvoice: Data.NextInvoice | null;
|
|
459
|
+
/**
|
|
460
|
+
* Purchase-order number, when set on the contract
|
|
461
|
+
*/
|
|
462
|
+
poNumber: string | null;
|
|
463
|
+
/**
|
|
464
|
+
* The Stigg contract ref ID (present for Stigg-managed contracts; the key used to
|
|
465
|
+
* update/delete)
|
|
466
|
+
*/
|
|
467
|
+
refId: string | null;
|
|
468
|
+
/**
|
|
469
|
+
* The current state of the contract
|
|
470
|
+
*/
|
|
471
|
+
state: 'DRAFT' | 'ACTIVE' | 'CANCELED' | 'END_BILLING';
|
|
472
|
+
/**
|
|
473
|
+
* The custom subscriptions attached to this contract (empty when none)
|
|
474
|
+
*/
|
|
475
|
+
subscriptions: Array<Data.Subscription>;
|
|
476
|
+
}
|
|
477
|
+
namespace Data {
|
|
478
|
+
/**
|
|
479
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
480
|
+
* or null when none exists
|
|
481
|
+
*/
|
|
482
|
+
interface LatestInvoice {
|
|
483
|
+
/**
|
|
484
|
+
* Invoice billing ID
|
|
485
|
+
*/
|
|
486
|
+
billingId: string;
|
|
487
|
+
/**
|
|
488
|
+
* Invoice creation date
|
|
489
|
+
*/
|
|
490
|
+
createdAt: string;
|
|
491
|
+
/**
|
|
492
|
+
* Whether payment requires action
|
|
493
|
+
*/
|
|
494
|
+
requiresAction: boolean;
|
|
495
|
+
/**
|
|
496
|
+
* Invoice status
|
|
497
|
+
*/
|
|
498
|
+
status: 'OPEN' | 'CANCELED' | 'PAID';
|
|
499
|
+
/**
|
|
500
|
+
* Amount due
|
|
501
|
+
*/
|
|
502
|
+
amountDue?: number | null;
|
|
503
|
+
/**
|
|
504
|
+
* Billing reason
|
|
505
|
+
*/
|
|
506
|
+
billingReason?: 'BILLING_CYCLE' | 'SUBSCRIPTION_CREATION' | 'SUBSCRIPTION_UPDATE' | 'MANUAL' | 'MINIMUM_INVOICE_AMOUNT_EXCEEDED' | 'OTHER' | null;
|
|
507
|
+
/**
|
|
508
|
+
* Invoice currency
|
|
509
|
+
*/
|
|
510
|
+
currency?: string | null;
|
|
511
|
+
/**
|
|
512
|
+
* Invoice PDF URL
|
|
513
|
+
*/
|
|
514
|
+
pdfUrl?: string | null;
|
|
515
|
+
/**
|
|
516
|
+
* Total amount
|
|
517
|
+
*/
|
|
518
|
+
total?: number | null;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
522
|
+
*/
|
|
523
|
+
interface NextInvoice {
|
|
524
|
+
/**
|
|
525
|
+
* The total amount of the upcoming invoice
|
|
526
|
+
*/
|
|
527
|
+
amount: NextInvoice.Amount;
|
|
528
|
+
/**
|
|
529
|
+
* The date the upcoming invoice is due
|
|
530
|
+
*/
|
|
531
|
+
dueDate: string | null;
|
|
532
|
+
/**
|
|
533
|
+
* The end of the billing period the upcoming invoice covers
|
|
534
|
+
*/
|
|
535
|
+
periodEnd: string | null;
|
|
536
|
+
/**
|
|
537
|
+
* The start of the billing period the upcoming invoice covers
|
|
538
|
+
*/
|
|
539
|
+
periodStart: string | null;
|
|
540
|
+
}
|
|
541
|
+
namespace NextInvoice {
|
|
542
|
+
/**
|
|
543
|
+
* The total amount of the upcoming invoice
|
|
544
|
+
*/
|
|
545
|
+
interface Amount {
|
|
546
|
+
/**
|
|
547
|
+
* The price amount
|
|
548
|
+
*/
|
|
549
|
+
amount: number;
|
|
550
|
+
/**
|
|
551
|
+
* ISO 4217 currency code
|
|
552
|
+
*/
|
|
553
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* A custom subscription attached to a contract.
|
|
558
|
+
*/
|
|
559
|
+
interface Subscription {
|
|
560
|
+
/**
|
|
561
|
+
* Display name of the subscription plan
|
|
562
|
+
*/
|
|
563
|
+
planDisplayName: string | null;
|
|
564
|
+
/**
|
|
565
|
+
* Display name of the product the subscription plan belongs to
|
|
566
|
+
*/
|
|
567
|
+
productDisplayName: string | null;
|
|
568
|
+
/**
|
|
569
|
+
* The subscription ref ID (use it to deep-link to the subscription)
|
|
570
|
+
*/
|
|
571
|
+
subscriptionId: string;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* A billing contract as reported by the connected billing provider.
|
|
577
|
+
*/
|
|
578
|
+
export interface ContractListResponse {
|
|
579
|
+
/**
|
|
580
|
+
* The persisted Stigg contract id (matches a subscription’s contractId; present
|
|
581
|
+
* for Stigg-managed contracts)
|
|
582
|
+
*/
|
|
583
|
+
id: string | null;
|
|
584
|
+
/**
|
|
585
|
+
* The date the contract activation ends
|
|
586
|
+
*/
|
|
587
|
+
activationEndDate: string | null;
|
|
588
|
+
/**
|
|
589
|
+
* The date the contract becomes active
|
|
590
|
+
*/
|
|
591
|
+
activationStartDate: string | null;
|
|
592
|
+
/**
|
|
593
|
+
* The billing provider (Received) contract ID; null until the contract has synced
|
|
594
|
+
* to the billing provider
|
|
595
|
+
*/
|
|
596
|
+
billingId: string | null;
|
|
597
|
+
/**
|
|
598
|
+
* The Stigg contract ref ID (the key used to fetch/update/delete this contract)
|
|
599
|
+
*/
|
|
600
|
+
contractId: string;
|
|
601
|
+
/**
|
|
602
|
+
* The date the contract was created
|
|
603
|
+
*/
|
|
604
|
+
createdAt: string | null;
|
|
605
|
+
/**
|
|
606
|
+
* The external identifier of the customer the contract belongs to
|
|
607
|
+
*/
|
|
608
|
+
customerExternalId: string | null;
|
|
609
|
+
/**
|
|
610
|
+
* The external identifier of the contract
|
|
611
|
+
*/
|
|
612
|
+
externalId: string;
|
|
613
|
+
/**
|
|
614
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
615
|
+
* or null when none exists
|
|
616
|
+
*/
|
|
617
|
+
latestInvoice: ContractListResponse.LatestInvoice | null;
|
|
618
|
+
/**
|
|
619
|
+
* The contract name (the purchase-order number when set, otherwise the
|
|
620
|
+
* contract/customer name)
|
|
621
|
+
*/
|
|
622
|
+
name: string | null;
|
|
623
|
+
/**
|
|
624
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
625
|
+
*/
|
|
626
|
+
nextInvoice: ContractListResponse.NextInvoice | null;
|
|
627
|
+
/**
|
|
628
|
+
* Purchase-order number, when set on the contract
|
|
629
|
+
*/
|
|
630
|
+
poNumber: string | null;
|
|
631
|
+
/**
|
|
632
|
+
* The Stigg contract ref ID (present for Stigg-managed contracts; the key used to
|
|
633
|
+
* update/delete)
|
|
634
|
+
*/
|
|
635
|
+
refId: string | null;
|
|
636
|
+
/**
|
|
637
|
+
* The current state of the contract
|
|
638
|
+
*/
|
|
639
|
+
state: 'DRAFT' | 'ACTIVE' | 'CANCELED' | 'END_BILLING';
|
|
640
|
+
/**
|
|
641
|
+
* The custom subscriptions attached to this contract (empty when none)
|
|
642
|
+
*/
|
|
643
|
+
subscriptions: Array<ContractListResponse.Subscription>;
|
|
644
|
+
}
|
|
645
|
+
export declare namespace ContractListResponse {
|
|
646
|
+
/**
|
|
647
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
648
|
+
* or null when none exists
|
|
649
|
+
*/
|
|
650
|
+
interface LatestInvoice {
|
|
651
|
+
/**
|
|
652
|
+
* Invoice billing ID
|
|
653
|
+
*/
|
|
654
|
+
billingId: string;
|
|
655
|
+
/**
|
|
656
|
+
* Invoice creation date
|
|
657
|
+
*/
|
|
658
|
+
createdAt: string;
|
|
659
|
+
/**
|
|
660
|
+
* Whether payment requires action
|
|
661
|
+
*/
|
|
662
|
+
requiresAction: boolean;
|
|
663
|
+
/**
|
|
664
|
+
* Invoice status
|
|
665
|
+
*/
|
|
666
|
+
status: 'OPEN' | 'CANCELED' | 'PAID';
|
|
667
|
+
/**
|
|
668
|
+
* Amount due
|
|
669
|
+
*/
|
|
670
|
+
amountDue?: number | null;
|
|
671
|
+
/**
|
|
672
|
+
* Billing reason
|
|
673
|
+
*/
|
|
674
|
+
billingReason?: 'BILLING_CYCLE' | 'SUBSCRIPTION_CREATION' | 'SUBSCRIPTION_UPDATE' | 'MANUAL' | 'MINIMUM_INVOICE_AMOUNT_EXCEEDED' | 'OTHER' | null;
|
|
675
|
+
/**
|
|
676
|
+
* Invoice currency
|
|
677
|
+
*/
|
|
678
|
+
currency?: string | null;
|
|
679
|
+
/**
|
|
680
|
+
* Invoice PDF URL
|
|
681
|
+
*/
|
|
682
|
+
pdfUrl?: string | null;
|
|
683
|
+
/**
|
|
684
|
+
* Total amount
|
|
685
|
+
*/
|
|
686
|
+
total?: number | null;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
690
|
+
*/
|
|
691
|
+
interface NextInvoice {
|
|
692
|
+
/**
|
|
693
|
+
* The total amount of the upcoming invoice
|
|
694
|
+
*/
|
|
695
|
+
amount: NextInvoice.Amount;
|
|
696
|
+
/**
|
|
697
|
+
* The date the upcoming invoice is due
|
|
698
|
+
*/
|
|
699
|
+
dueDate: string | null;
|
|
700
|
+
/**
|
|
701
|
+
* The end of the billing period the upcoming invoice covers
|
|
702
|
+
*/
|
|
703
|
+
periodEnd: string | null;
|
|
704
|
+
/**
|
|
705
|
+
* The start of the billing period the upcoming invoice covers
|
|
706
|
+
*/
|
|
707
|
+
periodStart: string | null;
|
|
708
|
+
}
|
|
709
|
+
namespace NextInvoice {
|
|
710
|
+
/**
|
|
711
|
+
* The total amount of the upcoming invoice
|
|
712
|
+
*/
|
|
713
|
+
interface Amount {
|
|
714
|
+
/**
|
|
715
|
+
* The price amount
|
|
716
|
+
*/
|
|
717
|
+
amount: number;
|
|
718
|
+
/**
|
|
719
|
+
* ISO 4217 currency code
|
|
720
|
+
*/
|
|
721
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* A custom subscription attached to a contract.
|
|
726
|
+
*/
|
|
727
|
+
interface Subscription {
|
|
728
|
+
/**
|
|
729
|
+
* Display name of the subscription plan
|
|
730
|
+
*/
|
|
731
|
+
planDisplayName: string | null;
|
|
732
|
+
/**
|
|
733
|
+
* Display name of the product the subscription plan belongs to
|
|
734
|
+
*/
|
|
735
|
+
productDisplayName: string | null;
|
|
736
|
+
/**
|
|
737
|
+
* The subscription ref ID (use it to deep-link to the subscription)
|
|
738
|
+
*/
|
|
739
|
+
subscriptionId: string;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Response object
|
|
744
|
+
*/
|
|
745
|
+
export interface ContractDeleteResponse {
|
|
746
|
+
/**
|
|
747
|
+
* A billing contract as reported by the connected billing provider.
|
|
748
|
+
*/
|
|
749
|
+
data: ContractDeleteResponse.Data;
|
|
750
|
+
}
|
|
751
|
+
export declare namespace ContractDeleteResponse {
|
|
752
|
+
/**
|
|
753
|
+
* A billing contract as reported by the connected billing provider.
|
|
754
|
+
*/
|
|
755
|
+
interface Data {
|
|
756
|
+
/**
|
|
757
|
+
* The persisted Stigg contract id (matches a subscription’s contractId; present
|
|
758
|
+
* for Stigg-managed contracts)
|
|
759
|
+
*/
|
|
760
|
+
id: string | null;
|
|
761
|
+
/**
|
|
762
|
+
* The date the contract activation ends
|
|
763
|
+
*/
|
|
764
|
+
activationEndDate: string | null;
|
|
765
|
+
/**
|
|
766
|
+
* The date the contract becomes active
|
|
767
|
+
*/
|
|
768
|
+
activationStartDate: string | null;
|
|
769
|
+
/**
|
|
770
|
+
* The billing provider (Received) contract ID; null until the contract has synced
|
|
771
|
+
* to the billing provider
|
|
772
|
+
*/
|
|
773
|
+
billingId: string | null;
|
|
774
|
+
/**
|
|
775
|
+
* The Stigg contract ref ID (the key used to fetch/update/delete this contract)
|
|
776
|
+
*/
|
|
777
|
+
contractId: string;
|
|
778
|
+
/**
|
|
779
|
+
* The date the contract was created
|
|
780
|
+
*/
|
|
781
|
+
createdAt: string | null;
|
|
782
|
+
/**
|
|
783
|
+
* The external identifier of the customer the contract belongs to
|
|
784
|
+
*/
|
|
785
|
+
customerExternalId: string | null;
|
|
786
|
+
/**
|
|
787
|
+
* The external identifier of the contract
|
|
788
|
+
*/
|
|
789
|
+
externalId: string;
|
|
790
|
+
/**
|
|
791
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
792
|
+
* or null when none exists
|
|
793
|
+
*/
|
|
794
|
+
latestInvoice: Data.LatestInvoice | null;
|
|
795
|
+
/**
|
|
796
|
+
* The contract name (the purchase-order number when set, otherwise the
|
|
797
|
+
* contract/customer name)
|
|
798
|
+
*/
|
|
799
|
+
name: string | null;
|
|
800
|
+
/**
|
|
801
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
802
|
+
*/
|
|
803
|
+
nextInvoice: Data.NextInvoice | null;
|
|
804
|
+
/**
|
|
805
|
+
* Purchase-order number, when set on the contract
|
|
806
|
+
*/
|
|
807
|
+
poNumber: string | null;
|
|
808
|
+
/**
|
|
809
|
+
* The Stigg contract ref ID (present for Stigg-managed contracts; the key used to
|
|
810
|
+
* update/delete)
|
|
811
|
+
*/
|
|
812
|
+
refId: string | null;
|
|
813
|
+
/**
|
|
814
|
+
* The current state of the contract
|
|
815
|
+
*/
|
|
816
|
+
state: 'DRAFT' | 'ACTIVE' | 'CANCELED' | 'END_BILLING';
|
|
817
|
+
/**
|
|
818
|
+
* The custom subscriptions attached to this contract (empty when none)
|
|
819
|
+
*/
|
|
820
|
+
subscriptions: Array<Data.Subscription>;
|
|
821
|
+
}
|
|
822
|
+
namespace Data {
|
|
823
|
+
/**
|
|
824
|
+
* The most recent non-draft invoice for this contract (open, paid, or canceled),
|
|
825
|
+
* or null when none exists
|
|
826
|
+
*/
|
|
827
|
+
interface LatestInvoice {
|
|
828
|
+
/**
|
|
829
|
+
* Invoice billing ID
|
|
830
|
+
*/
|
|
831
|
+
billingId: string;
|
|
832
|
+
/**
|
|
833
|
+
* Invoice creation date
|
|
834
|
+
*/
|
|
835
|
+
createdAt: string;
|
|
836
|
+
/**
|
|
837
|
+
* Whether payment requires action
|
|
838
|
+
*/
|
|
839
|
+
requiresAction: boolean;
|
|
840
|
+
/**
|
|
841
|
+
* Invoice status
|
|
842
|
+
*/
|
|
843
|
+
status: 'OPEN' | 'CANCELED' | 'PAID';
|
|
844
|
+
/**
|
|
845
|
+
* Amount due
|
|
846
|
+
*/
|
|
847
|
+
amountDue?: number | null;
|
|
848
|
+
/**
|
|
849
|
+
* Billing reason
|
|
850
|
+
*/
|
|
851
|
+
billingReason?: 'BILLING_CYCLE' | 'SUBSCRIPTION_CREATION' | 'SUBSCRIPTION_UPDATE' | 'MANUAL' | 'MINIMUM_INVOICE_AMOUNT_EXCEEDED' | 'OTHER' | null;
|
|
852
|
+
/**
|
|
853
|
+
* Invoice currency
|
|
854
|
+
*/
|
|
855
|
+
currency?: string | null;
|
|
856
|
+
/**
|
|
857
|
+
* Invoice PDF URL
|
|
858
|
+
*/
|
|
859
|
+
pdfUrl?: string | null;
|
|
860
|
+
/**
|
|
861
|
+
* Total amount
|
|
862
|
+
*/
|
|
863
|
+
total?: number | null;
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* A preview of the contract's upcoming invoice, or null when none is available
|
|
867
|
+
*/
|
|
868
|
+
interface NextInvoice {
|
|
869
|
+
/**
|
|
870
|
+
* The total amount of the upcoming invoice
|
|
871
|
+
*/
|
|
872
|
+
amount: NextInvoice.Amount;
|
|
873
|
+
/**
|
|
874
|
+
* The date the upcoming invoice is due
|
|
875
|
+
*/
|
|
876
|
+
dueDate: string | null;
|
|
877
|
+
/**
|
|
878
|
+
* The end of the billing period the upcoming invoice covers
|
|
879
|
+
*/
|
|
880
|
+
periodEnd: string | null;
|
|
881
|
+
/**
|
|
882
|
+
* The start of the billing period the upcoming invoice covers
|
|
883
|
+
*/
|
|
884
|
+
periodStart: string | null;
|
|
885
|
+
}
|
|
886
|
+
namespace NextInvoice {
|
|
887
|
+
/**
|
|
888
|
+
* The total amount of the upcoming invoice
|
|
889
|
+
*/
|
|
890
|
+
interface Amount {
|
|
891
|
+
/**
|
|
892
|
+
* The price amount
|
|
893
|
+
*/
|
|
894
|
+
amount: number;
|
|
895
|
+
/**
|
|
896
|
+
* ISO 4217 currency code
|
|
897
|
+
*/
|
|
898
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* A custom subscription attached to a contract.
|
|
903
|
+
*/
|
|
904
|
+
interface Subscription {
|
|
905
|
+
/**
|
|
906
|
+
* Display name of the subscription plan
|
|
907
|
+
*/
|
|
908
|
+
planDisplayName: string | null;
|
|
909
|
+
/**
|
|
910
|
+
* Display name of the product the subscription plan belongs to
|
|
911
|
+
*/
|
|
912
|
+
productDisplayName: string | null;
|
|
913
|
+
/**
|
|
914
|
+
* The subscription ref ID (use it to deep-link to the subscription)
|
|
915
|
+
*/
|
|
916
|
+
subscriptionId: string;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
export interface ContractCreateParams {
|
|
921
|
+
/**
|
|
922
|
+
* Body param: The customer ref ID the contract belongs to
|
|
923
|
+
*/
|
|
924
|
+
customerId: string;
|
|
925
|
+
/**
|
|
926
|
+
* Body param: The subscriptions to attach to the contract (must be non-empty).
|
|
927
|
+
* Each entry is either a new subscription to create or a reference to an existing
|
|
928
|
+
* custom subscription.
|
|
929
|
+
*/
|
|
930
|
+
subscriptions: Array<ContractCreateParams.Subscription>;
|
|
931
|
+
/**
|
|
932
|
+
* Body param: Optional contract activation end date
|
|
933
|
+
*/
|
|
934
|
+
activationEndDate?: string;
|
|
935
|
+
/**
|
|
936
|
+
* Body param: Optional contract activation start date
|
|
937
|
+
*/
|
|
938
|
+
activationStartDate?: string;
|
|
939
|
+
/**
|
|
940
|
+
* Body param: Optional contract name
|
|
941
|
+
*/
|
|
942
|
+
name?: string | null;
|
|
943
|
+
/**
|
|
944
|
+
* Body param: Optional purchase-order number
|
|
945
|
+
*/
|
|
946
|
+
poNumber?: string | null;
|
|
947
|
+
/**
|
|
948
|
+
* Body param: Whether to set up billing for the contract by creating a billing
|
|
949
|
+
* contract in the connected billing provider. When false, the contract only
|
|
950
|
+
* provisions access (grants entitlements) and no billing contract is created.
|
|
951
|
+
* Defaults to true.
|
|
952
|
+
*/
|
|
953
|
+
setupBilling?: boolean;
|
|
954
|
+
/**
|
|
955
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
956
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
957
|
+
*/
|
|
958
|
+
'X-ACCOUNT-ID'?: string;
|
|
959
|
+
/**
|
|
960
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
961
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
962
|
+
* intrinsic to the key).
|
|
963
|
+
*/
|
|
964
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
965
|
+
}
|
|
966
|
+
export declare namespace ContractCreateParams {
|
|
967
|
+
/**
|
|
968
|
+
* A single subscription on a contract: exactly one of newSubscription or
|
|
969
|
+
* existingSubscriptionId must be set.
|
|
970
|
+
*/
|
|
971
|
+
interface Subscription {
|
|
972
|
+
/**
|
|
973
|
+
* The subscription ref ID of an already-created custom subscription to link
|
|
974
|
+
*/
|
|
975
|
+
existingSubscriptionId?: string;
|
|
976
|
+
/**
|
|
977
|
+
* A new subscription to create, using the same body the provision-subscription
|
|
978
|
+
* endpoint accepts
|
|
979
|
+
*/
|
|
980
|
+
newSubscription?: Subscription.NewSubscription;
|
|
981
|
+
}
|
|
982
|
+
namespace Subscription {
|
|
983
|
+
/**
|
|
984
|
+
* A new subscription to create, using the same body the provision-subscription
|
|
985
|
+
* endpoint accepts
|
|
986
|
+
*/
|
|
987
|
+
interface NewSubscription {
|
|
988
|
+
/**
|
|
989
|
+
* Customer ID to provision the subscription for
|
|
990
|
+
*/
|
|
991
|
+
customerId: string;
|
|
992
|
+
/**
|
|
993
|
+
* Plan ID to provision
|
|
994
|
+
*/
|
|
995
|
+
planId: string;
|
|
996
|
+
/**
|
|
997
|
+
* Unique identifier for the subscription
|
|
998
|
+
*/
|
|
999
|
+
id?: string;
|
|
1000
|
+
addons?: Array<NewSubscription.Addon>;
|
|
1001
|
+
/**
|
|
1002
|
+
* Coupon configuration
|
|
1003
|
+
*/
|
|
1004
|
+
appliedCoupon?: NewSubscription.AppliedCoupon;
|
|
1005
|
+
/**
|
|
1006
|
+
* Whether to wait for payment confirmation before returning the subscription
|
|
1007
|
+
*/
|
|
1008
|
+
awaitPaymentConfirmation?: boolean;
|
|
1009
|
+
/**
|
|
1010
|
+
* The ISO 3166-1 alpha-2 country code for billing
|
|
1011
|
+
*/
|
|
1012
|
+
billingCountryCode?: string | null;
|
|
1013
|
+
/**
|
|
1014
|
+
* Billing cycle anchor behavior for the subscription
|
|
1015
|
+
*/
|
|
1016
|
+
billingCycleAnchor?: 'UNCHANGED' | 'NOW';
|
|
1017
|
+
/**
|
|
1018
|
+
* External billing system identifier
|
|
1019
|
+
*/
|
|
1020
|
+
billingId?: string | null;
|
|
1021
|
+
billingInformation?: NewSubscription.BillingInformation;
|
|
1022
|
+
/**
|
|
1023
|
+
* Billing period (MONTHLY or ANNUALLY)
|
|
1024
|
+
*/
|
|
1025
|
+
billingPeriod?: 'MONTHLY' | 'ANNUALLY';
|
|
1026
|
+
budget?: NewSubscription.Budget | null;
|
|
1027
|
+
/**
|
|
1028
|
+
* Subscription cancellation date
|
|
1029
|
+
*/
|
|
1030
|
+
cancellationDate?: string;
|
|
1031
|
+
charges?: Array<NewSubscription.Charge>;
|
|
1032
|
+
/**
|
|
1033
|
+
* Checkout page configuration for payment collection
|
|
1034
|
+
*/
|
|
1035
|
+
checkoutOptions?: NewSubscription.CheckoutOptions;
|
|
1036
|
+
entitlements?: Array<NewSubscription.Feature | NewSubscription.Credit>;
|
|
1037
|
+
/**
|
|
1038
|
+
* Additional metadata for the subscription
|
|
1039
|
+
*/
|
|
1040
|
+
metadata?: {
|
|
1041
|
+
[key: string]: string;
|
|
1042
|
+
};
|
|
1043
|
+
/**
|
|
1044
|
+
* Minimum spend amount
|
|
1045
|
+
*/
|
|
1046
|
+
minimumSpend?: NewSubscription.MinimumSpend | null;
|
|
1047
|
+
/**
|
|
1048
|
+
* Optional paying customer ID for split billing scenarios
|
|
1049
|
+
*/
|
|
1050
|
+
payingCustomerId?: string | null;
|
|
1051
|
+
/**
|
|
1052
|
+
* How payments should be collected for this subscription
|
|
1053
|
+
*/
|
|
1054
|
+
paymentCollectionMethod?: 'CHARGE' | 'INVOICE' | 'NONE';
|
|
1055
|
+
priceOverrides?: Array<NewSubscription.PriceOverride>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Optional resource ID for multi-instance subscriptions
|
|
1058
|
+
*/
|
|
1059
|
+
resourceId?: string | null;
|
|
1060
|
+
/**
|
|
1061
|
+
* Salesforce ID
|
|
1062
|
+
*/
|
|
1063
|
+
salesforceId?: string | null;
|
|
1064
|
+
/**
|
|
1065
|
+
* Strategy for scheduling subscription changes
|
|
1066
|
+
*/
|
|
1067
|
+
scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
|
|
1068
|
+
/**
|
|
1069
|
+
* Subscription start date
|
|
1070
|
+
*/
|
|
1071
|
+
startDate?: string;
|
|
1072
|
+
/**
|
|
1073
|
+
* Trial period override settings
|
|
1074
|
+
*/
|
|
1075
|
+
trialOverrideConfiguration?: NewSubscription.TrialOverrideConfiguration;
|
|
1076
|
+
/**
|
|
1077
|
+
* Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).
|
|
1078
|
+
*/
|
|
1079
|
+
unitQuantity?: number;
|
|
1080
|
+
}
|
|
1081
|
+
namespace NewSubscription {
|
|
1082
|
+
/**
|
|
1083
|
+
* Addon configuration
|
|
1084
|
+
*/
|
|
1085
|
+
interface Addon {
|
|
1086
|
+
/**
|
|
1087
|
+
* Addon ID
|
|
1088
|
+
*/
|
|
1089
|
+
id: string;
|
|
1090
|
+
/**
|
|
1091
|
+
* Number of addon instances
|
|
1092
|
+
*/
|
|
1093
|
+
quantity: number;
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Coupon configuration
|
|
1097
|
+
*/
|
|
1098
|
+
interface AppliedCoupon {
|
|
1099
|
+
/**
|
|
1100
|
+
* Billing provider coupon ID
|
|
1101
|
+
*/
|
|
1102
|
+
billingCouponId?: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* Coupon timing configuration
|
|
1105
|
+
*/
|
|
1106
|
+
configuration?: AppliedCoupon.Configuration;
|
|
1107
|
+
/**
|
|
1108
|
+
* Stigg coupon ID
|
|
1109
|
+
*/
|
|
1110
|
+
couponId?: string;
|
|
1111
|
+
/**
|
|
1112
|
+
* Ad-hoc discount configuration
|
|
1113
|
+
*/
|
|
1114
|
+
discount?: AppliedCoupon.Discount;
|
|
1115
|
+
/**
|
|
1116
|
+
* Promotion code to apply
|
|
1117
|
+
*/
|
|
1118
|
+
promotionCode?: string;
|
|
1119
|
+
}
|
|
1120
|
+
namespace AppliedCoupon {
|
|
1121
|
+
/**
|
|
1122
|
+
* Coupon timing configuration
|
|
1123
|
+
*/
|
|
1124
|
+
interface Configuration {
|
|
1125
|
+
/**
|
|
1126
|
+
* Coupon start date
|
|
1127
|
+
*/
|
|
1128
|
+
startDate?: string;
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* Ad-hoc discount configuration
|
|
1132
|
+
*/
|
|
1133
|
+
interface Discount {
|
|
1134
|
+
/**
|
|
1135
|
+
* Fixed amounts off by currency
|
|
1136
|
+
*/
|
|
1137
|
+
amountsOff?: Array<Discount.AmountsOff> | null;
|
|
1138
|
+
/**
|
|
1139
|
+
* Ad-hoc discount
|
|
1140
|
+
*/
|
|
1141
|
+
description?: string;
|
|
1142
|
+
/**
|
|
1143
|
+
* Duration in months
|
|
1144
|
+
*/
|
|
1145
|
+
durationInMonths?: number;
|
|
1146
|
+
/**
|
|
1147
|
+
* Discount name
|
|
1148
|
+
*/
|
|
1149
|
+
name?: string;
|
|
1150
|
+
/**
|
|
1151
|
+
* Percentage discount
|
|
1152
|
+
*/
|
|
1153
|
+
percentOff?: number;
|
|
1154
|
+
}
|
|
1155
|
+
namespace Discount {
|
|
1156
|
+
interface AmountsOff {
|
|
1157
|
+
/**
|
|
1158
|
+
* The price amount
|
|
1159
|
+
*/
|
|
1160
|
+
amount: number;
|
|
1161
|
+
/**
|
|
1162
|
+
* ISO 4217 currency code
|
|
1163
|
+
*/
|
|
1164
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
interface BillingInformation {
|
|
1169
|
+
/**
|
|
1170
|
+
* Billing address for the subscription
|
|
1171
|
+
*/
|
|
1172
|
+
billingAddress?: BillingInformation.BillingAddress;
|
|
1173
|
+
/**
|
|
1174
|
+
* Stripe Connect account to charge on behalf of
|
|
1175
|
+
*/
|
|
1176
|
+
chargeOnBehalfOfAccount?: string | null;
|
|
1177
|
+
/**
|
|
1178
|
+
* Billing integration identifier
|
|
1179
|
+
*/
|
|
1180
|
+
integrationId?: string | null;
|
|
1181
|
+
/**
|
|
1182
|
+
* Number of days until invoice is due
|
|
1183
|
+
*/
|
|
1184
|
+
invoiceDaysUntilDue?: number;
|
|
1185
|
+
/**
|
|
1186
|
+
* Whether the subscription is backdated
|
|
1187
|
+
*/
|
|
1188
|
+
isBackdated?: boolean;
|
|
1189
|
+
/**
|
|
1190
|
+
* Whether the invoice is marked as paid
|
|
1191
|
+
*/
|
|
1192
|
+
isInvoicePaid?: boolean;
|
|
1193
|
+
/**
|
|
1194
|
+
* Additional metadata for the subscription
|
|
1195
|
+
*/
|
|
1196
|
+
metadata?: {
|
|
1197
|
+
[key: string]: string;
|
|
1198
|
+
};
|
|
1199
|
+
/**
|
|
1200
|
+
* How to handle proration for billing changes
|
|
1201
|
+
*/
|
|
1202
|
+
prorationBehavior?: 'INVOICE_IMMEDIATELY' | 'CREATE_PRORATIONS' | 'NONE';
|
|
1203
|
+
/**
|
|
1204
|
+
* Customer tax identification numbers
|
|
1205
|
+
*/
|
|
1206
|
+
taxIds?: Array<BillingInformation.TaxID>;
|
|
1207
|
+
/**
|
|
1208
|
+
* Tax percentage (0-100)
|
|
1209
|
+
*/
|
|
1210
|
+
taxPercentage?: number;
|
|
1211
|
+
/**
|
|
1212
|
+
* Tax rate identifiers to apply
|
|
1213
|
+
*/
|
|
1214
|
+
taxRateIds?: Array<string>;
|
|
1215
|
+
}
|
|
1216
|
+
namespace BillingInformation {
|
|
1217
|
+
/**
|
|
1218
|
+
* Billing address for the subscription
|
|
1219
|
+
*/
|
|
1220
|
+
interface BillingAddress {
|
|
1221
|
+
city?: string;
|
|
1222
|
+
country?: string;
|
|
1223
|
+
line1?: string;
|
|
1224
|
+
line2?: string;
|
|
1225
|
+
postalCode?: string;
|
|
1226
|
+
state?: string;
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Tax identifier with type and value for customer tax exemptions.
|
|
1230
|
+
*/
|
|
1231
|
+
interface TaxID {
|
|
1232
|
+
/**
|
|
1233
|
+
* The type of tax exemption identifier, such as VAT.
|
|
1234
|
+
*/
|
|
1235
|
+
type: string;
|
|
1236
|
+
/**
|
|
1237
|
+
* The actual tax identifier value
|
|
1238
|
+
*/
|
|
1239
|
+
value: string;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
interface Budget {
|
|
1243
|
+
/**
|
|
1244
|
+
* Whether the budget is a soft limit
|
|
1245
|
+
*/
|
|
1246
|
+
hasSoftLimit: boolean;
|
|
1247
|
+
/**
|
|
1248
|
+
* Maximum spending limit
|
|
1249
|
+
*/
|
|
1250
|
+
limit: number;
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* A charge selection for a subscription (references a catalog charge with a
|
|
1254
|
+
* quantity).
|
|
1255
|
+
*/
|
|
1256
|
+
interface Charge {
|
|
1257
|
+
/**
|
|
1258
|
+
* Charge ID
|
|
1259
|
+
*/
|
|
1260
|
+
id: string;
|
|
1261
|
+
/**
|
|
1262
|
+
* Charge quantity. Minimum is 0 (zero is allowed).
|
|
1263
|
+
*/
|
|
1264
|
+
quantity: number;
|
|
1265
|
+
/**
|
|
1266
|
+
* Charge type
|
|
1267
|
+
*/
|
|
1268
|
+
type: 'FEATURE' | 'CREDIT';
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Checkout page configuration for payment collection
|
|
1272
|
+
*/
|
|
1273
|
+
interface CheckoutOptions {
|
|
1274
|
+
/**
|
|
1275
|
+
* URL to redirect to if checkout is canceled
|
|
1276
|
+
*/
|
|
1277
|
+
cancelUrl: string;
|
|
1278
|
+
/**
|
|
1279
|
+
* URL to redirect to after successful checkout
|
|
1280
|
+
*/
|
|
1281
|
+
successUrl: string;
|
|
1282
|
+
/**
|
|
1283
|
+
* Allow promotional codes during checkout
|
|
1284
|
+
*/
|
|
1285
|
+
allowPromoCodes?: boolean;
|
|
1286
|
+
/**
|
|
1287
|
+
* Allow tax ID collection during checkout
|
|
1288
|
+
*/
|
|
1289
|
+
allowTaxIdCollection?: boolean;
|
|
1290
|
+
/**
|
|
1291
|
+
* Collect billing address during checkout
|
|
1292
|
+
*/
|
|
1293
|
+
collectBillingAddress?: boolean;
|
|
1294
|
+
/**
|
|
1295
|
+
* Collect phone number during checkout
|
|
1296
|
+
*/
|
|
1297
|
+
collectPhoneNumber?: boolean;
|
|
1298
|
+
/**
|
|
1299
|
+
* Optional reference ID for the checkout session
|
|
1300
|
+
*/
|
|
1301
|
+
referenceId?: string | null;
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Feature entitlement configuration for a subscription
|
|
1305
|
+
*/
|
|
1306
|
+
interface Feature {
|
|
1307
|
+
/**
|
|
1308
|
+
* The feature ID to attach the entitlement to
|
|
1309
|
+
*/
|
|
1310
|
+
id: string;
|
|
1311
|
+
/**
|
|
1312
|
+
* SubscriptionFeatureEntitlementRequest
|
|
1313
|
+
*/
|
|
1314
|
+
type: 'FEATURE';
|
|
1315
|
+
/**
|
|
1316
|
+
* Whether the usage limit is a soft limit
|
|
1317
|
+
*/
|
|
1318
|
+
hasSoftLimit?: boolean;
|
|
1319
|
+
/**
|
|
1320
|
+
* Whether usage is unlimited
|
|
1321
|
+
*/
|
|
1322
|
+
hasUnlimitedUsage?: boolean;
|
|
1323
|
+
/**
|
|
1324
|
+
* Configuration for monthly reset period
|
|
1325
|
+
*/
|
|
1326
|
+
monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
|
|
1327
|
+
/**
|
|
1328
|
+
* Period at which usage resets
|
|
1329
|
+
*/
|
|
1330
|
+
resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
|
|
1331
|
+
/**
|
|
1332
|
+
* Maximum allowed usage for the feature
|
|
1333
|
+
*/
|
|
1334
|
+
usageLimit?: number;
|
|
1335
|
+
/**
|
|
1336
|
+
* Configuration for weekly reset period
|
|
1337
|
+
*/
|
|
1338
|
+
weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
|
|
1339
|
+
/**
|
|
1340
|
+
* Configuration for yearly reset period
|
|
1341
|
+
*/
|
|
1342
|
+
yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
|
|
1343
|
+
}
|
|
1344
|
+
namespace Feature {
|
|
1345
|
+
/**
|
|
1346
|
+
* Configuration for monthly reset period
|
|
1347
|
+
*/
|
|
1348
|
+
interface MonthlyResetPeriodConfiguration {
|
|
1349
|
+
/**
|
|
1350
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
1351
|
+
*/
|
|
1352
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Configuration for weekly reset period
|
|
1356
|
+
*/
|
|
1357
|
+
interface WeeklyResetPeriodConfiguration {
|
|
1358
|
+
/**
|
|
1359
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
1360
|
+
*/
|
|
1361
|
+
accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
|
|
1362
|
+
}
|
|
1363
|
+
/**
|
|
1364
|
+
* Configuration for yearly reset period
|
|
1365
|
+
*/
|
|
1366
|
+
interface YearlyResetPeriodConfiguration {
|
|
1367
|
+
/**
|
|
1368
|
+
* Reset anchor (SubscriptionStart)
|
|
1369
|
+
*/
|
|
1370
|
+
accordingTo: 'SubscriptionStart';
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* Credit entitlement configuration for a subscription
|
|
1375
|
+
*/
|
|
1376
|
+
interface Credit {
|
|
1377
|
+
/**
|
|
1378
|
+
* The custom currency ID for the credit entitlement
|
|
1379
|
+
*/
|
|
1380
|
+
id: string;
|
|
1381
|
+
/**
|
|
1382
|
+
* Credit grant amount
|
|
1383
|
+
*/
|
|
1384
|
+
amount: number;
|
|
1385
|
+
/**
|
|
1386
|
+
* Credit grant cadence (MONTH or YEAR)
|
|
1387
|
+
*/
|
|
1388
|
+
cadence: 'MONTH' | 'YEAR';
|
|
1389
|
+
/**
|
|
1390
|
+
* SubscriptionCreditEntitlementRequest
|
|
1391
|
+
*/
|
|
1392
|
+
type: 'CREDIT';
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Minimum spend amount
|
|
1396
|
+
*/
|
|
1397
|
+
interface MinimumSpend {
|
|
1398
|
+
/**
|
|
1399
|
+
* The price amount
|
|
1400
|
+
*/
|
|
1401
|
+
amount?: number;
|
|
1402
|
+
/**
|
|
1403
|
+
* The price currency
|
|
1404
|
+
*/
|
|
1405
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1406
|
+
}
|
|
1407
|
+
interface PriceOverride {
|
|
1408
|
+
/**
|
|
1409
|
+
* Addon identifier for the price override
|
|
1410
|
+
*/
|
|
1411
|
+
addonId?: string | null;
|
|
1412
|
+
/**
|
|
1413
|
+
* The price amount
|
|
1414
|
+
*/
|
|
1415
|
+
amount?: number;
|
|
1416
|
+
/**
|
|
1417
|
+
* Whether this is a base charge override
|
|
1418
|
+
*/
|
|
1419
|
+
baseCharge?: boolean;
|
|
1420
|
+
/**
|
|
1421
|
+
* The billing country code of the price
|
|
1422
|
+
*/
|
|
1423
|
+
billingCountryCode?: string;
|
|
1424
|
+
/**
|
|
1425
|
+
* Block size for pricing
|
|
1426
|
+
*/
|
|
1427
|
+
blockSize?: number;
|
|
1428
|
+
creditGrantCadence?: 'BEGINNING_OF_BILLING_PERIOD' | 'MONTHLY';
|
|
1429
|
+
creditRate?: PriceOverride.CreditRate;
|
|
1430
|
+
/**
|
|
1431
|
+
* The price currency
|
|
1432
|
+
*/
|
|
1433
|
+
currency?: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1434
|
+
/**
|
|
1435
|
+
* Feature identifier for the price override
|
|
1436
|
+
*/
|
|
1437
|
+
featureId?: string | null;
|
|
1438
|
+
/**
|
|
1439
|
+
* Pricing tiers configuration
|
|
1440
|
+
*/
|
|
1441
|
+
tiers?: Array<PriceOverride.Tier>;
|
|
1442
|
+
}
|
|
1443
|
+
namespace PriceOverride {
|
|
1444
|
+
interface CreditRate {
|
|
1445
|
+
/**
|
|
1446
|
+
* The credit rate amount
|
|
1447
|
+
*/
|
|
1448
|
+
amount: number;
|
|
1449
|
+
/**
|
|
1450
|
+
* The custom currency refId for the credit rate
|
|
1451
|
+
*/
|
|
1452
|
+
currencyId: string;
|
|
1453
|
+
/**
|
|
1454
|
+
* A custom formula for calculating cost based on single event dimensions
|
|
1455
|
+
*/
|
|
1456
|
+
costFormula?: string | null;
|
|
1457
|
+
}
|
|
1458
|
+
interface Tier {
|
|
1459
|
+
/**
|
|
1460
|
+
* The flat fee price of the price tier
|
|
1461
|
+
*/
|
|
1462
|
+
flatPrice?: Tier.FlatPrice;
|
|
1463
|
+
/**
|
|
1464
|
+
* The unit price of the price tier
|
|
1465
|
+
*/
|
|
1466
|
+
unitPrice?: Tier.UnitPrice;
|
|
1467
|
+
/**
|
|
1468
|
+
* The up to quantity of the price tier
|
|
1469
|
+
*/
|
|
1470
|
+
upTo?: number;
|
|
1471
|
+
}
|
|
1472
|
+
namespace Tier {
|
|
1473
|
+
/**
|
|
1474
|
+
* The flat fee price of the price tier
|
|
1475
|
+
*/
|
|
1476
|
+
interface FlatPrice {
|
|
1477
|
+
/**
|
|
1478
|
+
* The price amount
|
|
1479
|
+
*/
|
|
1480
|
+
amount: number;
|
|
1481
|
+
/**
|
|
1482
|
+
* ISO 4217 currency code
|
|
1483
|
+
*/
|
|
1484
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1485
|
+
}
|
|
1486
|
+
/**
|
|
1487
|
+
* The unit price of the price tier
|
|
1488
|
+
*/
|
|
1489
|
+
interface UnitPrice {
|
|
1490
|
+
/**
|
|
1491
|
+
* The price amount
|
|
1492
|
+
*/
|
|
1493
|
+
amount: number;
|
|
1494
|
+
/**
|
|
1495
|
+
* ISO 4217 currency code
|
|
1496
|
+
*/
|
|
1497
|
+
currency: 'usd' | 'aed' | 'all' | 'amd' | 'ang' | 'aud' | 'awg' | 'azn' | 'bam' | 'bbd' | 'bdt' | 'bgn' | 'bif' | 'bmd' | 'bnd' | 'bsd' | 'bwp' | 'byn' | 'bzd' | 'brl' | 'cad' | 'cdf' | 'chf' | 'cny' | 'czk' | 'dkk' | 'dop' | 'dzd' | 'egp' | 'etb' | 'eur' | 'fjd' | 'gbp' | 'gel' | 'gip' | 'gmd' | 'gyd' | 'hkd' | 'hrk' | 'htg' | 'idr' | 'ils' | 'inr' | 'isk' | 'jmd' | 'jpy' | 'kes' | 'kgs' | 'khr' | 'kmf' | 'krw' | 'kyd' | 'kzt' | 'lbp' | 'lkr' | 'lrd' | 'lsl' | 'mad' | 'mdl' | 'mga' | 'mkd' | 'mmk' | 'mnt' | 'mop' | 'mro' | 'mvr' | 'mwk' | 'mxn' | 'myr' | 'mzn' | 'nad' | 'ngn' | 'nok' | 'npr' | 'nzd' | 'pgk' | 'php' | 'pkr' | 'pln' | 'qar' | 'ron' | 'rsd' | 'rub' | 'rwf' | 'sar' | 'sbd' | 'scr' | 'sek' | 'sgd' | 'sle' | 'sll' | 'sos' | 'szl' | 'thb' | 'tjs' | 'top' | 'try' | 'ttd' | 'tzs' | 'uah' | 'uzs' | 'vnd' | 'vuv' | 'wst' | 'xaf' | 'xcd' | 'yer' | 'zar' | 'zmw' | 'clp' | 'djf' | 'gnf' | 'ugx' | 'pyg' | 'xof' | 'xpf';
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Trial period override settings
|
|
1503
|
+
*/
|
|
1504
|
+
interface TrialOverrideConfiguration {
|
|
1505
|
+
/**
|
|
1506
|
+
* Whether the subscription should start with a trial period
|
|
1507
|
+
*/
|
|
1508
|
+
isTrial: boolean;
|
|
1509
|
+
/**
|
|
1510
|
+
* Behavior when trial ends: CONVERT_TO_PAID or CANCEL_SUBSCRIPTION
|
|
1511
|
+
*/
|
|
1512
|
+
trialEndBehavior?: 'CONVERT_TO_PAID' | 'CANCEL_SUBSCRIPTION';
|
|
1513
|
+
/**
|
|
1514
|
+
* Custom trial end date
|
|
1515
|
+
*/
|
|
1516
|
+
trialEndDate?: string;
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
export interface ContractRetrieveParams {
|
|
1522
|
+
/**
|
|
1523
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
1524
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
1525
|
+
*/
|
|
1526
|
+
'X-ACCOUNT-ID'?: string;
|
|
1527
|
+
/**
|
|
1528
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
1529
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
1530
|
+
* key).
|
|
1531
|
+
*/
|
|
1532
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
1533
|
+
}
|
|
1534
|
+
export interface ContractUpdateParams {
|
|
1535
|
+
/**
|
|
1536
|
+
* Body param: New activation end date
|
|
1537
|
+
*/
|
|
1538
|
+
activationEndDate?: string;
|
|
1539
|
+
/**
|
|
1540
|
+
* Body param: New activation start date
|
|
1541
|
+
*/
|
|
1542
|
+
activationStartDate?: string;
|
|
1543
|
+
/**
|
|
1544
|
+
* Body param: New contract name
|
|
1545
|
+
*/
|
|
1546
|
+
name?: string | null;
|
|
1547
|
+
/**
|
|
1548
|
+
* Body param: New purchase-order number
|
|
1549
|
+
*/
|
|
1550
|
+
poNumber?: string | null;
|
|
1551
|
+
/**
|
|
1552
|
+
* Body param: Enable billing on a provision-access-only contract by creating a
|
|
1553
|
+
* billing contract in the connected billing provider. Only takes effect when true
|
|
1554
|
+
* and the contract has no billing yet; omitting it leaves billing unchanged.
|
|
1555
|
+
* Billing is never removed by an update.
|
|
1556
|
+
*/
|
|
1557
|
+
setupBilling?: boolean;
|
|
1558
|
+
/**
|
|
1559
|
+
* Body param: When provided, replaces the set of subscriptions linked to the
|
|
1560
|
+
* contract (subscription ref IDs)
|
|
1561
|
+
*/
|
|
1562
|
+
subscriptionIds?: Array<string>;
|
|
1563
|
+
/**
|
|
1564
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
1565
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
1566
|
+
*/
|
|
1567
|
+
'X-ACCOUNT-ID'?: string;
|
|
1568
|
+
/**
|
|
1569
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
1570
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
1571
|
+
* intrinsic to the key).
|
|
1572
|
+
*/
|
|
1573
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
1574
|
+
}
|
|
1575
|
+
export interface ContractListParams extends MyCursorIDPageParams {
|
|
1576
|
+
/**
|
|
1577
|
+
* Query param: Filter by the exact external ID of the customer the contract
|
|
1578
|
+
* belongs to
|
|
1579
|
+
*/
|
|
1580
|
+
customerExternalId?: string;
|
|
1581
|
+
/**
|
|
1582
|
+
* Query param: Filter by exact contract name
|
|
1583
|
+
*/
|
|
1584
|
+
name?: string;
|
|
1585
|
+
/**
|
|
1586
|
+
* Query param: Filter by contract state. Supports comma-separated values for
|
|
1587
|
+
* multiple states
|
|
1588
|
+
*/
|
|
1589
|
+
state?: string;
|
|
1590
|
+
/**
|
|
1591
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
1592
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
1593
|
+
*/
|
|
1594
|
+
'X-ACCOUNT-ID'?: string;
|
|
1595
|
+
/**
|
|
1596
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
1597
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
1598
|
+
* intrinsic to the key).
|
|
1599
|
+
*/
|
|
1600
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
1601
|
+
}
|
|
1602
|
+
export interface ContractDeleteParams {
|
|
1603
|
+
/**
|
|
1604
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
1605
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
1606
|
+
*/
|
|
1607
|
+
'X-ACCOUNT-ID'?: string;
|
|
1608
|
+
/**
|
|
1609
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
1610
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
1611
|
+
* key).
|
|
1612
|
+
*/
|
|
1613
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
1614
|
+
}
|
|
1615
|
+
export declare namespace Contracts {
|
|
1616
|
+
export { type ContractCreateResponse as ContractCreateResponse, type ContractRetrieveResponse as ContractRetrieveResponse, type ContractUpdateResponse as ContractUpdateResponse, type ContractListResponse as ContractListResponse, type ContractDeleteResponse as ContractDeleteResponse, type ContractListResponsesMyCursorIDPage as ContractListResponsesMyCursorIDPage, type ContractCreateParams as ContractCreateParams, type ContractRetrieveParams as ContractRetrieveParams, type ContractUpdateParams as ContractUpdateParams, type ContractListParams as ContractListParams, type ContractDeleteParams as ContractDeleteParams, };
|
|
1617
|
+
}
|
|
1618
|
+
//# sourceMappingURL=contracts.d.ts.map
|