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.
- package/CHANGELOG.md +35 -0
- package/README.md +55 -49
- package/lib/chargebee.js +1 -1
- package/package.json +1 -1
- package/types/core.d.ts +1 -0
- package/types/resources/Address.d.ts +245 -5
- package/types/resources/AdvanceInvoiceSchedule.d.ts +78 -2
- package/types/resources/AttachedItem.d.ts +305 -13
- package/types/resources/Card.d.ts +485 -13
- package/types/resources/Comment.d.ts +177 -11
- package/types/resources/Contact.d.ts +54 -0
- package/types/resources/ContractTerm.d.ts +83 -0
- package/types/resources/Coupon.d.ts +665 -20
- package/types/resources/CouponCode.d.ts +56 -5
- package/types/resources/CouponSet.d.ts +224 -17
- package/types/resources/CreditNote.d.ts +1202 -44
- package/types/resources/CreditNoteEstimate.d.ts +75 -6
- package/types/resources/Customer.d.ts +2132 -73
- package/types/resources/DifferentialPrice.d.ts +266 -15
- package/types/resources/Discount.d.ts +107 -0
- package/types/resources/Download.d.ts +18 -0
- package/types/resources/EntitlementOverride.d.ts +101 -7
- package/types/resources/Estimate.d.ts +1181 -27
- package/types/resources/Event.d.ts +145 -8
- package/types/resources/Export.d.ts +703 -32
- package/types/resources/Feature.d.ts +356 -22
- package/types/resources/Gift.d.ts +351 -24
- package/types/resources/Hierarchy.d.ts +30 -0
- package/types/resources/HostedPage.d.ts +1212 -37
- package/types/resources/ImpactedItem.d.ts +41 -1
- package/types/resources/ImpactedSubscription.d.ts +36 -1
- package/types/resources/InAppSubscription.d.ts +636 -9
- package/types/resources/Invoice.d.ts +2293 -93
- package/types/resources/InvoiceEstimate.d.ts +75 -6
- package/types/resources/Item.d.ts +542 -16
- package/types/resources/ItemEntitlement.d.ts +172 -13
- package/types/resources/ItemFamily.d.ts +173 -15
- package/types/resources/ItemPrice.d.ts +971 -26
- package/types/resources/Media.d.ts +24 -0
- package/types/resources/NonSubscription.d.ts +51 -3
- package/types/resources/Order.d.ts +1224 -32
- package/types/resources/PaymentIntent.d.ts +318 -8
- package/types/resources/PaymentReferenceNumber.d.ts +24 -0
- package/types/resources/PaymentSource.d.ts +1259 -55
- package/types/resources/PaymentVoucher.d.ts +262 -14
- package/types/resources/PortalSession.d.ts +187 -10
- package/types/resources/PromotionalCredit.d.ts +351 -16
- package/types/resources/Purchase.d.ts +274 -5
- package/types/resources/Quote.d.ts +1595 -62
- package/types/resources/QuoteLineGroup.d.ts +134 -5
- package/types/resources/QuotedCharge.d.ts +63 -5
- package/types/resources/QuotedSubscription.d.ts +192 -5
- package/types/resources/ResourceMigration.d.ts +73 -3
- package/types/resources/SiteMigrationDetail.d.ts +98 -5
- package/types/resources/Subscription.d.ts +3462 -137
- package/types/resources/SubscriptionEntitlement.d.ts +116 -8
- package/types/resources/SubscriptionEstimate.d.ts +36 -2
- package/types/resources/TaxWithheld.d.ts +32 -0
- package/types/resources/ThirdPartyPaymentMethod.d.ts +24 -0
- package/types/resources/TimeMachine.d.ts +99 -7
- package/types/resources/Token.d.ts +179 -7
- package/types/resources/Transaction.d.ts +597 -25
- package/types/resources/UnbilledCharge.d.ts +355 -14
- package/types/resources/Usage.d.ts +259 -13
- package/types/resources/VirtualBankAccount.d.ts +255 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
### v2.26.1 (2023-08-11)
|
|
2
|
+
* * *
|
|
3
|
+
* Support Descriptions for the attributes and actions has been added.
|
|
4
|
+
|
|
5
|
+
### v2.26.0 (2023-07-31)
|
|
6
|
+
* * *
|
|
7
|
+
|
|
8
|
+
#### New Attributes:
|
|
9
|
+
* tax_category has been added to the CreditNote, Quote and Invoice resource.
|
|
10
|
+
* proration_type has been added in Addon resource.
|
|
11
|
+
|
|
12
|
+
#### New Enum values:
|
|
13
|
+
* tax has been added to EntityType enum in Invoice resource.
|
|
14
|
+
* payment_source_locally_deleted has been added to EventType.
|
|
15
|
+
|
|
16
|
+
#### New Input parameters:
|
|
17
|
+
|
|
18
|
+
* CouponId and CouponApplyTill has been added to Subscritpion#CreateRequest in Subscritpion resource.
|
|
19
|
+
* CouponId and CouponApplyTill has been added to Subscritpion#CreateForCustomerRequest in Subscritpion resource.
|
|
20
|
+
* CouponId and CouponApplyTill has been added to Subscritpion#CreateWithItemsRequest in Subscritpion resource.
|
|
21
|
+
* CouponId and CouponApplyTill has been added to Subscritpion#UpdateRequest in Subscritpion resource.
|
|
22
|
+
* CouponId and CouponApplyTill has been added to Subscritpion#UpdateForItemsRequest in Subscritpion resource.
|
|
23
|
+
* CouponId and CouponApplyTill has been added to Subscritpion#ImportSubscriptionRequest in Subscritpion resource.
|
|
24
|
+
* CouponId and CouponApplyTill has been added to Subscritpion#ImportForCustomerRequest in Subscritpion resource.
|
|
25
|
+
* CouponId and CouponApplyTill has been added to Subscritpion#ImportForItemsRequest in Subscritpion resource.
|
|
26
|
+
* cancel_reason_code has been added to Subscritpion#ImportForItemsRequest in Subscritpion resource.
|
|
27
|
+
* proration_type has been added in addon#createRequest and addon#UpdateRequest in Addon resource.
|
|
28
|
+
* addons[proration_type] has been added in Estimate#UpdateSubscriptionRequest in Estimate resource.
|
|
29
|
+
* addons[proration_type] has been added in Subscription#UpdateRequest in Subscritpion resource.
|
|
30
|
+
|
|
31
|
+
#### New Enum Class:
|
|
32
|
+
* ProrationType enum has been added to addon resource.
|
|
33
|
+
* ProrationType enum has been added.
|
|
34
|
+
|
|
35
|
+
|
|
1
36
|
### v2.25.3 (2023-07-24)
|
|
2
37
|
* * *
|
|
3
38
|
* Add Request Config Type
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Chargebee Node Client Library
|
|
1
|
+
# Chargebee Node.js Client Library
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/chargebee)
|
|
4
4
|
[](https://www.npmjs.com/package/chargebee)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
This is the [node.js](http://nodejs.org/) library for integrating with Chargebee. Sign up for a Chargebee account [here](https://www.chargebee.com).
|
|
7
7
|
|
|
8
8
|
> **Note**
|
|
9
|
-
>
|
|
9
|
+
> If you’re using [API V1](https://apidocs.chargebee.com/docs/api/v1), head to [chargebee-v1 branch](https://github.com/chargebee/chargebee-node/tree/chargebee-v1).
|
|
10
10
|
|
|
11
11
|
## Requirements
|
|
12
12
|
|
|
@@ -26,15 +26,30 @@ pnpm install chargebee
|
|
|
26
26
|
|
|
27
27
|
## Usage
|
|
28
28
|
|
|
29
|
-
The package needs to be configured with your site's API key, which is available under Configure Chargebee Section. Refer [here](https://www.chargebee.com/docs/2.0/api_keys.html) for more details.
|
|
29
|
+
The package needs to be configured with your site's API key, which is available under Configure Chargebee Section. Refer [here](https://www.chargebee.com/docs/2.0/api_keys.html) for more details.
|
|
30
|
+
|
|
31
|
+
The full documentation can be found on the Chargebee API Docs: [https://apidocs.chargebee.com/docs/api?lang=node](https://apidocs.chargebee.com/docs/api?lang=node)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
const chargebee = require('chargebee');
|
|
36
|
+
|
|
37
|
+
chargebee.configure({
|
|
38
|
+
site: '<YOUR_SITE_NAME>',
|
|
39
|
+
api_key: '<YOUR_API_KEY>',
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or using ES modules,
|
|
30
44
|
|
|
31
45
|
```js
|
|
32
|
-
|
|
46
|
+
import chargebee from 'chargebee';
|
|
33
47
|
|
|
34
48
|
chargebee.configure({
|
|
35
|
-
site: 'YOUR_SITE_NAME',
|
|
36
|
-
api_key: 'YOUR_API_KEY',
|
|
49
|
+
site: '<YOUR_SITE_NAME>',
|
|
50
|
+
api_key: '<YOUR_API_KEY>',
|
|
37
51
|
});
|
|
52
|
+
|
|
38
53
|
```
|
|
39
54
|
|
|
40
55
|
### Using Async / Await
|
|
@@ -89,49 +104,33 @@ chargebee.customer
|
|
|
89
104
|
});
|
|
90
105
|
```
|
|
91
106
|
|
|
92
|
-
###
|
|
93
|
-
|
|
94
|
-
The response object returned by the `request()` method is generic response wrapper. You need to access the resource from it. For example,
|
|
95
|
-
|
|
96
|
-
- To access customer object.
|
|
97
|
-
|
|
98
|
-
```js
|
|
99
|
-
const result = await chargebee.customer.create({ email: 'john@test.com' }).request();
|
|
100
|
-
console.log(result.customer);
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Other resources can be accessed by the same approach. For subscription, it will be `result.subscription`
|
|
107
|
+
### Usage with TypeScript
|
|
104
108
|
|
|
105
|
-
|
|
109
|
+
You can import the types as shown below.
|
|
106
110
|
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
.list({
|
|
110
|
-
/* params */
|
|
111
|
-
})
|
|
112
|
-
.request();
|
|
111
|
+
```ts
|
|
112
|
+
import chargebee, { Customer } from 'chargebee';
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
chargebee.configure({
|
|
115
|
+
site: '<YOUR_SITE_NAME>',
|
|
116
|
+
api_key: '<YOUR_API_KEY>',
|
|
117
|
+
});
|
|
117
118
|
|
|
118
|
-
|
|
119
|
+
const createCustomer = async () => {
|
|
120
|
+
const inputParams: Customer.CreateInputParam = {
|
|
121
|
+
email: 'john@test.com',
|
|
122
|
+
first_name: 'John',
|
|
123
|
+
last_name: 'Doe',
|
|
124
|
+
};
|
|
119
125
|
|
|
120
|
-
|
|
126
|
+
const { customer } = await chargebee.customer.create(inputParams).request();
|
|
127
|
+
console.log(customer);
|
|
128
|
+
};
|
|
121
129
|
|
|
122
|
-
|
|
123
|
-
// ['list', 'next_offset']
|
|
124
|
-
console.log(Object.keys(result));
|
|
125
|
-
// ['1', '2', '3'], e.g. `result.list` is an array with 3 entries
|
|
126
|
-
console.log(Object.keys(result.list));
|
|
127
|
-
// ['activated_at', 'base_currency_code', ...]
|
|
128
|
-
// ['activated_at', 'base_currency_code', ...]
|
|
129
|
-
// ['activated_at', 'base_currency_code', ...]
|
|
130
|
-
// Which means we've reached the bottom and should have all the information available from this request
|
|
131
|
-
console.log(result.list.map((obj) => obj.subscription));
|
|
130
|
+
createCustomer();
|
|
132
131
|
```
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
### Using filters in the List API
|
|
135
134
|
|
|
136
135
|
For pagination: `offset` is the parameter that is being used. The value used for this parameter must be the value returned for `next_offset` parameter in the previous API call.
|
|
137
136
|
|
|
@@ -162,7 +161,7 @@ const fetchCustomers = async (offset) => {
|
|
|
162
161
|
});
|
|
163
162
|
```
|
|
164
163
|
|
|
165
|
-
|
|
164
|
+
### Using custom headers and custom fields:
|
|
166
165
|
|
|
167
166
|
```js
|
|
168
167
|
const result = await chargebee.customer
|
|
@@ -178,7 +177,7 @@ const customer = result.customer;
|
|
|
178
177
|
console.log(customer.cf_host_url);
|
|
179
178
|
```
|
|
180
179
|
|
|
181
|
-
###
|
|
180
|
+
### Creating an idempotent request
|
|
182
181
|
|
|
183
182
|
[Idempotency keys](https://apidocs.chargebee.com/docs/api/idempotency?prod_cat_ver=2) are passed along with request headers to allow a safe retry of POST requests.
|
|
184
183
|
|
|
@@ -208,15 +207,22 @@ chargebee.customer.create({ email: 'john@test.com', cf_host_url: 'http://xyz.com
|
|
|
208
207
|
});
|
|
209
208
|
```
|
|
210
209
|
|
|
211
|
-
###
|
|
212
|
-
|
|
213
|
-
An attribute, <b>api_version</b>, is added to the [Event](https://apidocs.chargebee.com/docs/api/events) resource, which indicates the API version based on which the event content is structured. In your webhook servers, ensure this \_api_version* is the same as the [API version](https://apidocs.chargebee.com/docs/api#versions) used by your webhook server's client library.
|
|
210
|
+
### Passing API Keys at request level
|
|
214
211
|
|
|
215
|
-
|
|
212
|
+
```js
|
|
213
|
+
const newCust = await chargebee.customer.create({
|
|
214
|
+
email: 'john@test.com',
|
|
215
|
+
first_name: 'John',
|
|
216
|
+
last_name: 'Doe'
|
|
217
|
+
}).request({
|
|
218
|
+
site: '<YOUR_SITE_NAME>',
|
|
219
|
+
api_key: '<YOUR_API_KEY>',
|
|
220
|
+
});
|
|
221
|
+
```
|
|
216
222
|
|
|
217
|
-
|
|
223
|
+
### Processing Webhooks - API Version Check
|
|
218
224
|
|
|
219
|
-
[https://apidocs.chargebee.com/docs/api
|
|
225
|
+
An attribute, <b>api_version</b>, is added to the [Event](https://apidocs.chargebee.com/docs/api/events) resource, which indicates the API version based on which the event content is structured. In your webhook servers, ensure this \_api_version* is the same as the [API version](https://apidocs.chargebee.com/docs/api#versions) used by your webhook server's client library.
|
|
220
226
|
|
|
221
227
|
## License
|
|
222
228
|
|
package/lib/chargebee.js
CHANGED
package/package.json
CHANGED
package/types/core.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ declare module 'chargebee' {
|
|
|
57
57
|
type Operation = 'create' | 'update' | 'delete'
|
|
58
58
|
type OperationType = 'add' | 'remove'
|
|
59
59
|
type PauseOption = 'end_of_term' | 'billing_cycles' | 'immediately' | 'specific_date'
|
|
60
|
+
type PaymentInitiator = 'merchant' | 'customer'
|
|
60
61
|
type PaymentMethod = 'other' | 'netbanking_emandates' | 'ach_credit' | 'dotpay' | 'boleto' | 'direct_debit' | 'chargeback' | 'wechat_pay' | 'cash' | 'giropay' | 'bank_transfer' | 'alipay' | 'ideal' | 'google_pay' | 'custom' | 'unionpay' | 'check' | 'sofort' | 'amazon_payments' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'sepa_credit' | 'card'
|
|
61
62
|
type PaymentMethodType = 'giropay' | 'alipay' | 'ideal' | 'google_pay' | 'netbanking_emandates' | 'dotpay' | 'unionpay' | 'direct_debit' | 'generic' | 'sofort' | 'amazon_payments' | 'upi' | 'apple_pay' | 'bancontact' | 'paypal_express_checkout' | 'wechat_pay' | 'card'
|
|
62
63
|
type PaymentVoucherType = 'boleto'
|
|
@@ -1,54 +1,294 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface Address {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description Label to identify the address. This is unique for all the address for a subscription.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
label:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description First name
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
first_name?:string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description Last name
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
last_name?:string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description Email
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
|
|
7
31
|
email?:string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @description Company name
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
8
38
|
company?:string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @description Phone number
|
|
42
|
+
|
|
43
|
+
*/
|
|
44
|
+
|
|
9
45
|
phone?:string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @description Address line 1
|
|
49
|
+
|
|
50
|
+
*/
|
|
51
|
+
|
|
10
52
|
addr?:string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @description Address line 2
|
|
56
|
+
|
|
57
|
+
*/
|
|
58
|
+
|
|
11
59
|
extended_addr?:string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @description Address line 3
|
|
63
|
+
|
|
64
|
+
*/
|
|
65
|
+
|
|
12
66
|
extended_addr2?:string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @description Name of the city
|
|
70
|
+
|
|
71
|
+
*/
|
|
72
|
+
|
|
13
73
|
city?:string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @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 `state_code` as `AZ` (not `US-AZ`). For Tamil Nadu (India), set as `TN` (not `IN-TN`). For British Columbia (Canada), set as `BC` (not `CA-BC`).
|
|
77
|
+
|
|
78
|
+
*/
|
|
79
|
+
|
|
14
80
|
state_code?:string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @description State or Province
|
|
84
|
+
|
|
85
|
+
*/
|
|
86
|
+
|
|
15
87
|
state?:string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @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).
|
|
91
|
+
|
|
92
|
+
**Note** : If you enter an invalid country code, the system will return an error.
|
|
93
|
+
|
|
94
|
+
**Brexit**
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
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 `XI` (the code for **United Kingdom -- Northern Ireland**) is available as an option.
|
|
98
|
+
|
|
99
|
+
*/
|
|
100
|
+
|
|
16
101
|
country?:string;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
|
|
105
|
+
|
|
106
|
+
*/
|
|
107
|
+
|
|
17
108
|
zip?:string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @description The address verification status. \* partially_valid - The address is valid for taxability but has not been validated for shipping. \* not_validated - Address is not yet validated. \* invalid - Address is invalid. \* valid - Address was validated successfully.
|
|
112
|
+
|
|
113
|
+
*/
|
|
114
|
+
|
|
18
115
|
validation_status?:ValidationStatus;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
|
|
119
|
+
|
|
120
|
+
*/
|
|
121
|
+
|
|
19
122
|
subscription_id:string;
|
|
20
123
|
}
|
|
21
124
|
export namespace Address {
|
|
22
|
-
export class AddressResource {
|
|
125
|
+
export class AddressResource {
|
|
126
|
+
/**
|
|
127
|
+
* @description Retrieves an address resource for a subscription and the specified label.
|
|
128
|
+
|
|
129
|
+
*/
|
|
130
|
+
|
|
23
131
|
retrieve(input:RetrieveInputParam):ChargebeeRequest<RetrieveResponse>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @description Adds or replaces the address for a subscription. If an address is already present for the specified label, it will be replaced otherwise new address is added with that label.
|
|
135
|
+
|
|
136
|
+
*/
|
|
137
|
+
|
|
24
138
|
update(input:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
|
|
25
139
|
}
|
|
26
|
-
export interface RetrieveResponse {
|
|
27
|
-
|
|
140
|
+
export interface RetrieveResponse {
|
|
141
|
+
/**
|
|
142
|
+
* @description Retrieves an address resource for a subscription and the specified label.
|
|
143
|
+
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
address:Address;
|
|
28
147
|
}
|
|
29
148
|
export interface RetrieveInputParam {
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @description Retrieves an address resource for a subscription and the specified label.
|
|
152
|
+
|
|
153
|
+
*/
|
|
154
|
+
|
|
30
155
|
subscription_id:string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @description Retrieves an address resource for a subscription and the specified label.
|
|
159
|
+
|
|
160
|
+
*/
|
|
161
|
+
|
|
31
162
|
label:string;
|
|
32
163
|
}
|
|
33
|
-
export interface UpdateResponse {
|
|
34
|
-
|
|
164
|
+
export interface UpdateResponse {
|
|
165
|
+
/**
|
|
166
|
+
* @description Adds or replaces the address for a subscription. If an address is already present for the specified label, it will be replaced otherwise new address is added with that label.
|
|
167
|
+
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
address:Address;
|
|
35
171
|
}
|
|
36
172
|
export interface UpdateInputParam {
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @description A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
|
|
176
|
+
|
|
177
|
+
*/
|
|
178
|
+
|
|
37
179
|
subscription_id:string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @description Label to identify the address. This is unique for all the address for a subscription.
|
|
183
|
+
|
|
184
|
+
*/
|
|
185
|
+
|
|
38
186
|
label:string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @description First name.
|
|
190
|
+
|
|
191
|
+
*/
|
|
192
|
+
|
|
39
193
|
first_name?:string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @description Last name.
|
|
197
|
+
|
|
198
|
+
*/
|
|
199
|
+
|
|
40
200
|
last_name?:string;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @description Email.
|
|
204
|
+
|
|
205
|
+
*/
|
|
206
|
+
|
|
41
207
|
email?:string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @description Company name.
|
|
211
|
+
|
|
212
|
+
*/
|
|
213
|
+
|
|
42
214
|
company?:string;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @description Phone number.
|
|
218
|
+
|
|
219
|
+
*/
|
|
220
|
+
|
|
43
221
|
phone?:string;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @description Address line 1.
|
|
225
|
+
|
|
226
|
+
*/
|
|
227
|
+
|
|
44
228
|
addr?:string;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* @description Address line 2.
|
|
232
|
+
|
|
233
|
+
*/
|
|
234
|
+
|
|
45
235
|
extended_addr?:string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @description Address line 3.
|
|
239
|
+
|
|
240
|
+
*/
|
|
241
|
+
|
|
46
242
|
extended_addr2?:string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @description Name of the city.
|
|
246
|
+
|
|
247
|
+
*/
|
|
248
|
+
|
|
47
249
|
city?:string;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @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 `state_code` as `AZ` (not `US-AZ`). For Tamil Nadu (India), set as `TN` (not `IN-TN`). For British Columbia (Canada), set as `BC` (not `CA-BC`).
|
|
253
|
+
|
|
254
|
+
*/
|
|
255
|
+
|
|
48
256
|
state_code?:string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @description The state/province name. Is set by Chargebee automatically for US, Canada and India If `state_code` is provided.
|
|
260
|
+
|
|
261
|
+
*/
|
|
262
|
+
|
|
49
263
|
state?:string;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @description Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address).
|
|
267
|
+
|
|
268
|
+
*/
|
|
269
|
+
|
|
50
270
|
zip?:string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @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).
|
|
274
|
+
|
|
275
|
+
**Note** : If you enter an invalid country code, the system will return an error.
|
|
276
|
+
|
|
277
|
+
**Brexit**
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
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 `XI` (the code for **United Kingdom -- Northern Ireland**) is available as an option.
|
|
281
|
+
.
|
|
282
|
+
|
|
283
|
+
*/
|
|
284
|
+
|
|
51
285
|
country?:string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* @description The address verification status. \* partially_valid - The address is valid for taxability but has not been validated for shipping. \* not_validated - Address is not yet validated. \* invalid - Address is invalid. \* valid - Address was validated successfully.
|
|
289
|
+
|
|
290
|
+
*/
|
|
291
|
+
|
|
52
292
|
validation_status?:ValidationStatus;
|
|
53
293
|
}
|
|
54
294
|
|
|
@@ -1,25 +1,101 @@
|
|
|
1
1
|
///<reference path='./../core.d.ts'/>
|
|
2
2
|
declare module 'chargebee' {
|
|
3
3
|
export interface AdvanceInvoiceSchedule {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description System-generated and immutable unique Id for the `advance_invoice_schedule`.
|
|
7
|
+
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
id:string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description The type of advance invoice or advance invoicing schedule. \* specific_dates - The advance charges occur on specific dates. For each date, [a fixed number of billing cycles](advance_invoice_schedules#advance_invoice_schedule_specific_dates_schedule_terms_to_charge) is charged for. There can be up to 5 dates configured. \* fixed_intervals - The advance charges occur at [fixed intervals of time](advance_invoice_schedules#advance_invoice_schedule_fixed_interval_schedule_terms_to_charge).
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
|
|
5
17
|
schedule_type?:'specific_dates' | 'fixed_intervals';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description When the `schedule_type` is `fixed_intervals`, this object gives further details of the schedule.
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
6
24
|
fixed_interval_schedule?:AdvanceInvoiceSchedule.FixedIntervalSchedule;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description The advance charges occur on specific dates. For each date, [a fixed number of billing cycles](advance_invoice_schedules#advance_invoice_schedule_specific_dates_schedule_terms_to_charge) is charged for. There can be up to 5 dates configured.
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
|
|
7
31
|
specific_dates_schedule?:AdvanceInvoiceSchedule.SpecificDatesSchedule;
|
|
8
32
|
}
|
|
9
33
|
export namespace AdvanceInvoiceSchedule {
|
|
10
34
|
|
|
11
35
|
|
|
12
|
-
export interface FixedIntervalSchedule {
|
|
36
|
+
export interface FixedIntervalSchedule {
|
|
37
|
+
/**
|
|
38
|
+
* @description Specifies when the schedule should end. \* after_number_of_intervals - Advance invoices are generated a `specified number of times` \* subscription_end - Advance invoices are generated for as long as the subscription is active. \* specific_date - End the advance invoicing schedule on a `specific date`.
|
|
39
|
+
|
|
40
|
+
*/
|
|
41
|
+
|
|
13
42
|
end_schedule_on?:EndScheduleOn;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @description The number of advance invoices to generate. The schedule is created such that the total number of billing cycles in the schedule does not exceed the [`remaining_billing_cycles`](subscriptions#subscription_remaining_billing_cycles) of the subscription. This parameter is applicable only when [`fixed_interval_schedule[end_schedule_on]`](advance_invoice_schedules#advance_invoice_schedule_fixed_interval_schedule_end_schedule_on) = `after_number_of_intervals`
|
|
46
|
+
|
|
47
|
+
*/
|
|
48
|
+
|
|
14
49
|
number_of_occurrences?:number;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @description The number of days before each interval that advance invoices are generated.
|
|
53
|
+
|
|
54
|
+
*/
|
|
55
|
+
|
|
15
56
|
days_before_renewal?:number;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @description The date when the schedule should end. Advance invoices are not generated beyond this date. It must be at least 1 day before the start of the last billing cycle of the subscription and also within 5 years from the current date. This parameter is only applicable when [`fixed_interval_schedule[end_schedule_on]`](advance_invoice_schedules#advance_invoice_schedule_fixed_interval_schedule_end_schedule_on) = `specific_date`.
|
|
60
|
+
|
|
61
|
+
*/
|
|
62
|
+
|
|
16
63
|
end_date?:number;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @description The date when this advance invoicing schedule was created.
|
|
67
|
+
|
|
68
|
+
*/
|
|
69
|
+
|
|
17
70
|
created_at?:number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @description The number of billing cycles in one interval.
|
|
74
|
+
|
|
75
|
+
*/
|
|
76
|
+
|
|
18
77
|
terms_to_charge?:number;
|
|
19
78
|
}
|
|
20
|
-
export interface SpecificDatesSchedule {
|
|
79
|
+
export interface SpecificDatesSchedule {
|
|
80
|
+
/**
|
|
81
|
+
* @description The number of billing cycles to charge for, on the date specified. Applicable only when [`schedule_type`](advance_invoice_schedules#advance_invoice_schedule_schedule_type) is specific_dates.
|
|
82
|
+
|
|
83
|
+
*/
|
|
84
|
+
|
|
21
85
|
terms_to_charge?:number;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @description The unique id of the member of the advance_invoice_schedule array which corresponds to the specific_dates_schedule that you intend to modify. Only applicable when [`schedule_type`](advance_invoice_schedules#advance_invoice_schedule_schedule_type) is `specific_dates`.
|
|
89
|
+
|
|
90
|
+
*/
|
|
91
|
+
|
|
22
92
|
date?:number;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @description The date when this advance invoicing schedule was created.
|
|
96
|
+
|
|
97
|
+
*/
|
|
98
|
+
|
|
23
99
|
created_at?:number;
|
|
24
100
|
}
|
|
25
101
|
}
|