chargebee 3.0.1 → 3.1.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +16 -0
  4. package/esm/environment.js +1 -1
  5. package/esm/resources/api_endpoints.js +16 -0
  6. package/package.json +1 -1
  7. package/types/core.d.ts +588 -0
  8. package/types/index.d.ts +172 -0
  9. package/types/resources/Address.d.ts +71 -0
  10. package/types/resources/AdvanceInvoiceSchedule.d.ts +29 -0
  11. package/types/resources/AttachedItem.d.ts +116 -0
  12. package/types/resources/Attribute.d.ts +9 -0
  13. package/types/resources/BusinessEntity.d.ts +64 -0
  14. package/types/resources/BusinessEntityTransfer.d.ts +15 -0
  15. package/types/resources/Card.d.ts +172 -0
  16. package/types/resources/Comment.d.ts +92 -0
  17. package/types/resources/Contact.d.ts +16 -0
  18. package/types/resources/ContractTerm.d.ts +19 -0
  19. package/types/resources/Coupon.d.ts +329 -0
  20. package/types/resources/CouponCode.d.ts +70 -0
  21. package/types/resources/CouponSet.d.ts +111 -0
  22. package/types/resources/CreditNote.d.ts +629 -0
  23. package/types/resources/CreditNoteEstimate.d.ts +143 -0
  24. package/types/resources/Currency.d.ts +91 -0
  25. package/types/resources/Customer.d.ts +964 -0
  26. package/types/resources/CustomerEntitlement.d.ts +36 -0
  27. package/types/resources/DifferentialPrice.d.ts +144 -0
  28. package/types/resources/Discount.d.ts +24 -0
  29. package/types/resources/Download.d.ts +10 -0
  30. package/types/resources/Entitlement.d.ts +66 -0
  31. package/types/resources/EntitlementOverride.d.ts +76 -0
  32. package/types/resources/Estimate.d.ts +1237 -0
  33. package/types/resources/Event.d.ts +81 -0
  34. package/types/resources/Export.d.ts +615 -0
  35. package/types/resources/Feature.d.ts +142 -0
  36. package/types/resources/GatewayErrorDetail.d.ts +20 -0
  37. package/types/resources/Gift.d.ts +296 -0
  38. package/types/resources/Hierarchy.d.ts +12 -0
  39. package/types/resources/HostedPage.d.ts +1112 -0
  40. package/types/resources/ImpactedItem.d.ts +20 -0
  41. package/types/resources/ImpactedItemPrice.d.ts +20 -0
  42. package/types/resources/ImpactedSubscription.d.ts +20 -0
  43. package/types/resources/InAppSubscription.d.ts +116 -0
  44. package/types/resources/Invoice.d.ts +1695 -0
  45. package/types/resources/InvoiceEstimate.d.ts +143 -0
  46. package/types/resources/Item.d.ts +208 -0
  47. package/types/resources/ItemEntitlement.d.ts +103 -0
  48. package/types/resources/ItemFamily.d.ts +93 -0
  49. package/types/resources/ItemPrice.d.ts +332 -0
  50. package/types/resources/Metadata.d.ts +8 -0
  51. package/types/resources/NonSubscription.d.ts +48 -0
  52. package/types/resources/OmnichannelSubscription.d.ts +75 -0
  53. package/types/resources/OmnichannelTransaction.d.ts +16 -0
  54. package/types/resources/Order.d.ts +586 -0
  55. package/types/resources/PaymentIntent.d.ts +178 -0
  56. package/types/resources/PaymentReferenceNumber.d.ts +11 -0
  57. package/types/resources/PaymentSchedule.d.ts +28 -0
  58. package/types/resources/PaymentScheduleEstimate.d.ts +25 -0
  59. package/types/resources/PaymentScheduleScheme.d.ts +67 -0
  60. package/types/resources/PaymentSource.d.ts +530 -0
  61. package/types/resources/PaymentVoucher.d.ts +107 -0
  62. package/types/resources/PortalSession.d.ts +88 -0
  63. package/types/resources/PriceVariant.d.ts +116 -0
  64. package/types/resources/PricingPageSession.d.ts +130 -0
  65. package/types/resources/PromotionalCredit.d.ts +111 -0
  66. package/types/resources/Purchase.d.ts +202 -0
  67. package/types/resources/Quote.d.ts +1467 -0
  68. package/types/resources/QuoteLineGroup.d.ts +136 -0
  69. package/types/resources/QuotedCharge.d.ts +56 -0
  70. package/types/resources/QuotedSubscription.d.ts +114 -0
  71. package/types/resources/Ramp.d.ts +260 -0
  72. package/types/resources/RecordedPurchase.d.ts +60 -0
  73. package/types/resources/ResourceMigration.d.ts +36 -0
  74. package/types/resources/SiteMigrationDetail.d.ts +46 -0
  75. package/types/resources/Subscription.d.ts +2447 -0
  76. package/types/resources/SubscriptionEntitlement.d.ts +79 -0
  77. package/types/resources/SubscriptionEstimate.d.ts +59 -0
  78. package/types/resources/TaxWithheld.d.ts +19 -0
  79. package/types/resources/ThirdPartyPaymentMethod.d.ts +11 -0
  80. package/types/resources/TimeMachine.d.ts +57 -0
  81. package/types/resources/Token.d.ts +19 -0
  82. package/types/resources/Transaction.d.ts +316 -0
  83. package/types/resources/UnbilledCharge.d.ts +209 -0
  84. package/types/resources/Usage.d.ts +113 -0
  85. package/types/resources/VirtualBankAccount.d.ts +125 -0
  86. package/types/resources/filter.d.ts +52 -0
