chargebee 2.25.3 → 2.26.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 (65) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +55 -49
  3. package/lib/chargebee.js +1 -1
  4. package/package.json +1 -1
  5. package/types/core.d.ts +1 -0
  6. package/types/resources/Address.d.ts +245 -5
  7. package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
  8. package/types/resources/AttachedItem.d.ts +305 -13
  9. package/types/resources/Card.d.ts +485 -13
  10. package/types/resources/Comment.d.ts +177 -11
  11. package/types/resources/Contact.d.ts +54 -0
  12. package/types/resources/ContractTerm.d.ts +83 -0
  13. package/types/resources/Coupon.d.ts +665 -20
  14. package/types/resources/CouponCode.d.ts +56 -5
  15. package/types/resources/CouponSet.d.ts +224 -17
  16. package/types/resources/CreditNote.d.ts +1202 -44
  17. package/types/resources/CreditNoteEstimate.d.ts +75 -6
  18. package/types/resources/Customer.d.ts +2132 -73
  19. package/types/resources/DifferentialPrice.d.ts +266 -15
  20. package/types/resources/Discount.d.ts +107 -0
  21. package/types/resources/Download.d.ts +18 -0
  22. package/types/resources/EntitlementOverride.d.ts +101 -7
  23. package/types/resources/Estimate.d.ts +1181 -27
  24. package/types/resources/Event.d.ts +145 -8
  25. package/types/resources/Export.d.ts +703 -32
  26. package/types/resources/Feature.d.ts +356 -22
  27. package/types/resources/Gift.d.ts +351 -24
  28. package/types/resources/Hierarchy.d.ts +30 -0
  29. package/types/resources/HostedPage.d.ts +1212 -37
  30. package/types/resources/ImpactedItem.d.ts +41 -1
  31. package/types/resources/ImpactedSubscription.d.ts +36 -1
  32. package/types/resources/InAppSubscription.d.ts +636 -9
  33. package/types/resources/Invoice.d.ts +2293 -93
  34. package/types/resources/InvoiceEstimate.d.ts +75 -6
  35. package/types/resources/Item.d.ts +542 -16
  36. package/types/resources/ItemEntitlement.d.ts +172 -13
  37. package/types/resources/ItemFamily.d.ts +173 -15
  38. package/types/resources/ItemPrice.d.ts +971 -26
  39. package/types/resources/Media.d.ts +24 -0
  40. package/types/resources/NonSubscription.d.ts +51 -3
  41. package/types/resources/Order.d.ts +1224 -32
  42. package/types/resources/PaymentIntent.d.ts +318 -8
  43. package/types/resources/PaymentReferenceNumber.d.ts +24 -0
  44. package/types/resources/PaymentSource.d.ts +1259 -55
  45. package/types/resources/PaymentVoucher.d.ts +262 -14
  46. package/types/resources/PortalSession.d.ts +187 -10
  47. package/types/resources/PromotionalCredit.d.ts +351 -16
  48. package/types/resources/Purchase.d.ts +274 -5
  49. package/types/resources/Quote.d.ts +1595 -62
  50. package/types/resources/QuoteLineGroup.d.ts +134 -5
  51. package/types/resources/QuotedCharge.d.ts +63 -5
  52. package/types/resources/QuotedSubscription.d.ts +192 -5
  53. package/types/resources/ResourceMigration.d.ts +73 -3
  54. package/types/resources/SiteMigrationDetail.d.ts +98 -5
  55. package/types/resources/Subscription.d.ts +3462 -137
  56. package/types/resources/SubscriptionEntitlement.d.ts +116 -8
  57. package/types/resources/SubscriptionEstimate.d.ts +36 -2
  58. package/types/resources/TaxWithheld.d.ts +32 -0
  59. package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
  60. package/types/resources/TimeMachine.d.ts +99 -7
  61. package/types/resources/Token.d.ts +179 -7
  62. package/types/resources/Transaction.d.ts +597 -25
  63. package/types/resources/UnbilledCharge.d.ts +355 -14
  64. package/types/resources/Usage.d.ts +259 -13
  65. package/types/resources/VirtualBankAccount.d.ts +255 -17
