@whop/sdk 0.0.3 → 0.0.5
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 +64 -0
- package/client.d.mts +14 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +14 -8
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +8 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/access-tokens.d.mts +58 -0
- package/resources/access-tokens.d.mts.map +1 -0
- package/resources/access-tokens.d.ts +58 -0
- package/resources/access-tokens.d.ts.map +1 -0
- package/resources/access-tokens.js +25 -0
- package/resources/access-tokens.js.map +1 -0
- package/resources/access-tokens.mjs +21 -0
- package/resources/access-tokens.mjs.map +1 -0
- package/resources/app-builds.d.mts +16 -13
- package/resources/app-builds.d.mts.map +1 -1
- package/resources/app-builds.d.ts +16 -13
- package/resources/app-builds.d.ts.map +1 -1
- package/resources/app-builds.js +1 -1
- package/resources/app-builds.mjs +1 -1
- package/resources/apps.d.mts +15 -10
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +15 -10
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +221 -183
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +221 -183
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +4 -20
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +4 -20
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/companies.d.mts +157 -0
- package/resources/companies.d.mts.map +1 -1
- package/resources/companies.d.ts +157 -0
- package/resources/companies.d.ts.map +1 -1
- package/resources/companies.js +22 -0
- package/resources/companies.js.map +1 -1
- package/resources/companies.mjs +22 -0
- package/resources/companies.mjs.map +1 -1
- package/resources/course-lesson-interactions.d.mts +2 -2
- package/resources/course-lesson-interactions.d.ts +2 -2
- package/resources/course-lesson-interactions.js +2 -2
- package/resources/course-lesson-interactions.mjs +2 -2
- package/resources/course-lessons.d.mts +184 -24
- package/resources/course-lessons.d.mts.map +1 -1
- package/resources/course-lessons.d.ts +184 -24
- package/resources/course-lessons.d.ts.map +1 -1
- package/resources/course-students.d.mts +187 -0
- package/resources/course-students.d.mts.map +1 -0
- package/resources/course-students.d.ts +187 -0
- package/resources/course-students.d.ts.map +1 -0
- package/resources/course-students.js +36 -0
- package/resources/course-students.js.map +1 -0
- package/resources/course-students.mjs +32 -0
- package/resources/course-students.mjs.map +1 -0
- package/resources/courses.d.mts +85 -21
- package/resources/courses.d.mts.map +1 -1
- package/resources/courses.d.ts +85 -21
- package/resources/courses.d.ts.map +1 -1
- package/resources/entries.d.mts +2 -2
- package/resources/entries.d.ts +2 -2
- package/resources/experiences.d.mts +15 -10
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +15 -10
- package/resources/experiences.d.ts.map +1 -1
- package/resources/forum-posts.d.mts +29 -19
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +29 -19
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/index.d.mts +6 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +539 -167
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +539 -167
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +2 -24
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +2 -24
- package/resources/invoices.mjs.map +1 -1
- package/resources/ledger-accounts.d.mts +1 -1
- package/resources/ledger-accounts.d.ts +1 -1
- package/resources/ledger-accounts.js +1 -1
- package/resources/ledger-accounts.mjs +1 -1
- package/resources/members.d.mts +11 -11
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +11 -11
- package/resources/members.d.ts.map +1 -1
- package/resources/memberships.d.mts +4 -4
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +4 -4
- package/resources/memberships.d.ts.map +1 -1
- package/resources/messages.d.mts +29 -19
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +29 -19
- package/resources/messages.d.ts.map +1 -1
- package/resources/payments.d.mts +10 -3
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +10 -3
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +118 -20
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +118 -20
- package/resources/plans.d.ts.map +1 -1
- package/resources/plans.js.map +1 -1
- package/resources/plans.mjs.map +1 -1
- package/resources/products.d.mts +20 -15
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +20 -15
- package/resources/products.d.ts.map +1 -1
- package/resources/promo-codes.d.mts +4 -4
- package/resources/promo-codes.d.ts +4 -4
- package/resources/shared.d.mts +69 -20
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +69 -20
- package/resources/shared.d.ts.map +1 -1
- package/resources/transfers.d.mts +12 -0
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +12 -0
- package/resources/transfers.d.ts.map +1 -1
- package/resources/users.d.mts +3 -0
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +3 -0
- package/resources/users.d.ts.map +1 -1
- package/src/client.ts +45 -10
- package/src/resources/access-tokens.ts +72 -0
- package/src/resources/app-builds.ts +19 -14
- package/src/resources/apps.ts +16 -11
- package/src/resources/checkout-configurations.ts +245 -199
- package/src/resources/companies.ts +196 -0
- package/src/resources/course-lesson-interactions.ts +2 -2
- package/src/resources/course-lessons.ts +223 -24
- package/src/resources/course-students.ts +238 -0
- package/src/resources/courses.ts +104 -22
- package/src/resources/entries.ts +2 -2
- package/src/resources/experiences.ts +19 -11
- package/src/resources/forum-posts.ts +35 -21
- package/src/resources/index.ts +17 -2
- package/src/resources/invoices.ts +630 -171
- package/src/resources/ledger-accounts.ts +1 -1
- package/src/resources/members.ts +12 -12
- package/src/resources/memberships.ts +5 -5
- package/src/resources/messages.ts +35 -21
- package/src/resources/payments.ts +10 -3
- package/src/resources/plans.ts +130 -20
- package/src/resources/products.ts +24 -16
- package/src/resources/promo-codes.ts +4 -4
- package/src/resources/shared.ts +70 -20
- package/src/resources/transfers.ts +10 -0
- package/src/resources/users.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/invoices.d.ts
CHANGED
|
@@ -19,11 +19,13 @@ export declare class Invoices extends APIResource {
|
|
|
19
19
|
* collection_method: 'send_invoice',
|
|
20
20
|
* company_id: 'biz_xxxxxxxxxxxxxx',
|
|
21
21
|
* due_date: '2023-12-01T05:00:00.401Z',
|
|
22
|
+
* member_id: 'mber_xxxxxxxxxxxxx',
|
|
22
23
|
* plan: {},
|
|
24
|
+
* product: { title: 'title' },
|
|
23
25
|
* });
|
|
24
26
|
* ```
|
|
25
27
|
*/
|
|
26
|
-
create(body: InvoiceCreateParams, options?: RequestOptions): APIPromise<
|
|
28
|
+
create(body: InvoiceCreateParams, options?: RequestOptions): APIPromise<Shared.Invoice>;
|
|
27
29
|
/**
|
|
28
30
|
* Retrieves an invoice by ID or token
|
|
29
31
|
*
|
|
@@ -31,13 +33,6 @@ export declare class Invoices extends APIResource {
|
|
|
31
33
|
*
|
|
32
34
|
* - `invoice:basic:read`
|
|
33
35
|
* - `plan:basic:read`
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* const invoice = await client.invoices.retrieve(
|
|
38
|
-
* 'inv_xxxxxxxxxxxxxx',
|
|
39
|
-
* );
|
|
40
|
-
* ```
|
|
41
36
|
*/
|
|
42
37
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.Invoice>;
|
|
43
38
|
/**
|
|
@@ -47,16 +42,6 @@ export declare class Invoices extends APIResource {
|
|
|
47
42
|
*
|
|
48
43
|
* - `invoice:basic:read`
|
|
49
44
|
* - `plan:basic:read`
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* // Automatically fetches more pages as needed.
|
|
54
|
-
* for await (const invoiceListItem of client.invoices.list({
|
|
55
|
-
* company_id: 'biz_xxxxxxxxxxxxxx',
|
|
56
|
-
* })) {
|
|
57
|
-
* // ...
|
|
58
|
-
* }
|
|
59
|
-
* ```
|
|
60
45
|
*/
|
|
61
46
|
list(query: InvoiceListParams, options?: RequestOptions): PagePromise<InvoiceListItemsCursorPage, Shared.InvoiceListItem>;
|
|
62
47
|
/**
|
|
@@ -65,182 +50,580 @@ export declare class Invoices extends APIResource {
|
|
|
65
50
|
* Required permissions:
|
|
66
51
|
*
|
|
67
52
|
* - `invoice:update`
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```ts
|
|
71
|
-
* const response = await client.invoices.void(
|
|
72
|
-
* 'inv_xxxxxxxxxxxxxx',
|
|
73
|
-
* );
|
|
74
|
-
* ```
|
|
75
53
|
*/
|
|
76
54
|
void(id: string, options?: RequestOptions): APIPromise<InvoiceVoidResponse>;
|
|
77
55
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Autogenerated return type of CreateInvoice.
|
|
80
|
-
*/
|
|
81
|
-
export interface InvoiceCreateResponse {
|
|
82
|
-
/**
|
|
83
|
-
* The ID of the checkout job that was created for this invoice.
|
|
84
|
-
*/
|
|
85
|
-
checkout_job_id: string | null;
|
|
86
|
-
/**
|
|
87
|
-
* The invoice that was created for this invoice.
|
|
88
|
-
*/
|
|
89
|
-
invoice: Shared.Invoice;
|
|
90
|
-
}
|
|
91
56
|
/**
|
|
92
57
|
* Represents `true` or `false` values.
|
|
93
58
|
*/
|
|
94
59
|
export type InvoiceVoidResponse = boolean;
|
|
95
|
-
export
|
|
96
|
-
/**
|
|
97
|
-
* The method of collection for this invoice. If using charge_automatically, you
|
|
98
|
-
* must provide a payment_token.
|
|
99
|
-
*/
|
|
100
|
-
collection_method: Shared.CollectionMethod;
|
|
101
|
-
/**
|
|
102
|
-
* The company ID to create this invoice for.
|
|
103
|
-
*/
|
|
104
|
-
company_id: string;
|
|
105
|
-
/**
|
|
106
|
-
* The date the invoice is due, if applicable.
|
|
107
|
-
*/
|
|
108
|
-
due_date: string;
|
|
109
|
-
/**
|
|
110
|
-
* The properties of the plan to create for this invoice.
|
|
111
|
-
*/
|
|
112
|
-
plan: InvoiceCreateParams.Plan;
|
|
113
|
-
/**
|
|
114
|
-
* Whether or not to charge the customer a buyer fee.
|
|
115
|
-
*/
|
|
116
|
-
charge_buyer_fee?: boolean | null;
|
|
117
|
-
/**
|
|
118
|
-
* The name of the customer to create this invoice for. This is required if you
|
|
119
|
-
* want to create an invoice for a customer who does not have a member of your
|
|
120
|
-
* company yet.
|
|
121
|
-
*/
|
|
122
|
-
customer_name?: string | null;
|
|
123
|
-
/**
|
|
124
|
-
* The email address to create this invoice for. This is required if you want to
|
|
125
|
-
* create an invoice for a user who does not have a member of your company yet.
|
|
126
|
-
*/
|
|
127
|
-
email_address?: string | null;
|
|
128
|
-
/**
|
|
129
|
-
* The member ID to create this invoice for. Include this if you want to create an
|
|
130
|
-
* invoice for an existing member. If you do not have a member ID, you must provide
|
|
131
|
-
* an email_address and customer_name.
|
|
132
|
-
*/
|
|
133
|
-
member_id?: string | null;
|
|
134
|
-
/**
|
|
135
|
-
* The payment token ID to use for this invoice. If using charge_automatically, you
|
|
136
|
-
* must provide a payment_token.
|
|
137
|
-
*/
|
|
138
|
-
payment_token_id?: string | null;
|
|
139
|
-
/**
|
|
140
|
-
* The properties of the product to create for this invoice. Include this if you
|
|
141
|
-
* want to create an invoice for a new product.
|
|
142
|
-
*/
|
|
143
|
-
product?: InvoiceCreateParams.Product | null;
|
|
144
|
-
/**
|
|
145
|
-
* The product ID to create this invoice for. Include this if you want to create an
|
|
146
|
-
* invoice for an existing product.
|
|
147
|
-
*/
|
|
148
|
-
product_id?: string | null;
|
|
149
|
-
}
|
|
60
|
+
export type InvoiceCreateParams = InvoiceCreateParams.CreateInvoiceInputWithProductAndMemberID | InvoiceCreateParams.CreateInvoiceInputWithProductAndEmailAddress | InvoiceCreateParams.CreateInvoiceInputWithProductIDAndMemberID | InvoiceCreateParams.CreateInvoiceInputWithProductIDAndEmailAddress;
|
|
150
61
|
export declare namespace InvoiceCreateParams {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
62
|
+
interface CreateInvoiceInputWithProductAndMemberID {
|
|
63
|
+
/**
|
|
64
|
+
* The method of collection for this invoice. If using charge_automatically, you
|
|
65
|
+
* must provide a payment_token.
|
|
66
|
+
*/
|
|
67
|
+
collection_method: Shared.CollectionMethod;
|
|
68
|
+
/**
|
|
69
|
+
* The company ID to create this invoice for.
|
|
70
|
+
*/
|
|
71
|
+
company_id: string;
|
|
72
|
+
/**
|
|
73
|
+
* The date the invoice is due, if applicable.
|
|
74
|
+
*/
|
|
75
|
+
due_date: string;
|
|
76
|
+
/**
|
|
77
|
+
* The member ID to create this invoice for. Include this if you want to create an
|
|
78
|
+
* invoice for an existing member. If you do not have a member ID, you must provide
|
|
79
|
+
* an email_address and customer_name.
|
|
80
|
+
*/
|
|
81
|
+
member_id: string;
|
|
82
|
+
/**
|
|
83
|
+
* The properties of the plan to create for this invoice.
|
|
84
|
+
*/
|
|
85
|
+
plan: CreateInvoiceInputWithProductAndMemberID.Plan;
|
|
86
|
+
/**
|
|
87
|
+
* The properties of the product to create for this invoice. Include this if you
|
|
88
|
+
* want to create an invoice for a new product.
|
|
89
|
+
*/
|
|
90
|
+
product: CreateInvoiceInputWithProductAndMemberID.Product;
|
|
91
|
+
/**
|
|
92
|
+
* Whether or not to charge the customer a buyer fee.
|
|
93
|
+
*/
|
|
94
|
+
charge_buyer_fee?: boolean | null;
|
|
95
|
+
/**
|
|
96
|
+
* The name of the customer to create this invoice for. This is required if you
|
|
97
|
+
* want to create an invoice for a customer who does not have a member of your
|
|
98
|
+
* company yet.
|
|
99
|
+
*/
|
|
100
|
+
customer_name?: string | null;
|
|
101
|
+
/**
|
|
102
|
+
* The payment token ID to use for this invoice. If using charge_automatically, you
|
|
103
|
+
* must provide a payment_token.
|
|
104
|
+
*/
|
|
105
|
+
payment_token_id?: string | null;
|
|
106
|
+
}
|
|
107
|
+
namespace CreateInvoiceInputWithProductAndMemberID {
|
|
108
|
+
/**
|
|
109
|
+
* The properties of the plan to create for this invoice.
|
|
110
|
+
*/
|
|
111
|
+
interface Plan {
|
|
112
|
+
/**
|
|
113
|
+
* The interval at which the plan charges (renewal plans).
|
|
114
|
+
*/
|
|
115
|
+
billing_period?: number | null;
|
|
116
|
+
/**
|
|
117
|
+
* An array of custom field objects.
|
|
118
|
+
*/
|
|
119
|
+
custom_fields?: Array<Plan.CustomField> | null;
|
|
120
|
+
/**
|
|
121
|
+
* The description of the plan.
|
|
122
|
+
*/
|
|
123
|
+
description?: string | null;
|
|
124
|
+
/**
|
|
125
|
+
* The interval at which the plan charges (expiration plans).
|
|
126
|
+
*/
|
|
127
|
+
expiration_days?: number | null;
|
|
128
|
+
/**
|
|
129
|
+
* An additional amount charged upon first purchase. Use only if a one time payment
|
|
130
|
+
* OR you want to charge an additional amount on top of the renewal price. Provided
|
|
131
|
+
* as a number in dollars. Eg: 10.43 for $10.43
|
|
132
|
+
*/
|
|
133
|
+
initial_price?: number | null;
|
|
134
|
+
/**
|
|
135
|
+
* A personal description or notes section for the business.
|
|
136
|
+
*/
|
|
137
|
+
internal_notes?: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* The type of plan that can be attached to a product
|
|
140
|
+
*/
|
|
141
|
+
plan_type?: Shared.PlanType | null;
|
|
142
|
+
/**
|
|
143
|
+
* The methods of how a plan can be released.
|
|
144
|
+
*/
|
|
145
|
+
release_method?: Shared.ReleaseMethod | null;
|
|
146
|
+
/**
|
|
147
|
+
* The amount the customer is charged every billing period. Use only if a recurring
|
|
148
|
+
* payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
149
|
+
*/
|
|
150
|
+
renewal_price?: number | null;
|
|
151
|
+
/**
|
|
152
|
+
* The number of units available for purchase.
|
|
153
|
+
*/
|
|
154
|
+
stock?: number | null;
|
|
155
|
+
/**
|
|
156
|
+
* The number of free trial days added before a renewal plan.
|
|
157
|
+
*/
|
|
158
|
+
trial_period_days?: number | null;
|
|
159
|
+
/**
|
|
160
|
+
* Limits/doesn't limit the number of units available for purchase.
|
|
161
|
+
*/
|
|
162
|
+
unlimited_stock?: boolean | null;
|
|
163
|
+
/**
|
|
164
|
+
* Visibility of a resource
|
|
165
|
+
*/
|
|
166
|
+
visibility?: Shared.Visibility | null;
|
|
167
|
+
}
|
|
168
|
+
namespace Plan {
|
|
169
|
+
interface CustomField {
|
|
170
|
+
/**
|
|
171
|
+
* The type of the custom field.
|
|
172
|
+
*/
|
|
173
|
+
field_type: 'text';
|
|
174
|
+
/**
|
|
175
|
+
* The name of the custom field.
|
|
176
|
+
*/
|
|
177
|
+
name: string;
|
|
178
|
+
/**
|
|
179
|
+
* The ID of the custom field (if being updated)
|
|
180
|
+
*/
|
|
181
|
+
id?: string | null;
|
|
182
|
+
/**
|
|
183
|
+
* The order of the field.
|
|
184
|
+
*/
|
|
185
|
+
order?: number | null;
|
|
186
|
+
/**
|
|
187
|
+
* The placeholder value of the field.
|
|
188
|
+
*/
|
|
189
|
+
placeholder?: string | null;
|
|
190
|
+
/**
|
|
191
|
+
* Whether or not the field is required.
|
|
192
|
+
*/
|
|
193
|
+
required?: boolean | null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The properties of the product to create for this invoice. Include this if you
|
|
198
|
+
* want to create an invoice for a new product.
|
|
199
|
+
*/
|
|
200
|
+
interface Product {
|
|
201
|
+
/**
|
|
202
|
+
* The title of the product.
|
|
203
|
+
*/
|
|
204
|
+
title: string;
|
|
205
|
+
/**
|
|
206
|
+
* The ID of the product tax code to apply to this product.
|
|
207
|
+
*/
|
|
208
|
+
product_tax_code_id?: string | null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
interface CreateInvoiceInputWithProductAndEmailAddress {
|
|
212
|
+
/**
|
|
213
|
+
* The method of collection for this invoice. If using charge_automatically, you
|
|
214
|
+
* must provide a payment_token.
|
|
215
|
+
*/
|
|
216
|
+
collection_method: Shared.CollectionMethod;
|
|
217
|
+
/**
|
|
218
|
+
* The company ID to create this invoice for.
|
|
219
|
+
*/
|
|
220
|
+
company_id: string;
|
|
221
|
+
/**
|
|
222
|
+
* The date the invoice is due, if applicable.
|
|
223
|
+
*/
|
|
224
|
+
due_date: string;
|
|
225
|
+
/**
|
|
226
|
+
* The email address to create this invoice for. This is required if you want to
|
|
227
|
+
* create an invoice for a user who does not have a member of your company yet.
|
|
228
|
+
*/
|
|
229
|
+
email_address: string;
|
|
230
|
+
/**
|
|
231
|
+
* The properties of the plan to create for this invoice.
|
|
232
|
+
*/
|
|
233
|
+
plan: CreateInvoiceInputWithProductAndEmailAddress.Plan;
|
|
234
|
+
/**
|
|
235
|
+
* The properties of the product to create for this invoice. Include this if you
|
|
236
|
+
* want to create an invoice for a new product.
|
|
237
|
+
*/
|
|
238
|
+
product: CreateInvoiceInputWithProductAndEmailAddress.Product;
|
|
239
|
+
/**
|
|
240
|
+
* Whether or not to charge the customer a buyer fee.
|
|
241
|
+
*/
|
|
242
|
+
charge_buyer_fee?: boolean | null;
|
|
155
243
|
/**
|
|
156
|
-
* The
|
|
244
|
+
* The name of the customer to create this invoice for. This is required if you
|
|
245
|
+
* want to create an invoice for a customer who does not have a member of your
|
|
246
|
+
* company yet.
|
|
157
247
|
*/
|
|
158
|
-
|
|
248
|
+
customer_name?: string | null;
|
|
159
249
|
/**
|
|
160
|
-
*
|
|
250
|
+
* The payment token ID to use for this invoice. If using charge_automatically, you
|
|
251
|
+
* must provide a payment_token.
|
|
161
252
|
*/
|
|
162
|
-
|
|
253
|
+
payment_token_id?: string | null;
|
|
254
|
+
}
|
|
255
|
+
namespace CreateInvoiceInputWithProductAndEmailAddress {
|
|
163
256
|
/**
|
|
164
|
-
* The
|
|
257
|
+
* The properties of the plan to create for this invoice.
|
|
165
258
|
*/
|
|
166
|
-
|
|
259
|
+
interface Plan {
|
|
260
|
+
/**
|
|
261
|
+
* The interval at which the plan charges (renewal plans).
|
|
262
|
+
*/
|
|
263
|
+
billing_period?: number | null;
|
|
264
|
+
/**
|
|
265
|
+
* An array of custom field objects.
|
|
266
|
+
*/
|
|
267
|
+
custom_fields?: Array<Plan.CustomField> | null;
|
|
268
|
+
/**
|
|
269
|
+
* The description of the plan.
|
|
270
|
+
*/
|
|
271
|
+
description?: string | null;
|
|
272
|
+
/**
|
|
273
|
+
* The interval at which the plan charges (expiration plans).
|
|
274
|
+
*/
|
|
275
|
+
expiration_days?: number | null;
|
|
276
|
+
/**
|
|
277
|
+
* An additional amount charged upon first purchase. Use only if a one time payment
|
|
278
|
+
* OR you want to charge an additional amount on top of the renewal price. Provided
|
|
279
|
+
* as a number in dollars. Eg: 10.43 for $10.43
|
|
280
|
+
*/
|
|
281
|
+
initial_price?: number | null;
|
|
282
|
+
/**
|
|
283
|
+
* A personal description or notes section for the business.
|
|
284
|
+
*/
|
|
285
|
+
internal_notes?: string | null;
|
|
286
|
+
/**
|
|
287
|
+
* The type of plan that can be attached to a product
|
|
288
|
+
*/
|
|
289
|
+
plan_type?: Shared.PlanType | null;
|
|
290
|
+
/**
|
|
291
|
+
* The methods of how a plan can be released.
|
|
292
|
+
*/
|
|
293
|
+
release_method?: Shared.ReleaseMethod | null;
|
|
294
|
+
/**
|
|
295
|
+
* The amount the customer is charged every billing period. Use only if a recurring
|
|
296
|
+
* payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
297
|
+
*/
|
|
298
|
+
renewal_price?: number | null;
|
|
299
|
+
/**
|
|
300
|
+
* The number of units available for purchase.
|
|
301
|
+
*/
|
|
302
|
+
stock?: number | null;
|
|
303
|
+
/**
|
|
304
|
+
* The number of free trial days added before a renewal plan.
|
|
305
|
+
*/
|
|
306
|
+
trial_period_days?: number | null;
|
|
307
|
+
/**
|
|
308
|
+
* Limits/doesn't limit the number of units available for purchase.
|
|
309
|
+
*/
|
|
310
|
+
unlimited_stock?: boolean | null;
|
|
311
|
+
/**
|
|
312
|
+
* Visibility of a resource
|
|
313
|
+
*/
|
|
314
|
+
visibility?: Shared.Visibility | null;
|
|
315
|
+
}
|
|
316
|
+
namespace Plan {
|
|
317
|
+
interface CustomField {
|
|
318
|
+
/**
|
|
319
|
+
* The type of the custom field.
|
|
320
|
+
*/
|
|
321
|
+
field_type: 'text';
|
|
322
|
+
/**
|
|
323
|
+
* The name of the custom field.
|
|
324
|
+
*/
|
|
325
|
+
name: string;
|
|
326
|
+
/**
|
|
327
|
+
* The ID of the custom field (if being updated)
|
|
328
|
+
*/
|
|
329
|
+
id?: string | null;
|
|
330
|
+
/**
|
|
331
|
+
* The order of the field.
|
|
332
|
+
*/
|
|
333
|
+
order?: number | null;
|
|
334
|
+
/**
|
|
335
|
+
* The placeholder value of the field.
|
|
336
|
+
*/
|
|
337
|
+
placeholder?: string | null;
|
|
338
|
+
/**
|
|
339
|
+
* Whether or not the field is required.
|
|
340
|
+
*/
|
|
341
|
+
required?: boolean | null;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
167
344
|
/**
|
|
168
|
-
* The
|
|
345
|
+
* The properties of the product to create for this invoice. Include this if you
|
|
346
|
+
* want to create an invoice for a new product.
|
|
169
347
|
*/
|
|
170
|
-
|
|
348
|
+
interface Product {
|
|
349
|
+
/**
|
|
350
|
+
* The title of the product.
|
|
351
|
+
*/
|
|
352
|
+
title: string;
|
|
353
|
+
/**
|
|
354
|
+
* The ID of the product tax code to apply to this product.
|
|
355
|
+
*/
|
|
356
|
+
product_tax_code_id?: string | null;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
interface CreateInvoiceInputWithProductIDAndMemberID {
|
|
360
|
+
/**
|
|
361
|
+
* The method of collection for this invoice. If using charge_automatically, you
|
|
362
|
+
* must provide a payment_token.
|
|
363
|
+
*/
|
|
364
|
+
collection_method: Shared.CollectionMethod;
|
|
171
365
|
/**
|
|
172
|
-
*
|
|
173
|
-
* OR you want to charge an additional amount on top of the renewal price. Provided
|
|
174
|
-
* as a number in dollars. Eg: 10.43 for $10.43
|
|
366
|
+
* The company ID to create this invoice for.
|
|
175
367
|
*/
|
|
176
|
-
|
|
368
|
+
company_id: string;
|
|
177
369
|
/**
|
|
178
|
-
*
|
|
370
|
+
* The date the invoice is due, if applicable.
|
|
179
371
|
*/
|
|
180
|
-
|
|
372
|
+
due_date: string;
|
|
181
373
|
/**
|
|
182
|
-
* The
|
|
374
|
+
* The member ID to create this invoice for. Include this if you want to create an
|
|
375
|
+
* invoice for an existing member. If you do not have a member ID, you must provide
|
|
376
|
+
* an email_address and customer_name.
|
|
183
377
|
*/
|
|
184
|
-
|
|
378
|
+
member_id: string;
|
|
185
379
|
/**
|
|
186
|
-
* The
|
|
380
|
+
* The properties of the plan to create for this invoice.
|
|
187
381
|
*/
|
|
188
|
-
|
|
382
|
+
plan: CreateInvoiceInputWithProductIDAndMemberID.Plan;
|
|
189
383
|
/**
|
|
190
|
-
* The
|
|
191
|
-
*
|
|
384
|
+
* The product ID to create this invoice for. Include this if you want to create an
|
|
385
|
+
* invoice for an existing product.
|
|
192
386
|
*/
|
|
193
|
-
|
|
387
|
+
product_id: string;
|
|
194
388
|
/**
|
|
195
|
-
*
|
|
389
|
+
* Whether or not to charge the customer a buyer fee.
|
|
196
390
|
*/
|
|
197
|
-
|
|
391
|
+
charge_buyer_fee?: boolean | null;
|
|
198
392
|
/**
|
|
199
|
-
*
|
|
393
|
+
* The name of the customer to create this invoice for. This is required if you
|
|
394
|
+
* want to create an invoice for a customer who does not have a member of your
|
|
395
|
+
* company yet.
|
|
200
396
|
*/
|
|
201
|
-
|
|
397
|
+
customer_name?: string | null;
|
|
398
|
+
/**
|
|
399
|
+
* The payment token ID to use for this invoice. If using charge_automatically, you
|
|
400
|
+
* must provide a payment_token.
|
|
401
|
+
*/
|
|
402
|
+
payment_token_id?: string | null;
|
|
202
403
|
}
|
|
203
|
-
namespace
|
|
204
|
-
|
|
404
|
+
namespace CreateInvoiceInputWithProductIDAndMemberID {
|
|
405
|
+
/**
|
|
406
|
+
* The properties of the plan to create for this invoice.
|
|
407
|
+
*/
|
|
408
|
+
interface Plan {
|
|
409
|
+
/**
|
|
410
|
+
* The interval at which the plan charges (renewal plans).
|
|
411
|
+
*/
|
|
412
|
+
billing_period?: number | null;
|
|
413
|
+
/**
|
|
414
|
+
* An array of custom field objects.
|
|
415
|
+
*/
|
|
416
|
+
custom_fields?: Array<Plan.CustomField> | null;
|
|
205
417
|
/**
|
|
206
|
-
* The
|
|
418
|
+
* The description of the plan.
|
|
207
419
|
*/
|
|
208
|
-
|
|
420
|
+
description?: string | null;
|
|
209
421
|
/**
|
|
210
|
-
* The
|
|
422
|
+
* The interval at which the plan charges (expiration plans).
|
|
211
423
|
*/
|
|
212
|
-
|
|
424
|
+
expiration_days?: number | null;
|
|
213
425
|
/**
|
|
214
|
-
*
|
|
426
|
+
* An additional amount charged upon first purchase. Use only if a one time payment
|
|
427
|
+
* OR you want to charge an additional amount on top of the renewal price. Provided
|
|
428
|
+
* as a number in dollars. Eg: 10.43 for $10.43
|
|
215
429
|
*/
|
|
216
|
-
|
|
430
|
+
initial_price?: number | null;
|
|
217
431
|
/**
|
|
218
|
-
*
|
|
432
|
+
* A personal description or notes section for the business.
|
|
219
433
|
*/
|
|
220
|
-
|
|
434
|
+
internal_notes?: string | null;
|
|
221
435
|
/**
|
|
222
|
-
* The
|
|
436
|
+
* The type of plan that can be attached to a product
|
|
223
437
|
*/
|
|
224
|
-
|
|
438
|
+
plan_type?: Shared.PlanType | null;
|
|
225
439
|
/**
|
|
226
|
-
*
|
|
440
|
+
* The methods of how a plan can be released.
|
|
227
441
|
*/
|
|
228
|
-
|
|
442
|
+
release_method?: Shared.ReleaseMethod | null;
|
|
443
|
+
/**
|
|
444
|
+
* The amount the customer is charged every billing period. Use only if a recurring
|
|
445
|
+
* payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
446
|
+
*/
|
|
447
|
+
renewal_price?: number | null;
|
|
448
|
+
/**
|
|
449
|
+
* The number of units available for purchase.
|
|
450
|
+
*/
|
|
451
|
+
stock?: number | null;
|
|
452
|
+
/**
|
|
453
|
+
* The number of free trial days added before a renewal plan.
|
|
454
|
+
*/
|
|
455
|
+
trial_period_days?: number | null;
|
|
456
|
+
/**
|
|
457
|
+
* Limits/doesn't limit the number of units available for purchase.
|
|
458
|
+
*/
|
|
459
|
+
unlimited_stock?: boolean | null;
|
|
460
|
+
/**
|
|
461
|
+
* Visibility of a resource
|
|
462
|
+
*/
|
|
463
|
+
visibility?: Shared.Visibility | null;
|
|
464
|
+
}
|
|
465
|
+
namespace Plan {
|
|
466
|
+
interface CustomField {
|
|
467
|
+
/**
|
|
468
|
+
* The type of the custom field.
|
|
469
|
+
*/
|
|
470
|
+
field_type: 'text';
|
|
471
|
+
/**
|
|
472
|
+
* The name of the custom field.
|
|
473
|
+
*/
|
|
474
|
+
name: string;
|
|
475
|
+
/**
|
|
476
|
+
* The ID of the custom field (if being updated)
|
|
477
|
+
*/
|
|
478
|
+
id?: string | null;
|
|
479
|
+
/**
|
|
480
|
+
* The order of the field.
|
|
481
|
+
*/
|
|
482
|
+
order?: number | null;
|
|
483
|
+
/**
|
|
484
|
+
* The placeholder value of the field.
|
|
485
|
+
*/
|
|
486
|
+
placeholder?: string | null;
|
|
487
|
+
/**
|
|
488
|
+
* Whether or not the field is required.
|
|
489
|
+
*/
|
|
490
|
+
required?: boolean | null;
|
|
491
|
+
}
|
|
229
492
|
}
|
|
230
493
|
}
|
|
231
|
-
|
|
232
|
-
* The properties of the product to create for this invoice. Include this if you
|
|
233
|
-
* want to create an invoice for a new product.
|
|
234
|
-
*/
|
|
235
|
-
interface Product {
|
|
494
|
+
interface CreateInvoiceInputWithProductIDAndEmailAddress {
|
|
236
495
|
/**
|
|
237
|
-
* The
|
|
496
|
+
* The method of collection for this invoice. If using charge_automatically, you
|
|
497
|
+
* must provide a payment_token.
|
|
238
498
|
*/
|
|
239
|
-
|
|
499
|
+
collection_method: Shared.CollectionMethod;
|
|
240
500
|
/**
|
|
241
|
-
* The ID
|
|
501
|
+
* The company ID to create this invoice for.
|
|
242
502
|
*/
|
|
243
|
-
|
|
503
|
+
company_id: string;
|
|
504
|
+
/**
|
|
505
|
+
* The date the invoice is due, if applicable.
|
|
506
|
+
*/
|
|
507
|
+
due_date: string;
|
|
508
|
+
/**
|
|
509
|
+
* The email address to create this invoice for. This is required if you want to
|
|
510
|
+
* create an invoice for a user who does not have a member of your company yet.
|
|
511
|
+
*/
|
|
512
|
+
email_address: string;
|
|
513
|
+
/**
|
|
514
|
+
* The properties of the plan to create for this invoice.
|
|
515
|
+
*/
|
|
516
|
+
plan: CreateInvoiceInputWithProductIDAndEmailAddress.Plan;
|
|
517
|
+
/**
|
|
518
|
+
* The product ID to create this invoice for. Include this if you want to create an
|
|
519
|
+
* invoice for an existing product.
|
|
520
|
+
*/
|
|
521
|
+
product_id: string;
|
|
522
|
+
/**
|
|
523
|
+
* Whether or not to charge the customer a buyer fee.
|
|
524
|
+
*/
|
|
525
|
+
charge_buyer_fee?: boolean | null;
|
|
526
|
+
/**
|
|
527
|
+
* The name of the customer to create this invoice for. This is required if you
|
|
528
|
+
* want to create an invoice for a customer who does not have a member of your
|
|
529
|
+
* company yet.
|
|
530
|
+
*/
|
|
531
|
+
customer_name?: string | null;
|
|
532
|
+
/**
|
|
533
|
+
* The payment token ID to use for this invoice. If using charge_automatically, you
|
|
534
|
+
* must provide a payment_token.
|
|
535
|
+
*/
|
|
536
|
+
payment_token_id?: string | null;
|
|
537
|
+
}
|
|
538
|
+
namespace CreateInvoiceInputWithProductIDAndEmailAddress {
|
|
539
|
+
/**
|
|
540
|
+
* The properties of the plan to create for this invoice.
|
|
541
|
+
*/
|
|
542
|
+
interface Plan {
|
|
543
|
+
/**
|
|
544
|
+
* The interval at which the plan charges (renewal plans).
|
|
545
|
+
*/
|
|
546
|
+
billing_period?: number | null;
|
|
547
|
+
/**
|
|
548
|
+
* An array of custom field objects.
|
|
549
|
+
*/
|
|
550
|
+
custom_fields?: Array<Plan.CustomField> | null;
|
|
551
|
+
/**
|
|
552
|
+
* The description of the plan.
|
|
553
|
+
*/
|
|
554
|
+
description?: string | null;
|
|
555
|
+
/**
|
|
556
|
+
* The interval at which the plan charges (expiration plans).
|
|
557
|
+
*/
|
|
558
|
+
expiration_days?: number | null;
|
|
559
|
+
/**
|
|
560
|
+
* An additional amount charged upon first purchase. Use only if a one time payment
|
|
561
|
+
* OR you want to charge an additional amount on top of the renewal price. Provided
|
|
562
|
+
* as a number in dollars. Eg: 10.43 for $10.43
|
|
563
|
+
*/
|
|
564
|
+
initial_price?: number | null;
|
|
565
|
+
/**
|
|
566
|
+
* A personal description or notes section for the business.
|
|
567
|
+
*/
|
|
568
|
+
internal_notes?: string | null;
|
|
569
|
+
/**
|
|
570
|
+
* The type of plan that can be attached to a product
|
|
571
|
+
*/
|
|
572
|
+
plan_type?: Shared.PlanType | null;
|
|
573
|
+
/**
|
|
574
|
+
* The methods of how a plan can be released.
|
|
575
|
+
*/
|
|
576
|
+
release_method?: Shared.ReleaseMethod | null;
|
|
577
|
+
/**
|
|
578
|
+
* The amount the customer is charged every billing period. Use only if a recurring
|
|
579
|
+
* payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
580
|
+
*/
|
|
581
|
+
renewal_price?: number | null;
|
|
582
|
+
/**
|
|
583
|
+
* The number of units available for purchase.
|
|
584
|
+
*/
|
|
585
|
+
stock?: number | null;
|
|
586
|
+
/**
|
|
587
|
+
* The number of free trial days added before a renewal plan.
|
|
588
|
+
*/
|
|
589
|
+
trial_period_days?: number | null;
|
|
590
|
+
/**
|
|
591
|
+
* Limits/doesn't limit the number of units available for purchase.
|
|
592
|
+
*/
|
|
593
|
+
unlimited_stock?: boolean | null;
|
|
594
|
+
/**
|
|
595
|
+
* Visibility of a resource
|
|
596
|
+
*/
|
|
597
|
+
visibility?: Shared.Visibility | null;
|
|
598
|
+
}
|
|
599
|
+
namespace Plan {
|
|
600
|
+
interface CustomField {
|
|
601
|
+
/**
|
|
602
|
+
* The type of the custom field.
|
|
603
|
+
*/
|
|
604
|
+
field_type: 'text';
|
|
605
|
+
/**
|
|
606
|
+
* The name of the custom field.
|
|
607
|
+
*/
|
|
608
|
+
name: string;
|
|
609
|
+
/**
|
|
610
|
+
* The ID of the custom field (if being updated)
|
|
611
|
+
*/
|
|
612
|
+
id?: string | null;
|
|
613
|
+
/**
|
|
614
|
+
* The order of the field.
|
|
615
|
+
*/
|
|
616
|
+
order?: number | null;
|
|
617
|
+
/**
|
|
618
|
+
* The placeholder value of the field.
|
|
619
|
+
*/
|
|
620
|
+
placeholder?: string | null;
|
|
621
|
+
/**
|
|
622
|
+
* Whether or not the field is required.
|
|
623
|
+
*/
|
|
624
|
+
required?: boolean | null;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
244
627
|
}
|
|
245
628
|
}
|
|
246
629
|
export interface InvoiceListParams extends CursorPageParams {
|
|
@@ -253,13 +636,13 @@ export interface InvoiceListParams extends CursorPageParams {
|
|
|
253
636
|
*/
|
|
254
637
|
before?: string | null;
|
|
255
638
|
/**
|
|
256
|
-
*
|
|
639
|
+
* Filter invoices by their collection method
|
|
257
640
|
*/
|
|
258
|
-
|
|
641
|
+
collection_methods?: Array<Shared.CollectionMethod> | null;
|
|
259
642
|
/**
|
|
260
|
-
* The
|
|
643
|
+
* The direction of the sort.
|
|
261
644
|
*/
|
|
262
|
-
|
|
645
|
+
direction?: Shared.Direction | null;
|
|
263
646
|
/**
|
|
264
647
|
* Returns the first _n_ elements from the list.
|
|
265
648
|
*/
|
|
@@ -272,28 +655,17 @@ export interface InvoiceListParams extends CursorPageParams {
|
|
|
272
655
|
* Which columns can be used to sort.
|
|
273
656
|
*/
|
|
274
657
|
order?: 'id' | 'created_at' | 'due_date' | null;
|
|
275
|
-
}
|
|
276
|
-
export declare namespace InvoiceListParams {
|
|
277
658
|
/**
|
|
278
|
-
*
|
|
659
|
+
* Return only invoices created for these specific product ids
|
|
279
660
|
*/
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* The collection methods to filter the invoices by
|
|
287
|
-
*/
|
|
288
|
-
collection_methods?: Array<Shared.CollectionMethod> | null;
|
|
289
|
-
/**
|
|
290
|
-
* The statuses to filter the invoices by
|
|
291
|
-
*/
|
|
292
|
-
statuses?: Array<Shared.InvoiceStatus> | null;
|
|
293
|
-
}
|
|
661
|
+
product_ids?: Array<string> | null;
|
|
662
|
+
/**
|
|
663
|
+
* The statuses to filter the invoices by
|
|
664
|
+
*/
|
|
665
|
+
statuses?: Array<Shared.InvoiceStatus> | null;
|
|
294
666
|
}
|
|
295
667
|
export declare namespace Invoices {
|
|
296
|
-
export { type
|
|
668
|
+
export { type InvoiceVoidResponse as InvoiceVoidResponse, type InvoiceCreateParams as InvoiceCreateParams, type InvoiceListParams as InvoiceListParams, };
|
|
297
669
|
}
|
|
298
670
|
export { type InvoiceListItemsCursorPage };
|
|
299
671
|
//# sourceMappingURL=invoices.d.ts.map
|