chargebee 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +16 -0
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +16 -0
- package/package.json +1 -1
- package/types/core.d.ts +588 -0
- package/types/index.d.ts +172 -0
- package/types/resources/Address.d.ts +71 -0
- package/types/resources/AdvanceInvoiceSchedule.d.ts +29 -0
- package/types/resources/AttachedItem.d.ts +116 -0
- package/types/resources/Attribute.d.ts +9 -0
- package/types/resources/BusinessEntity.d.ts +64 -0
- package/types/resources/BusinessEntityTransfer.d.ts +15 -0
- package/types/resources/Card.d.ts +172 -0
- package/types/resources/Comment.d.ts +92 -0
- package/types/resources/Contact.d.ts +16 -0
- package/types/resources/ContractTerm.d.ts +19 -0
- package/types/resources/Coupon.d.ts +329 -0
- package/types/resources/CouponCode.d.ts +70 -0
- package/types/resources/CouponSet.d.ts +111 -0
- package/types/resources/CreditNote.d.ts +629 -0
- package/types/resources/CreditNoteEstimate.d.ts +143 -0
- package/types/resources/Currency.d.ts +91 -0
- package/types/resources/Customer.d.ts +964 -0
- package/types/resources/CustomerEntitlement.d.ts +36 -0
- package/types/resources/DifferentialPrice.d.ts +144 -0
- package/types/resources/Discount.d.ts +24 -0
- package/types/resources/Download.d.ts +10 -0
- package/types/resources/Entitlement.d.ts +66 -0
- package/types/resources/EntitlementOverride.d.ts +76 -0
- package/types/resources/Estimate.d.ts +1237 -0
- package/types/resources/Event.d.ts +81 -0
- package/types/resources/Export.d.ts +615 -0
- package/types/resources/Feature.d.ts +142 -0
- package/types/resources/GatewayErrorDetail.d.ts +20 -0
- package/types/resources/Gift.d.ts +296 -0
- package/types/resources/Hierarchy.d.ts +12 -0
- package/types/resources/HostedPage.d.ts +1112 -0
- package/types/resources/ImpactedItem.d.ts +20 -0
- package/types/resources/ImpactedItemPrice.d.ts +20 -0
- package/types/resources/ImpactedSubscription.d.ts +20 -0
- package/types/resources/InAppSubscription.d.ts +116 -0
- package/types/resources/Invoice.d.ts +1695 -0
- package/types/resources/InvoiceEstimate.d.ts +143 -0
- package/types/resources/Item.d.ts +208 -0
- package/types/resources/ItemEntitlement.d.ts +103 -0
- package/types/resources/ItemFamily.d.ts +93 -0
- package/types/resources/ItemPrice.d.ts +332 -0
- package/types/resources/Metadata.d.ts +8 -0
- package/types/resources/NonSubscription.d.ts +48 -0
- package/types/resources/OmnichannelSubscription.d.ts +75 -0
- package/types/resources/OmnichannelTransaction.d.ts +16 -0
- package/types/resources/Order.d.ts +586 -0
- package/types/resources/PaymentIntent.d.ts +178 -0
- package/types/resources/PaymentReferenceNumber.d.ts +11 -0
- package/types/resources/PaymentSchedule.d.ts +28 -0
- package/types/resources/PaymentScheduleEstimate.d.ts +25 -0
- package/types/resources/PaymentScheduleScheme.d.ts +67 -0
- package/types/resources/PaymentSource.d.ts +530 -0
- package/types/resources/PaymentVoucher.d.ts +107 -0
- package/types/resources/PortalSession.d.ts +88 -0
- package/types/resources/PriceVariant.d.ts +116 -0
- package/types/resources/PricingPageSession.d.ts +130 -0
- package/types/resources/PromotionalCredit.d.ts +111 -0
- package/types/resources/Purchase.d.ts +202 -0
- package/types/resources/Quote.d.ts +1467 -0
- package/types/resources/QuoteLineGroup.d.ts +136 -0
- package/types/resources/QuotedCharge.d.ts +56 -0
- package/types/resources/QuotedSubscription.d.ts +114 -0
- package/types/resources/Ramp.d.ts +260 -0
- package/types/resources/RecordedPurchase.d.ts +60 -0
- package/types/resources/ResourceMigration.d.ts +36 -0
- package/types/resources/SiteMigrationDetail.d.ts +46 -0
- package/types/resources/Subscription.d.ts +2447 -0
- package/types/resources/SubscriptionEntitlement.d.ts +79 -0
- package/types/resources/SubscriptionEstimate.d.ts +59 -0
- package/types/resources/TaxWithheld.d.ts +19 -0
- package/types/resources/ThirdPartyPaymentMethod.d.ts +11 -0
- package/types/resources/TimeMachine.d.ts +57 -0
- package/types/resources/Token.d.ts +19 -0
- package/types/resources/Transaction.d.ts +316 -0
- package/types/resources/UnbilledCharge.d.ts +209 -0
- package/types/resources/Usage.d.ts +113 -0
- package/types/resources/VirtualBankAccount.d.ts +125 -0
- package/types/resources/filter.d.ts +52 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface PortalSession {
|
|
6
|
+
id: string;
|
|
7
|
+
token: string;
|
|
8
|
+
access_url: string;
|
|
9
|
+
redirect_url?: string;
|
|
10
|
+
status:
|
|
11
|
+
| 'created'
|
|
12
|
+
| 'logged_in'
|
|
13
|
+
| 'logged_out'
|
|
14
|
+
| 'not_yet_activated'
|
|
15
|
+
| 'activated';
|
|
16
|
+
created_at: number;
|
|
17
|
+
expires_at?: number;
|
|
18
|
+
customer_id: string;
|
|
19
|
+
login_at?: number;
|
|
20
|
+
logout_at?: number;
|
|
21
|
+
login_ipaddress?: string;
|
|
22
|
+
logout_ipaddress?: string;
|
|
23
|
+
linked_customers?: PortalSession.LinkedCustomer[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export namespace PortalSession {
|
|
27
|
+
export class PortalSessionResource {
|
|
28
|
+
create(
|
|
29
|
+
input: CreateInputParam,
|
|
30
|
+
headers?: ChargebeeRequestHeader,
|
|
31
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
32
|
+
|
|
33
|
+
retrieve(
|
|
34
|
+
portal_session_id: string,
|
|
35
|
+
headers?: ChargebeeRequestHeader,
|
|
36
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
37
|
+
|
|
38
|
+
logout(
|
|
39
|
+
portal_session_id: string,
|
|
40
|
+
headers?: ChargebeeRequestHeader,
|
|
41
|
+
): Promise<ChargebeeResponse<LogoutResponse>>;
|
|
42
|
+
|
|
43
|
+
activate(
|
|
44
|
+
portal_session_id: string,
|
|
45
|
+
input: ActivateInputParam,
|
|
46
|
+
headers?: ChargebeeRequestHeader,
|
|
47
|
+
): Promise<ChargebeeResponse<ActivateResponse>>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CreateResponse {
|
|
51
|
+
portal_session: PortalSession;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface RetrieveResponse {
|
|
55
|
+
portal_session: PortalSession;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface LogoutResponse {
|
|
59
|
+
portal_session: PortalSession;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ActivateResponse {
|
|
63
|
+
portal_session: PortalSession;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface LinkedCustomer {
|
|
67
|
+
customer_id: string;
|
|
68
|
+
email?: string;
|
|
69
|
+
has_billing_address: boolean;
|
|
70
|
+
has_payment_method: boolean;
|
|
71
|
+
has_active_subscription: boolean;
|
|
72
|
+
}
|
|
73
|
+
// REQUEST PARAMS
|
|
74
|
+
//---------------
|
|
75
|
+
|
|
76
|
+
export interface CreateInputParam {
|
|
77
|
+
redirect_url?: string;
|
|
78
|
+
forward_url?: string;
|
|
79
|
+
customer?: CustomerCreateInputParam;
|
|
80
|
+
}
|
|
81
|
+
export interface ActivateInputParam {
|
|
82
|
+
token: string;
|
|
83
|
+
}
|
|
84
|
+
export interface CustomerCreateInputParam {
|
|
85
|
+
id: string;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface PriceVariant {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
external_name?: string;
|
|
9
|
+
variant_group?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
status?: 'active' | 'archived' | 'deleted';
|
|
12
|
+
created_at: number;
|
|
13
|
+
resource_version?: number;
|
|
14
|
+
updated_at?: number;
|
|
15
|
+
archived_at?: number;
|
|
16
|
+
attributes?: PriceVariant.Attribute[];
|
|
17
|
+
business_entity_id?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export namespace PriceVariant {
|
|
21
|
+
export class PriceVariantResource {
|
|
22
|
+
create(
|
|
23
|
+
input: CreateInputParam,
|
|
24
|
+
headers?: ChargebeeRequestHeader,
|
|
25
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
26
|
+
|
|
27
|
+
retrieve(
|
|
28
|
+
price_variant_id: string,
|
|
29
|
+
headers?: ChargebeeRequestHeader,
|
|
30
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
31
|
+
|
|
32
|
+
update(
|
|
33
|
+
price_variant_id: string,
|
|
34
|
+
input: UpdateInputParam,
|
|
35
|
+
headers?: ChargebeeRequestHeader,
|
|
36
|
+
): Promise<ChargebeeResponse<UpdateResponse>>;
|
|
37
|
+
|
|
38
|
+
delete(
|
|
39
|
+
price_variant_id: string,
|
|
40
|
+
headers?: ChargebeeRequestHeader,
|
|
41
|
+
): Promise<ChargebeeResponse<DeleteResponse>>;
|
|
42
|
+
|
|
43
|
+
list(
|
|
44
|
+
input?: ListInputParam,
|
|
45
|
+
headers?: ChargebeeRequestHeader,
|
|
46
|
+
): Promise<ChargebeeResponse<ListResponse>>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface CreateResponse {
|
|
50
|
+
price_variant: PriceVariant;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface RetrieveResponse {
|
|
54
|
+
price_variant: PriceVariant;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface UpdateResponse {
|
|
58
|
+
price_variant: PriceVariant;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface DeleteResponse {
|
|
62
|
+
price_variant: PriceVariant;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface ListResponse {
|
|
66
|
+
list: { price_variant: PriceVariant }[];
|
|
67
|
+
next_offset?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface Attribute {
|
|
71
|
+
name: string;
|
|
72
|
+
value: string;
|
|
73
|
+
}
|
|
74
|
+
// REQUEST PARAMS
|
|
75
|
+
//---------------
|
|
76
|
+
|
|
77
|
+
export interface CreateInputParam {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
external_name?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
variant_group?: string;
|
|
83
|
+
business_entity_id?: string;
|
|
84
|
+
attributes?: AttributesCreateInputParam[];
|
|
85
|
+
}
|
|
86
|
+
export interface UpdateInputParam {
|
|
87
|
+
name?: string;
|
|
88
|
+
external_name?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
variant_group?: string;
|
|
91
|
+
status?: 'active' | 'archived';
|
|
92
|
+
attributes?: AttributesUpdateInputParam[];
|
|
93
|
+
}
|
|
94
|
+
export interface ListInputParam {
|
|
95
|
+
limit?: number;
|
|
96
|
+
offset?: string;
|
|
97
|
+
id?: filter.String;
|
|
98
|
+
name?: filter.String;
|
|
99
|
+
status?: filter.Enum;
|
|
100
|
+
updated_at?: filter.Timestamp;
|
|
101
|
+
created_at?: filter.Timestamp;
|
|
102
|
+
business_entity_id?: filter.String;
|
|
103
|
+
include_site_level_resources?: filter.Boolean;
|
|
104
|
+
'sort_by[asc]'?: string;
|
|
105
|
+
'sort_by[desc]'?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface AttributesCreateInputParam {
|
|
108
|
+
name: string;
|
|
109
|
+
value: string;
|
|
110
|
+
}
|
|
111
|
+
export interface AttributesUpdateInputParam {
|
|
112
|
+
name: string;
|
|
113
|
+
value: string;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface PricingPageSession {
|
|
6
|
+
id?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
created_at?: number;
|
|
9
|
+
expires_at?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export namespace PricingPageSession {
|
|
13
|
+
export class PricingPageSessionResource {
|
|
14
|
+
createForNewSubscription(
|
|
15
|
+
input: CreateForNewSubscriptionInputParam,
|
|
16
|
+
headers?: ChargebeeRequestHeader,
|
|
17
|
+
): Promise<ChargebeeResponse<CreateForNewSubscriptionResponse>>;
|
|
18
|
+
|
|
19
|
+
createForExistingSubscription(
|
|
20
|
+
input: CreateForExistingSubscriptionInputParam,
|
|
21
|
+
headers?: ChargebeeRequestHeader,
|
|
22
|
+
): Promise<ChargebeeResponse<CreateForExistingSubscriptionResponse>>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CreateForNewSubscriptionResponse {
|
|
26
|
+
pricing_page_session: PricingPageSession;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface CreateForExistingSubscriptionResponse {
|
|
30
|
+
pricing_page_session: PricingPageSession;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// REQUEST PARAMS
|
|
34
|
+
//---------------
|
|
35
|
+
|
|
36
|
+
export interface CreateForNewSubscriptionInputParam {
|
|
37
|
+
redirect_url?: string;
|
|
38
|
+
business_entity_id?: string;
|
|
39
|
+
pricing_page?: PricingPageCreateForNewSubscriptionInputParam;
|
|
40
|
+
subscription?: SubscriptionCreateForNewSubscriptionInputParam;
|
|
41
|
+
customer?: CustomerCreateForNewSubscriptionInputParam;
|
|
42
|
+
billing_address?: BillingAddressCreateForNewSubscriptionInputParam;
|
|
43
|
+
shipping_address?: ShippingAddressCreateForNewSubscriptionInputParam;
|
|
44
|
+
discounts?: DiscountsCreateForNewSubscriptionInputParam[];
|
|
45
|
+
}
|
|
46
|
+
export interface CreateForExistingSubscriptionInputParam {
|
|
47
|
+
redirect_url?: string;
|
|
48
|
+
pricing_page?: PricingPageCreateForExistingSubscriptionInputParam;
|
|
49
|
+
subscription?: SubscriptionCreateForExistingSubscriptionInputParam;
|
|
50
|
+
discounts?: DiscountsCreateForExistingSubscriptionInputParam[];
|
|
51
|
+
}
|
|
52
|
+
export interface BillingAddressCreateForNewSubscriptionInputParam {
|
|
53
|
+
first_name?: string;
|
|
54
|
+
last_name?: string;
|
|
55
|
+
email?: string;
|
|
56
|
+
company?: string;
|
|
57
|
+
phone?: string;
|
|
58
|
+
line1?: string;
|
|
59
|
+
line2?: string;
|
|
60
|
+
line3?: string;
|
|
61
|
+
city?: string;
|
|
62
|
+
state_code?: string;
|
|
63
|
+
state?: string;
|
|
64
|
+
zip?: string;
|
|
65
|
+
country?: string;
|
|
66
|
+
validation_status?: ValidationStatusEnum;
|
|
67
|
+
}
|
|
68
|
+
export interface PricingPageCreateForNewSubscriptionInputParam {
|
|
69
|
+
id: string;
|
|
70
|
+
}
|
|
71
|
+
export interface CustomerCreateForNewSubscriptionInputParam {
|
|
72
|
+
id?: string;
|
|
73
|
+
email?: string;
|
|
74
|
+
first_name?: string;
|
|
75
|
+
last_name?: string;
|
|
76
|
+
company?: string;
|
|
77
|
+
phone?: string;
|
|
78
|
+
locale?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ShippingAddressCreateForNewSubscriptionInputParam {
|
|
81
|
+
first_name?: string;
|
|
82
|
+
last_name?: string;
|
|
83
|
+
email?: string;
|
|
84
|
+
company?: string;
|
|
85
|
+
phone?: string;
|
|
86
|
+
line1?: string;
|
|
87
|
+
line2?: string;
|
|
88
|
+
line3?: string;
|
|
89
|
+
city?: string;
|
|
90
|
+
state_code?: string;
|
|
91
|
+
state?: string;
|
|
92
|
+
zip?: string;
|
|
93
|
+
country?: string;
|
|
94
|
+
validation_status?: ValidationStatusEnum;
|
|
95
|
+
}
|
|
96
|
+
export interface SubscriptionCreateForNewSubscriptionInputParam {
|
|
97
|
+
id?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface DiscountsCreateForNewSubscriptionInputParam {
|
|
101
|
+
apply_on: ApplyOnEnum;
|
|
102
|
+
duration_type: DurationTypeEnum;
|
|
103
|
+
percentage?: number;
|
|
104
|
+
amount?: number;
|
|
105
|
+
period?: number;
|
|
106
|
+
period_unit?: PeriodUnitEnum;
|
|
107
|
+
included_in_mrr?: boolean;
|
|
108
|
+
item_price_id?: string;
|
|
109
|
+
label?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface PricingPageCreateForExistingSubscriptionInputParam {
|
|
112
|
+
id: string;
|
|
113
|
+
}
|
|
114
|
+
export interface SubscriptionCreateForExistingSubscriptionInputParam {
|
|
115
|
+
id: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface DiscountsCreateForExistingSubscriptionInputParam {
|
|
119
|
+
apply_on: ApplyOnEnum;
|
|
120
|
+
duration_type: DurationTypeEnum;
|
|
121
|
+
percentage?: number;
|
|
122
|
+
amount?: number;
|
|
123
|
+
period?: number;
|
|
124
|
+
period_unit?: PeriodUnitEnum;
|
|
125
|
+
included_in_mrr?: boolean;
|
|
126
|
+
item_price_id?: string;
|
|
127
|
+
label?: string;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
///<reference path='./filter.d.ts'/>
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface PromotionalCredit {
|
|
6
|
+
id: string;
|
|
7
|
+
customer_id: string;
|
|
8
|
+
type: 'increment' | 'decrement';
|
|
9
|
+
amount_in_decimal?: string;
|
|
10
|
+
amount: number;
|
|
11
|
+
currency_code: string;
|
|
12
|
+
description: string;
|
|
13
|
+
credit_type: CreditTypeEnum;
|
|
14
|
+
reference?: string;
|
|
15
|
+
closing_balance: number;
|
|
16
|
+
done_by?: string;
|
|
17
|
+
created_at: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export namespace PromotionalCredit {
|
|
21
|
+
export class PromotionalCreditResource {
|
|
22
|
+
add(
|
|
23
|
+
input: AddInputParam,
|
|
24
|
+
headers?: ChargebeeRequestHeader,
|
|
25
|
+
): Promise<ChargebeeResponse<AddResponse>>;
|
|
26
|
+
|
|
27
|
+
deduct(
|
|
28
|
+
input: DeductInputParam,
|
|
29
|
+
headers?: ChargebeeRequestHeader,
|
|
30
|
+
): Promise<ChargebeeResponse<DeductResponse>>;
|
|
31
|
+
|
|
32
|
+
set(
|
|
33
|
+
input: SetInputParam,
|
|
34
|
+
headers?: ChargebeeRequestHeader,
|
|
35
|
+
): Promise<ChargebeeResponse<SetResponse>>;
|
|
36
|
+
|
|
37
|
+
list(
|
|
38
|
+
input?: ListInputParam,
|
|
39
|
+
headers?: ChargebeeRequestHeader,
|
|
40
|
+
): Promise<ChargebeeResponse<ListResponse>>;
|
|
41
|
+
|
|
42
|
+
retrieve(
|
|
43
|
+
account_credit_id: string,
|
|
44
|
+
headers?: ChargebeeRequestHeader,
|
|
45
|
+
): Promise<ChargebeeResponse<RetrieveResponse>>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface AddResponse {
|
|
49
|
+
customer: Customer;
|
|
50
|
+
promotional_credit: PromotionalCredit;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface DeductResponse {
|
|
54
|
+
customer: Customer;
|
|
55
|
+
promotional_credit: PromotionalCredit;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface SetResponse {
|
|
59
|
+
customer: Customer;
|
|
60
|
+
promotional_credit: PromotionalCredit;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ListResponse {
|
|
64
|
+
list: { promotional_credit: PromotionalCredit }[];
|
|
65
|
+
next_offset?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface RetrieveResponse {
|
|
69
|
+
promotional_credit: PromotionalCredit;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// REQUEST PARAMS
|
|
73
|
+
//---------------
|
|
74
|
+
|
|
75
|
+
export interface AddInputParam {
|
|
76
|
+
customer_id: string;
|
|
77
|
+
amount?: number;
|
|
78
|
+
amount_in_decimal?: string;
|
|
79
|
+
currency_code?: string;
|
|
80
|
+
description: string;
|
|
81
|
+
credit_type?: CreditTypeEnum;
|
|
82
|
+
reference?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface DeductInputParam {
|
|
85
|
+
customer_id: string;
|
|
86
|
+
amount?: number;
|
|
87
|
+
amount_in_decimal?: string;
|
|
88
|
+
currency_code?: string;
|
|
89
|
+
description: string;
|
|
90
|
+
credit_type?: CreditTypeEnum;
|
|
91
|
+
reference?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface SetInputParam {
|
|
94
|
+
customer_id: string;
|
|
95
|
+
amount?: number;
|
|
96
|
+
amount_in_decimal?: string;
|
|
97
|
+
currency_code?: string;
|
|
98
|
+
description: string;
|
|
99
|
+
credit_type?: CreditTypeEnum;
|
|
100
|
+
reference?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface ListInputParam {
|
|
103
|
+
limit?: number;
|
|
104
|
+
offset?: string;
|
|
105
|
+
id?: filter.String;
|
|
106
|
+
created_at?: filter.Timestamp;
|
|
107
|
+
type?: filter.Enum;
|
|
108
|
+
customer_id?: filter.String;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
///<reference path='./../core.d.ts'/>
|
|
2
|
+
///<reference path='./../index.d.ts'/>
|
|
3
|
+
|
|
4
|
+
declare module 'chargebee' {
|
|
5
|
+
export interface Purchase {
|
|
6
|
+
id?: string;
|
|
7
|
+
customer_id: string;
|
|
8
|
+
created_at?: number;
|
|
9
|
+
modified_at?: number;
|
|
10
|
+
subscription_ids?: string[];
|
|
11
|
+
invoice_ids?: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export namespace Purchase {
|
|
15
|
+
export class PurchaseResource {
|
|
16
|
+
create(
|
|
17
|
+
input: CreateInputParam,
|
|
18
|
+
headers?: ChargebeeRequestHeader,
|
|
19
|
+
): Promise<ChargebeeResponse<CreateResponse>>;
|
|
20
|
+
|
|
21
|
+
estimate(
|
|
22
|
+
input: EstimateInputParam,
|
|
23
|
+
headers?: ChargebeeRequestHeader,
|
|
24
|
+
): Promise<ChargebeeResponse<EstimateResponse>>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface CreateResponse {
|
|
28
|
+
purchase: Purchase;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface EstimateResponse {
|
|
32
|
+
estimate: Estimate;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// REQUEST PARAMS
|
|
36
|
+
//---------------
|
|
37
|
+
|
|
38
|
+
export interface CreateInputParam {
|
|
39
|
+
customer_id: string;
|
|
40
|
+
payment_source_id?: string;
|
|
41
|
+
invoice_info?: InvoiceInfoCreateInputParam;
|
|
42
|
+
payment_schedule?: PaymentScheduleCreateInputParam;
|
|
43
|
+
statement_descriptor?: StatementDescriptorCreateInputParam;
|
|
44
|
+
purchase_items?: PurchaseItemsCreateInputParam[];
|
|
45
|
+
item_tiers?: ItemTiersCreateInputParam[];
|
|
46
|
+
shipping_addresses?: ShippingAddressesCreateInputParam[];
|
|
47
|
+
discounts?: DiscountsCreateInputParam[];
|
|
48
|
+
subscription_info?: SubscriptionInfoCreateInputParam[];
|
|
49
|
+
contract_terms?: ContractTermsCreateInputParam[];
|
|
50
|
+
}
|
|
51
|
+
export interface EstimateInputParam {
|
|
52
|
+
client_profile_id?: string;
|
|
53
|
+
customer_id?: string;
|
|
54
|
+
customer?: CustomerEstimateInputParam;
|
|
55
|
+
billing_address?: BillingAddressEstimateInputParam;
|
|
56
|
+
purchase_items?: PurchaseItemsEstimateInputParam[];
|
|
57
|
+
item_tiers?: ItemTiersEstimateInputParam[];
|
|
58
|
+
shipping_addresses?: ShippingAddressesEstimateInputParam[];
|
|
59
|
+
discounts?: DiscountsEstimateInputParam[];
|
|
60
|
+
subscription_info?: SubscriptionInfoEstimateInputParam[];
|
|
61
|
+
contract_terms?: ContractTermsEstimateInputParam[];
|
|
62
|
+
}
|
|
63
|
+
export interface StatementDescriptorCreateInputParam {
|
|
64
|
+
descriptor?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface PaymentScheduleCreateInputParam {
|
|
67
|
+
scheme_id?: string;
|
|
68
|
+
amount?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface InvoiceInfoCreateInputParam {
|
|
71
|
+
po_number?: string;
|
|
72
|
+
notes?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SubscriptionInfoCreateInputParam {
|
|
76
|
+
index: number;
|
|
77
|
+
subscription_id?: string;
|
|
78
|
+
billing_cycles?: number;
|
|
79
|
+
contract_term_billing_cycle_on_renewal?: number;
|
|
80
|
+
meta_data?: any;
|
|
81
|
+
}
|
|
82
|
+
export interface PurchaseItemsCreateInputParam {
|
|
83
|
+
index: number;
|
|
84
|
+
item_price_id: string;
|
|
85
|
+
quantity?: number;
|
|
86
|
+
unit_amount?: number;
|
|
87
|
+
unit_amount_in_decimal?: string;
|
|
88
|
+
quantity_in_decimal?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface DiscountsCreateInputParam {
|
|
91
|
+
index?: number;
|
|
92
|
+
coupon_id?: string;
|
|
93
|
+
percentage?: number;
|
|
94
|
+
amount?: number;
|
|
95
|
+
included_in_mrr?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export interface ContractTermsCreateInputParam {
|
|
98
|
+
index: number;
|
|
99
|
+
action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
100
|
+
cancellation_cutoff_period?: number;
|
|
101
|
+
}
|
|
102
|
+
export interface ItemTiersCreateInputParam {
|
|
103
|
+
index: number;
|
|
104
|
+
item_price_id?: string;
|
|
105
|
+
starting_unit?: number;
|
|
106
|
+
ending_unit?: number;
|
|
107
|
+
price?: number;
|
|
108
|
+
starting_unit_in_decimal?: string;
|
|
109
|
+
ending_unit_in_decimal?: string;
|
|
110
|
+
price_in_decimal?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface ShippingAddressesCreateInputParam {
|
|
113
|
+
first_name?: string;
|
|
114
|
+
last_name?: string;
|
|
115
|
+
email?: string;
|
|
116
|
+
company?: string;
|
|
117
|
+
phone?: string;
|
|
118
|
+
line1?: string;
|
|
119
|
+
line2?: string;
|
|
120
|
+
line3?: string;
|
|
121
|
+
city?: string;
|
|
122
|
+
state?: string;
|
|
123
|
+
state_code?: string;
|
|
124
|
+
country?: string;
|
|
125
|
+
zip?: string;
|
|
126
|
+
validation_status?: ValidationStatusEnum;
|
|
127
|
+
}
|
|
128
|
+
export interface BillingAddressEstimateInputParam {
|
|
129
|
+
line1?: string;
|
|
130
|
+
line2?: string;
|
|
131
|
+
line3?: string;
|
|
132
|
+
city?: string;
|
|
133
|
+
state_code?: string;
|
|
134
|
+
zip?: string;
|
|
135
|
+
country?: string;
|
|
136
|
+
validation_status?: ValidationStatusEnum;
|
|
137
|
+
}
|
|
138
|
+
export interface CustomerEstimateInputParam {
|
|
139
|
+
vat_number?: string;
|
|
140
|
+
vat_number_prefix?: string;
|
|
141
|
+
registered_for_gst?: boolean;
|
|
142
|
+
taxability?: TaxabilityEnum;
|
|
143
|
+
entity_code?: EntityCodeEnum;
|
|
144
|
+
exempt_number?: string;
|
|
145
|
+
exemption_details?: any;
|
|
146
|
+
customer_type?: CustomerTypeEnum;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface SubscriptionInfoEstimateInputParam {
|
|
150
|
+
index: number;
|
|
151
|
+
subscription_id?: string;
|
|
152
|
+
billing_cycles?: number;
|
|
153
|
+
contract_term_billing_cycle_on_renewal?: number;
|
|
154
|
+
}
|
|
155
|
+
export interface PurchaseItemsEstimateInputParam {
|
|
156
|
+
index: number;
|
|
157
|
+
item_price_id: string;
|
|
158
|
+
quantity?: number;
|
|
159
|
+
unit_amount?: number;
|
|
160
|
+
unit_amount_in_decimal?: string;
|
|
161
|
+
quantity_in_decimal?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface DiscountsEstimateInputParam {
|
|
164
|
+
index?: number;
|
|
165
|
+
coupon_id?: string;
|
|
166
|
+
percentage?: number;
|
|
167
|
+
amount?: number;
|
|
168
|
+
included_in_mrr?: boolean;
|
|
169
|
+
}
|
|
170
|
+
export interface ContractTermsEstimateInputParam {
|
|
171
|
+
index: number;
|
|
172
|
+
action_at_term_end?: 'renew' | 'evergreen' | 'cancel' | 'renew_once';
|
|
173
|
+
cancellation_cutoff_period?: number;
|
|
174
|
+
}
|
|
175
|
+
export interface ItemTiersEstimateInputParam {
|
|
176
|
+
index: number;
|
|
177
|
+
item_price_id?: string;
|
|
178
|
+
starting_unit?: number;
|
|
179
|
+
ending_unit?: number;
|
|
180
|
+
price?: number;
|
|
181
|
+
starting_unit_in_decimal?: string;
|
|
182
|
+
ending_unit_in_decimal?: string;
|
|
183
|
+
price_in_decimal?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface ShippingAddressesEstimateInputParam {
|
|
186
|
+
first_name?: string;
|
|
187
|
+
last_name?: string;
|
|
188
|
+
email?: string;
|
|
189
|
+
company?: string;
|
|
190
|
+
phone?: string;
|
|
191
|
+
line1?: string;
|
|
192
|
+
line2?: string;
|
|
193
|
+
line3?: string;
|
|
194
|
+
city?: string;
|
|
195
|
+
state?: string;
|
|
196
|
+
state_code?: string;
|
|
197
|
+
country?: string;
|
|
198
|
+
zip?: string;
|
|
199
|
+
validation_status?: ValidationStatusEnum;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|