chargebee 2.40.0 → 3.0.0-beta.1

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 (118) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/LICENSE +1 -1
  3. package/README.md +90 -172
  4. package/cjs/RequestWrapper.js +81 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +77 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +91 -54
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +36 -0
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +233 -724
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4335
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +278 -900
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2912
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,935 +1,313 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
2
4
  declare module 'chargebee' {
3
5
  export interface Transaction {
4
-
5
- /**
6
- * @description Uniquely identifies the transaction.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description Identifier of the customer for which this transaction is made
14
-
15
- */
16
-
17
- customer_id?:string;
18
-
19
- /**
20
- * @description Identifier of the subscription for which this transaction is made.
21
-
22
- */
23
-
24
- subscription_id?:string;
25
-
26
- /**
27
- * @description The gateway account used for this transaction
28
-
29
- */
30
-
31
- gateway_account_id?:string;
32
-
33
- /**
34
- * @description Identifier of the payment source for which this transaction is made
35
-
36
- */
37
-
38
- payment_source_id?:string;
39
-
40
- /**
41
- * @description The payment method of this transaction \* unionpay - Unionpay \* upi - upi \* check - Check \* custom - Custom \* amazon_payments - Amazon Payments \* boleto - boleto \* direct_debit - Direct Debit \* sepa_instant_transfer - Sepa Instant Transfer \* apple_pay - Apple Pay \* wechat_pay - WeChat Pay \* bancontact - Bancontact \* faster_payments - Faster Payments \* venmo - Venmo \* bank_transfer - Bank Transfer \* paypal_express_checkout - Paypal Express Checkout \* other - Payment Methods other than the above types \* ach_credit - ACH Credit \* sepa_credit - SEPA Credit \* card - Card \* ideal - IDEAL \* chargeback - Only applicable for a transaction of [type](transactions#transaction_type) &#x3D; &#x60;refund&#x60;. This value is set by Chargebee when an automated [chargeback](https://www.chargebee.com/docs/chargeback.html#chargeback-process) occurs. You can also set this explicitly when [recording a refund](transactions#record_an_offline_refund). \* google_pay - Google Pay \* netbanking_emandates - netbanking_emandates \* pay_to - PayTo \* dotpay - Dotpay \* alipay - Alipay \* sofort - Sofort \* giropay - giropay \* cash - Cash
42
-
43
- */
44
-
45
- payment_method:PaymentMethod;
46
-
47
- /**
48
- * @description The reference number for this transaction. For example, the check number when [payment_method](transactions#transaction_payment_method) &#x3D; &#x60;check&#x60;.
49
-
50
- */
51
-
52
- reference_number?:string;
53
-
54
- /**
55
- * @description Gateway through which this transaction was done. Applicable only for &#x27;Card&#x27; Payment Method \* bluesnap - BlueSnap is a payment gateway. \* tco - 2Checkout is a payment gateway. \* razorpay - Razorpay is a fast growing payment service provider in India working with all leading banks and support for major local payment methods including Netbanking, UPI etc. \* checkout_com - Checkout.com is a payment gateway. \* adyen - Adyen is a payment gateway. \* braintree - Braintree is a payment gateway. \* pay_com - Pay.com provides payment services focused on simplicity and hassle-free operations for businesses of all sizes. \* moneris_us - Moneris USA is a payment gateway. \* pin - Pin is a payment gateway \* moneris - Moneris is a payment gateway. \* chargebee - Chargebee test gateway. \* cybersource - CyberSource is a payment gateway. \* ecentric - Ecentric provides a seamless payment processing service in South Africa specializing on omnichannel capabilities. \* first_data_global - First Data Global Gateway Virtual Terminal Account \* exact - Exact Payments is a payment gateway. \* eway - eWAY Account is a payment gateway. \* amazon_payments - Amazon Payments is a payment service provider. \* sage_pay - Sage Pay is a payment gateway. \* elavon - Elavon Virtual Merchant is a payment solution. \* orbital - Chase Paymentech(Orbital) is a payment gateway. \* beanstream - Bambora(formerly known as Beanstream) is a payment gateway. \* hdfc - HDFC Account is a payment gateway. \* bank_of_america - Bank of America Gateway \* gocardless - GoCardless is a payment service provider. \* paymill - PAYMILL is a payment gateway. \* balanced_payments - Balanced is a payment gateway \* bluepay - BluePay is a payment gateway. \* paypal_express_checkout - PayPal Express Checkout is a payment gateway. \* paypal_payflow_pro - PayPal Payflow Pro is a payment gateway. \* global_payments - Global Payments is a payment service provider. \* not_applicable - Indicates that payment gateway is not applicable for this resource. \* nmi - NMI is a payment gateway. \* worldpay - WorldPay is a payment gateway \* authorize_net - Authorize.net is a payment gateway \* stripe - Stripe is a payment gateway. \* metrics_global - Metrics global is a leading payment service provider providing unified payment services in the US. \* windcave - Windcave provides an end to end payment processing solution in ANZ and other leading global markets. \* quickbooks - Intuit QuickBooks Payments gateway \* wepay - WePay is a payment gateway. \* wirecard - WireCard Account is a payment service provider. \* chargebee_payments - Chargebee Payments gateway \* paypal_pro - PayPal Pro Account is a payment gateway. \* paypal - PayPal Commerce is a payment gateway. \* ingenico_direct - Worldline Online Payments is a payment gateway. \* ogone - Ingenico ePayments (formerly known as Ogone) is a payment gateway. \* migs - MasterCard Internet Gateway Service payment gateway. \* vantiv - Vantiv is a payment gateway. \* eway_rapid - eWAY Rapid is a payment gateway. \* mollie - Mollie is a payment gateway. \* ebanx - EBANX is a payment gateway, enabling businesses to accept diverse local payment methods from various countries for increased market reach and conversion.
56
-
57
- */
58
-
59
- gateway:Gateway;
60
-
61
- /**
62
- * @description Type of the transaction. \* authorization - The transaction represents an authorization for capturing the [amount](transactions#transaction_amount) from the customer&#x27;s [payment_source](payment_sources). \* payment - The transaction represents capture of [amount](transactions#transaction_amount) from the customer&#x27;s [payment_source](payment_sources). \* refund - The transaction represents a refund of [amount](transactions#transaction_amount) to the customer&#x27;s [payment_source](payment_sources). \* payment_reversal - Indicates a reversal transaction.
63
-
64
- */
65
-
66
- type:'authorization' | 'payment_reversal' | 'payment' | 'refund';
67
-
68
- /**
69
- * @description Indicates when this transaction occurred.
70
-
71
- */
72
-
73
- date?:number;
74
-
75
- /**
76
- * @description Indicates the time at which the final status of the transaction has been marked.
77
-
78
- */
79
-
80
- settled_at?:number;
81
-
82
- /**
83
- * @description Exchange rate used for base currency conversion
84
-
85
- */
86
-
87
- exchange_rate?:number;
88
-
89
- /**
90
- * @description The currency code (ISO 4217 format) for the transaction.
91
-
92
- */
93
-
94
- currency_code:string;
95
-
96
- /**
97
- * @description Amount for this transaction.
98
-
99
- */
100
-
101
- amount?:number;
102
-
103
- /**
104
- * @description The id with which this transaction is referred in gateway.
105
-
106
- */
107
-
108
- id_at_gateway?:string;
109
-
110
- /**
111
- * @description The status of this transaction. \* in_progress - Transaction is being processed by the gateway. This typically happens for [direct debit transactions](https://www.chargebee.com/docs/direct-debit-payments.html) or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method. \* timeout - Transaction failed because of Gateway not accepting the connection. \* success - The transaction is successful. \* voided - The transaction got voided or authorization expired at gateway. \* needs_attention - Connection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually \* failure - Transaction failed. Refer the &#x27;error_code&#x27; and &#x27;error_text&#x27; fields to know the reason for failure
112
-
113
- */
114
-
115
- status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
116
-
117
- /**
118
- * @description Indicates whether or not the transaction has been identified as fraudulent. \* suspicious - The transaction has been identified as potentially fraudulent by the gateway \* safe - The transaction has been marked as safe \* fraudulent - The transaction has been marked as fraudulent
119
-
120
- */
121
-
122
- fraud_flag?:'safe' | 'suspicious' | 'fraudulent';
123
-
124
- /**
125
- * @description Marker for on-session payments (3DS). null indicates &#x27;merchant&#x27;. \* merchant - Payment initiated on stored payment method by the merchant \* customer - Customer initiated 3DS payment
126
-
127
- */
128
-
129
- initiator_type?:'merchant' | 'customer';
130
-
131
- /**
132
- * @description Indicates whether this transaction has gone through 3DS. Applicable only for &#x27;on-session&#x27; payments \&amp; verifications.If 3DS is not enforced by the gateway/bank or if the customers&#x27; card is not enrolled, this will be false.
133
-
134
- */
135
-
136
- three_d_secure?:boolean;
137
-
138
- /**
139
- * @description Type of authorization transaction. \* verification - The transaction has been created for payment method verification. \* blocking_funds - The transaction has been created to block the funds from payment method.
140
-
141
- */
142
-
143
- authorization_reason?:'blocking_funds' | 'verification';
144
-
145
- /**
146
- * @description Error code received from the payment gateway on failure.
147
-
148
- */
149
-
150
- error_code?:string;
151
-
152
- /**
153
- * @description Error message received from the payment gateway on failure.
154
-
155
- */
156
-
157
- error_text?:string;
158
-
159
- /**
160
- * @description Timestamp indicating when the payment was voided or authorization expired at gateway.
161
-
162
- */
163
-
164
- voided_at?:number;
165
-
166
- /**
167
- * @description Version number of this resource. The &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
168
-
169
- */
170
-
171
- resource_version?:number;
172
-
173
- /**
174
- * @description Timestamp indicating when this transaction was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.
175
-
176
- */
177
-
178
- updated_at?:number;
179
-
180
- /**
181
- * @description Short description why the transaction was marked as fraud/suspicious
182
-
183
- */
184
-
185
- fraud_reason?:string;
186
-
187
- custom_payment_method_id?:string;
188
-
189
- /**
190
- * @description This is the part of the &#x60;amount&#x60; which has not been invoiced yet and is therefore added to [excess_payments](customers#customer_excess_payments) for the customer. Applicable only for a transaction of &#x60;type&#x60; &#x3D; &#x60;payment&#x60;.
191
-
192
- */
193
-
194
- amount_unused?:number;
195
-
196
- /**
197
- * @description The masked card number used for this transaction. Applicable only for &#x27;Card&#x27; Payment Method
198
-
199
- */
200
-
201
- masked_card_number?:string;
202
-
203
- /**
204
- * @description This is the &#x60;id&#x60; of the offline transaction that is being refunded or reversed. Applicable only for transaction of &#x60;type&#x60; &#x3D; &#x60;refund&#x60; or &#x60;payment_reversal&#x60;.
205
-
206
- */
207
-
208
- reference_transaction_id?:string;
209
-
210
- /**
211
- * @description This is the &#x60;id&#x60; of the transaction (always of &#x60;type&#x60; &#x3D; &#x60;payment&#x60;) being refunded. Applicable only for transaction of &#x60;type&#x60; &#x3D; &#x60;refund&#x60;.
212
-
213
- */
214
-
215
- refunded_txn_id?:string;
216
-
217
- /**
218
- * @description This is the &#x60;id&#x60; of the transaction (always of &#x60;type&#x60; &#x3D; &#x60;authorization&#x60;) which authorizes the payment being captured. Applicable only for transaction of &#x60;type&#x60; &#x3D; &#x60;payment&#x60;.
219
-
220
- */
221
-
222
- reference_authorization_id?:string;
223
-
224
- /**
225
- * @description This is the part of the authorized &#x60;amount&#x60; that is yet to be captured. The payment capture is recorded as a transaction of of &#x60;type&#x60; &#x3D; &#x60;payment&#x60;. Applicable only for a transaction of &#x60;type&#x60; &#x3D; &#x60;authorization&#x60;.
226
-
227
- */
228
-
229
- amount_capturable?:number;
230
-
231
- /**
232
- * @description Reversal transaction id. Applicable only for payment transactions.
233
-
234
- */
235
-
236
- reversal_transaction_id?:string;
237
-
238
- /**
239
- * @description Indicates that this resource has been deleted.
240
-
241
- */
242
-
243
- deleted:boolean;
244
-
245
- /**
246
- * @description First 6 digits of the card payment method.
247
-
248
- */
249
-
250
- iin?:string;
251
-
252
- /**
253
- * @description Last 4 digits of the card payment method.
254
-
255
- */
256
-
257
- last4?:string;
258
-
259
- /**
260
- * @description A unique id used to track this transaction across various systems you integrate with. This id is passed to the payment gateway when the transaction is initiated. Supported only for the [Exact payment gateway](https://www.chargebee.com/docs/exact-direct.html).
261
-
262
- */
263
-
264
- merchant_reference_id?:string;
265
-
266
- /**
267
- * @description The unique ID of the [business entity](/docs/api?prod_cat_ver&#x3D;2#mbe) of this &#x60;transaction&#x60;. This is always the same as the business entity of the [customer](/docs/api/transactions?prod_cat_ver&#x3D;2#transaction_customer_id).
268
-
269
- */
270
-
271
- business_entity_id?:string;
272
-
273
- /**
274
- * @description Payment method details of the corresponding transaction
275
-
276
- */
277
-
278
- payment_method_details?:string;
279
-
280
- custom_payment_method_name?:string;
281
-
282
- /**
283
- * @description Applicable only for &#x27;Payment&#x27; transactions. The list of invoices this &#x27;payment&#x27; transaction is applied to.
284
-
285
- */
286
-
287
- linked_invoices?:Transaction.InvoiceTransaction[];
288
-
289
- /**
290
- * @description Applicable only for &#x27;Refund&#x27; transactions. The list of Credit Notes this &#x27;refund&#x27; transaction is associated with.
291
-
292
- */
293
-
294
- linked_credit_notes?:Transaction.CreditNoteTransaction[];
295
-
296
- /**
297
- * @description Applicable only for Payment transactions. It only returns values when the transaction is not associated with an invoice, and that there is a refund for the transaction.
298
-
299
- */
300
-
301
- linked_refunds?:Transaction.TxnRefundsAndReversal[];
302
-
303
- /**
304
- * @description The list of payments captured for this authorization transaction.
305
-
306
- */
307
-
308
- linked_payments?:Transaction.LinkedPayment[];
309
-
310
- /**
311
- * @description Comprehensive information regarding the error experienced during an unsuccessful or declined transaction. Learn more about [gateway error references](gateway_error_references)
312
-
313
- */
314
-
315
- error_detail?:Transaction.GatewayErrorDetail;
6
+ id: string;
7
+ customer_id?: string;
8
+ subscription_id?: string;
9
+ gateway_account_id?: string;
10
+ payment_source_id?: string;
11
+ payment_method: PaymentMethod;
12
+ reference_number?: string;
13
+ gateway: Gateway;
14
+ type: 'authorization' | 'payment' | 'refund' | 'payment_reversal';
15
+ date?: number;
16
+ settled_at?: number;
17
+ exchange_rate?: number;
18
+ currency_code: string;
19
+ amount?: number;
20
+ id_at_gateway?: string;
21
+ status?:
22
+ | 'in_progress'
23
+ | 'success'
24
+ | 'voided'
25
+ | 'failure'
26
+ | 'timeout'
27
+ | 'needs_attention';
28
+ fraud_flag?: 'safe' | 'suspicious' | 'fraudulent';
29
+ initiator_type?: 'customer' | 'merchant';
30
+ three_d_secure?: boolean;
31
+ authorization_reason?: 'blocking_funds' | 'verification';
32
+ error_code?: string;
33
+ error_text?: string;
34
+ voided_at?: number;
35
+ resource_version?: number;
36
+ updated_at?: number;
37
+ fraud_reason?: string;
38
+ custom_payment_method_id?: string;
39
+ amount_unused?: number;
40
+ masked_card_number?: string;
41
+ reference_transaction_id?: string;
42
+ refunded_txn_id?: string;
43
+ reference_authorization_id?: string;
44
+ amount_capturable?: number;
45
+ reversal_transaction_id?: string;
46
+ linked_invoices?: Transaction.LinkedInvoice[];
47
+ linked_credit_notes?: Transaction.LinkedCreditNote[];
48
+ linked_refunds?: Transaction.LinkedRefund[];
49
+ linked_payments?: Transaction.LinkedPayment[];
50
+ deleted: boolean;
51
+ iin?: string;
52
+ last4?: string;
53
+ merchant_reference_id?: string;
54
+ business_entity_id?: string;
55
+ payment_method_details?: string;
56
+ error_detail?: Transaction.GatewayErrorDetail;
57
+ custom_payment_method_name?: string;
316
58
  }
317
- export namespace Transaction {
318
- export class TransactionResource {
319
- /**
320
- * @description Authorizes a specific amount in customer&#x27;s Credit card, which can be collected within a span of time. Read more on authorization and capture [here](https://www.chargebee.com/docs/stripe.html#auth-and-capture).
321
-
322
- */
323
-
324
- create_authorization(input:CreateAuthorizationInputParam):ChargebeeRequest<CreateAuthorizationResponse>;
325
-
326
- /**
327
- * @description This API voids the specific authorization transaction in order to release the blocked funds from the customer&#x27;s card. Voiding an already captured or voided transaction is not possible.
328
-
329
- */
330
-
331
- void_transaction(transaction_id:string):ChargebeeRequest<VoidTransactionResponse>;
332
-
333
- /**
334
- * @description Records a refund made offline. Applicable only for &#x60;transaction&#x60;s of [type](transactions#transaction_type) &#x3D; &#x60;payment&#x60;.
335
-
336
- */
337
-
338
- record_refund(transaction_id:string, input:RecordRefundInputParam):ChargebeeRequest<RecordRefundResponse>;
339
-
340
- /**
341
- * @description Refunds an online payment. Applicable only for &#x60;transaction&#x60;s of [type](transactions#transaction_type) &#x3D; &#x60;payment&#x60;. You can only refund a &#x60;transaction&#x60; whose [status](transactions#transaction_status)&#x60; &#x60; is &#x60;success&#x60;.
342
-
343
- */
344
-
345
- refund(transaction_id:string, input?:RefundInputParam):ChargebeeRequest<RefundResponse>;
346
-
347
- /**
348
- * @description Lists all the transactions.
349
59
 
350
- */
351
-
352
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
353
-
354
- /**
355
- * @description Retrieves the payments for an invoice with the recent ones on top. This returns all the payment attempts(manual \&amp; automatic) made for this invoice.
356
-
357
- */
358
-
359
- payments_for_invoice(invoice_id:string, input?:PaymentsForInvoiceInputParam):ChargebeeRequest<PaymentsForInvoiceResponse>;
360
-
361
- /**
362
- * @description Retrieve a transaction identified by its unique id.
363
-
364
- */
365
-
366
- retrieve(transaction_id:string):ChargebeeRequest<RetrieveResponse>;
367
-
368
- /**
369
- * @description This API deletes an offline transaction. However, to delete an offline transaction all payment allocations associated with the transaction must be removed.
370
-
371
- */
372
-
373
- delete_offline_transaction(transaction_id:string, input?:DeleteOfflineTransactionInputParam):ChargebeeRequest<DeleteOfflineTransactionResponse>;
374
- }
375
- export interface CreateAuthorizationResponse {
376
- transaction:Transaction;
60
+ export namespace Transaction {
61
+ export class TransactionResource {
62
+ createAuthorization(
63
+ input: CreateAuthorizationInputParam,
64
+ headers?: ChargebeeRequestHeader,
65
+ ): Promise<ChargebeeResponse<CreateAuthorizationResponse>>;
66
+
67
+ voidTransaction(
68
+ transaction_id: string,
69
+ headers?: ChargebeeRequestHeader,
70
+ ): Promise<ChargebeeResponse<VoidTransactionResponse>>;
71
+
72
+ recordRefund(
73
+ transaction_id: string,
74
+ input: RecordRefundInputParam,
75
+ headers?: ChargebeeRequestHeader,
76
+ ): Promise<ChargebeeResponse<RecordRefundResponse>>;
77
+
78
+ reconcile(
79
+ transaction_id: string,
80
+ input?: ReconcileInputParam,
81
+ headers?: ChargebeeRequestHeader,
82
+ ): Promise<ChargebeeResponse<ReconcileResponse>>;
83
+
84
+ refund(
85
+ transaction_id: string,
86
+ input?: RefundInputParam,
87
+ headers?: ChargebeeRequestHeader,
88
+ ): Promise<ChargebeeResponse<RefundResponse>>;
89
+
90
+ list(
91
+ input?: ListInputParam,
92
+ headers?: ChargebeeRequestHeader,
93
+ ): Promise<ChargebeeResponse<ListResponse>>;
94
+
95
+ transactionsForCustomer(
96
+ customer_id: string,
97
+ input?: TransactionsForCustomerInputParam,
98
+ headers?: ChargebeeRequestHeader,
99
+ ): Promise<ChargebeeResponse<TransactionsForCustomerResponse>>;
100
+
101
+ transactionsForSubscription(
102
+ subscription_id: string,
103
+ input?: TransactionsForSubscriptionInputParam,
104
+ headers?: ChargebeeRequestHeader,
105
+ ): Promise<ChargebeeResponse<TransactionsForSubscriptionResponse>>;
106
+
107
+ paymentsForInvoice(
108
+ invoice_id: string,
109
+ input?: PaymentsForInvoiceInputParam,
110
+ headers?: ChargebeeRequestHeader,
111
+ ): Promise<ChargebeeResponse<PaymentsForInvoiceResponse>>;
112
+
113
+ retrieve(
114
+ transaction_id: string,
115
+ headers?: ChargebeeRequestHeader,
116
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
117
+
118
+ deleteOfflineTransaction(
119
+ transaction_id: string,
120
+ input?: DeleteOfflineTransactionInputParam,
121
+ headers?: ChargebeeRequestHeader,
122
+ ): Promise<ChargebeeResponse<DeleteOfflineTransactionResponse>>;
377
123
  }
378
- export interface CreateAuthorizationInputParam {
379
-
380
- /**
381
- * @description Identifier of the customer.
382
-
383
- */
384
-
385
- customer_id:string;
386
-
387
- /**
388
- * @description Payment source to be used for authorizing the transaction.
389
-
390
- */
391
-
392
- payment_source_id?:string;
393
-
394
- /**
395
- * @description The currency code (ISO 4217 format) of the transaction amount.
396
-
397
- */
398
-
399
- currency_code?:string;
400
-
401
- /**
402
- * @description The amount to be blocked.
403
124
 
404
- */
405
-
406
- amount:number;
125
+ export interface CreateAuthorizationResponse {
126
+ transaction: Transaction;
407
127
  }
408
- export interface VoidTransactionResponse {
409
- transaction:Transaction;
410
- }
411
-
412
- export interface RecordRefundResponse {
413
- transaction:Transaction;
414
- }
415
- export interface RecordRefundInputParam {
416
-
417
- /**
418
- * @description The amount to be recorded as refunded. Must not exceed [amount_unused](transactions#transaction_amount_unused). If not passed then all of [amount_unused](transactions#transaction_amount_unused) is recorded as refunded.
419
-
420
- */
421
-
422
- amount?:number;
423
-
424
- /**
425
- * @description The payment method used to make the refund. \* card - Card \* alipay - Alipay \* sofort - Sofort \* play_store - Play Store \* custom - Custom \* upi - upi \* ach_credit - ACH Credit \* amazon_payments - Amazon Payments \* apple_pay - Apple Pay \* ideal - IDEAL \* giropay - giropay \* boleto - boleto \* chargeback - Only applicable for a transaction of [type](transactions#transaction_type) &#x3D; &#x60;refund&#x60;. This value is set by Chargebee when an automated [chargeback](https://www.chargebee.com/docs/chargeback.html#chargeback-process) occurs. You can also set this explicitly when [recording a refund](transactions#record_an_offline_refund). \* wechat_pay - WeChat Pay \* sepa_credit - SEPA Credit \* google_pay - Google Pay \* cash - Cash \* netbanking_emandates - netbanking_emandates \* unionpay - Unionpay \* bancontact - Bancontact \* bank_transfer - Bank Transfer \* paypal_express_checkout - Paypal Express Checkout \* app_store - App Store \* check - Check \* direct_debit - Direct Debit \* dotpay - Dotpay \* other - Payment Methods other than the above types
426
128
 
427
- */
428
-
429
- payment_method:PaymentMethod;
430
-
431
- /**
432
- * @description The date when the refund was made.
433
-
434
- */
435
-
436
- date:number;
437
-
438
- /**
439
- * @description The reference number for this transaction. For example, the check number when &#x60;payment_method&#x60; &#x3D; &#x60;check&#x60;.
440
-
441
- */
442
-
443
- reference_number?:string;
444
-
445
- /**
446
- * @description Records a refund made offline. Applicable only for &#x60;transaction&#x60;s of [type](transactions#transaction_type) &#x3D; &#x60;payment&#x60;.
447
-
448
- */
449
-
450
- custom_payment_method_id?:string;
451
-
452
- /**
453
- * @description Remarks, if any, on the refund.
454
-
455
- */
456
-
457
- comment?:string;
129
+ export interface VoidTransactionResponse {
130
+ transaction: Transaction;
458
131
  }
459
- export interface RefundResponse {
460
- transaction:Transaction;
461
- }
462
- export interface RefundInputParam {
463
-
464
- /**
465
- * @description The amount to be refunded. Must not exceed [amount_unused](transactions#transaction_amount_unused). If not passed then all of [amount_unused](transactions#transaction_amount_unused) is refunded.
466
132
 
467
- */
468
-
469
- amount?:number;
470
-
471
- /**
472
- * @description Remarks, if any, on the refund.
473
-
474
- */
475
-
476
- comment?:string;
133
+ export interface RecordRefundResponse {
134
+ transaction: Transaction;
477
135
  }
478
- export interface ListResponse {
479
- /**
480
- * @description Lists all the transactions.
481
-
482
- */
483
-
484
- list:{transaction:Transaction}[];
485
-
486
- /**
487
- * @description Lists all the transactions.
488
136
 
489
- */
490
-
491
- next_offset?:string;
137
+ export interface ReconcileResponse {
138
+ transaction: Transaction;
492
139
  }
493
- export interface ListInputParam {
494
- [key : string]: any;
495
- /**
496
- * @description Lists all the transactions.
497
-
498
- */
499
-
500
- limit?:number;
501
-
502
- /**
503
- * @description Lists all the transactions.
504
-
505
- */
506
-
507
- offset?:string;
508
-
509
- /**
510
- * @description Lists all the transactions.
511
-
512
- */
513
-
514
- include_deleted?:boolean;
515
-
516
- /**
517
- * @description Lists all the transactions.
518
-
519
- */
520
-
521
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
522
-
523
- /**
524
- * @description Lists all the transactions.
525
-
526
- */
527
-
528
- customer_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
529
-
530
- /**
531
- * @description Lists all the transactions.
532
-
533
- */
534
-
535
- subscription_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
536
-
537
- /**
538
- * @description Lists all the transactions.
539
-
540
- */
541
-
542
- payment_source_id?:{in?:string,is?:string,is_not?:string,is_present?:'true' | 'false',not_in?:string,starts_with?:string};
543
-
544
- /**
545
- * @description Lists all the transactions.
546
-
547
- */
548
-
549
- payment_method?:{in?:string,is?:'other' | 'netbanking_emandates' | 'klarna_pay_now' | 'ach_credit' | 'dotpay' | 'boleto' | 'direct_debit' | 'automated_bank_transfer' | 'chargeback' | 'wechat_pay' | 'pay_to' | 'cash' | 'giropay' | 'bank_transfer' | 'alipay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'custom' | 'unionpay' | 'check' | 'faster_payments' | 'sofort' | 'amazon_payments' | 'upi' | 'venmo' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'sepa_credit' | 'card',is_not?:'other' | 'netbanking_emandates' | 'ach_credit' | 'dotpay' | 'boleto' | 'direct_debit' | 'automated_bank_transfer' | 'chargeback' | 'wechat_pay' | 'pay_to' | 'cash' | 'giropay' | 'bank_transfer' | 'alipay' | 'ideal' | 'sepa_instant_transfer' | 'google_pay' | 'custom' | 'unionpay' | 'check' | 'faster_payments' | 'sofort' | 'amazon_payments' | 'upi' | 'venmo' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'sepa_credit' | 'card',not_in?:string};
550
-
551
- /**
552
- * @description Lists all the transactions.
553
140
 
554
- */
555
-
556
- gateway?:{in?:string,is?:'bluepay' | 'beanstream' | 'elavon' | 'orbital' | 'hdfc' | 'nmi' | 'moneris' | 'metrics_global' | 'ebanx' | 'pin' | 'stripe' | 'quickbooks' | 'razorpay' | 'eway_rapid' | 'balanced_payments' | 'ecentric' | 'wepay' | 'chargebee_payments' | 'bank_of_america' | 'braintree' | 'first_data_global' | 'paypal_express_checkout' | 'ingenico_direct' | 'moneris_us' | 'exact' | 'migs' | 'checkout_com' | 'not_applicable' | 'paypal_pro' | 'ogone' | 'eway' | 'dlocal' | 'gocardless' | 'global_payments' | 'paymill' | 'adyen' | 'paypal' | 'chargebee' | 'authorize_net' | 'tco' | 'bluesnap' | 'windcave' | 'paypal_payflow_pro' | 'amazon_payments' | 'mollie' | 'cybersource' | 'wirecard' | 'sage_pay' | 'vantiv' | 'worldpay' | 'pay_com',is_not?:'bluepay' | 'beanstream' | 'elavon' | 'orbital' | 'hdfc' | 'nmi' | 'moneris' | 'metrics_global' | 'ebanx' | 'pin' | 'stripe' | 'quickbooks' | 'razorpay' | 'eway_rapid' | 'balanced_payments' | 'ecentric' | 'wepay' | 'chargebee_payments' | 'bank_of_america' | 'braintree' | 'first_data_global' | 'paypal_express_checkout' | 'ingenico_direct' | 'moneris_us' | 'exact' | 'migs' | 'checkout_com' | 'not_applicable' | 'paypal_pro' | 'ogone' | 'eway' | 'dlocal' | 'gocardless' | 'global_payments' | 'paymill' | 'adyen' | 'paypal' | 'chargebee' | 'authorize_net' | 'tco' | 'bluesnap' | 'windcave' | 'paypal_payflow_pro' | 'amazon_payments' | 'mollie' | 'cybersource' | 'wirecard' | 'sage_pay' | 'vantiv' | 'worldpay' | 'pay_com',not_in?:string};
557
-
558
- /**
559
- * @description Lists all the transactions.
560
-
561
- */
562
-
563
- gateway_account_id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
564
-
565
- /**
566
- * @description Lists all the transactions.
567
-
568
- */
569
-
570
- id_at_gateway?:{is?:string,is_not?:string,starts_with?:string};
571
-
572
- /**
573
- * @description Lists all the transactions.
574
-
575
- */
576
-
577
- reference_number?:{is?:string,is_not?:string,is_present?:'true' | 'false',starts_with?:string};
578
-
579
- /**
580
- * @description Lists all the transactions.
581
-
582
- */
583
-
584
- type?:{in?:string,is?:'authorization' | 'payment_reversal' | 'payment' | 'refund',is_not?:'authorization' | 'payment_reversal' | 'payment' | 'refund',not_in?:string};
585
-
586
- /**
587
- * @description Lists all the transactions.
588
-
589
- */
590
-
591
- date?:{after?:string,before?:string,between?:string,on?:string};
592
-
593
- /**
594
- * @description Lists all the transactions.
595
-
596
- */
597
-
598
- amount?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
599
-
600
- /**
601
- * @description Lists all the transactions.
602
-
603
- */
604
-
605
- amount_capturable?:{between?:string,gt?:string,gte?:string,is?:string,is_not?:string,lt?:string,lte?:string};
606
-
607
- /**
608
- * @description Lists all the transactions.
141
+ export interface RefundResponse {
142
+ transaction: Transaction;
143
+ }
609
144
 
610
- */
611
-
612
- status?:{in?:string,is?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention',is_not?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention',not_in?:string};
613
-
614
- /**
615
- * @description Lists all the transactions.
145
+ export interface ListResponse {
146
+ list: { transaction: Transaction }[];
147
+ next_offset?: string;
148
+ }
616
149
 
617
- */
618
-
619
- updated_at?:{after?:string,before?:string,between?:string,on?:string};
620
-
621
- /**
622
- * @description Lists all the transactions.
150
+ export interface TransactionsForCustomerResponse {
151
+ list: { transaction: Transaction }[];
152
+ next_offset?: string;
153
+ }
623
154
 
624
- */
625
-
626
- sort_by?:{asc?:'date' | 'updated_at',desc?:'date' | 'updated_at'};
155
+ export interface TransactionsForSubscriptionResponse {
156
+ list: { transaction: Transaction }[];
157
+ next_offset?: string;
627
158
  }
628
- export interface PaymentsForInvoiceResponse {
629
- /**
630
- * @description Retrieves the payments for an invoice with the recent ones on top. This returns all the payment attempts(manual \&amp; automatic) made for this invoice.
631
159
 
632
- */
633
-
634
- list:{transaction:Transaction}[];
635
-
636
- /**
637
- * @description Retrieves the payments for an invoice with the recent ones on top. This returns all the payment attempts(manual \&amp; automatic) made for this invoice.
160
+ export interface PaymentsForInvoiceResponse {
161
+ list: { transaction: Transaction }[];
162
+ next_offset?: string;
163
+ }
638
164
 
639
- */
640
-
641
- next_offset?:string;
165
+ export interface RetrieveResponse {
166
+ transaction: Transaction;
642
167
  }
643
- export interface PaymentsForInvoiceInputParam {
644
- [key : string]: any;
645
- /**
646
- * @description Retrieves the payments for an invoice with the recent ones on top. This returns all the payment attempts(manual \&amp; automatic) made for this invoice.
647
168
 
648
- */
649
-
650
- limit?:number;
651
-
652
- /**
653
- * @description Retrieves the payments for an invoice with the recent ones on top. This returns all the payment attempts(manual \&amp; automatic) made for this invoice.
169
+ export interface DeleteOfflineTransactionResponse {
170
+ transaction: Transaction;
171
+ }
654
172
 
655
- */
656
-
657
- offset?:string;
173
+ export interface LinkedInvoice {
174
+ invoice_id: string;
175
+ applied_amount: number;
176
+ applied_at: number;
177
+ invoice_date?: number;
178
+ invoice_total?: number;
179
+ invoice_status:
180
+ | 'paid'
181
+ | 'posted'
182
+ | 'payment_due'
183
+ | 'not_paid'
184
+ | 'voided'
185
+ | 'pending';
658
186
  }
659
- export interface RetrieveResponse {
660
- transaction:Transaction;
187
+ export interface LinkedCreditNote {
188
+ cn_id: string;
189
+ applied_amount: number;
190
+ applied_at: number;
191
+ cn_reason_code?:
192
+ | 'write_off'
193
+ | 'subscription_change'
194
+ | 'subscription_cancellation'
195
+ | 'subscription_pause'
196
+ | 'chargeback'
197
+ | 'product_unsatisfactory'
198
+ | 'service_unsatisfactory'
199
+ | 'order_change'
200
+ | 'order_cancellation'
201
+ | 'waiver'
202
+ | 'other'
203
+ | 'fraudulent';
204
+ cn_create_reason_code?: string;
205
+ cn_date?: number;
206
+ cn_total?: number;
207
+ cn_status: 'adjusted' | 'refunded' | 'refund_due' | 'voided';
208
+ cn_reference_invoice_id: string;
661
209
  }
662
-
663
- export interface DeleteOfflineTransactionResponse {
664
- transaction:Transaction;
210
+ export interface LinkedRefund {
211
+ txn_id: string;
212
+ txn_status:
213
+ | 'in_progress'
214
+ | 'success'
215
+ | 'voided'
216
+ | 'failure'
217
+ | 'timeout'
218
+ | 'needs_attention';
219
+ txn_date: number;
220
+ txn_amount: number;
665
221
  }
666
- export interface DeleteOfflineTransactionInputParam {
667
-
668
- /**
669
- * @description Reason for deleting this transaction. This comment will be added to the associated entity.
670
-
671
- */
672
-
673
- comment?:string;
222
+ export interface LinkedPayment {
223
+ id: string;
224
+ status?:
225
+ | 'in_progress'
226
+ | 'success'
227
+ | 'voided'
228
+ | 'failure'
229
+ | 'timeout'
230
+ | 'needs_attention';
231
+ amount?: number;
232
+ date?: number;
674
233
  }
675
- export interface InvoiceTransaction {
676
- /**
677
- * @description Identifier for the invoice.
678
-
679
- */
680
-
681
- invoice_id:string;
682
-
683
- /**
684
- * @description The transaction amount applied to this invoice
685
-
686
- */
687
-
688
- applied_amount:number;
689
-
690
- /**
691
- * @description Timestamp at which the transaction is applied.
692
-
693
- */
694
-
695
- applied_at:number;
696
-
697
- /**
698
- * @description The date this invoice is issued.
699
-
700
- */
701
-
702
- invoice_date?:number;
703
-
704
- /**
705
- * @description Total amount of the invoice
706
-
707
- */
708
-
709
- invoice_total?:number;
710
-
711
- /**
712
- * @description Current status of this invoice. \* pending -
713
- The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;2#invoice_status) is yet to be closed (sent for payment collection). An invoice is generated with this &#x60;status&#x60; when it has line items that belong to items that are &#x60;metered&#x60; or when the &#x60;subscription.create_pending_invoices&#x60;attribute is set to &#x60;true&#x60;.
714
- The [invoice](/docs/api/invoices?prod_cat_ver&#x3D;1#invoice_status) is yet to be closed (sent for payment collection). All invoices are generated with this &#x60;status&#x60; when [Metered Billing](https://www.chargebee.com/docs/1.0/metered_billing.html) is enabled for the site. \* voided - Indicates a voided invoice. \* payment_due - Indicates the payment is not yet collected and is being retried as per retry settings. \* paid - Indicates a paid invoice. \* posted - Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period \* not_paid - Indicates the payment is not made and all attempts to collect is failed.
715
-
716
- */
717
-
718
- invoice_status:'pending' | 'paid' | 'voided' | 'not_paid' | 'posted' | 'payment_due';
234
+ export interface GatewayErrorDetail {
235
+ request_id?: string;
236
+ error_category?: string;
237
+ error_code?: string;
238
+ error_message?: string;
239
+ decline_code?: string;
240
+ decline_message?: string;
241
+ network_error_code?: string;
242
+ network_error_message?: string;
243
+ error_field?: string;
244
+ recommendation_code?: string;
245
+ recommendation_message?: string;
246
+ processor_error_code?: string;
247
+ processor_error_message?: string;
719
248
  }
720
- export interface CreditNoteTransaction {
721
- /**
722
- * @description Identifier for the credit-notes.
723
-
724
- */
725
-
726
- cn_id:string;
727
-
728
- /**
729
- * @description The transaction amount applied to this invoice
730
-
731
- */
732
-
733
- applied_amount:number;
734
-
735
- /**
736
- * @description Timestamp at which the transaction is applied.
737
-
738
- */
739
-
740
- applied_at:number;
741
-
742
- /**
743
- * @description Credit note reason code. Deprecated use the cn_create_reason_code parameter instead \* service_unsatisfactory - Service Unsatisfactory \* other - Can be set when none of the above reason codes are applicable \* subscription_cancellation - This reason will be set automatically for Credit Notes created during cancel subscription operation \* fraudulent - FRAUDULENT \* order_change - Order Change \* subscription_pause - This reason will be automatically set to credit notes created during pause/resume subscription operation. \* write_off - This reason will be set automatically for the Credit Notes created during invoice [Write Off](https://www.chargebee.com/docs/invoice-operations.html#write-off) operation. \* subscription_change - This reason will be set automatically for Credit Notes created during Change Subscription operation when [proration](https://www.chargebee.com/docs/proration.html) is enabled \* chargeback - Can be set when you are recording your customer Chargebacks \* waiver - Waiver \* order_cancellation - Order Cancellation \* product_unsatisfactory - Product Unsatisfactory
744
-
745
- */
746
-
747
- cn_reason_code?:'other' | 'product_unsatisfactory' | 'subscription_pause' | 'order_cancellation' | 'service_unsatisfactory' | 'subscription_cancellation' | 'chargeback' | 'order_change' | 'write_off' | 'waiver' | 'subscription_change' | 'fraudulent';
748
-
749
- /**
750
- * @description Credit note reason code
751
-
752
- */
753
-
754
- cn_create_reason_code?:string;
755
-
756
- /**
757
- * @description The date this credit note is created.
249
+ // REQUEST PARAMS
250
+ //---------------
758
251
 
759
- */
760
-
761
- cn_date?:number;
762
-
763
- /**
764
- * @description Total amount of the credit note
765
-
766
- */
767
-
768
- cn_total?:number;
769
-
770
- /**
771
- * @description The status of this Credit Note. \* voided - When the Credit Note has been cancelled. \* refund_due - When the credits are yet to be used, or have been partially used. \* refunded - When the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded). \* adjusted - When the Credit Note has been adjusted against an invoice.
772
-
773
- */
774
-
775
- cn_status:'refund_due' | 'adjusted' | 'refunded' | 'voided';
776
-
777
- /**
778
- * @description The invoice number. Acts as a identifier for invoice and typically generated sequentially.
779
-
780
- */
781
-
782
- cn_reference_invoice_id:string;
252
+ export interface CreateAuthorizationInputParam {
253
+ customer_id: string;
254
+ payment_source_id?: string;
255
+ currency_code?: string;
256
+ amount: number;
783
257
  }
784
- export interface TxnRefundsAndReversal {
785
- /**
786
- * @description Uniquely identifies the transaction.
787
-
788
- */
789
-
790
- txn_id:string;
791
-
792
- /**
793
- * @description The status of this transaction. \* needs_attention - Connection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually \* voided - The transaction got voided or authorization expired at gateway. \* timeout - Transaction failed because of Gateway not accepting the connection. \* success - The transaction is successful. \* failure - Transaction failed. Refer the &#x27;error_code&#x27; and &#x27;error_text&#x27; fields to know the reason for failure \* in_progress - Transaction is being processed by the gateway. This typically happens for [direct debit transactions](https://www.chargebee.com/docs/direct-debit-payments.html) or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method.
794
-
795
- */
796
-
797
- txn_status:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
798
-
799
- /**
800
- * @description Indicates when this refund occured.
801
-
802
- */
803
-
804
- txn_date:number;
805
-
806
- /**
807
- * @description Amount of this refund transaction.
808
-
809
- */
810
-
811
- txn_amount:number;
258
+ export interface RecordRefundInputParam {
259
+ amount?: number;
260
+ payment_method: PaymentMethod;
261
+ date: number;
262
+ reference_number?: string;
263
+ custom_payment_method_id?: string;
264
+ comment?: string;
812
265
  }
813
- export interface LinkedPayment {
814
- /**
815
- * @description Uniquely identifies the transaction.
816
-
817
- */
818
-
819
- id:string;
820
-
821
- /**
822
- * @description The status of this transaction. \* needs_attention - Connection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually \* success - The transaction is successful. \* voided - The transaction got voided or authorization expired at gateway. \* in_progress - Transaction is being processed by the gateway. This typically happens for [direct debit transactions](https://www.chargebee.com/docs/direct-debit-payments.html) or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method. \* failure - Transaction failed. Refer the &#x27;error_code&#x27; and &#x27;error_text&#x27; fields to know the reason for failure \* timeout - Transaction failed because of Gateway not accepting the connection.
823
-
824
- */
825
-
826
- status?:'in_progress' | 'success' | 'failure' | 'voided' | 'timeout' | 'needs_attention';
827
-
828
- /**
829
- * @description Amount for this transaction.
830
-
831
- */
832
-
833
- amount?:number;
834
-
835
- /**
836
- * @description Indicates when this transaction occurred.
837
-
838
- */
839
-
840
- date?:number;
266
+ export interface ReconcileInputParam {
267
+ id_at_gateway?: string;
268
+ customer_id?: string;
269
+ status?: 'success' | 'failure';
841
270
  }
842
- export interface GatewayErrorDetail {
843
- /**
844
- * @description This is a unique identifier assigned by the payment gateway. It is used to track the request at the payment gateway
845
-
846
- */
847
-
848
- request_id?:string;
849
-
850
- /**
851
- * @description This parameter categorizes the type of error that occurred for the request. It helps in understanding whether the error is due to API error, validation, processing, network issues, and more
852
-
853
- */
854
-
855
- error_category?:string;
856
-
857
- /**
858
- * @description A gateway-specific code that corresponds to the particular error encountered for the request. This code can be used for identifying the error in a standardized manner across the gateway&#x27;s services
859
-
860
- */
861
-
862
- error_code?:string;
863
-
864
- /**
865
- * @description A message provided by the gateway that describes the nature of the error encountered
866
-
867
- */
868
-
869
- error_message?:string;
870
-
871
- /**
872
- * @description When a transaction is declined, this code is provided by the gateway to specify the reason for the decline
873
-
874
- */
875
-
876
- decline_code?:string;
877
-
878
- /**
879
- * @description This message gives a descriptive explanation of the reason for the transaction&#x27;s decline
880
-
881
- */
882
-
883
- decline_message?:string;
884
-
885
- /**
886
- * @description This code represents errors that originate from the payment network (such as Visa, MasterCard, and more). It is different from the gateway error code and is specific to the network&#x27;s error-handling system
887
-
888
- */
889
-
890
- network_error_code?:string;
891
-
892
- /**
893
- * @description This the network related error message from the gateway, this is a detailed message provided by the payment network explaining the nature of the network error encountered
894
-
895
- */
896
-
897
- network_error_message?:string;
898
-
899
- /**
900
- * @description This parameter indicates which specific data field or attribute in the request caused the error
901
-
902
- */
903
-
904
- error_field?:string;
905
-
906
- /**
907
- * @description After an error has occurred, the gateway or payment network may provide a recommendation code. This code suggests a course of action or remedy that you can follow to resolve the issue
908
-
909
- */
910
-
911
- recommendation_code?:string;
912
-
913
- /**
914
- * @description This message is intended to provide guidance or suggestions on action or remedy that you can follow to resolve the issue
915
-
916
- */
917
-
918
- recommendation_message?:string;
919
-
920
- /**
921
- * @description This code is provided by the payment processor (the entity that handles the transaction between the bank accounts and the payment networks) and indicates errors that occur at this stage of the payment process
922
-
923
- */
924
-
925
- processor_error_code?:string;
926
-
927
- /**
928
- * @description This message describes the specific error that the payment processor encountered
929
-
930
- */
931
-
932
- processor_error_message?:string;
271
+ export interface RefundInputParam {
272
+ amount?: number;
273
+ comment?: string;
274
+ }
275
+ export interface ListInputParam {
276
+ limit?: number;
277
+ offset?: string;
278
+ include_deleted?: boolean;
279
+ id?: filter.String;
280
+ customer_id?: filter.String;
281
+ subscription_id?: filter.String;
282
+ payment_source_id?: filter.String;
283
+ payment_method?: filter.Enum;
284
+ gateway?: filter.Enum;
285
+ gateway_account_id?: filter.String;
286
+ id_at_gateway?: filter.String;
287
+ reference_number?: filter.String;
288
+ type?: filter.Enum;
289
+ date?: filter.Timestamp;
290
+ amount?: filter.Number;
291
+ amount_capturable?: filter.Number;
292
+ status?: filter.Enum;
293
+ updated_at?: filter.Timestamp;
294
+ 'sort_by[asc]'?: string;
295
+ 'sort_by[desc]'?: string;
296
+ }
297
+ export interface TransactionsForCustomerInputParam {
298
+ limit?: number;
299
+ offset?: string;
300
+ }
301
+ export interface TransactionsForSubscriptionInputParam {
302
+ limit?: number;
303
+ offset?: string;
304
+ }
305
+ export interface PaymentsForInvoiceInputParam {
306
+ limit?: number;
307
+ offset?: string;
308
+ }
309
+ export interface DeleteOfflineTransactionInputParam {
310
+ comment?: string;
933
311
  }
934
312
  }
935
- }
313
+ }