@@ -0,0 +1,530 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
4
+ declare module 'chargebee' {
5
+ export interface PaymentSource {
6
+ id: string;
7
+ resource_version?: number;
8
+ updated_at?: number;
9
+ created_at: number;
10
+ customer_id: string;
11
+ type: TypeEnum;
12
+ reference_id: string;
13
+ status:
14
+ | 'valid'
15
+ | 'expiring'
16
+ | 'expired'
17
+ | 'invalid'
18
+ | 'pending_verification';
19
+ gateway: GatewayEnum;
20
+ gateway_account_id?: string;
21
+ ip_address?: string;
22
+ issuing_country?: string;
23
+ card?: PaymentSource.Card;
24
+ bank_account?: PaymentSource.BankAccount;
25
+ boleto?: PaymentSource.CustVoucherSource;
26
+ billing_address?: PaymentSource.BillingAddress;
27
+ amazon_payment?: PaymentSource.AmazonPayment;
28
+ upi?: PaymentSource.Upi;
29
+ paypal?: PaymentSource.Paypal;
30
+ venmo?: PaymentSource.Venmo;
31
+ klarna_pay_now?: PaymentSource.KlarnaPayNow;
32
+ mandates?: PaymentSource.Mandate[];
33
+ deleted: boolean;
34
+ business_entity_id?: string;
35
+ }
36
+
37
+ export namespace PaymentSource {
38
+ export class PaymentSourceResource {
39
+ createUsingTempToken(
40
+ input: CreateUsingTempTokenInputParam,
41
+ headers?: ChargebeeRequestHeader,
42
+ ): Promise<ChargebeeResponse<CreateUsingTempTokenResponse>>;
43
+
44
+ createUsingPermanentToken(
45
+ input: CreateUsingPermanentTokenInputParam,
46
+ headers?: ChargebeeRequestHeader,
47
+ ): Promise<ChargebeeResponse<CreateUsingPermanentTokenResponse>>;
48
+
49
+ createUsingToken(
50
+ input: CreateUsingTokenInputParam,
51
+ headers?: ChargebeeRequestHeader,
52
+ ): Promise<ChargebeeResponse<CreateUsingTokenResponse>>;
53
+
54
+ createUsingPaymentIntent(
55
+ input: CreateUsingPaymentIntentInputParam,
56
+ headers?: ChargebeeRequestHeader,
57
+ ): Promise<ChargebeeResponse<CreateUsingPaymentIntentResponse>>;
58
+
59
+ createVoucherPaymentSource(
60
+ input: CreateVoucherPaymentSourceInputParam,
61
+ headers?: ChargebeeRequestHeader,
62
+ ): Promise<ChargebeeResponse<CreateVoucherPaymentSourceResponse>>;
63
+
64
+ createCard(
65
+ input: CreateCardInputParam,
66
+ headers?: ChargebeeRequestHeader,
67
+ ): Promise<ChargebeeResponse<CreateCardResponse>>;
68
+
69
+ createBankAccount(
70
+ input: CreateBankAccountInputParam,
71
+ headers?: ChargebeeRequestHeader,
72
+ ): Promise<ChargebeeResponse<CreateBankAccountResponse>>;
73
+
74
+ updateCard(
75
+ cust_payment_source_id: string,
76
+ input?: UpdateCardInputParam,
77
+ headers?: ChargebeeRequestHeader,
78
+ ): Promise<ChargebeeResponse<UpdateCardResponse>>;
79
+
80
+ updateBankAccount(
81
+ cust_payment_source_id: string,
82
+ input?: UpdateBankAccountInputParam,
83
+ headers?: ChargebeeRequestHeader,
84
+ ): Promise<ChargebeeResponse<UpdateBankAccountResponse>>;
85
+
86
+ verifyBankAccount(
87
+ cust_payment_source_id: string,
88
+ input: VerifyBankAccountInputParam,
89
+ headers?: ChargebeeRequestHeader,
90
+ ): Promise<ChargebeeResponse<VerifyBankAccountResponse>>;
91
+
92
+ retrieve(
93
+ cust_payment_source_id: string,
94
+ headers?: ChargebeeRequestHeader,
95
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
96
+
97
+ list(
98
+ input?: ListInputParam,
99
+ headers?: ChargebeeRequestHeader,
100
+ ): Promise<ChargebeeResponse<ListResponse>>;
101
+
102
+ switchGatewayAccount(
103
+ cust_payment_source_id: string,
104
+ input: SwitchGatewayAccountInputParam,
105
+ headers?: ChargebeeRequestHeader,
106
+ ): Promise<ChargebeeResponse<SwitchGatewayAccountResponse>>;
107
+
108
+ exportPaymentSource(
109
+ cust_payment_source_id: string,
110
+ input: ExportPaymentSourceInputParam,
111
+ headers?: ChargebeeRequestHeader,
112
+ ): Promise<ChargebeeResponse<ExportPaymentSourceResponse>>;
113
+
114
+ delete(
115
+ cust_payment_source_id: string,
116
+ headers?: ChargebeeRequestHeader,
117
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
118
+
119
+ deleteLocal(
120
+ cust_payment_source_id: string,
121
+ headers?: ChargebeeRequestHeader,
122
+ ): Promise<ChargebeeResponse<DeleteLocalResponse>>;
123
+ }
124
+
125
+ export interface CreateUsingTempTokenResponse {
126
+ customer: Customer;
127
+ payment_source: PaymentSource;
128
+ }
129
+
130
+ export interface CreateUsingPermanentTokenResponse {
131
+ customer: Customer;
132
+ payment_source: PaymentSource;
133
+ }
134
+
135
+ export interface CreateUsingTokenResponse {
136
+ customer: Customer;
137
+ payment_source: PaymentSource;
138
+ }
139
+
140
+ export interface CreateUsingPaymentIntentResponse {
141
+ customer: Customer;
142
+ payment_source: PaymentSource;
143
+ }
144
+
145
+ export interface CreateVoucherPaymentSourceResponse {
146
+ customer: Customer;
147
+ payment_source: PaymentSource;
148
+ }
149
+
150
+ export interface CreateCardResponse {
151
+ customer: Customer;
152
+ payment_source: PaymentSource;
153
+ }
154
+
155
+ export interface CreateBankAccountResponse {
156
+ customer: Customer;
157
+ payment_source: PaymentSource;
158
+ }
159
+
160
+ export interface UpdateCardResponse {
161
+ customer: Customer;
162
+ payment_source: PaymentSource;
163
+ }
164
+
165
+ export interface UpdateBankAccountResponse {
166
+ customer: Customer;
167
+ payment_source: PaymentSource;
168
+ }
169
+
170
+ export interface VerifyBankAccountResponse {
171
+ payment_source: PaymentSource;
172
+ }
173
+
174
+ export interface RetrieveResponse {
175
+ payment_source: PaymentSource;
176
+ }
177
+
178
+ export interface ListResponse {
179
+ list: { payment_source: PaymentSource }[];
180
+ next_offset?: string;
181
+ }
182
+
183
+ export interface SwitchGatewayAccountResponse {
184
+ customer: Customer;
185
+ payment_source: PaymentSource;
186
+ }
187
+
188
+ export interface ExportPaymentSourceResponse {
189
+ third_party_payment_method: ThirdPartyPaymentMethod;
190
+ }
191
+
192
+ export interface DeleteResponse {
193
+ customer: Customer;
194
+ payment_source: PaymentSource;
195
+ }
196
+
197
+ export interface DeleteLocalResponse {
198
+ customer: Customer;
199
+ payment_source: PaymentSource;
200
+ }
201
+
202
+ export interface Card {
203
+ first_name?: string;
204
+ last_name?: string;
205
+ iin: string;
206
+ last4: string;
207
+ brand:
208
+ | 'visa'
209
+ | 'mastercard'
210
+ | 'american_express'
211
+ | 'discover'
212
+ | 'jcb'
213
+ | 'diners_club'
214
+ | 'other'
215
+ | 'bancontact'
216
+ | 'cmr_falabella'
217
+ | 'tarjeta_naranja'
218
+ | 'nativa'
219
+ | 'cencosud'
220
+ | 'cabal'
221
+ | 'argencard'
222
+ | 'elo'
223
+ | 'hipercard'
224
+ | 'carnet'
225
+ | 'rupay'
226
+ | 'maestro'
227
+ | 'dankort'
228
+ | 'cartes_bancaires'
229
+ | 'not_applicable';
230
+ funding_type:
231
+ | 'credit'
232
+ | 'debit'
233
+ | 'prepaid'
234
+ | 'not_known'
235
+ | 'not_applicable';
236
+ expiry_month: number;
237
+ expiry_year: number;
238
+ billing_addr1?: string;
239
+ billing_addr2?: string;
240
+ billing_city?: string;
241
+ billing_state_code?: string;
242
+ billing_state?: string;
243
+ billing_country?: string;
244
+ billing_zip?: string;
245
+ masked_number?: string;
246
+ }
247
+ export interface BankAccount {
248
+ last4: string;
249
+ name_on_account?: string;
250
+ first_name?: string;
251
+ last_name?: string;
252
+ direct_debit_scheme?: DirectDebitSchemeEnum;
253
+ bank_name?: string;
254
+ mandate_id?: string;
255
+ account_type?: AccountTypeEnum;
256
+ echeck_type?: EcheckTypeEnum;
257
+ account_holder_type?: AccountHolderTypeEnum;
258
+ email?: string;
259
+ }
260
+ export interface CustVoucherSource {
261
+ last4: string;
262
+ first_name?: string;
263
+ last_name?: string;
264
+ email?: string;
265
+ }
266
+ export interface BillingAddress {
267
+ first_name?: string;
268
+ last_name?: string;
269
+ email?: string;
270
+ company?: string;
271
+ phone?: string;
272
+ line1?: string;
273
+ line2?: string;
274
+ line3?: string;
275
+ city?: string;
276
+ state_code?: string;
277
+ state?: string;
278
+ country?: string;
279
+ zip?: string;
280
+ validation_status?: ValidationStatusEnum;
281
+ }
282
+ export interface AmazonPayment {
283
+ email?: string;
284
+ agreement_id?: string;
285
+ }
286
+ export interface Upi {
287
+ vpa?: string;
288
+ }
289
+ export interface Paypal {
290
+ email?: string;
291
+ agreement_id?: string;
292
+ }
293
+ export interface Venmo {
294
+ user_name?: string;
295
+ }
296
+ export interface KlarnaPayNow {
297
+ email?: string;
298
+ }
299
+ export interface Mandate {
300
+ id: string;
301
+ subscription_id: string;
302
+ created_at: number;
303
+ }
304
+ // REQUEST PARAMS
305
+ //---------------
306
+
307
+ export interface CreateUsingTempTokenInputParam {
308
+ customer_id: string;
309
+ gateway_account_id?: string;
310
+ type: TypeEnum;
311
+ tmp_token: string;
312
+ issuing_country?: string;
313
+ replace_primary_payment_source?: boolean;
314
+ additional_information?: any;
315
+ }
316
+ export interface CreateUsingPermanentTokenInputParam {
317
+ customer_id: string;
318
+ type: TypeEnum;
319
+ gateway_account_id?: string;
320
+ reference_id?: string;
321
+ issuing_country?: string;
322
+ replace_primary_payment_source?: boolean;
323
+ payment_method_token?: string;
324
+ customer_profile_token?: string;
325
+ network_transaction_id?: string;
326
+ mandate_id?: string;
327
+ skip_retrieval?: boolean;
328
+ additional_information?: any;
329
+ card?: CardCreateUsingPermanentTokenInputParam;
330
+ billing_address?: BillingAddressCreateUsingPermanentTokenInputParam;
331
+ }
332
+ export interface CreateUsingTokenInputParam {
333
+ customer_id: string;
334
+ replace_primary_payment_source?: boolean;
335
+ token_id: string;
336
+ }
337
+ export interface CreateUsingPaymentIntentInputParam {
338
+ customer_id: string;
339
+ replace_primary_payment_source?: boolean;
340
+ payment_intent?: PaymentIntentCreateUsingPaymentIntentInputParam;
341
+ }
342
+ export interface CreateVoucherPaymentSourceInputParam {
343
+ customer_id: string;
344
+ voucher_payment_source?: VoucherPaymentSourceCreateVoucherPaymentSourceInputParam;
345
+ }
346
+ export interface CreateCardInputParam {
347
+ customer_id: string;
348
+ replace_primary_payment_source?: boolean;
349
+ card?: CardCreateCardInputParam;
350
+ }
351
+ export interface CreateBankAccountInputParam {
352
+ customer_id: string;
353
+ issuing_country?: string;
354
+ replace_primary_payment_source?: boolean;
355
+ bank_account?: BankAccountCreateBankAccountInputParam;
356
+ }
357
+ export interface UpdateCardInputParam {
358
+ gateway_meta_data?: any;
359
+ reference_transaction?: string;
360
+ card?: CardUpdateCardInputParam;
361
+ }
362
+ export interface UpdateBankAccountInputParam {
363
+ bank_account?: BankAccountUpdateBankAccountInputParam;
364
+ }
365
+ export interface VerifyBankAccountInputParam {
366
+ amount1: number;
367
+ amount2: number;
368
+ }
369
+ export interface ListInputParam {
370
+ limit?: number;
371
+ offset?: string;
372
+ subscription_id?: string;
373
+ customer_id?: filter.String;
374
+ type?: filter.Enum;
375
+ status?: filter.Enum;
376
+ updated_at?: filter.Timestamp;
377
+ created_at?: filter.Timestamp;
378
+ 'sort_by[asc]'?: string;
379
+ 'sort_by[desc]'?: string;
380
+ }
381
+ export interface SwitchGatewayAccountInputParam {
382
+ gateway_account_id: string;
383
+ }
384
+ export interface ExportPaymentSourceInputParam {
385
+ gateway_account_id: string;
386
+ }
387
+ export interface BillingAddressCreateUsingPermanentTokenInputParam {
388
+ first_name?: string;
389
+ last_name?: string;
390
+ email?: string;
391
+ line1?: string;
392
+ line2?: string;
393
+ line3?: string;
394
+ city?: string;
395
+ state_code?: string;
396
+ state?: string;
397
+ zip?: string;
398
+ country?: string;
399
+ }
400
+ export interface CardCreateUsingPermanentTokenInputParam {
401
+ last4?: string;
402
+ iin?: string;
403
+ expiry_month?: number;
404
+ expiry_year?: number;
405
+ brand?:
406
+ | 'visa'
407
+ | 'mastercard'
408
+ | 'american_express'
409
+ | 'discover'
410
+ | 'jcb'
411
+ | 'diners_club'
412
+ | 'other'
413
+ | 'bancontact'
414
+ | 'cmr_falabella'
415
+ | 'tarjeta_naranja'
416
+ | 'nativa'
417
+ | 'cencosud'
418
+ | 'cabal'
419
+ | 'argencard'
420
+ | 'elo'
421
+ | 'hipercard'
422
+ | 'carnet'
423
+ | 'rupay'
424
+ | 'maestro'
425
+ | 'dankort'
426
+ | 'cartes_bancaires';
427
+ funding_type?: 'credit' | 'debit' | 'prepaid' | 'not_known';
428
+ }
429
+
430
+ export interface PaymentIntentCreateUsingPaymentIntentInputParam {
431
+ id?: string;
432
+ gateway_account_id?: string;
433
+ gw_token?: string;
434
+ payment_method_type?:
435
+ | 'card'
436
+ | 'ideal'
437
+ | 'sofort'
438
+ | 'bancontact'
439
+ | 'google_pay'
440
+ | 'dotpay'
441
+ | 'giropay'
442
+ | 'apple_pay'
443
+ | 'upi'
444
+ | 'netbanking_emandates'
445
+ | 'paypal_express_checkout'
446
+ | 'direct_debit'
447
+ | 'boleto'
448
+ | 'venmo'
449
+ | 'amazon_payments'
450
+ | 'pay_to'
451
+ | 'faster_payments'
452
+ | 'sepa_instant_transfer'
453
+ | 'klarna_pay_now'
454
+ | 'online_banking_poland';
455
+ reference_id?: string;
456
+ /**
457
+ * @deprecated Please refer API docs to use other attributes
458
+ */
459
+ gw_payment_method_id?: string;
460
+ additional_info?: any;
461
+ additional_information?: any;
462
+ }
463
+
464
+ export interface VoucherPaymentSourceCreateVoucherPaymentSourceInputParam {
465
+ voucher_type: VoucherTypeEnum;
466
+ gateway_account_id?: string;
467
+ tax_id?: string;
468
+ billing_address?: any;
469
+ }
470
+
471
+ export interface CardCreateCardInputParam {
472
+ gateway_account_id?: string;
473
+ first_name?: string;
474
+ last_name?: string;
475
+ number: string;
476
+ expiry_month: number;
477
+ expiry_year: number;
478
+ cvv?: string;
479
+ preferred_scheme?: 'cartes_bancaires' | 'mastercard' | 'visa';
480
+ billing_addr1?: string;
481
+ billing_addr2?: string;
482
+ billing_city?: string;
483
+ billing_state_code?: string;
484
+ billing_state?: string;
485
+ billing_zip?: string;
486
+ billing_country?: string;
487
+ additional_information?: any;
488
+ }
489
+
490
+ export interface BankAccountCreateBankAccountInputParam {
491
+ gateway_account_id?: string;
492
+ iban?: string;
493
+ first_name?: string;
494
+ last_name?: string;
495
+ company?: string;
496
+ email?: string;
497
+ phone?: string;
498
+ bank_name?: string;
499
+ account_number?: string;
500
+ routing_number?: string;
501
+ bank_code?: string;
502
+ account_type?: AccountTypeEnum;
503
+ account_holder_type?: AccountHolderTypeEnum;
504
+ echeck_type?: EcheckTypeEnum;
505
+ swedish_identity_number?: string;
506
+ billing_address?: any;
507
+ }
508
+
509
+ export interface CardUpdateCardInputParam {
510
+ first_name?: string;
511
+ last_name?: string;
512
+ expiry_month?: number;
513
+ expiry_year?: number;
514
+ billing_addr1?: string;
515
+ billing_addr2?: string;
516
+ billing_city?: string;
517
+ billing_zip?: string;
518
+ billing_state_code?: string;
519
+ billing_state?: string;
520
+ billing_country?: string;
521
+ additional_information?: any;
522
+ }
523
+
524
+ export interface BankAccountUpdateBankAccountInputParam {
525
+ first_name?: string;
526
+ last_name?: string;
527
+ email?: string;
528
+ }
529
+ }
530
+ }
@@ -0,0 +1,107 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
4
+ declare module 'chargebee' {
5
+ export interface PaymentVoucher {
6
+ id: string;
7
+ id_at_gateway?: string;
8
+ payment_voucher_type: PaymentVoucherTypeEnum;
9
+ expires_at?: number;
10
+ status?: 'active' | 'consumed' | 'expired' | 'failure';
11
+ subscription_id?: string;
12
+ currency_code: string;
13
+ amount?: number;
14
+ gateway_account_id?: string;
15
+ payment_source_id?: string;
16
+ gateway: GatewayEnum;
17
+ payload?: string;
18
+ error_code?: string;
19
+ error_text?: string;
20
+ url?: string;
21
+ date?: number;
22
+ resource_version?: number;
23
+ updated_at?: number;
24
+ customer_id: string;
25
+ linked_invoices?: PaymentVoucher.LinkedInvoice[];
26
+ }
27
+
28
+ export namespace PaymentVoucher {
29
+ export class PaymentVoucherResource {
30
+ create(
31
+ input: CreateInputParam,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<CreateResponse>>;
34
+
35
+ retrieve(
36
+ payment_voucher_id: string,
37
+ headers?: ChargebeeRequestHeader,
38
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
39
+
40
+ paymentVouchersForInvoice(
41
+ invoice_id: string,
42
+ input?: PaymentVouchersForInvoiceInputParam,
43
+ headers?: ChargebeeRequestHeader,
44
+ ): Promise<ChargebeeResponse<PaymentVouchersForInvoiceResponse>>;
45
+
46
+ paymentVouchersForCustomer(
47
+ customer_id: string,
48
+ input?: PaymentVouchersForCustomerInputParam,
49
+ headers?: ChargebeeRequestHeader,
50
+ ): Promise<ChargebeeResponse<PaymentVouchersForCustomerResponse>>;
51
+ }
52
+
53
+ export interface CreateResponse {
54
+ payment_voucher: PaymentVoucher;
55
+ }
56
+
57
+ export interface RetrieveResponse {
58
+ payment_voucher: PaymentVoucher;
59
+ }
60
+
61
+ export interface PaymentVouchersForInvoiceResponse {
62
+ list: { payment_voucher: PaymentVoucher }[];
63
+ next_offset?: string;
64
+ }
65
+
66
+ export interface PaymentVouchersForCustomerResponse {
67
+ list: { payment_voucher: PaymentVoucher }[];
68
+ next_offset?: string;
69
+ }
70
+
71
+ export interface LinkedInvoice {
72
+ invoice_id: string;
73
+ txn_id: string;
74
+ applied_at: number;
75
+ }
76
+ // REQUEST PARAMS
77
+ //---------------
78
+
79
+ export interface CreateInputParam {
80
+ customer_id: string;
81
+ payment_source_id?: string;
82
+ voucher_payment_source?: VoucherPaymentSourceCreateInputParam;
83
+ invoice_allocations?: InvoiceAllocationsCreateInputParam[];
84
+ }
85
+ export interface PaymentVouchersForInvoiceInputParam {
86
+ limit?: number;
87
+ offset?: string;
88
+ status?: filter.Enum;
89
+ 'sort_by[asc]'?: string;
90
+ 'sort_by[desc]'?: string;
91
+ }
92
+ export interface PaymentVouchersForCustomerInputParam {
93
+ limit?: number;
94
+ offset?: string;
95
+ status?: filter.Enum;
96
+ 'sort_by[asc]'?: string;
97
+ 'sort_by[desc]'?: string;
98
+ }
99
+ export interface VoucherPaymentSourceCreateInputParam {
100
+ voucher_type: VoucherTypeEnum;
101
+ }
102
+
103
+ export interface InvoiceAllocationsCreateInputParam {
104
+ invoice_id: string;
105
+ }
106
+ }
107
+ }