@@ -1,83 +1,555 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  declare module 'chargebee' {
3
3
  export interface Card {
4
+
5
+ /**
6
+ * @description Identifier of the payment source
7
+
8
+ */
9
+
4
10
  payment_source_id:string;
11
+
12
+ /**
13
+ * @description Current status of the card. \* valid - A valid and active credit card \* expired - An expired card \* expiring - A card which is expiring in the current month.
14
+
15
+ */
16
+
5
17
  status:'valid' | 'expiring' | 'expired';
18
+
19
+ /**
20
+ * @description Name of the gateway this payment source is stored with. \* bluesnap - BlueSnap is a payment gateway. \* tco - 2Checkout is a payment gateway. \* first_data_global - First Data Global Gateway Virtual Terminal Account \* exact - Exact Payments is a payment gateway. \* bluepay - BluePay is a payment gateway. \* paypal_express_checkout - PayPal Express Checkout is a payment gateway. \* eway - eWAY Account is a payment gateway. \* paypal_payflow_pro - PayPal Payflow Pro 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. \* global_payments - Global Payments is a payment service provider. \* amazon_payments - Amazon Payments is a payment service provider. \* not_applicable - Indicates that payment gateway is not applicable for this resource. \* checkout_com - Checkout.com is a payment gateway. \* adyen - Adyen is a payment gateway. \* braintree - Braintree is a payment gateway. \* nmi - NMI is a payment gateway. \* quickbooks - Intuit QuickBooks Payments gateway \* wepay - WePay is a payment gateway. \* worldpay - WorldPay is a payment gateway \* wirecard - WireCard Account is a payment service provider. \* chargebee_payments - Chargebee Payments gateway \* sage_pay - Sage Pay is a payment gateway. \* moneris_us - Moneris USA is a payment gateway. \* pin - Pin is a payment gateway \* authorize_net - Authorize.net is a payment gateway \* elavon - Elavon Virtual Merchant is a payment solution. \* paypal_pro - PayPal Pro Account is a payment gateway. \* orbital - Chase Paymentech(Orbital) is a payment gateway. \* paypal - PayPal Commerce is a payment gateway. \* beanstream - Bambora(formerly known as Beanstream) is a payment gateway. \* hdfc - HDFC Account 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. \* stripe - Stripe is a payment gateway. \* vantiv - Vantiv is a payment gateway. \* moneris - Moneris is a payment gateway. \* chargebee - Chargebee test gateway. \* eway_rapid - eWAY Rapid is a payment gateway. \* gocardless - GoCardless is a payment service provider. \* mollie - Mollie is a payment gateway. \* paymill - PAYMILL is a payment gateway. \* balanced_payments - Balanced is a payment gateway \* cybersource - CyberSource is a payment gateway.
21
+
22
+ */
23
+
6
24
  gateway:Gateway;
25
+
26
+ /**
27
+ * @description The gateway account to which this payment source is stored with.
28
+
29
+ */
30
+
7
31
  gateway_account_id?:string;
32
+
33
+ /**
34
+ * @description Reference transaction id which used for transactions
35
+
36
+ */
37
+
8
38
  ref_tx_id?:string;
39
+
40
+ /**
41
+ * @description Cardholder&#x27;s first name
42
+
43
+ */
44
+
9
45
  first_name?:string;
46
+
47
+ /**
48
+ * @description Cardholder&#x27;s last name
49
+
50
+ */
51
+
10
52
  last_name?:string;
53
+
54
+ /**
55
+ * @description The Issuer Identification Number, i.e. the first six digits of the card number
56
+
57
+ */
58
+
11
59
  iin:string;
60
+
61
+ /**
62
+ * @description Last four digits of the card number
63
+
64
+ */
65
+
12
66
  last4:string;
67
+
68
+ /**
69
+ * @description Card type \* other - Card belonging to types other than those listed above. \* bancontact - A Bancontact card. \* american_express - An American Express card. \* mastercard - A MasterCard. \* jcb - A JCB card. \* not_applicable - Used for offline entries in transactions. Not applicable for cards \* visa - A Visa card. \* diners_club - A Diner&#x27;s Club card. \* discover - A Discover card.
70
+
71
+ */
72
+
13
73
  card_type?:'discover' | 'bancontact' | 'other' | 'visa' | 'jcb' | 'diners_club' | 'mastercard' | 'not_applicable' | 'american_express';
74
+
75
+ /**
76
+ * @description Card Funding type \* prepaid - A prepaid card. \* debit - A debit card. \* not_applicable - Used for ACH. Not applicable for cards \* credit - A credit card. \* not_known - An unknown card.
77
+
78
+ */
79
+
14
80
  funding_type:'not_known' | 'prepaid' | 'not_applicable' | 'credit' | 'debit';
81
+
82
+ /**
83
+ * @description Card expiry month.
84
+
85
+ */
86
+
15
87
  expiry_month:number;
88
+
89
+ /**
90
+ * @description Card expiry year.
91
+
92
+ */
93
+
16
94
  expiry_year:number;
95
+
96
+ /**
97
+ * @description [two-letter(alpha2)](https://www.iso.org/iso-3166-country-codes.html) ISO country code.
98
+
99
+ */
100
+
17
101
  issuing_country?:string;
102
+
103
+ /**
104
+ * @description Address line 1, as available in card billing address.
105
+
106
+ */
107
+
18
108
  billing_addr1?:string;
109
+
110
+ /**
111
+ * @description Address line 2, as available in card billing address.
112
+
113
+ */
114
+
19
115
  billing_addr2?:string;
116
+
117
+ /**
118
+ * @description City, as available in card billing address.
119
+
120
+ */
121
+
20
122
  billing_city?:string;
123
+
124
+ /**
125
+ * @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
126
+
127
+ */
128
+
21
129
  billing_state_code?:string;
130
+
131
+ /**
132
+ * @description The state/province name.
133
+
134
+ */
135
+
22
136
  billing_state?:string;
137
+
138
+ /**
139
+ * @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
140
+
141
+ **Note** : If you enter an invalid country code, the system will return an error.
142
+
143
+ **Brexit**
144
+
145
+
146
+ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
147
+
148
+ */
149
+
23
150
  billing_country?:string;
151
+
152
+ /**
153
+ * @description Postal or Zip code, as available in card billing address.
154
+
155
+ */
156
+
24
157
  billing_zip?:string;
158
+
159
+ /**
160
+ * @description Timestamp indicating when this card resource is created.
161
+
162
+ */
163
+
25
164
  created_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
+
26
171
  resource_version?:number;
172
+
173
+ /**
174
+ * @description Timestamp indicating when this credit card resource was last updated.
175
+
176
+ */
177
+
27
178
  updated_at?:number;
179
+
180
+ /**
181
+ * @description The IP address of the customer. Used primarily for referral integration and EU VAT validation.
182
+
183
+ */
184
+
28
185
  ip_address?:string;
186
+
187
+ /**
188
+ * @description Card is powered by payment method. \* ideal - ideal \* sofort - sofort \* bancontact - bancontact \* giropay - giropay \* latam_local_card - latam_local_card \* not_applicable - not_applicable \* card - card
189
+
190
+ */
191
+
29
192
  powered_by?:'giropay' | 'bancontact' | 'ideal' | 'latam_local_card' | 'not_applicable' | 'sofort' | 'card';
193
+
194
+ /**
195
+ * @description Identifier of the customer.
196
+
197
+ */
198
+
30
199
  customer_id:string;
200
+
201
+ /**
202
+ * @description Masked credit card number that is safe to show.
203
+
204
+ */
205
+
31
206
  masked_number?:string;
32
207
  }
33
208
  export namespace Card {
34
- export class CardResource {
209
+ export class CardResource {
210
+ /**
211
+ * @description #### deprecated
212
+
213
+ The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the Cards APIs. This request is obsoleted by the [Export payment source API](/docs/api/payment_sources#export_payment_source).
214
+
215
+ Copies the customer&#x27;s card information to another payment gateway. This is useful if you want to port your customer&#x27;s card details to another gateway.
216
+
217
+ **Limitation**
218
+ This request does not support copying of cards between Braintree and Stripe payment gateways. Contact [Chargebee Support](https://chargebee.freshdesk.com/support/home) to perform those actions.
219
+
220
+ */
221
+
35
222
  copy_card_for_customer(customer_id:string, input:CopyCardForCustomerInputParam):ChargebeeRequest<CopyCardForCustomerResponse>;
223
+
224
+ /**
225
+ * @description #### Deprecated
226
+
227
+ This operation is obsoleted by the [Retrieve a payment source API](/docs/api/payment_sources#retrieve_a_payment_source).
228
+
229
+ Retrieves the credit card for the customer id.
230
+
231
+ */
232
+
36
233
  retrieve(customer_id:string):ChargebeeRequest<RetrieveResponse>;
234
+
235
+ /**
236
+ * @description #### Deprecated
237
+
238
+ This request is obsoleted by the [Switch gateway account API](/docs/api/payment_sources#switch_gateway_account) for Payment Sources.
239
+
240
+ Switches the gateway in which customer&#x27;s card information is stored. This is applicable only if the payment method is &#x60;card&#x60;.
241
+
242
+ **Limitation**
243
+ This request does not support switching between Braintree and Stripe payment gateways. Contact [Chargebee Support](https://chargebee.freshdesk.com/support/home) to perform those actions.
244
+
245
+ */
246
+
37
247
  switch_gateway_for_customer(customer_id:string, input:SwitchGatewayForCustomerInputParam):ChargebeeRequest<SwitchGatewayForCustomerResponse>;
248
+
249
+ /**
250
+ * @description #### deprecated
251
+
252
+ The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the Cards APIs. This request is obsoleted by the [Delete a payment source API](/docs/api/payment_sources#delete_a_payment_source).
253
+
254
+ Deletes the card for a customer. Upon successful deletion the &#x60;auto_collection&#x60; attribute for the customer is set to &#x60;off&#x60; and a &#x60;card_deleted&#x60; event is triggered. If there is no card found at the gateway for the customer, this API returns without errors.
255
+
256
+ */
257
+
38
258
  delete_card_for_customer(customer_id:string):ChargebeeRequest<DeleteCardForCustomerResponse>;
259
+
260
+ /**
261
+ * @description #### Deprecated
262
+
263
+ The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the [Cards APIs](/docs/api/cards). This operation is obsoleted by the following:
264
+
265
+ * [Create using temporary token](/docs/api/payment_sources#create_using_temporary_token)
266
+ * [Create using permanent token](/docs/api/payment_sources#create_using_permanent_token)
267
+ * [Create a card payment source](/docs/api/payment_sources#create_a_card_payment_source)
268
+
269
+ Adds or replaces card details of a customer. Updating card details replaces the present payment method.
270
+
271
+ Passing credit card details to this API involves PCI liability at your end as sensitive card info passes through your servers. If you wish to avoid that, you can use one of the following integration methodologies if applicable
272
+
273
+ * If you are using Stripe gateway, you can use [Stripe.js](https://stripe.com/docs/stripe.js) with your card update form.
274
+ * If you are using Braintree gateway, you can use [Braintree.js](https://www.braintreepayments.com/docs/javascript) with your card update form.
275
+ * If you are using Authorize.Net gateway, you use [Accept.js](https://developer.authorize.net/api/reference/features/acceptjs.html) with your card update form.
276
+ * In case you are using the Adyen gateway, you will have to use the Adyen&#x27;s [Client Side Encryption](https://docs.adyen.com/developers/features/client-side-encryption) to encrypt sensitive cardholder data. Once the cardholder data is encrypted, pass the value in adyen.encrypted.data as temp token in this API.
277
+ * You can also use our [Hosted Pages](https://www.chargebee.com/docs/hosted_pages.html) based integration. Use our [Hosted Page - Update Card](/docs/api/hosted_pages#update_card) API to generate a &#x27;Update Card&#x27; Hosted Page link.
278
+
279
+
280
+
281
+ **Legacy behavior:**
282
+
283
+ * **For [sites](https://www.chargebee.com/docs/sites-intro.html) created before March 1st, 2014:** On making this request, the &#x60;billing_address&#x60; and &#x60;vat_number&#x60; of the customer are **deleted** and replaced by the values passed with this request. Ensure that you pass the [billing address parameters](/docs/api/subscriptions?prod_cat_ver&#x3D;1#create_a_subscription_card_billing_addr1) and the &#x60;vat_number&#x60; parameters each time you make this request, to avoid losing the same information at the customer-level.
284
+ * **For [sites](https://www.chargebee.com/docs/sites-intro.html) created on or after March 1st, 2014:** This request does not alter the &#x60;billing_address&#x60; and &#x60;vat_number&#x60; of the customer.
285
+
286
+ */
287
+
39
288
  update_card_for_customer(customer_id:string, input:UpdateCardForCustomerInputParam):ChargebeeRequest<UpdateCardForCustomerResponse>;
40
289
  }
41
- export interface CopyCardForCustomerResponse {
42
- third_party_payment_method:ThirdPartyPaymentMethod;
290
+ export interface CopyCardForCustomerResponse {
291
+ /**
292
+ * @description #### deprecated
293
+
294
+ The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the Cards APIs. This request is obsoleted by the [Export payment source API](/docs/api/payment_sources#export_payment_source).
295
+
296
+ Copies the customer&#x27;s card information to another payment gateway. This is useful if you want to port your customer&#x27;s card details to another gateway.
297
+
298
+ **Limitation**
299
+ This request does not support copying of cards between Braintree and Stripe payment gateways. Contact [Chargebee Support](https://chargebee.freshdesk.com/support/home) to perform those actions.
300
+
301
+ */
302
+
303
+ third_party_payment_method:ThirdPartyPaymentMethod;
43
304
  }
44
305
  export interface CopyCardForCustomerInputParam {
306
+
307
+ /**
308
+ * @description The gateway account you want to copy the card.
309
+
310
+ */
311
+
45
312
  gateway_account_id:string;
46
313
  }
47
- export interface RetrieveResponse {
48
- card:Card;
314
+ export interface RetrieveResponse {
315
+ /**
316
+ * @description #### Deprecated
317
+
318
+ This operation is obsoleted by the [Retrieve a payment source API](/docs/api/payment_sources#retrieve_a_payment_source).
319
+
320
+ Retrieves the credit card for the customer id.
321
+
322
+ */
323
+
324
+ card:Card;
49
325
  }
50
326
 
51
- export interface SwitchGatewayForCustomerResponse {
52
- customer:Customer;
53
- card:Card;
327
+ export interface SwitchGatewayForCustomerResponse {
328
+ /**
329
+ * @description #### Deprecated
330
+
331
+ This request is obsoleted by the [Switch gateway account API](/docs/api/payment_sources#switch_gateway_account) for Payment Sources.
332
+
333
+ Switches the gateway in which customer&#x27;s card information is stored. This is applicable only if the payment method is &#x60;card&#x60;.
334
+
335
+ **Limitation**
336
+ This request does not support switching between Braintree and Stripe payment gateways. Contact [Chargebee Support](https://chargebee.freshdesk.com/support/home) to perform those actions.
337
+
338
+ */
339
+
340
+ customer:Customer;
341
+
342
+ /**
343
+ * @description #### Deprecated
344
+
345
+ This request is obsoleted by the [Switch gateway account API](/docs/api/payment_sources#switch_gateway_account) for Payment Sources.
346
+
347
+ Switches the gateway in which customer&#x27;s card information is stored. This is applicable only if the payment method is &#x60;card&#x60;.
348
+
349
+ **Limitation**
350
+ This request does not support switching between Braintree and Stripe payment gateways. Contact [Chargebee Support](https://chargebee.freshdesk.com/support/home) to perform those actions.
351
+
352
+ */
353
+
354
+ card:Card;
54
355
  }
55
356
  export interface SwitchGatewayForCustomerInputParam {
357
+
358
+ /**
359
+ * @description The gateway account you want to switch to.
360
+
361
+ */
362
+
56
363
  gateway_account_id:string;
57
364
  }
58
- export interface DeleteCardForCustomerResponse {
59
- customer:Customer;
365
+ export interface DeleteCardForCustomerResponse {
366
+ /**
367
+ * @description #### deprecated
368
+
369
+ The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the Cards APIs. This request is obsoleted by the [Delete a payment source API](/docs/api/payment_sources#delete_a_payment_source).
370
+
371
+ Deletes the card for a customer. Upon successful deletion the &#x60;auto_collection&#x60; attribute for the customer is set to &#x60;off&#x60; and a &#x60;card_deleted&#x60; event is triggered. If there is no card found at the gateway for the customer, this API returns without errors.
372
+
373
+ */
374
+
375
+ customer:Customer;
60
376
  }
61
377
 
62
- export interface UpdateCardForCustomerResponse {
63
- customer:Customer;
64
- card:Card;
378
+ export interface UpdateCardForCustomerResponse {
379
+ /**
380
+ * @description #### Deprecated
381
+
382
+ The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the [Cards APIs](/docs/api/cards). This operation is obsoleted by the following:
383
+
384
+ * [Create using temporary token](/docs/api/payment_sources#create_using_temporary_token)
385
+ * [Create using permanent token](/docs/api/payment_sources#create_using_permanent_token)
386
+ * [Create a card payment source](/docs/api/payment_sources#create_a_card_payment_source)
387
+
388
+ Adds or replaces card details of a customer. Updating card details replaces the present payment method.
389
+
390
+ Passing credit card details to this API involves PCI liability at your end as sensitive card info passes through your servers. If you wish to avoid that, you can use one of the following integration methodologies if applicable
391
+
392
+ * If you are using Stripe gateway, you can use [Stripe.js](https://stripe.com/docs/stripe.js) with your card update form.
393
+ * If you are using Braintree gateway, you can use [Braintree.js](https://www.braintreepayments.com/docs/javascript) with your card update form.
394
+ * If you are using Authorize.Net gateway, you use [Accept.js](https://developer.authorize.net/api/reference/features/acceptjs.html) with your card update form.
395
+ * In case you are using the Adyen gateway, you will have to use the Adyen&#x27;s [Client Side Encryption](https://docs.adyen.com/developers/features/client-side-encryption) to encrypt sensitive cardholder data. Once the cardholder data is encrypted, pass the value in adyen.encrypted.data as temp token in this API.
396
+ * You can also use our [Hosted Pages](https://www.chargebee.com/docs/hosted_pages.html) based integration. Use our [Hosted Page - Update Card](/docs/api/hosted_pages#update_card) API to generate a &#x27;Update Card&#x27; Hosted Page link.
397
+
398
+
399
+
400
+ **Legacy behavior:**
401
+
402
+ * **For [sites](https://www.chargebee.com/docs/sites-intro.html) created before March 1st, 2014:** On making this request, the &#x60;billing_address&#x60; and &#x60;vat_number&#x60; of the customer are **deleted** and replaced by the values passed with this request. Ensure that you pass the [billing address parameters](/docs/api/subscriptions?prod_cat_ver&#x3D;1#create_a_subscription_card_billing_addr1) and the &#x60;vat_number&#x60; parameters each time you make this request, to avoid losing the same information at the customer-level.
403
+ * **For [sites](https://www.chargebee.com/docs/sites-intro.html) created on or after March 1st, 2014:** This request does not alter the &#x60;billing_address&#x60; and &#x60;vat_number&#x60; of the customer.
404
+
405
+ */
406
+
407
+ customer:Customer;
408
+
409
+ /**
410
+ * @description #### Deprecated
411
+
412
+ The [Payment Sources API](/docs/api/payment_sources), with its additional options and improvements, obsoletes the [Cards APIs](/docs/api/cards). This operation is obsoleted by the following:
413
+
414
+ * [Create using temporary token](/docs/api/payment_sources#create_using_temporary_token)
415
+ * [Create using permanent token](/docs/api/payment_sources#create_using_permanent_token)
416
+ * [Create a card payment source](/docs/api/payment_sources#create_a_card_payment_source)
417
+
418
+ Adds or replaces card details of a customer. Updating card details replaces the present payment method.
419
+
420
+ Passing credit card details to this API involves PCI liability at your end as sensitive card info passes through your servers. If you wish to avoid that, you can use one of the following integration methodologies if applicable
421
+
422
+ * If you are using Stripe gateway, you can use [Stripe.js](https://stripe.com/docs/stripe.js) with your card update form.
423
+ * If you are using Braintree gateway, you can use [Braintree.js](https://www.braintreepayments.com/docs/javascript) with your card update form.
424
+ * If you are using Authorize.Net gateway, you use [Accept.js](https://developer.authorize.net/api/reference/features/acceptjs.html) with your card update form.
425
+ * In case you are using the Adyen gateway, you will have to use the Adyen&#x27;s [Client Side Encryption](https://docs.adyen.com/developers/features/client-side-encryption) to encrypt sensitive cardholder data. Once the cardholder data is encrypted, pass the value in adyen.encrypted.data as temp token in this API.
426
+ * You can also use our [Hosted Pages](https://www.chargebee.com/docs/hosted_pages.html) based integration. Use our [Hosted Page - Update Card](/docs/api/hosted_pages#update_card) API to generate a &#x27;Update Card&#x27; Hosted Page link.
427
+
428
+
429
+
430
+ **Legacy behavior:**
431
+
432
+ * **For [sites](https://www.chargebee.com/docs/sites-intro.html) created before March 1st, 2014:** On making this request, the &#x60;billing_address&#x60; and &#x60;vat_number&#x60; of the customer are **deleted** and replaced by the values passed with this request. Ensure that you pass the [billing address parameters](/docs/api/subscriptions?prod_cat_ver&#x3D;1#create_a_subscription_card_billing_addr1) and the &#x60;vat_number&#x60; parameters each time you make this request, to avoid losing the same information at the customer-level.
433
+ * **For [sites](https://www.chargebee.com/docs/sites-intro.html) created on or after March 1st, 2014:** This request does not alter the &#x60;billing_address&#x60; and &#x60;vat_number&#x60; of the customer.
434
+
435
+ */
436
+
437
+ card:Card;
65
438
  }
66
439
  export interface UpdateCardForCustomerInputParam {
440
+
441
+ /**
442
+ * @description The gateway account in which this payment source is stored.
443
+
444
+ */
445
+
67
446
  gateway_account_id?:string;
447
+
448
+ /**
449
+ * @description The single-use card token returned by vaults like Stripe/Braintree which act as a substitute for your card details. Before calling this API, you should have submitted your card details to the gateway and gotten this token in return.
450
+ **Note:** Supported only for Stripe, Braintree and Authorize.Net. If this value is specified, there is no need to specify other card details (like number, cvv, etc).
451
+
452
+ */
453
+
68
454
  tmp_token?:string;
455
+
456
+ /**
457
+ * @description Cardholder&#x27;s first name.
458
+
459
+ */
460
+
69
461
  first_name?:string;
462
+
463
+ /**
464
+ * @description Cardholder&#x27;s last name.
465
+
466
+ */
467
+
70
468
  last_name?:string;
469
+
470
+ /**
471
+ * @description The credit card number without any format. If you are using [Braintree.js](https://developer.paypal.com/braintree/docs/guides/client-sdk/setup/javascript/v2#getting-braintree.js), you can specify the Braintree encrypted card number here.
472
+
473
+ */
474
+
71
475
  number:string;
476
+
477
+ /**
478
+ * @description Card expiry month.
479
+
480
+ */
481
+
72
482
  expiry_month:number;
483
+
484
+ /**
485
+ * @description Card expiry year.
486
+
487
+ */
488
+
73
489
  expiry_year:number;
490
+
491
+ /**
492
+ * @description The card verification value (CVV). If you are using [Braintree.js](https://developer.paypal.com/braintree/docs/guides/client-sdk/setup/javascript/v2#getting-braintree.js), you can specify the Braintree encrypted CVV here.
493
+
494
+ */
495
+
74
496
  cvv?:string;
497
+
498
+ /**
499
+ * @description Address line 1, as available in card billing address.
500
+
501
+ */
502
+
75
503
  billing_addr1?:string;
504
+
505
+ /**
506
+ * @description Address line 2, as available in card billing address.
507
+
508
+ */
509
+
76
510
  billing_addr2?:string;
511
+
512
+ /**
513
+ * @description City, as available in card billing address.
514
+
515
+ */
516
+
77
517
  billing_city?:string;
518
+
519
+ /**
520
+ * @description The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search/code) without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set &#x60;state_code&#x60; as &#x60;AZ&#x60; (not &#x60;US-AZ&#x60;). For Tamil Nadu (India), set as &#x60;TN&#x60; (not &#x60;IN-TN&#x60;). For British Columbia (Canada), set as &#x60;BC&#x60; (not &#x60;CA-BC&#x60;).
521
+
522
+ */
523
+
78
524
  billing_state_code?:string;
525
+
526
+ /**
527
+ * @description The state/province name. Is set by Chargebee automatically for US, Canada and India If &#x60;state_code&#x60; is provided.
528
+
529
+ */
530
+
79
531
  billing_state?:string;
532
+
533
+ /**
534
+ * @description Postal or Zip code, as available in card billing address.
535
+
536
+ */
537
+
80
538
  billing_zip?:string;
539
+
540
+ /**
541
+ * @description The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html).
542
+
543
+ **Note** : If you enter an invalid country code, the system will return an error.
544
+
545
+ **Brexit**
546
+
547
+
548
+ If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then &#x60;XI&#x60; (the code for **United Kingdom -- Northern Ireland**) is available as an option.
549
+ .
550
+
551
+ */
552
+
81
553
  billing_country?:string;
82
554
  }
83
555