@onflay/node 0.2.1 → 1.0.0-staging-20261206080029
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 +74 -0
- package/README.md +211 -48
- package/dist/chunk-4RUPPDC2.mjs +121 -0
- package/dist/chunk-4RUPPDC2.mjs.map +1 -0
- package/dist/chunk-63KSRMJG.mjs +47 -0
- package/dist/chunk-63KSRMJG.mjs.map +1 -0
- package/dist/chunk-7LYAEZCT.mjs +197 -0
- package/dist/chunk-7LYAEZCT.mjs.map +1 -0
- package/dist/chunk-A3TRCKHK.mjs +60 -0
- package/dist/chunk-A3TRCKHK.mjs.map +1 -0
- package/dist/chunk-AFAU2FH2.js +47 -0
- package/dist/chunk-AFAU2FH2.js.map +1 -0
- package/dist/chunk-DBE2YZWE.mjs +38 -0
- package/dist/chunk-DBE2YZWE.mjs.map +1 -0
- package/dist/chunk-EOHFYWFQ.mjs +154 -0
- package/dist/chunk-EOHFYWFQ.mjs.map +1 -0
- package/dist/chunk-I2IVHBFA.js +197 -0
- package/dist/chunk-I2IVHBFA.js.map +1 -0
- package/dist/chunk-J4MYKTPN.mjs +37 -0
- package/dist/chunk-J4MYKTPN.mjs.map +1 -0
- package/dist/chunk-JQPANXLV.mjs +37 -0
- package/dist/chunk-JQPANXLV.mjs.map +1 -0
- package/dist/chunk-JXP6V2P2.mjs +1057 -0
- package/dist/chunk-JXP6V2P2.mjs.map +1 -0
- package/dist/chunk-M52GW7GQ.js +1057 -0
- package/dist/chunk-M52GW7GQ.js.map +1 -0
- package/dist/chunk-MMMUKAI6.js +37 -0
- package/dist/chunk-MMMUKAI6.js.map +1 -0
- package/dist/chunk-NSR4UQLV.js +87 -0
- package/dist/chunk-NSR4UQLV.js.map +1 -0
- package/dist/chunk-SUONZUVK.js +154 -0
- package/dist/chunk-SUONZUVK.js.map +1 -0
- package/dist/chunk-T26CPULH.js +121 -0
- package/dist/chunk-T26CPULH.js.map +1 -0
- package/dist/chunk-V2XJ4GZU.js +38 -0
- package/dist/chunk-V2XJ4GZU.js.map +1 -0
- package/dist/chunk-W6AEPYUG.js +37 -0
- package/dist/chunk-W6AEPYUG.js.map +1 -0
- package/dist/chunk-YHQ7XIC6.js +60 -0
- package/dist/chunk-YHQ7XIC6.js.map +1 -0
- package/dist/chunk-YSXUZYUY.mjs +87 -0
- package/dist/chunk-YSXUZYUY.mjs.map +1 -0
- package/dist/index-C1KFW_9r.d.mts +3989 -0
- package/dist/index-C1KFW_9r.d.ts +3989 -0
- package/dist/index.d.mts +918 -0
- package/dist/index.d.ts +918 -26
- package/dist/index.js +2990 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2991 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/config.d.mts +59 -0
- package/dist/lib/config.d.ts +59 -0
- package/dist/lib/config.js +15 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/config.mjs +15 -0
- package/dist/lib/config.mjs.map +1 -0
- package/dist/lib/http.d.mts +51 -0
- package/dist/lib/http.d.ts +51 -0
- package/dist/lib/http.js +13 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/http.mjs +13 -0
- package/dist/lib/http.mjs.map +1 -0
- package/dist/lib/retries.d.mts +41 -0
- package/dist/lib/retries.d.ts +41 -0
- package/dist/lib/retries.js +16 -0
- package/dist/lib/retries.js.map +1 -0
- package/dist/lib/retries.mjs +16 -0
- package/dist/lib/retries.mjs.map +1 -0
- package/dist/lib/sdks.d.mts +61 -0
- package/dist/lib/sdks.d.ts +61 -0
- package/dist/lib/sdks.js +12 -0
- package/dist/lib/sdks.js.map +1 -0
- package/dist/lib/sdks.mjs +12 -0
- package/dist/lib/sdks.mjs.map +1 -0
- package/dist/models/components/index.d.mts +1 -0
- package/dist/models/components/index.d.ts +1 -0
- package/dist/models/components/index.js +1 -0
- package/dist/models/components/index.js.map +1 -0
- package/dist/models/components/index.mjs +1 -0
- package/dist/models/components/index.mjs.map +1 -0
- package/dist/models/errors/index.d.mts +161 -0
- package/dist/models/errors/index.d.ts +161 -0
- package/dist/models/errors/index.js +29 -0
- package/dist/models/errors/index.js.map +1 -0
- package/dist/models/errors/index.mjs +29 -0
- package/dist/models/errors/index.mjs.map +1 -0
- package/dist/models/operations/index.d.mts +769 -0
- package/dist/models/operations/index.d.ts +769 -0
- package/dist/models/operations/index.js +1 -0
- package/dist/models/operations/index.js.map +1 -0
- package/dist/models/operations/index.mjs +1 -0
- package/dist/models/operations/index.mjs.map +1 -0
- package/dist/types/index.d.mts +26 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/verify-tF2BsJK6.d.mts +325 -0
- package/dist/verify-tF2BsJK6.d.ts +325 -0
- package/dist/webhooks/express.d.mts +39 -0
- package/dist/webhooks/express.d.ts +39 -0
- package/dist/webhooks/express.js +10 -0
- package/dist/webhooks/express.js.map +1 -0
- package/dist/webhooks/express.mjs +10 -0
- package/dist/webhooks/express.mjs.map +1 -0
- package/dist/webhooks/hono.d.mts +33 -0
- package/dist/webhooks/hono.d.ts +33 -0
- package/dist/webhooks/hono.js +10 -0
- package/dist/webhooks/hono.js.map +1 -0
- package/dist/webhooks/hono.mjs +10 -0
- package/dist/webhooks/hono.mjs.map +1 -0
- package/dist/webhooks/index.d.mts +34 -0
- package/dist/webhooks/index.d.ts +34 -0
- package/dist/webhooks/index.js +75 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/index.mjs +75 -0
- package/dist/webhooks/index.mjs.map +1 -0
- package/dist/webhooks/next.d.mts +38 -0
- package/dist/webhooks/next.d.ts +38 -0
- package/dist/webhooks/next.js +10 -0
- package/dist/webhooks/next.js.map +1 -0
- package/dist/webhooks/next.mjs +10 -0
- package/dist/webhooks/next.mjs.map +1 -0
- package/package.json +273 -14
- package/dist/client.d.ts +0 -65
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -216
- package/dist/client.js.map +0 -1
- package/dist/errors.d.ts +0 -61
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -134
- package/dist/errors.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/onflay.d.ts +0 -42
- package/dist/onflay.d.ts.map +0 -1
- package/dist/onflay.js +0 -60
- package/dist/onflay.js.map +0 -1
- package/dist/pagination.d.ts +0 -19
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js +0 -61
- package/dist/pagination.js.map +0 -1
- package/dist/resources/checkout-sessions.d.ts +0 -11
- package/dist/resources/checkout-sessions.d.ts.map +0 -1
- package/dist/resources/checkout-sessions.js +0 -20
- package/dist/resources/checkout-sessions.js.map +0 -1
- package/dist/resources/customers.d.ts +0 -17
- package/dist/resources/customers.d.ts.map +0 -1
- package/dist/resources/customers.js +0 -39
- package/dist/resources/customers.js.map +0 -1
- package/dist/resources/payments.d.ts +0 -11
- package/dist/resources/payments.d.ts.map +0 -1
- package/dist/resources/payments.js +0 -27
- package/dist/resources/payments.js.map +0 -1
- package/dist/resources/prices.d.ts +0 -24
- package/dist/resources/prices.d.ts.map +0 -1
- package/dist/resources/prices.js +0 -46
- package/dist/resources/prices.js.map +0 -1
- package/dist/resources/products.d.ts +0 -18
- package/dist/resources/products.d.ts.map +0 -1
- package/dist/resources/products.js +0 -40
- package/dist/resources/products.js.map +0 -1
- package/dist/resources/subscriptions.d.ts +0 -39
- package/dist/resources/subscriptions.d.ts.map +0 -1
- package/dist/resources/subscriptions.js +0 -62
- package/dist/resources/subscriptions.js.map +0 -1
- package/dist/resources/usage.d.ts +0 -26
- package/dist/resources/usage.d.ts.map +0 -1
- package/dist/resources/usage.js +0 -43
- package/dist/resources/usage.js.map +0 -1
- package/dist/resources/webhook-endpoints.d.ts +0 -20
- package/dist/resources/webhook-endpoints.d.ts.map +0 -1
- package/dist/resources/webhook-endpoints.js +0 -47
- package/dist/resources/webhook-endpoints.js.map +0 -1
- package/dist/types/checkout-sessions.d.ts +0 -67
- package/dist/types/checkout-sessions.d.ts.map +0 -1
- package/dist/types/checkout-sessions.js +0 -3
- package/dist/types/checkout-sessions.js.map +0 -1
- package/dist/types/customers.d.ts +0 -28
- package/dist/types/customers.d.ts.map +0 -1
- package/dist/types/customers.js +0 -3
- package/dist/types/customers.js.map +0 -1
- package/dist/types/events.d.ts +0 -95
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/events.js +0 -24
- package/dist/types/events.js.map +0 -1
- package/dist/types/payments.d.ts +0 -25
- package/dist/types/payments.d.ts.map +0 -1
- package/dist/types/payments.js +0 -3
- package/dist/types/payments.js.map +0 -1
- package/dist/types/prices.d.ts +0 -57
- package/dist/types/prices.d.ts.map +0 -1
- package/dist/types/prices.js +0 -3
- package/dist/types/prices.js.map +0 -1
- package/dist/types/products.d.ts +0 -29
- package/dist/types/products.d.ts.map +0 -1
- package/dist/types/products.js +0 -3
- package/dist/types/products.js.map +0 -1
- package/dist/types/shared.d.ts +0 -34
- package/dist/types/shared.d.ts.map +0 -1
- package/dist/types/shared.js +0 -4
- package/dist/types/shared.js.map +0 -1
- package/dist/types/subscriptions.d.ts +0 -85
- package/dist/types/subscriptions.d.ts.map +0 -1
- package/dist/types/subscriptions.js +0 -3
- package/dist/types/subscriptions.js.map +0 -1
- package/dist/types/usage.d.ts +0 -35
- package/dist/types/usage.d.ts.map +0 -1
- package/dist/types/usage.js +0 -3
- package/dist/types/usage.js.map +0 -1
- package/dist/types/webhook-endpoints.d.ts +0 -48
- package/dist/types/webhook-endpoints.d.ts.map +0 -1
- package/dist/types/webhook-endpoints.js +0 -3
- package/dist/types/webhook-endpoints.js.map +0 -1
- package/dist/version.d.ts +0 -4
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -7
- package/dist/version.js.map +0 -1
|
@@ -0,0 +1,3989 @@
|
|
|
1
|
+
type ActivateLicenseKey = {
|
|
2
|
+
/**
|
|
3
|
+
* The license key.
|
|
4
|
+
*/
|
|
5
|
+
key: string;
|
|
6
|
+
/**
|
|
7
|
+
* Your id for this install (machine id, device id…).
|
|
8
|
+
*/
|
|
9
|
+
instanceId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Human label for the install, e.g. "Ana’s MacBook".
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
};
|
|
15
|
+
type AdjustCredits = {
|
|
16
|
+
/**
|
|
17
|
+
* Your app's id for the customer (the `externalCustomerId` sent to checkout).
|
|
18
|
+
*/
|
|
19
|
+
externalCustomerId: string;
|
|
20
|
+
/**
|
|
21
|
+
* Credit key, e.g. `api_credits`.
|
|
22
|
+
*/
|
|
23
|
+
key: string;
|
|
24
|
+
/**
|
|
25
|
+
* Your unique id for this operation (at most 255 characters). Sending it again returns the first result without moving credits twice.
|
|
26
|
+
*/
|
|
27
|
+
idempotencyKey: string;
|
|
28
|
+
/**
|
|
29
|
+
* Free-form data stored on the ledger entry (at most 4 KB as JSON).
|
|
30
|
+
*/
|
|
31
|
+
metadata?: {
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Credits to add (positive) or remove (negative). Not zero. A removal larger than the balance answers 402 `insufficient_credits`.
|
|
36
|
+
*/
|
|
37
|
+
amount: number;
|
|
38
|
+
/**
|
|
39
|
+
* Positive adjustments only: the added credits expire this many days from now if unspent. Omit for credits that never expire. Sending it with a negative `amount` answers 400 `expires_in_days_not_allowed`.
|
|
40
|
+
*/
|
|
41
|
+
expiresInDays?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Why you adjusted the balance, kept on the ledger entry.
|
|
44
|
+
*/
|
|
45
|
+
note?: string;
|
|
46
|
+
};
|
|
47
|
+
type ApiError = {
|
|
48
|
+
error: ApiErrorDetail;
|
|
49
|
+
};
|
|
50
|
+
type ApiErrorDetail = {
|
|
51
|
+
/**
|
|
52
|
+
* Error class. Branch retries on it: `rate_limit_error` and `api_error` are retryable, `idempotency_error` only marks idempotency-key conflicts.
|
|
53
|
+
*/
|
|
54
|
+
type: 'authentication_error' | 'invalid_request' | 'api_error' | 'rate_limit_error' | 'idempotency_error';
|
|
55
|
+
/**
|
|
56
|
+
* Stable machine-readable error code, e.g. `not_found`, `insufficient_scope`. Every code is documented at https://docs.onflay.com/errors.
|
|
57
|
+
*/
|
|
58
|
+
code: string;
|
|
59
|
+
message: string;
|
|
60
|
+
/**
|
|
61
|
+
* One sentence telling you (or your agent) how to fix the request. Absent for codes without guidance.
|
|
62
|
+
*/
|
|
63
|
+
hint?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Reference page for `code`.
|
|
66
|
+
*/
|
|
67
|
+
doc_url?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Request field the error refers to (the first invalid field for validation errors).
|
|
70
|
+
*/
|
|
71
|
+
param?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Alias of `param`.
|
|
74
|
+
*/
|
|
75
|
+
field?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Validation errors only: one entry per failed rule, in request order.
|
|
78
|
+
*/
|
|
79
|
+
errors?: Array<ApiFieldError>;
|
|
80
|
+
requestId: string;
|
|
81
|
+
/**
|
|
82
|
+
* Alias of `requestId`.
|
|
83
|
+
*/
|
|
84
|
+
request_id?: string;
|
|
85
|
+
};
|
|
86
|
+
type ApiFieldError = {
|
|
87
|
+
/**
|
|
88
|
+
* Path of the invalid field in the request, e.g. `catalog.product` or `prices[0].amountInCents`.
|
|
89
|
+
*/
|
|
90
|
+
field: string;
|
|
91
|
+
/**
|
|
92
|
+
* Snake-case name of the failed rule, e.g. `is_int`, `is_not_empty`, `unknown_field`.
|
|
93
|
+
*/
|
|
94
|
+
code: string;
|
|
95
|
+
message: string;
|
|
96
|
+
};
|
|
97
|
+
type AppointmentSlotCheckout = {
|
|
98
|
+
/**
|
|
99
|
+
* Slot start ISO 8601 (UTC or offset)
|
|
100
|
+
*/
|
|
101
|
+
startsAt: string;
|
|
102
|
+
timezone: string;
|
|
103
|
+
/**
|
|
104
|
+
* Buyer choice for hybrid listings; inferred when listing is online or in-person only
|
|
105
|
+
*/
|
|
106
|
+
deliveryMode?: 'virtual' | 'in_person';
|
|
107
|
+
};
|
|
108
|
+
type BillingLineItem = {
|
|
109
|
+
/**
|
|
110
|
+
* Line description shown on the invoice.
|
|
111
|
+
*/
|
|
112
|
+
description: string;
|
|
113
|
+
/**
|
|
114
|
+
* Pre-computed amount for this line in cents. This is what is charged.
|
|
115
|
+
*/
|
|
116
|
+
amountInCents: number;
|
|
117
|
+
/**
|
|
118
|
+
* Informational quantity; amountInCents is what is charged.
|
|
119
|
+
*/
|
|
120
|
+
quantity?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Informational unit amount in cents.
|
|
123
|
+
*/
|
|
124
|
+
unitAmountInCents?: number;
|
|
125
|
+
};
|
|
126
|
+
type CancelByExternalCustomer = {
|
|
127
|
+
/**
|
|
128
|
+
* Developer's app-side customer id (same as checkout externalCustomerId)
|
|
129
|
+
*/
|
|
130
|
+
externalCustomerId: string;
|
|
131
|
+
/**
|
|
132
|
+
* When the customer has multiple active plans, scope cancel to this catalog key
|
|
133
|
+
*/
|
|
134
|
+
catalogKey?: string;
|
|
135
|
+
/**
|
|
136
|
+
* If true (default), schedule cancel at period end. If false, cancel immediately.
|
|
137
|
+
*/
|
|
138
|
+
cancelAtPeriodEnd?: boolean;
|
|
139
|
+
};
|
|
140
|
+
type CancelSubscription = {
|
|
141
|
+
/**
|
|
142
|
+
* If true (default), access continues until currentPeriodEnd and status stays `active` with cancelAtPeriodEnd=true. If false, cancels immediately.
|
|
143
|
+
*/
|
|
144
|
+
cancelAtPeriodEnd?: boolean;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Present for recurring prices.
|
|
148
|
+
*/
|
|
149
|
+
type CatalogCheckoutInterval = 'month' | 'year';
|
|
150
|
+
type CatalogCheckoutSelection = {
|
|
151
|
+
/**
|
|
152
|
+
* Product key.
|
|
153
|
+
*/
|
|
154
|
+
product: string;
|
|
155
|
+
/**
|
|
156
|
+
* Plan key.
|
|
157
|
+
*/
|
|
158
|
+
plan: string;
|
|
159
|
+
/**
|
|
160
|
+
* Present for recurring prices.
|
|
161
|
+
*/
|
|
162
|
+
interval?: CatalogCheckoutInterval;
|
|
163
|
+
};
|
|
164
|
+
type CatalogCreditGrant = {
|
|
165
|
+
/**
|
|
166
|
+
* Credit key, e.g. `api_credits`.
|
|
167
|
+
*/
|
|
168
|
+
key: string;
|
|
169
|
+
/**
|
|
170
|
+
* Credits granted per successful payment.
|
|
171
|
+
*/
|
|
172
|
+
amount: number;
|
|
173
|
+
/**
|
|
174
|
+
* Days after each grant until its unspent credits expire; null when they never expire.
|
|
175
|
+
*/
|
|
176
|
+
expiresInDays: number | null;
|
|
177
|
+
};
|
|
178
|
+
type CatalogCreditGrantInput = {
|
|
179
|
+
/**
|
|
180
|
+
* Credit key your app consumes, e.g. `api_credits`. Same format as plan keys.
|
|
181
|
+
*/
|
|
182
|
+
key: string;
|
|
183
|
+
/**
|
|
184
|
+
* Credits granted on every successful payment of the plan (each renewal included).
|
|
185
|
+
*/
|
|
186
|
+
amount: number;
|
|
187
|
+
/**
|
|
188
|
+
* Days after each grant until its unspent credits expire. Omit for credits that never expire. Consumes spend the soonest-expiring credits first.
|
|
189
|
+
*/
|
|
190
|
+
expiresInDays?: number;
|
|
191
|
+
};
|
|
192
|
+
type CatalogEntitlementInput = {
|
|
193
|
+
/**
|
|
194
|
+
* Entitlement key your app checks, e.g. `pro_features`.
|
|
195
|
+
*/
|
|
196
|
+
key: string;
|
|
197
|
+
/**
|
|
198
|
+
* Entitlement value, e.g. `true` or a limit like `1000`.
|
|
199
|
+
*/
|
|
200
|
+
value: string | number | boolean;
|
|
201
|
+
};
|
|
202
|
+
type CatalogEnvironment = 'live' | 'sandbox';
|
|
203
|
+
type CatalogLicenseKeyConfig = {
|
|
204
|
+
/**
|
|
205
|
+
* Instances one key can activate at a time; null is unlimited.
|
|
206
|
+
*/
|
|
207
|
+
activationLimit: number | null;
|
|
208
|
+
/**
|
|
209
|
+
* Days from issuance until the key expires; null never.
|
|
210
|
+
*/
|
|
211
|
+
expiresInDays: number | null;
|
|
212
|
+
};
|
|
213
|
+
type CatalogLicenseKeyInput = {
|
|
214
|
+
/**
|
|
215
|
+
* How many instances (machines, installs) can use one key at a time. Omit for no limit.
|
|
216
|
+
*/
|
|
217
|
+
activationLimit?: number;
|
|
218
|
+
/**
|
|
219
|
+
* Days from issuance until the key expires. Omit for keys that do not expire on their own (subscription keys still expire when the subscription ends).
|
|
220
|
+
*/
|
|
221
|
+
expiresInDays?: number;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Who owns this product from now on: `api` (your code or admin panel through the API) or `code` (a config file applied with `onflay catalog apply`). The dashboard warns before edits that the owner may overwrite.
|
|
225
|
+
*/
|
|
226
|
+
type CatalogManagedBy = 'api' | 'code';
|
|
227
|
+
type CatalogPlan = {
|
|
228
|
+
/**
|
|
229
|
+
* Plan key, e.g. `pro`.
|
|
230
|
+
*/
|
|
231
|
+
key: string;
|
|
232
|
+
name: string;
|
|
233
|
+
description: string | null;
|
|
234
|
+
isDefault: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* What a buyer of this plan gets.
|
|
237
|
+
*/
|
|
238
|
+
entitlements: Array<ListingRecipeEntitlement>;
|
|
239
|
+
/**
|
|
240
|
+
* Credits granted on every successful payment of the plan (each renewal included).
|
|
241
|
+
*/
|
|
242
|
+
credits: Array<CatalogCreditGrant>;
|
|
243
|
+
/**
|
|
244
|
+
* License key issued per one-time purchase (or per subscription); null when the plan issues none.
|
|
245
|
+
*/
|
|
246
|
+
licenseKey: CatalogLicenseKeyConfig | null;
|
|
247
|
+
/**
|
|
248
|
+
* Free trial days of a subscription plan: the card is saved at checkout and charged when the trial ends. 0 when the plan has no trial (always 0 for other products).
|
|
249
|
+
*/
|
|
250
|
+
trialDays: number;
|
|
251
|
+
prices: Array<CatalogPrice>;
|
|
252
|
+
};
|
|
253
|
+
type CatalogPrice = {
|
|
254
|
+
type: CatalogPriceType;
|
|
255
|
+
/**
|
|
256
|
+
* Recurring prices only.
|
|
257
|
+
*/
|
|
258
|
+
interval?: PriceRecurringInterval;
|
|
259
|
+
/**
|
|
260
|
+
* Recurring prices only: intervals per billing period.
|
|
261
|
+
*/
|
|
262
|
+
intervalCount?: number;
|
|
263
|
+
/**
|
|
264
|
+
* Amount in cents (per period for recurring prices).
|
|
265
|
+
*/
|
|
266
|
+
amountInCents: number;
|
|
267
|
+
/**
|
|
268
|
+
* ISO 4217 currency code, for example `usd`.
|
|
269
|
+
*/
|
|
270
|
+
currency: string;
|
|
271
|
+
/**
|
|
272
|
+
* Ready-to-send `catalog` selection for checkout. `null` when the price cannot be bought through catalog checkout yet (day or week intervals).
|
|
273
|
+
*/
|
|
274
|
+
checkout: CatalogCheckoutSelection | null;
|
|
275
|
+
};
|
|
276
|
+
type CatalogPriceInput = {
|
|
277
|
+
type: CatalogPriceType;
|
|
278
|
+
/**
|
|
279
|
+
* Required for recurring prices.
|
|
280
|
+
*/
|
|
281
|
+
interval?: CatalogCheckoutInterval;
|
|
282
|
+
/**
|
|
283
|
+
* Amount in cents (per period for recurring prices).
|
|
284
|
+
*/
|
|
285
|
+
amountInCents: number;
|
|
286
|
+
/**
|
|
287
|
+
* Currency. Only 'usd' is accepted today.
|
|
288
|
+
*/
|
|
289
|
+
currency?: 'usd';
|
|
290
|
+
};
|
|
291
|
+
type CatalogPriceType = 'recurring' | 'one_time';
|
|
292
|
+
type CatalogProduct = {
|
|
293
|
+
object: 'catalog_product';
|
|
294
|
+
/**
|
|
295
|
+
* Product key, e.g. `acme-saas`.
|
|
296
|
+
*/
|
|
297
|
+
key: string;
|
|
298
|
+
name: string;
|
|
299
|
+
description: string | null;
|
|
300
|
+
type: CatalogProductType;
|
|
301
|
+
/**
|
|
302
|
+
* Who owns the product: `dashboard`, `api` (written with `PUT /v1/catalog/products/{key}`) or `code` (a config file applied with `onflay catalog apply`).
|
|
303
|
+
*/
|
|
304
|
+
managedBy: CatalogProductManagedBy;
|
|
305
|
+
environment: CatalogEnvironment;
|
|
306
|
+
plans: Array<CatalogPlan>;
|
|
307
|
+
/**
|
|
308
|
+
* Granted by the product regardless of plan.
|
|
309
|
+
*/
|
|
310
|
+
entitlements: Array<ListingRecipeEntitlement>;
|
|
311
|
+
endpoints: ListingRecipeEndpoints;
|
|
312
|
+
/**
|
|
313
|
+
* Same value as the `ETag` response header.
|
|
314
|
+
*/
|
|
315
|
+
etag: string;
|
|
316
|
+
updatedAt: Date;
|
|
317
|
+
};
|
|
318
|
+
type CatalogProductList = {
|
|
319
|
+
object: 'list';
|
|
320
|
+
data: Array<CatalogProductSummary>;
|
|
321
|
+
hasMore: boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Pass as `cursor` to get the next page.
|
|
324
|
+
*/
|
|
325
|
+
nextCursor: string | null;
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* Who owns the product: `dashboard`, `api` (written with `PUT /v1/catalog/products/{key}`) or `code` (a config file applied with `onflay catalog apply`).
|
|
329
|
+
*/
|
|
330
|
+
type CatalogProductManagedBy = 'dashboard' | 'api' | 'code';
|
|
331
|
+
type CatalogProductSummary = {
|
|
332
|
+
object: 'catalog_product_summary';
|
|
333
|
+
key: string;
|
|
334
|
+
name: string;
|
|
335
|
+
type: CatalogProductType;
|
|
336
|
+
/**
|
|
337
|
+
* Lowercase listing status, e.g. `active`, `draft`, `paused`.
|
|
338
|
+
*/
|
|
339
|
+
status: string;
|
|
340
|
+
plans: Array<CatalogProductSummaryPlan>;
|
|
341
|
+
/**
|
|
342
|
+
* Path of the full product, e.g. `/v1/catalog/products/acme-saas`.
|
|
343
|
+
*/
|
|
344
|
+
url: string;
|
|
345
|
+
updatedAt: Date;
|
|
346
|
+
};
|
|
347
|
+
type CatalogProductSummaryPlan = {
|
|
348
|
+
key: string;
|
|
349
|
+
name: string;
|
|
350
|
+
isDefault: boolean;
|
|
351
|
+
};
|
|
352
|
+
type CatalogProductType = 'digital' | 'service' | 'appointment' | 'subscription' | 'event';
|
|
353
|
+
type CatalogSelection = {
|
|
354
|
+
/**
|
|
355
|
+
* Product key (the product's catalog key). Send `product` or the deprecated alias `listing`.
|
|
356
|
+
*/
|
|
357
|
+
product?: string;
|
|
358
|
+
/**
|
|
359
|
+
* Deprecated alias of `product`.
|
|
360
|
+
*
|
|
361
|
+
* @deprecated
|
|
362
|
+
*/
|
|
363
|
+
listing?: string;
|
|
364
|
+
/**
|
|
365
|
+
* Plan key, e.g. `pro`.
|
|
366
|
+
*/
|
|
367
|
+
plan: string;
|
|
368
|
+
/**
|
|
369
|
+
* Billing interval for subscription plans. Defaults to month when omitted. If you send an interval the plan has no price for, the request fails with `price_not_found` instead of billing another interval.
|
|
370
|
+
*/
|
|
371
|
+
interval?: 'month' | 'year';
|
|
372
|
+
};
|
|
373
|
+
type CheckoutAttribution = {
|
|
374
|
+
/**
|
|
375
|
+
* Normalized traffic source. UTM source takes precedence over referrer domain.
|
|
376
|
+
*/
|
|
377
|
+
source?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Safe referrer hostname only; no URL path or query string.
|
|
380
|
+
*/
|
|
381
|
+
referrerDomain?: string;
|
|
382
|
+
utmSource?: string;
|
|
383
|
+
utmMedium?: string;
|
|
384
|
+
utmCampaign?: string;
|
|
385
|
+
device?: 'mobile' | 'desktop' | 'tablet' | 'unknown';
|
|
386
|
+
/**
|
|
387
|
+
* Public listing id on which the buyer entered checkout. The API verifies it matches.
|
|
388
|
+
*/
|
|
389
|
+
landingListingId?: string;
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* Only present when it was sent in the request.
|
|
393
|
+
*/
|
|
394
|
+
type CheckoutCatalogInterval = 'month' | 'year';
|
|
395
|
+
type CheckoutReceipt = {
|
|
396
|
+
object: 'checkout_receipt';
|
|
397
|
+
/**
|
|
398
|
+
* Checkout session id.
|
|
399
|
+
*/
|
|
400
|
+
checkoutId: string;
|
|
401
|
+
status: CheckoutReceiptStatus;
|
|
402
|
+
/**
|
|
403
|
+
* Suggested poll delay in milliseconds. Only when `status` is `processing`.
|
|
404
|
+
*/
|
|
405
|
+
retryAfterMs?: number;
|
|
406
|
+
/**
|
|
407
|
+
* Only when `status` is `paid` and both catalog keys are known.
|
|
408
|
+
*/
|
|
409
|
+
catalog?: CheckoutReceiptCatalog;
|
|
410
|
+
/**
|
|
411
|
+
* Amount charged in cents. Only when `status` is `paid`.
|
|
412
|
+
*/
|
|
413
|
+
amountInCents?: number;
|
|
414
|
+
/**
|
|
415
|
+
* Currency. Only when `status` is `paid`.
|
|
416
|
+
*/
|
|
417
|
+
currency?: string;
|
|
418
|
+
/**
|
|
419
|
+
* Your app's customer id, when the checkout had one.
|
|
420
|
+
*/
|
|
421
|
+
externalCustomerId?: string;
|
|
422
|
+
/**
|
|
423
|
+
* Current access snapshot (never includes `accessToken`), when `externalCustomerId` is set.
|
|
424
|
+
*/
|
|
425
|
+
access?: CustomerAccess;
|
|
426
|
+
/**
|
|
427
|
+
* Only when `status` is `failed`.
|
|
428
|
+
*/
|
|
429
|
+
failedReason?: string;
|
|
430
|
+
};
|
|
431
|
+
type CheckoutReceiptCatalog = {
|
|
432
|
+
/**
|
|
433
|
+
* Listing catalog key.
|
|
434
|
+
*/
|
|
435
|
+
listing: string;
|
|
436
|
+
/**
|
|
437
|
+
* Plan (variant) key.
|
|
438
|
+
*/
|
|
439
|
+
plan: string;
|
|
440
|
+
};
|
|
441
|
+
type CheckoutReceiptStatus = 'processing' | 'paid' | 'failed' | 'expired';
|
|
442
|
+
type CheckoutSession = {
|
|
443
|
+
/**
|
|
444
|
+
* Checkout session id.
|
|
445
|
+
*/
|
|
446
|
+
id: string;
|
|
447
|
+
object: 'checkout_session';
|
|
448
|
+
status: CheckoutSessionStatus;
|
|
449
|
+
mode: CheckoutSessionMode;
|
|
450
|
+
/**
|
|
451
|
+
* Hosted checkout page to send the buyer to (`<checkout app>/s/<id>`).
|
|
452
|
+
*/
|
|
453
|
+
checkoutUrl: string;
|
|
454
|
+
/**
|
|
455
|
+
* Stripe client secret for a custom embedded flow; null until payment can be collected (for example before a slot is picked or tax details are known).
|
|
456
|
+
*/
|
|
457
|
+
clientSecret: string | null;
|
|
458
|
+
/**
|
|
459
|
+
* Stripe publishable key for the client secret.
|
|
460
|
+
*/
|
|
461
|
+
stripePublishableKey: string;
|
|
462
|
+
/**
|
|
463
|
+
* True when there is no client secret yet because tax details must be collected first.
|
|
464
|
+
*/
|
|
465
|
+
taxPreparationRequired: boolean;
|
|
466
|
+
customerEmail: string;
|
|
467
|
+
/**
|
|
468
|
+
* Your app's customer id, when the session was created with one.
|
|
469
|
+
*/
|
|
470
|
+
externalCustomerId: string | null;
|
|
471
|
+
product: ProductRef;
|
|
472
|
+
plan: PlanRef | null;
|
|
473
|
+
/**
|
|
474
|
+
* Amount the buyer will pay, in cents.
|
|
475
|
+
*/
|
|
476
|
+
amountInCents: number;
|
|
477
|
+
/**
|
|
478
|
+
* Lowercase ISO currency code.
|
|
479
|
+
*/
|
|
480
|
+
currency: string;
|
|
481
|
+
pricing: CheckoutSessionPricing | null;
|
|
482
|
+
successUrl: string | null;
|
|
483
|
+
cancelUrl: string | null;
|
|
484
|
+
/**
|
|
485
|
+
* Session-bound return token for the receipt route.
|
|
486
|
+
*/
|
|
487
|
+
returnToken: string | null;
|
|
488
|
+
expiresAt: Date;
|
|
489
|
+
createdAt: Date;
|
|
490
|
+
};
|
|
491
|
+
type CheckoutSessionCatalog = {
|
|
492
|
+
/**
|
|
493
|
+
* Product catalog key. Present when the request sent `product`.
|
|
494
|
+
*/
|
|
495
|
+
product?: string;
|
|
496
|
+
/**
|
|
497
|
+
* Deprecated alias of `product`. Present only when the request sent `listing`.
|
|
498
|
+
*
|
|
499
|
+
* @deprecated
|
|
500
|
+
*/
|
|
501
|
+
listing?: string;
|
|
502
|
+
/**
|
|
503
|
+
* Plan key.
|
|
504
|
+
*/
|
|
505
|
+
plan: string;
|
|
506
|
+
/**
|
|
507
|
+
* Only present when it was sent in the request.
|
|
508
|
+
*/
|
|
509
|
+
interval?: CheckoutCatalogInterval;
|
|
510
|
+
};
|
|
511
|
+
type CheckoutSessionCreateResponse = {
|
|
512
|
+
/**
|
|
513
|
+
* Checkout session id (same value as `sessionId`). Use it with `GET /v1/checkout-sessions/{id}`.
|
|
514
|
+
*/
|
|
515
|
+
id: string;
|
|
516
|
+
object: 'checkout_session';
|
|
517
|
+
/**
|
|
518
|
+
* Checkout URL to send the buyer to: the Onflay hosted page (`<checkout app>/s/<sessionId>`), or a Stripe-hosted page on the legacy path.
|
|
519
|
+
*/
|
|
520
|
+
checkoutUrl: string;
|
|
521
|
+
/**
|
|
522
|
+
* Checkout session id. Use it with `GET /v1/checkout-sessions/{id}`. (On the legacy path this is the Stripe session id.)
|
|
523
|
+
*/
|
|
524
|
+
sessionId: string;
|
|
525
|
+
/**
|
|
526
|
+
* Id of the pending payment (transaction) created for this session.
|
|
527
|
+
*/
|
|
528
|
+
transactionId: string;
|
|
529
|
+
/**
|
|
530
|
+
* Amount that will be charged, in cents (0 for free checkout).
|
|
531
|
+
*/
|
|
532
|
+
chargedAmountInCents: number;
|
|
533
|
+
/**
|
|
534
|
+
* Stripe PaymentIntent/SetupIntent client secret. Null until the buyer completes required steps (for example tax details); absent on free checkout.
|
|
535
|
+
*/
|
|
536
|
+
clientSecret?: string | null;
|
|
537
|
+
/**
|
|
538
|
+
* Stripe publishable key for the client secret.
|
|
539
|
+
*/
|
|
540
|
+
stripePublishableKey?: string;
|
|
541
|
+
/**
|
|
542
|
+
* Session-bound token for `GET /v1/checkout-sessions/{id}/receipt` (send as `X-Onflay-Return-Token`).
|
|
543
|
+
*/
|
|
544
|
+
returnToken?: string;
|
|
545
|
+
/**
|
|
546
|
+
* Presentation mode. Absent on free checkout.
|
|
547
|
+
*/
|
|
548
|
+
uiMode?: CheckoutUiMode;
|
|
549
|
+
/**
|
|
550
|
+
* Overlay iframe URL (`<checkout app>/embed/s/<id>?t=...`). Only when `uiMode` is `embedded`.
|
|
551
|
+
*/
|
|
552
|
+
embedUrl?: string;
|
|
553
|
+
/**
|
|
554
|
+
* Present (always true) when the price was 0 and the order was completed immediately.
|
|
555
|
+
*/
|
|
556
|
+
freeCheckoutCompleted?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* Echo of the request `externalCustomerId`, when sent.
|
|
559
|
+
*/
|
|
560
|
+
externalCustomerId?: string;
|
|
561
|
+
/**
|
|
562
|
+
* Echo of the request `catalog`, when sent.
|
|
563
|
+
*/
|
|
564
|
+
catalog?: CheckoutSessionCatalog;
|
|
565
|
+
};
|
|
566
|
+
type CheckoutSessionMode = 'payment' | 'subscription';
|
|
567
|
+
type CheckoutSessionPricing = {
|
|
568
|
+
/**
|
|
569
|
+
* Price after discount, before tax handling, in cents.
|
|
570
|
+
*/
|
|
571
|
+
priceAmountInCents: number | null;
|
|
572
|
+
taxBehavior: TaxPriceBehavior | null;
|
|
573
|
+
/**
|
|
574
|
+
* Total minus tax, in cents.
|
|
575
|
+
*/
|
|
576
|
+
subtotalAmountInCents: number;
|
|
577
|
+
/**
|
|
578
|
+
* Tax in cents.
|
|
579
|
+
*/
|
|
580
|
+
taxAmountInCents: number;
|
|
581
|
+
/**
|
|
582
|
+
* Total charged, in cents.
|
|
583
|
+
*/
|
|
584
|
+
totalAmountInCents: number;
|
|
585
|
+
currency: string;
|
|
586
|
+
};
|
|
587
|
+
type CheckoutSessionStatus = 'pending' | 'processing' | 'completed' | 'expired' | 'failed';
|
|
588
|
+
/**
|
|
589
|
+
* Presentation mode. Absent on free checkout.
|
|
590
|
+
*/
|
|
591
|
+
type CheckoutUiMode = 'hosted' | 'embedded';
|
|
592
|
+
type ConsumeCredits = {
|
|
593
|
+
/**
|
|
594
|
+
* Your app's id for the customer (the `externalCustomerId` sent to checkout).
|
|
595
|
+
*/
|
|
596
|
+
externalCustomerId: string;
|
|
597
|
+
/**
|
|
598
|
+
* Credit key, e.g. `api_credits`.
|
|
599
|
+
*/
|
|
600
|
+
key: string;
|
|
601
|
+
/**
|
|
602
|
+
* Your unique id for this operation (at most 255 characters). Sending it again returns the first result without moving credits twice.
|
|
603
|
+
*/
|
|
604
|
+
idempotencyKey: string;
|
|
605
|
+
/**
|
|
606
|
+
* Free-form data stored on the ledger entry (at most 4 KB as JSON).
|
|
607
|
+
*/
|
|
608
|
+
metadata?: {
|
|
609
|
+
[key: string]: unknown;
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* Credits to spend.
|
|
613
|
+
*/
|
|
614
|
+
amount: number;
|
|
615
|
+
};
|
|
616
|
+
type CreateBillingInvoice = {
|
|
617
|
+
/**
|
|
618
|
+
* Onflay customer id to charge. The customer must have a card saved with your account (`POST /v1/customers/{id}/setup-intent`); cards saved with other sellers are never charged.
|
|
619
|
+
*/
|
|
620
|
+
customerId: string;
|
|
621
|
+
/**
|
|
622
|
+
* ISO currency code (stored lowercase).
|
|
623
|
+
*/
|
|
624
|
+
currency: string;
|
|
625
|
+
/**
|
|
626
|
+
* Pre-computed line items; the invoice total is their sum.
|
|
627
|
+
*/
|
|
628
|
+
lineItems: Array<BillingLineItem>;
|
|
629
|
+
/**
|
|
630
|
+
* Related Onflay subscription id, for cross-referencing.
|
|
631
|
+
*/
|
|
632
|
+
subscriptionId?: string;
|
|
633
|
+
/**
|
|
634
|
+
* Inclusive start of the billing period (informational).
|
|
635
|
+
*/
|
|
636
|
+
periodStart?: Date;
|
|
637
|
+
/**
|
|
638
|
+
* Exclusive end of the billing period (informational).
|
|
639
|
+
*/
|
|
640
|
+
periodEnd?: Date;
|
|
641
|
+
};
|
|
642
|
+
type CreateBillingPlan = {
|
|
643
|
+
/**
|
|
644
|
+
* Onflay subscription id. One plan per subscription.
|
|
645
|
+
*/
|
|
646
|
+
subscriptionId: string;
|
|
647
|
+
/**
|
|
648
|
+
* Id of the meter to aggregate.
|
|
649
|
+
*/
|
|
650
|
+
meterId: string;
|
|
651
|
+
/**
|
|
652
|
+
* Id of the price used to bill aggregated usage (usage-based or tiered).
|
|
653
|
+
*/
|
|
654
|
+
priceId: string;
|
|
655
|
+
billingInterval?: UsageBillingInterval;
|
|
656
|
+
/**
|
|
657
|
+
* Day of month that anchors billing cycles. Defaults to the subscription's current period end day, capped at 28.
|
|
658
|
+
*/
|
|
659
|
+
billingAnchorDay?: number;
|
|
660
|
+
};
|
|
661
|
+
type CreateCheckout = {
|
|
662
|
+
/**
|
|
663
|
+
* Selected buyer market country code (ISO 3166-1 alpha-2)
|
|
664
|
+
*/
|
|
665
|
+
countryCode?: string;
|
|
666
|
+
/**
|
|
667
|
+
* ID of the listing to purchase (legacy mode). Required unless `catalog` is set; send exactly one of the two.
|
|
668
|
+
*/
|
|
669
|
+
listingId?: string;
|
|
670
|
+
/**
|
|
671
|
+
* ID of the variant to purchase. Falls back to the default variant when omitted.
|
|
672
|
+
*/
|
|
673
|
+
variantId?: string;
|
|
674
|
+
/**
|
|
675
|
+
* Stable-key catalog selection. When set, Onflay resolves listing/plan/price server-side.
|
|
676
|
+
*/
|
|
677
|
+
catalog?: CatalogSelection;
|
|
678
|
+
/**
|
|
679
|
+
* Developer's app-side customer id. Required for catalog mode. Stored as CreatorCustomer.externalReference.
|
|
680
|
+
*/
|
|
681
|
+
externalCustomerId?: string;
|
|
682
|
+
/**
|
|
683
|
+
* Buyer email address. Required unless `appointmentSeriesToken` is set (the series supplies the buyer).
|
|
684
|
+
*/
|
|
685
|
+
email?: string;
|
|
686
|
+
/**
|
|
687
|
+
* Buyer full name (stored on customer when provided)
|
|
688
|
+
*/
|
|
689
|
+
fullName?: string;
|
|
690
|
+
/**
|
|
691
|
+
* Buyer phone in E.164 format (e.g. +18095551234)
|
|
692
|
+
*/
|
|
693
|
+
phone?: string;
|
|
694
|
+
/**
|
|
695
|
+
* Save the buyer’s card with your account for later charges with `POST /v1/payments`. One-time payments only, and requires `externalCustomerId` (the id you charge later). The checkout page tells the buyer the card will be saved for future payments to you. Cards are never shared with other sellers.
|
|
696
|
+
*/
|
|
697
|
+
savePaymentMethod?: boolean;
|
|
698
|
+
/**
|
|
699
|
+
* URL to redirect on success
|
|
700
|
+
*/
|
|
701
|
+
successUrl?: string;
|
|
702
|
+
/**
|
|
703
|
+
* URL to redirect on cancel
|
|
704
|
+
*/
|
|
705
|
+
cancelUrl?: string;
|
|
706
|
+
/**
|
|
707
|
+
* Checkout presentation mode. `hosted` (default) returns a full-page checkoutUrl. `embedded` returns an embedUrl for the Onflay overlay iframe; requires successUrl and/or cancelUrl with a valid https origin (http://localhost allowed in development).
|
|
708
|
+
*/
|
|
709
|
+
uiMode?: 'hosted' | 'embedded';
|
|
710
|
+
/**
|
|
711
|
+
* Selected slot for APPOINTMENT listings. Omit (with or without appointmentSlots) to create an open hosted/embedded checkout where the buyer picks time(s) on the payment page, including session packs.
|
|
712
|
+
*/
|
|
713
|
+
appointmentSlot?: AppointmentSlotCheckout;
|
|
714
|
+
/**
|
|
715
|
+
* When the variant sessionCount is greater than 1: exactly N slots for the session pack. Omit with appointmentSlot to let the buyer pick all pack times on hosted/overlay checkout.
|
|
716
|
+
*/
|
|
717
|
+
appointmentSlots?: Array<AppointmentSlotCheckout>;
|
|
718
|
+
/**
|
|
719
|
+
* Schedule token for booking the next session in an existing appointment series.
|
|
720
|
+
*/
|
|
721
|
+
appointmentSeriesToken?: string;
|
|
722
|
+
/**
|
|
723
|
+
* Billing interval for subscription checkout (storefront / legacy ID mode). Catalog mode uses catalog.interval instead. Defaults to month when a monthly Price exists.
|
|
724
|
+
*/
|
|
725
|
+
billingInterval?: 'month' | 'year';
|
|
726
|
+
/**
|
|
727
|
+
* Free trial days for this checkout, overriding the plan’s `trialDays` (0 sells it without a trial). Subscription products and API-key calls only. The card is saved at checkout and charged when the trial ends; a customer who already had a trial of this product gets none.
|
|
728
|
+
*/
|
|
729
|
+
trialDays?: number;
|
|
730
|
+
/**
|
|
731
|
+
* Buyer storefront locale for receipt email (`en` or `es`)
|
|
732
|
+
*/
|
|
733
|
+
locale?: 'en' | 'es';
|
|
734
|
+
/**
|
|
735
|
+
* Checkout session id from an abandoned-checkout reminder email CTA (`?abandonedSession=`). Links recovery attribution to that reminded session when the buyer rebooks via the listing (appointments/events).
|
|
736
|
+
*/
|
|
737
|
+
abandonedCheckoutSessionId?: string;
|
|
738
|
+
/**
|
|
739
|
+
* Optional discount code (overrides auto time-limited offers when valid)
|
|
740
|
+
*/
|
|
741
|
+
discountCode?: string;
|
|
742
|
+
/**
|
|
743
|
+
* Override the price for this specific session without creating a persistent Price record. Only accepted when the request is authenticated with an API key (sk_live_* / sk_test_*). The buyer-facing checkout endpoint rejects this field with 403.
|
|
744
|
+
*/
|
|
745
|
+
customPrice?: CustomPrice;
|
|
746
|
+
/**
|
|
747
|
+
* Anonymous PostHog distinct_id from the buyer browser. Stored in checkout session metadata so server-side events can be attributed to the same anonymous buyer person. Never stored as a user identifier or used for any purpose other than analytics stitching.
|
|
748
|
+
*/
|
|
749
|
+
analyticsDistinctId?: string;
|
|
750
|
+
/**
|
|
751
|
+
* Anonymous PostHog session identifier from the buyer browser. Retained only as analytics context.
|
|
752
|
+
*/
|
|
753
|
+
analyticsSessionId?: string;
|
|
754
|
+
/**
|
|
755
|
+
* Safe behavioral attribution snapshot. Country is resolved from trusted edge headers, not client input.
|
|
756
|
+
*/
|
|
757
|
+
attribution?: CheckoutAttribution;
|
|
758
|
+
/**
|
|
759
|
+
* Number of seats to buy for an EVENT listing (1..10). Each seat issues one ticket. Defaults to 1. The fixed platform limit of 10 seats per order is not configurable.
|
|
760
|
+
*/
|
|
761
|
+
quantity?: number;
|
|
762
|
+
/**
|
|
763
|
+
* Chosen event session id. Required for PICK_A_DATE events; ignored for SINGLE_SESSION / FULL_PASS (every ticket covers all sessions).
|
|
764
|
+
*/
|
|
765
|
+
eventSessionId?: string;
|
|
766
|
+
/**
|
|
767
|
+
* Optional per-seat attendee details for an EVENT order. Seats without an entry fall back to the purchaser. At most 10 (one per seat).
|
|
768
|
+
*/
|
|
769
|
+
attendees?: Array<EventSeatAttendee>;
|
|
770
|
+
};
|
|
771
|
+
type CreateCustomer = {
|
|
772
|
+
/**
|
|
773
|
+
* Customer email. If a customer with this email exists it is linked and returned.
|
|
774
|
+
*/
|
|
775
|
+
email: string;
|
|
776
|
+
/**
|
|
777
|
+
* Customer name.
|
|
778
|
+
*/
|
|
779
|
+
name?: string;
|
|
780
|
+
/**
|
|
781
|
+
* Deprecated alias of `name`; ignored when `name` is sent.
|
|
782
|
+
*
|
|
783
|
+
* @deprecated
|
|
784
|
+
*/
|
|
785
|
+
displayName?: string;
|
|
786
|
+
/**
|
|
787
|
+
* Customer phone, ideally E.164 (for example `+18095551234`).
|
|
788
|
+
*/
|
|
789
|
+
phone?: string;
|
|
790
|
+
};
|
|
791
|
+
type CreateCustomerPortalSession = {
|
|
792
|
+
/**
|
|
793
|
+
* Your app's user id for the customer (the `externalCustomerId` you passed to checkout).
|
|
794
|
+
*/
|
|
795
|
+
externalCustomerId: string;
|
|
796
|
+
/**
|
|
797
|
+
* Where the portal's "Back" link sends the customer, usually your account or billing page. `http(s)` only.
|
|
798
|
+
*/
|
|
799
|
+
returnUrl?: string;
|
|
800
|
+
};
|
|
801
|
+
type CreateDiscount = {
|
|
802
|
+
/**
|
|
803
|
+
* `discount_code`: buyers type `code` at checkout (or you pass it as `discountCode`). `time_limited_offer`: applies on its own between `startsAt` and `expiresAt`.
|
|
804
|
+
*/
|
|
805
|
+
type: DiscountType;
|
|
806
|
+
/**
|
|
807
|
+
* Required for `discount_code`, not allowed for `time_limited_offer`. Stored uppercase; buyers can type it in any case. Unique per account.
|
|
808
|
+
*/
|
|
809
|
+
code?: string;
|
|
810
|
+
/**
|
|
811
|
+
* Name shown to buyers, for example "Launch week".
|
|
812
|
+
*/
|
|
813
|
+
label?: string;
|
|
814
|
+
valueType: DiscountValueType;
|
|
815
|
+
/**
|
|
816
|
+
* Percent off (1 to 100) for `percentage`; amount off in cents for `fixed_amount`.
|
|
817
|
+
*/
|
|
818
|
+
value: number;
|
|
819
|
+
/**
|
|
820
|
+
* Lowercase ISO currency. A `fixed_amount` discount applies only to prices in this currency.
|
|
821
|
+
*/
|
|
822
|
+
currency?: string;
|
|
823
|
+
/**
|
|
824
|
+
* Product keys the discount applies to. Omit or send `[]` for every product.
|
|
825
|
+
*/
|
|
826
|
+
productKeys?: Array<string>;
|
|
827
|
+
/**
|
|
828
|
+
* Plan keys of the one product in `productKeys`. Needs exactly one product key. Omit or send `[]` for every plan of the product.
|
|
829
|
+
*/
|
|
830
|
+
planKeys?: Array<string>;
|
|
831
|
+
/**
|
|
832
|
+
* When the discount starts. Defaults to now.
|
|
833
|
+
*/
|
|
834
|
+
startsAt?: Date;
|
|
835
|
+
/**
|
|
836
|
+
* When the discount ends; must be after `startsAt`. Omit or send null for no end.
|
|
837
|
+
*/
|
|
838
|
+
expiresAt?: Date | null;
|
|
839
|
+
/**
|
|
840
|
+
* Total uses allowed; null is unlimited.
|
|
841
|
+
*/
|
|
842
|
+
maxRedemptions?: number | null;
|
|
843
|
+
/**
|
|
844
|
+
* Uses allowed per customer; null is unlimited.
|
|
845
|
+
*/
|
|
846
|
+
maxRedemptionsPerCustomer?: number | null;
|
|
847
|
+
/**
|
|
848
|
+
* When true, only customers with no earlier paid purchase from you can use it.
|
|
849
|
+
*/
|
|
850
|
+
firstTimePurchaseOnly?: boolean;
|
|
851
|
+
/**
|
|
852
|
+
* Minimum subtotal in cents before the discount applies; null for none.
|
|
853
|
+
*/
|
|
854
|
+
minPriceInCents?: number | null;
|
|
855
|
+
/**
|
|
856
|
+
* Subscriptions only: `once` discounts the first invoice, `repeating` the first `durationInCycles` invoices, `forever` every invoice. One-time payments ignore it.
|
|
857
|
+
*/
|
|
858
|
+
duration?: DiscountDuration;
|
|
859
|
+
/**
|
|
860
|
+
* Required when `duration` is `repeating`: how many billing cycles (2 or more).
|
|
861
|
+
*/
|
|
862
|
+
durationInCycles?: number | null;
|
|
863
|
+
/**
|
|
864
|
+
* Whether buyers can use it now. Deactivate instead of deleting.
|
|
865
|
+
*/
|
|
866
|
+
active?: boolean;
|
|
867
|
+
};
|
|
868
|
+
type CreateMeter = {
|
|
869
|
+
/**
|
|
870
|
+
* Display name.
|
|
871
|
+
*/
|
|
872
|
+
name: string;
|
|
873
|
+
/**
|
|
874
|
+
* Token passed as `meter` when reporting usage. Unique per account.
|
|
875
|
+
*/
|
|
876
|
+
eventName: string;
|
|
877
|
+
/**
|
|
878
|
+
* How reported quantities are aggregated per billing period.
|
|
879
|
+
*/
|
|
880
|
+
aggregation?: MeterAggregation;
|
|
881
|
+
};
|
|
882
|
+
type CreatePayment = {
|
|
883
|
+
/**
|
|
884
|
+
* Your id for the customer (the `externalCustomerId` you used at checkout).
|
|
885
|
+
*/
|
|
886
|
+
externalCustomerId: string;
|
|
887
|
+
/**
|
|
888
|
+
* Amount to charge in cents, tax included. Send with `currency`, or send `catalog` instead (not both).
|
|
889
|
+
*/
|
|
890
|
+
amountInCents?: number;
|
|
891
|
+
/**
|
|
892
|
+
* Lowercase ISO currency code; required with `amountInCents`.
|
|
893
|
+
*/
|
|
894
|
+
currency?: string;
|
|
895
|
+
/**
|
|
896
|
+
* Charge a one-time plan of your catalog at its price instead of a custom amount. What the plan grants (credits, license keys, access) is granted when the payment succeeds.
|
|
897
|
+
*/
|
|
898
|
+
catalog?: PaymentCatalogSelection;
|
|
899
|
+
/**
|
|
900
|
+
* What the charge is for. Shown to the customer on the confirmation page and email.
|
|
901
|
+
*/
|
|
902
|
+
description?: string;
|
|
903
|
+
/**
|
|
904
|
+
* Your own key/value data, returned on the payment and its webhooks. Up to 20 string values.
|
|
905
|
+
*/
|
|
906
|
+
metadata?: {
|
|
907
|
+
[key: string]: string;
|
|
908
|
+
};
|
|
909
|
+
/**
|
|
910
|
+
* Card to charge: an `id` (or `externalPaymentMethodId`) from `GET /v1/customers/{id}/payment-methods`. Defaults to the customer’s default card with your account.
|
|
911
|
+
*/
|
|
912
|
+
paymentMethodId?: string;
|
|
913
|
+
};
|
|
914
|
+
type CreatePrice = {
|
|
915
|
+
/**
|
|
916
|
+
* Owning product (listing) id
|
|
917
|
+
*/
|
|
918
|
+
productId: string;
|
|
919
|
+
/**
|
|
920
|
+
* Currency code. Only `usd` is accepted (case-insensitive).
|
|
921
|
+
*/
|
|
922
|
+
currency: string;
|
|
923
|
+
/**
|
|
924
|
+
* Unit amount in cents. Must fall within the platform pricing policy range.
|
|
925
|
+
*/
|
|
926
|
+
unitAmountInCents: number;
|
|
927
|
+
/**
|
|
928
|
+
* Only `flat` is supported today; other values return 400.
|
|
929
|
+
*/
|
|
930
|
+
billingScheme?: PriceBillingScheme;
|
|
931
|
+
/**
|
|
932
|
+
* Set for recurring (subscription) prices; omit for one-time prices.
|
|
933
|
+
*/
|
|
934
|
+
recurring?: PriceRecurringInput;
|
|
935
|
+
/**
|
|
936
|
+
* When false the price is created inactive and the product is paused.
|
|
937
|
+
*/
|
|
938
|
+
active?: boolean;
|
|
939
|
+
/**
|
|
940
|
+
* Arbitrary key/value metadata
|
|
941
|
+
*/
|
|
942
|
+
metadata?: {
|
|
943
|
+
[key: string]: unknown;
|
|
944
|
+
};
|
|
945
|
+
/**
|
|
946
|
+
* Plan key, e.g. `pro`. Attaches the price to that plan, creating the plan when the product has none with this key. Lowercase letters, digits, `-` and `_`, starting with a letter or digit, at most 64 characters.
|
|
947
|
+
*/
|
|
948
|
+
planKey?: string;
|
|
949
|
+
/**
|
|
950
|
+
* Optional friendly label for the price row.
|
|
951
|
+
*/
|
|
952
|
+
nickname?: string;
|
|
953
|
+
};
|
|
954
|
+
type CreateProduct = {
|
|
955
|
+
/**
|
|
956
|
+
* Product display name
|
|
957
|
+
*/
|
|
958
|
+
name: string;
|
|
959
|
+
/**
|
|
960
|
+
* Long-form description
|
|
961
|
+
*/
|
|
962
|
+
description?: string;
|
|
963
|
+
/**
|
|
964
|
+
* When false the product is created unpublished (draft). Defaults to true.
|
|
965
|
+
*/
|
|
966
|
+
active?: boolean;
|
|
967
|
+
/**
|
|
968
|
+
* Arbitrary string-keyed metadata
|
|
969
|
+
*/
|
|
970
|
+
metadata?: {
|
|
971
|
+
[key: string]: unknown;
|
|
972
|
+
};
|
|
973
|
+
};
|
|
974
|
+
type CreateRefund = {
|
|
975
|
+
/**
|
|
976
|
+
* Amount to refund, in cents, tax included. Omit to refund everything that is left (the payment amount less completed and pending refunds and lost disputes).
|
|
977
|
+
*/
|
|
978
|
+
amountInCents?: number;
|
|
979
|
+
reason?: RefundReason;
|
|
980
|
+
};
|
|
981
|
+
type CreateSetupIntentParams = {
|
|
982
|
+
/**
|
|
983
|
+
* Where the hosted page sends the customer after the card is saved.
|
|
984
|
+
*/
|
|
985
|
+
returnUrl?: string;
|
|
986
|
+
};
|
|
987
|
+
type CreateWebhookEndpoint = {
|
|
988
|
+
/**
|
|
989
|
+
* Absolute URL (with `https://` or `http://`) the dispatcher posts events to.
|
|
990
|
+
*/
|
|
991
|
+
url: string;
|
|
992
|
+
/**
|
|
993
|
+
* Event patterns to subscribe to: `*` (every event), `payment.*` (a family) or an exact type such as `payment.completed`.
|
|
994
|
+
*/
|
|
995
|
+
events: Array<string>;
|
|
996
|
+
/**
|
|
997
|
+
* Free-form note shown in the dashboard.
|
|
998
|
+
*/
|
|
999
|
+
description?: string;
|
|
1000
|
+
};
|
|
1001
|
+
type CreditBalance = {
|
|
1002
|
+
/**
|
|
1003
|
+
* Credit key, e.g. `api_credits`.
|
|
1004
|
+
*/
|
|
1005
|
+
key: string;
|
|
1006
|
+
/**
|
|
1007
|
+
* Credits the customer can spend now; never negative and never includes expired credits.
|
|
1008
|
+
*/
|
|
1009
|
+
balance: number;
|
|
1010
|
+
/**
|
|
1011
|
+
* Next time some of the balance expires (plans with `credits[].expiresInDays`); null when none of it expires.
|
|
1012
|
+
*/
|
|
1013
|
+
expiresSoonest: Date | null;
|
|
1014
|
+
/**
|
|
1015
|
+
* Credits that expire at `expiresSoonest`; null when none of the balance expires.
|
|
1016
|
+
*/
|
|
1017
|
+
expiringAmount: number | null;
|
|
1018
|
+
updatedAt: Date;
|
|
1019
|
+
};
|
|
1020
|
+
type CreditBalances = {
|
|
1021
|
+
object: 'credit_balances';
|
|
1022
|
+
externalCustomerId: string;
|
|
1023
|
+
/**
|
|
1024
|
+
* One entry per credit key the customer ever had.
|
|
1025
|
+
*/
|
|
1026
|
+
balances: Array<CreditBalance>;
|
|
1027
|
+
};
|
|
1028
|
+
type CreditLedgerEntry = {
|
|
1029
|
+
id: string;
|
|
1030
|
+
object: 'credit_ledger_entry';
|
|
1031
|
+
/**
|
|
1032
|
+
* Credit key.
|
|
1033
|
+
*/
|
|
1034
|
+
key: string;
|
|
1035
|
+
/**
|
|
1036
|
+
* Signed change: positive for grants, negative for consumes and reversals (0 when a refund found nothing left to reverse).
|
|
1037
|
+
*/
|
|
1038
|
+
delta: number;
|
|
1039
|
+
/**
|
|
1040
|
+
* Balance right after this entry.
|
|
1041
|
+
*/
|
|
1042
|
+
balanceAfter: number;
|
|
1043
|
+
/**
|
|
1044
|
+
* `purchase` (a payment of a plan with credits), `consume`, `adjustment` (yours, or credits given back when a lost dispute is won), `refund` (reversal after a full refund or a lost dispute) or `expiry` (the unspent remainder of credits whose `expiresInDays` passed).
|
|
1045
|
+
*/
|
|
1046
|
+
reason: CreditLedgerReason;
|
|
1047
|
+
/**
|
|
1048
|
+
* Payment that granted (or whose refund reversed) the credits.
|
|
1049
|
+
*/
|
|
1050
|
+
paymentId: string | null;
|
|
1051
|
+
subscriptionId: string | null;
|
|
1052
|
+
/**
|
|
1053
|
+
* Your idempotencyKey for consumes and adjustments; null for entries Onflay wrote.
|
|
1054
|
+
*/
|
|
1055
|
+
idempotencyKey: string | null;
|
|
1056
|
+
/**
|
|
1057
|
+
* Your metadata. Onflay entries: purchases `{ expiresAt }` when they expire; refunds `{ grantEntryId, grantedAmount, reversedAmount, unrecoveredAmount, expiredAmount?, takenFrom, refundId? | disputeId? }`; expiry `{ lotId, grantEntryId, expiredAmount, expiresAt }`; credits given back when a lost dispute is won: an `adjustment` with `{ cause: "dispute_won", disputeId, grantEntryId, restoredAmount, expiresAt?, skipped? }`.
|
|
1058
|
+
*/
|
|
1059
|
+
metadata: {
|
|
1060
|
+
[key: string]: unknown;
|
|
1061
|
+
} | null;
|
|
1062
|
+
createdAt: Date;
|
|
1063
|
+
};
|
|
1064
|
+
type CreditLedgerEntryList = {
|
|
1065
|
+
object: 'list';
|
|
1066
|
+
data: Array<CreditLedgerEntry>;
|
|
1067
|
+
/**
|
|
1068
|
+
* True when another page exists.
|
|
1069
|
+
*/
|
|
1070
|
+
hasMore: boolean;
|
|
1071
|
+
/**
|
|
1072
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
1073
|
+
*/
|
|
1074
|
+
nextCursor: string | null;
|
|
1075
|
+
};
|
|
1076
|
+
/**
|
|
1077
|
+
* `purchase` (a payment of a plan with credits), `consume`, `adjustment` (yours, or credits given back when a lost dispute is won), `refund` (reversal after a full refund or a lost dispute) or `expiry` (the unspent remainder of credits whose `expiresInDays` passed).
|
|
1078
|
+
*/
|
|
1079
|
+
type CreditLedgerReason = 'purchase' | 'consume' | 'adjustment' | 'refund' | 'expiry';
|
|
1080
|
+
type CreditOperation = {
|
|
1081
|
+
object: 'credit_operation';
|
|
1082
|
+
externalCustomerId: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* Credit key.
|
|
1085
|
+
*/
|
|
1086
|
+
key: string;
|
|
1087
|
+
/**
|
|
1088
|
+
* Balance right after the operation. On a replay, the balance right after the first call.
|
|
1089
|
+
*/
|
|
1090
|
+
balance: number;
|
|
1091
|
+
/**
|
|
1092
|
+
* True when the idempotencyKey was already used: nothing moved this time.
|
|
1093
|
+
*/
|
|
1094
|
+
replayed: boolean;
|
|
1095
|
+
entry: CreditLedgerEntry;
|
|
1096
|
+
};
|
|
1097
|
+
type CustomPrice = {
|
|
1098
|
+
/**
|
|
1099
|
+
* Override amount in cents. Must be >= 50 (Stripe minimum). Only USD is supported.
|
|
1100
|
+
*/
|
|
1101
|
+
unitAmountInCents: number;
|
|
1102
|
+
/**
|
|
1103
|
+
* Currency code. Only 'usd' is accepted in the current release.
|
|
1104
|
+
*/
|
|
1105
|
+
currency?: 'usd';
|
|
1106
|
+
/**
|
|
1107
|
+
* Human-readable note surfaced in audit logs and the payment.completed webhook payload.
|
|
1108
|
+
*/
|
|
1109
|
+
description?: string;
|
|
1110
|
+
};
|
|
1111
|
+
type Customer = {
|
|
1112
|
+
/**
|
|
1113
|
+
* Customer id.
|
|
1114
|
+
*/
|
|
1115
|
+
id: string;
|
|
1116
|
+
object: 'customer';
|
|
1117
|
+
/**
|
|
1118
|
+
* Customer email. Unique across Onflay.
|
|
1119
|
+
*/
|
|
1120
|
+
email: string;
|
|
1121
|
+
/**
|
|
1122
|
+
* Customer name.
|
|
1123
|
+
*/
|
|
1124
|
+
name: string | null;
|
|
1125
|
+
/**
|
|
1126
|
+
* Customer phone, normally E.164.
|
|
1127
|
+
*/
|
|
1128
|
+
phone: string | null;
|
|
1129
|
+
/**
|
|
1130
|
+
* Your app's id for the customer (the `externalCustomerId` sent at checkout); null until one is set. Not a payment-processor id.
|
|
1131
|
+
*/
|
|
1132
|
+
externalCustomerId: string | null;
|
|
1133
|
+
createdAt: Date;
|
|
1134
|
+
};
|
|
1135
|
+
type CustomerAccess = {
|
|
1136
|
+
object: 'customer_access';
|
|
1137
|
+
/**
|
|
1138
|
+
* Your app's id for the customer, as sent to checkout.
|
|
1139
|
+
*/
|
|
1140
|
+
externalCustomerId: string;
|
|
1141
|
+
/**
|
|
1142
|
+
* Access version; increases every time the customer's access changes.
|
|
1143
|
+
*/
|
|
1144
|
+
version: number;
|
|
1145
|
+
activePlans: Array<CustomerAccessActivePlan>;
|
|
1146
|
+
/**
|
|
1147
|
+
* Entitlements from active plans and owned products, deduplicated by key. Subscription entitlements come first and win a clash.
|
|
1148
|
+
*/
|
|
1149
|
+
entitlements: Array<CustomerAccessEntitlement>;
|
|
1150
|
+
/**
|
|
1151
|
+
* One-time purchases of digital and service products, newest first (at most 100). Fully refunded purchases are left out.
|
|
1152
|
+
*/
|
|
1153
|
+
ownedProducts: Array<CustomerAccessOwnedProduct>;
|
|
1154
|
+
/**
|
|
1155
|
+
* Valid event tickets, newest first (at most 100).
|
|
1156
|
+
*/
|
|
1157
|
+
tickets: Array<CustomerAccessTicket>;
|
|
1158
|
+
/**
|
|
1159
|
+
* Bookings that are not cancelled, latest start first (at most 100).
|
|
1160
|
+
*/
|
|
1161
|
+
bookings: Array<CustomerAccessBooking>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Credit balances, one per credit key. Consuming credits changes the balance (and the ETag) but not `version`.
|
|
1164
|
+
*/
|
|
1165
|
+
credits: Array<CustomerAccessCredit>;
|
|
1166
|
+
/**
|
|
1167
|
+
* License keys, newest first (at most 100), without the key itself. Fetch a key with `GET /v1/license-keys/{id}` (secret key).
|
|
1168
|
+
*/
|
|
1169
|
+
licenseKeys: Array<CustomerAccessLicenseKey>;
|
|
1170
|
+
/**
|
|
1171
|
+
* Reserved; currently always empty.
|
|
1172
|
+
*/
|
|
1173
|
+
meters: Array<{
|
|
1174
|
+
[key: string]: unknown;
|
|
1175
|
+
}>;
|
|
1176
|
+
updatedAt: Date;
|
|
1177
|
+
/**
|
|
1178
|
+
* Short-lived (5 minute) RS256 JWT carrying `sub`, `version`, `activePlans` and `entitlements`. Only present when `includeToken=true`; verify it with the keys from `GET /v1/.well-known/jwks.json`.
|
|
1179
|
+
*/
|
|
1180
|
+
accessToken?: string;
|
|
1181
|
+
};
|
|
1182
|
+
type CustomerAccessActivePlan = {
|
|
1183
|
+
/**
|
|
1184
|
+
* Onflay subscription id; use it with `POST /v1/subscriptions/{id}/cancel`.
|
|
1185
|
+
*/
|
|
1186
|
+
subscriptionId: string;
|
|
1187
|
+
/**
|
|
1188
|
+
* Catalog key of the listing (falls back to the listing id when it has none).
|
|
1189
|
+
*/
|
|
1190
|
+
catalogKey: string;
|
|
1191
|
+
/**
|
|
1192
|
+
* Plan (variant) key; `default` when the subscription has no variant.
|
|
1193
|
+
*/
|
|
1194
|
+
planKey: string;
|
|
1195
|
+
/**
|
|
1196
|
+
* Subscription status. `ACTIVE`/`TRIALING` always grant access; `PAST_DUE`/`CANCELED` only until `currentPeriodEnd`.
|
|
1197
|
+
*/
|
|
1198
|
+
status: CustomerAccessPlanStatus;
|
|
1199
|
+
/**
|
|
1200
|
+
* End of the current billing period.
|
|
1201
|
+
*/
|
|
1202
|
+
currentPeriodEnd: Date | null;
|
|
1203
|
+
/**
|
|
1204
|
+
* True when cancellation is scheduled; access continues until `currentPeriodEnd`.
|
|
1205
|
+
*/
|
|
1206
|
+
cancelAtPeriodEnd: boolean;
|
|
1207
|
+
/**
|
|
1208
|
+
* When access ends if `cancelAtPeriodEnd` is true (equals `currentPeriodEnd`); otherwise null.
|
|
1209
|
+
*/
|
|
1210
|
+
accessUntil: Date | null;
|
|
1211
|
+
/**
|
|
1212
|
+
* Billing interval from the subscription's price. Omitted when unknown.
|
|
1213
|
+
*/
|
|
1214
|
+
interval?: PriceRecurringInterval;
|
|
1215
|
+
/**
|
|
1216
|
+
* End of the free trial while `status` is `TRIALING` (the saved card is charged then); null otherwise.
|
|
1217
|
+
*/
|
|
1218
|
+
trialEndsAt: Date | null;
|
|
1219
|
+
};
|
|
1220
|
+
type CustomerAccessBooking = {
|
|
1221
|
+
/**
|
|
1222
|
+
* Booking (appointment) id.
|
|
1223
|
+
*/
|
|
1224
|
+
id: string;
|
|
1225
|
+
/**
|
|
1226
|
+
* Cancelled bookings are not listed.
|
|
1227
|
+
*/
|
|
1228
|
+
status: CustomerAccessBookingStatus;
|
|
1229
|
+
/**
|
|
1230
|
+
* The appointment product.
|
|
1231
|
+
*/
|
|
1232
|
+
product: CustomerAccessProductRef;
|
|
1233
|
+
/**
|
|
1234
|
+
* The session type.
|
|
1235
|
+
*/
|
|
1236
|
+
plan: CustomerAccessPlanRef | null;
|
|
1237
|
+
startsAt: Date;
|
|
1238
|
+
endsAt: Date;
|
|
1239
|
+
};
|
|
1240
|
+
/**
|
|
1241
|
+
* Cancelled bookings are not listed.
|
|
1242
|
+
*/
|
|
1243
|
+
type CustomerAccessBookingStatus = 'pending' | 'confirmed' | 'completed' | 'no_show' | 'rescheduled';
|
|
1244
|
+
type CustomerAccessCredit = {
|
|
1245
|
+
/**
|
|
1246
|
+
* Credit key, e.g. `api_credits`.
|
|
1247
|
+
*/
|
|
1248
|
+
key: string;
|
|
1249
|
+
/**
|
|
1250
|
+
* Credits the customer can spend now; never negative and never includes expired credits.
|
|
1251
|
+
*/
|
|
1252
|
+
balance: number;
|
|
1253
|
+
/**
|
|
1254
|
+
* Next time some of the balance expires (plans with `credits[].expiresInDays`); null when none of it expires.
|
|
1255
|
+
*/
|
|
1256
|
+
expiresSoonest: Date | null;
|
|
1257
|
+
/**
|
|
1258
|
+
* Credits that expire at `expiresSoonest`; null when none of the balance expires.
|
|
1259
|
+
*/
|
|
1260
|
+
expiringAmount: number | null;
|
|
1261
|
+
};
|
|
1262
|
+
type CustomerAccessEntitlement = {
|
|
1263
|
+
/**
|
|
1264
|
+
* Entitlement key, for example `seats` or `api_access`.
|
|
1265
|
+
*/
|
|
1266
|
+
key: string;
|
|
1267
|
+
/**
|
|
1268
|
+
* Entitlement value: string, number or boolean.
|
|
1269
|
+
*/
|
|
1270
|
+
value: string | number | boolean;
|
|
1271
|
+
/**
|
|
1272
|
+
* Key of the plan that granted this entitlement.
|
|
1273
|
+
*/
|
|
1274
|
+
sourcePlanKey: string | null;
|
|
1275
|
+
/**
|
|
1276
|
+
* What granted it: an active subscription (`activePlans`) or a one-time purchase (`ownedProducts`).
|
|
1277
|
+
*/
|
|
1278
|
+
source: CustomerAccessEntitlementSource;
|
|
1279
|
+
/**
|
|
1280
|
+
* Key of the product that granted it; null for products without a key.
|
|
1281
|
+
*/
|
|
1282
|
+
sourceProductKey: string | null;
|
|
1283
|
+
/**
|
|
1284
|
+
* True when the plan no longer lists this entitlement but the customer keeps it because they bought before it was removed (removals are grandfathered; additions and value edits apply at once). Ends when the customer switches plan, the subscription ends or the purchase is refunded.
|
|
1285
|
+
*/
|
|
1286
|
+
grandfathered: boolean;
|
|
1287
|
+
};
|
|
1288
|
+
/**
|
|
1289
|
+
* What granted it: an active subscription (`activePlans`) or a one-time purchase (`ownedProducts`).
|
|
1290
|
+
*/
|
|
1291
|
+
type CustomerAccessEntitlementSource = 'subscription' | 'purchase';
|
|
1292
|
+
type CustomerAccessKeyRef = {
|
|
1293
|
+
key: string | null;
|
|
1294
|
+
};
|
|
1295
|
+
type CustomerAccessLicenseKey = {
|
|
1296
|
+
/**
|
|
1297
|
+
* License key id (`GET /v1/license-keys/{id}`).
|
|
1298
|
+
*/
|
|
1299
|
+
id: string;
|
|
1300
|
+
/**
|
|
1301
|
+
* `expired` also covers an active key whose `expiresAt` has passed.
|
|
1302
|
+
*/
|
|
1303
|
+
status: LicenseKeyState;
|
|
1304
|
+
product: CustomerAccessKeyRef;
|
|
1305
|
+
plan: CustomerAccessKeyRef | null;
|
|
1306
|
+
expiresAt: Date | null;
|
|
1307
|
+
};
|
|
1308
|
+
type CustomerAccessOwnedProduct = {
|
|
1309
|
+
product: CustomerAccessProductRef;
|
|
1310
|
+
plan: CustomerAccessPlanRef | null;
|
|
1311
|
+
/**
|
|
1312
|
+
* When the purchase was made.
|
|
1313
|
+
*/
|
|
1314
|
+
purchasedAt: Date;
|
|
1315
|
+
/**
|
|
1316
|
+
* Onflay payment id; use it with `GET /v1/payments/{id}`.
|
|
1317
|
+
*/
|
|
1318
|
+
paymentId: string;
|
|
1319
|
+
};
|
|
1320
|
+
type CustomerAccessPlanRef = {
|
|
1321
|
+
/**
|
|
1322
|
+
* Plan key; null for plans without a key.
|
|
1323
|
+
*/
|
|
1324
|
+
key: string | null;
|
|
1325
|
+
/**
|
|
1326
|
+
* Plan name.
|
|
1327
|
+
*/
|
|
1328
|
+
name: string;
|
|
1329
|
+
};
|
|
1330
|
+
/**
|
|
1331
|
+
* Subscription status. `ACTIVE`/`TRIALING` always grant access; `PAST_DUE`/`CANCELED` only until `currentPeriodEnd`.
|
|
1332
|
+
*/
|
|
1333
|
+
type CustomerAccessPlanStatus = 'ACTIVE' | 'TRIALING' | 'PAST_DUE' | 'CANCELED';
|
|
1334
|
+
type CustomerAccessProductRef = {
|
|
1335
|
+
/**
|
|
1336
|
+
* Product key; null for products without a key.
|
|
1337
|
+
*/
|
|
1338
|
+
key: string | null;
|
|
1339
|
+
/**
|
|
1340
|
+
* Product name.
|
|
1341
|
+
*/
|
|
1342
|
+
name: string;
|
|
1343
|
+
};
|
|
1344
|
+
type CustomerAccessTicket = {
|
|
1345
|
+
/**
|
|
1346
|
+
* Ticket id.
|
|
1347
|
+
*/
|
|
1348
|
+
id: string;
|
|
1349
|
+
/**
|
|
1350
|
+
* Only valid tickets are listed: voided and refunded tickets drop out.
|
|
1351
|
+
*/
|
|
1352
|
+
status: CustomerAccessTicketStatus;
|
|
1353
|
+
/**
|
|
1354
|
+
* The event.
|
|
1355
|
+
*/
|
|
1356
|
+
product: CustomerAccessProductRef;
|
|
1357
|
+
/**
|
|
1358
|
+
* The ticket type.
|
|
1359
|
+
*/
|
|
1360
|
+
plan: CustomerAccessPlanRef | null;
|
|
1361
|
+
/**
|
|
1362
|
+
* Start of the ticket's date (pick-a-date events) or of the event's first date.
|
|
1363
|
+
*/
|
|
1364
|
+
startsAt: Date | null;
|
|
1365
|
+
/**
|
|
1366
|
+
* End of the ticket's date or of the event's last date.
|
|
1367
|
+
*/
|
|
1368
|
+
endsAt: Date | null;
|
|
1369
|
+
/**
|
|
1370
|
+
* True once the ticket was checked in at the door.
|
|
1371
|
+
*/
|
|
1372
|
+
checkedIn: boolean;
|
|
1373
|
+
checkedInAt: Date | null;
|
|
1374
|
+
};
|
|
1375
|
+
/**
|
|
1376
|
+
* Only valid tickets are listed: voided and refunded tickets drop out.
|
|
1377
|
+
*/
|
|
1378
|
+
type CustomerAccessTicketStatus = 'valid';
|
|
1379
|
+
type CustomerList = {
|
|
1380
|
+
object: 'list';
|
|
1381
|
+
data: Array<Customer>;
|
|
1382
|
+
/**
|
|
1383
|
+
* True when another page exists.
|
|
1384
|
+
*/
|
|
1385
|
+
hasMore: boolean;
|
|
1386
|
+
/**
|
|
1387
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
1388
|
+
*/
|
|
1389
|
+
nextCursor: string | null;
|
|
1390
|
+
};
|
|
1391
|
+
type CustomerPortalSession = {
|
|
1392
|
+
object: 'customer_portal_session';
|
|
1393
|
+
/**
|
|
1394
|
+
* Onflay-hosted portal for this customer. Redirect to it right away; it works for 1 hour and only for this customer.
|
|
1395
|
+
*/
|
|
1396
|
+
url: string;
|
|
1397
|
+
/**
|
|
1398
|
+
* When the link stops working (ISO 8601).
|
|
1399
|
+
*/
|
|
1400
|
+
expiresAt: string;
|
|
1401
|
+
};
|
|
1402
|
+
type CustomerRef = {
|
|
1403
|
+
/**
|
|
1404
|
+
* Onflay customer id.
|
|
1405
|
+
*/
|
|
1406
|
+
id: string;
|
|
1407
|
+
/**
|
|
1408
|
+
* Your app's id for the customer (the `externalCustomerId` sent at checkout). Not a payment-processor id.
|
|
1409
|
+
*/
|
|
1410
|
+
externalCustomerId: string | null;
|
|
1411
|
+
/**
|
|
1412
|
+
* Customer email.
|
|
1413
|
+
*/
|
|
1414
|
+
email: string;
|
|
1415
|
+
};
|
|
1416
|
+
type DeactivateLicenseKey = {
|
|
1417
|
+
/**
|
|
1418
|
+
* The license key.
|
|
1419
|
+
*/
|
|
1420
|
+
key: string;
|
|
1421
|
+
/**
|
|
1422
|
+
* The install to deactivate.
|
|
1423
|
+
*/
|
|
1424
|
+
instanceId: string;
|
|
1425
|
+
};
|
|
1426
|
+
type Discount = {
|
|
1427
|
+
/**
|
|
1428
|
+
* Discount id.
|
|
1429
|
+
*/
|
|
1430
|
+
id: string;
|
|
1431
|
+
object: 'discount';
|
|
1432
|
+
type: DiscountType;
|
|
1433
|
+
/**
|
|
1434
|
+
* Uppercase code buyers type; null for a `time_limited_offer`.
|
|
1435
|
+
*/
|
|
1436
|
+
code: string | null;
|
|
1437
|
+
/**
|
|
1438
|
+
* Name shown to buyers.
|
|
1439
|
+
*/
|
|
1440
|
+
label: string | null;
|
|
1441
|
+
valueType: DiscountValueType;
|
|
1442
|
+
/**
|
|
1443
|
+
* Percent off for `percentage`, cents off for `fixed_amount`.
|
|
1444
|
+
*/
|
|
1445
|
+
value: number;
|
|
1446
|
+
/**
|
|
1447
|
+
* Lowercase ISO currency of a `fixed_amount` discount.
|
|
1448
|
+
*/
|
|
1449
|
+
currency: string;
|
|
1450
|
+
/**
|
|
1451
|
+
* Products it applies to. Empty: every product.
|
|
1452
|
+
*/
|
|
1453
|
+
products: Array<ProductRef>;
|
|
1454
|
+
/**
|
|
1455
|
+
* Plans of the one product in `products` it applies to. Empty: every plan.
|
|
1456
|
+
*/
|
|
1457
|
+
plans: Array<PlanRef>;
|
|
1458
|
+
startsAt: Date;
|
|
1459
|
+
/**
|
|
1460
|
+
* Null: no end date.
|
|
1461
|
+
*/
|
|
1462
|
+
expiresAt: Date | null;
|
|
1463
|
+
/**
|
|
1464
|
+
* Total uses allowed; null is unlimited.
|
|
1465
|
+
*/
|
|
1466
|
+
maxRedemptions: number | null;
|
|
1467
|
+
/**
|
|
1468
|
+
* Uses allowed per customer; null is unlimited.
|
|
1469
|
+
*/
|
|
1470
|
+
maxRedemptionsPerCustomer: number | null;
|
|
1471
|
+
/**
|
|
1472
|
+
* Times it was used on a paid order. A full refund gives the use back.
|
|
1473
|
+
*/
|
|
1474
|
+
redemptionsCount: number;
|
|
1475
|
+
/**
|
|
1476
|
+
* Only customers with no earlier paid purchase can use it.
|
|
1477
|
+
*/
|
|
1478
|
+
firstTimePurchaseOnly: boolean;
|
|
1479
|
+
/**
|
|
1480
|
+
* Minimum subtotal in cents; null for none.
|
|
1481
|
+
*/
|
|
1482
|
+
minPriceInCents: number | null;
|
|
1483
|
+
/**
|
|
1484
|
+
* How many subscription invoices it discounts.
|
|
1485
|
+
*/
|
|
1486
|
+
duration: DiscountDuration;
|
|
1487
|
+
/**
|
|
1488
|
+
* Billing cycles for `repeating`; null otherwise.
|
|
1489
|
+
*/
|
|
1490
|
+
durationInCycles: number | null;
|
|
1491
|
+
/**
|
|
1492
|
+
* The on/off switch. An active discount applies only between `startsAt` and `expiresAt` and while uses remain.
|
|
1493
|
+
*/
|
|
1494
|
+
active: boolean;
|
|
1495
|
+
createdAt: Date;
|
|
1496
|
+
updatedAt: Date;
|
|
1497
|
+
};
|
|
1498
|
+
/**
|
|
1499
|
+
* Subscriptions only: `once` discounts the first invoice, `repeating` the first `durationInCycles` invoices, `forever` every invoice. One-time payments ignore it.
|
|
1500
|
+
*/
|
|
1501
|
+
type DiscountDuration = 'once' | 'repeating' | 'forever';
|
|
1502
|
+
type DiscountList = {
|
|
1503
|
+
object: 'list';
|
|
1504
|
+
data: Array<Discount>;
|
|
1505
|
+
/**
|
|
1506
|
+
* True when another page exists.
|
|
1507
|
+
*/
|
|
1508
|
+
hasMore: boolean;
|
|
1509
|
+
/**
|
|
1510
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
1511
|
+
*/
|
|
1512
|
+
nextCursor: string | null;
|
|
1513
|
+
};
|
|
1514
|
+
/**
|
|
1515
|
+
* `discount_code`: buyers type `code` at checkout (or you pass it as `discountCode`). `time_limited_offer`: applies on its own between `startsAt` and `expiresAt`.
|
|
1516
|
+
*/
|
|
1517
|
+
type DiscountType = 'discount_code' | 'time_limited_offer';
|
|
1518
|
+
type DiscountTypeFilter = 'discount_code' | 'time_limited_offer';
|
|
1519
|
+
type DiscountValueType = 'percentage' | 'fixed_amount';
|
|
1520
|
+
type EventSeatAttendee = {
|
|
1521
|
+
/**
|
|
1522
|
+
* Attendee full name for this seat
|
|
1523
|
+
*/
|
|
1524
|
+
name?: string;
|
|
1525
|
+
/**
|
|
1526
|
+
* Attendee email for this seat
|
|
1527
|
+
*/
|
|
1528
|
+
email?: string;
|
|
1529
|
+
};
|
|
1530
|
+
type IntegrationGuide = {
|
|
1531
|
+
object: 'integration_guide';
|
|
1532
|
+
target: IntegrationGuideTarget;
|
|
1533
|
+
catalogKey: string;
|
|
1534
|
+
/**
|
|
1535
|
+
* Ready-to-paste prompt for the target builder.
|
|
1536
|
+
*/
|
|
1537
|
+
prompt: string;
|
|
1538
|
+
/**
|
|
1539
|
+
* Checks the finished integration must pass.
|
|
1540
|
+
*/
|
|
1541
|
+
acceptanceChecklist: Array<string>;
|
|
1542
|
+
recipe: ListingRecipe;
|
|
1543
|
+
};
|
|
1544
|
+
type IntegrationGuideTarget = 'lovable';
|
|
1545
|
+
type IntegrationVerification = {
|
|
1546
|
+
/**
|
|
1547
|
+
* Integration verification id.
|
|
1548
|
+
*/
|
|
1549
|
+
id: string;
|
|
1550
|
+
object: 'integration_verification';
|
|
1551
|
+
/**
|
|
1552
|
+
* Listing (product) id the verification is for.
|
|
1553
|
+
*/
|
|
1554
|
+
listingId: string;
|
|
1555
|
+
/**
|
|
1556
|
+
* Checkout session used for the test, if any.
|
|
1557
|
+
*/
|
|
1558
|
+
checkoutSessionId: string | null;
|
|
1559
|
+
/**
|
|
1560
|
+
* Your app's id for the test customer.
|
|
1561
|
+
*/
|
|
1562
|
+
externalCustomerRef: string;
|
|
1563
|
+
/**
|
|
1564
|
+
* Entitlements the integration expected to see, exactly as submitted.
|
|
1565
|
+
*/
|
|
1566
|
+
expectedEntitlements: Array<unknown>;
|
|
1567
|
+
result: IntegrationVerificationResult;
|
|
1568
|
+
/**
|
|
1569
|
+
* Free-form details, exactly as submitted; null when none were sent.
|
|
1570
|
+
*/
|
|
1571
|
+
details: {
|
|
1572
|
+
[key: string]: unknown;
|
|
1573
|
+
} | null;
|
|
1574
|
+
verifiedAt: Date;
|
|
1575
|
+
createdAt: Date;
|
|
1576
|
+
};
|
|
1577
|
+
type IntegrationVerificationList = {
|
|
1578
|
+
object: 'list';
|
|
1579
|
+
data: Array<IntegrationVerification>;
|
|
1580
|
+
/**
|
|
1581
|
+
* True when another page exists.
|
|
1582
|
+
*/
|
|
1583
|
+
hasMore: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
1586
|
+
*/
|
|
1587
|
+
nextCursor: string | null;
|
|
1588
|
+
};
|
|
1589
|
+
type IntegrationVerificationResult = 'passed' | 'failed';
|
|
1590
|
+
type Invoice = {
|
|
1591
|
+
/**
|
|
1592
|
+
* Onflay invoice id.
|
|
1593
|
+
*/
|
|
1594
|
+
id: string;
|
|
1595
|
+
object: 'invoice';
|
|
1596
|
+
status: InvoiceStatus;
|
|
1597
|
+
/**
|
|
1598
|
+
* `developer_push`: created via `POST /v1/invoices`; `usage_metered`: computed from usage records; `subscription_tax`: renewal invoice with Onflay-calculated tax.
|
|
1599
|
+
*/
|
|
1600
|
+
source: InvoiceSource;
|
|
1601
|
+
/**
|
|
1602
|
+
* Lowercase ISO currency code.
|
|
1603
|
+
*/
|
|
1604
|
+
currency: string;
|
|
1605
|
+
/**
|
|
1606
|
+
* Invoice total in cents.
|
|
1607
|
+
*/
|
|
1608
|
+
totalInCents: number;
|
|
1609
|
+
lineItems: Array<InvoiceLineItem>;
|
|
1610
|
+
/**
|
|
1611
|
+
* Inclusive start of the billing period.
|
|
1612
|
+
*/
|
|
1613
|
+
periodStart: Date | null;
|
|
1614
|
+
/**
|
|
1615
|
+
* Exclusive end of the billing period.
|
|
1616
|
+
*/
|
|
1617
|
+
periodEnd: Date | null;
|
|
1618
|
+
/**
|
|
1619
|
+
* Onflay customer id.
|
|
1620
|
+
*/
|
|
1621
|
+
customerId: string;
|
|
1622
|
+
/**
|
|
1623
|
+
* Related Onflay subscription id.
|
|
1624
|
+
*/
|
|
1625
|
+
subscriptionId: string | null;
|
|
1626
|
+
createdAt: Date;
|
|
1627
|
+
};
|
|
1628
|
+
type InvoiceLineItem = {
|
|
1629
|
+
description: string;
|
|
1630
|
+
/**
|
|
1631
|
+
* Line amount in cents.
|
|
1632
|
+
*/
|
|
1633
|
+
amountInCents: number;
|
|
1634
|
+
/**
|
|
1635
|
+
* Informational quantity, if supplied.
|
|
1636
|
+
*/
|
|
1637
|
+
quantity?: number;
|
|
1638
|
+
/**
|
|
1639
|
+
* Informational unit amount in cents, if supplied.
|
|
1640
|
+
*/
|
|
1641
|
+
unitAmountInCents?: number;
|
|
1642
|
+
};
|
|
1643
|
+
type InvoiceList = {
|
|
1644
|
+
object: 'list';
|
|
1645
|
+
data: Array<Invoice>;
|
|
1646
|
+
/**
|
|
1647
|
+
* True when another page exists.
|
|
1648
|
+
*/
|
|
1649
|
+
hasMore: boolean;
|
|
1650
|
+
/**
|
|
1651
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
1652
|
+
*/
|
|
1653
|
+
nextCursor: string | null;
|
|
1654
|
+
};
|
|
1655
|
+
/**
|
|
1656
|
+
* `developer_push`: created via `POST /v1/invoices`; `usage_metered`: computed from usage records; `subscription_tax`: renewal invoice with Onflay-calculated tax.
|
|
1657
|
+
*/
|
|
1658
|
+
type InvoiceSource = 'developer_push' | 'usage_metered' | 'subscription_tax';
|
|
1659
|
+
type InvoiceStatus = 'open' | 'paid' | 'failed' | 'voided';
|
|
1660
|
+
type Jwks = {
|
|
1661
|
+
/**
|
|
1662
|
+
* Signing keys; empty if no key is configured.
|
|
1663
|
+
*/
|
|
1664
|
+
keys: Array<JwksKey>;
|
|
1665
|
+
};
|
|
1666
|
+
type JwksKey = {
|
|
1667
|
+
kty: 'RSA';
|
|
1668
|
+
/**
|
|
1669
|
+
* Key id; matches the `kid` header of access tokens.
|
|
1670
|
+
*/
|
|
1671
|
+
kid: string;
|
|
1672
|
+
use: 'sig';
|
|
1673
|
+
alg: string;
|
|
1674
|
+
/**
|
|
1675
|
+
* RSA modulus, base64url.
|
|
1676
|
+
*/
|
|
1677
|
+
n: string;
|
|
1678
|
+
/**
|
|
1679
|
+
* RSA public exponent, base64url.
|
|
1680
|
+
*/
|
|
1681
|
+
e: string;
|
|
1682
|
+
};
|
|
1683
|
+
type LicenseKey = {
|
|
1684
|
+
id: string;
|
|
1685
|
+
object: 'license_key';
|
|
1686
|
+
/**
|
|
1687
|
+
* The license key, e.g. `ONF-7K2M-Q9XD-4TRB-WN0C-8HJF-VZ3P-6A1E`. Treat it like a password.
|
|
1688
|
+
*/
|
|
1689
|
+
key: string;
|
|
1690
|
+
/**
|
|
1691
|
+
* `expired` also covers an active key whose `expiresAt` has passed.
|
|
1692
|
+
*/
|
|
1693
|
+
status: LicenseKeyState;
|
|
1694
|
+
customer: LicenseKeyCustomerRef;
|
|
1695
|
+
product: LicenseKeyNamedRef;
|
|
1696
|
+
plan: LicenseKeyNamedRef | null;
|
|
1697
|
+
/**
|
|
1698
|
+
* Instances allowed at a time; null is unlimited.
|
|
1699
|
+
*/
|
|
1700
|
+
activationLimit: number | null;
|
|
1701
|
+
/**
|
|
1702
|
+
* Active instances, oldest first.
|
|
1703
|
+
*/
|
|
1704
|
+
activations: Array<LicenseKeyActivation>;
|
|
1705
|
+
expiresAt: Date | null;
|
|
1706
|
+
revokedAt: Date | null;
|
|
1707
|
+
/**
|
|
1708
|
+
* Payment that issued the key.
|
|
1709
|
+
*/
|
|
1710
|
+
paymentId: string | null;
|
|
1711
|
+
subscriptionId: string | null;
|
|
1712
|
+
createdAt: Date;
|
|
1713
|
+
};
|
|
1714
|
+
type LicenseKeyActivation = {
|
|
1715
|
+
/**
|
|
1716
|
+
* Your id for the install.
|
|
1717
|
+
*/
|
|
1718
|
+
instanceId: string;
|
|
1719
|
+
label: string | null;
|
|
1720
|
+
activatedAt: Date;
|
|
1721
|
+
};
|
|
1722
|
+
type LicenseKeyActivationCount = {
|
|
1723
|
+
/**
|
|
1724
|
+
* Instances active now.
|
|
1725
|
+
*/
|
|
1726
|
+
used: number;
|
|
1727
|
+
/**
|
|
1728
|
+
* Instances allowed; null is unlimited.
|
|
1729
|
+
*/
|
|
1730
|
+
limit: number | null;
|
|
1731
|
+
};
|
|
1732
|
+
type LicenseKeyCustomerRef = {
|
|
1733
|
+
/**
|
|
1734
|
+
* Your app's id for the customer.
|
|
1735
|
+
*/
|
|
1736
|
+
externalCustomerId: string | null;
|
|
1737
|
+
};
|
|
1738
|
+
type LicenseKeyInstanceState = {
|
|
1739
|
+
instanceId: string;
|
|
1740
|
+
/**
|
|
1741
|
+
* True when this instance is activated.
|
|
1742
|
+
*/
|
|
1743
|
+
active: boolean;
|
|
1744
|
+
};
|
|
1745
|
+
type LicenseKeyKeyRef = {
|
|
1746
|
+
key: string | null;
|
|
1747
|
+
};
|
|
1748
|
+
type LicenseKeyList = {
|
|
1749
|
+
object: 'list';
|
|
1750
|
+
data: Array<LicenseKey>;
|
|
1751
|
+
/**
|
|
1752
|
+
* True when another page exists.
|
|
1753
|
+
*/
|
|
1754
|
+
hasMore: boolean;
|
|
1755
|
+
/**
|
|
1756
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
1757
|
+
*/
|
|
1758
|
+
nextCursor: string | null;
|
|
1759
|
+
};
|
|
1760
|
+
type LicenseKeyNamedRef = {
|
|
1761
|
+
key: string | null;
|
|
1762
|
+
name: string;
|
|
1763
|
+
};
|
|
1764
|
+
/**
|
|
1765
|
+
* `expired` also covers an active key whose `expiresAt` has passed.
|
|
1766
|
+
*/
|
|
1767
|
+
type LicenseKeyState = 'active' | 'revoked' | 'expired';
|
|
1768
|
+
type LicenseKeyStatus = {
|
|
1769
|
+
object: 'license_key_status';
|
|
1770
|
+
/**
|
|
1771
|
+
* True when the key is active and, if you sent `instanceId`, that instance is activated.
|
|
1772
|
+
*/
|
|
1773
|
+
valid: boolean;
|
|
1774
|
+
status: LicenseKeyState;
|
|
1775
|
+
product: LicenseKeyKeyRef;
|
|
1776
|
+
plan: LicenseKeyKeyRef | null;
|
|
1777
|
+
expiresAt: Date | null;
|
|
1778
|
+
activations: LicenseKeyActivationCount;
|
|
1779
|
+
/**
|
|
1780
|
+
* Null when you sent no `instanceId`.
|
|
1781
|
+
*/
|
|
1782
|
+
instance: LicenseKeyInstanceState | null;
|
|
1783
|
+
};
|
|
1784
|
+
type ListingBusinessModel = 'DIGITAL' | 'SERVICE' | 'APPOINTMENT' | 'SUBSCRIPTION' | 'EVENT';
|
|
1785
|
+
type ListingRecipe = {
|
|
1786
|
+
object: 'listing_recipe';
|
|
1787
|
+
catalogKey: string;
|
|
1788
|
+
/**
|
|
1789
|
+
* Listing title.
|
|
1790
|
+
*/
|
|
1791
|
+
name: string;
|
|
1792
|
+
description: string | null;
|
|
1793
|
+
businessModel: ListingBusinessModel;
|
|
1794
|
+
environment: ListingRecipeEnvironment;
|
|
1795
|
+
plans: Array<ListingRecipePlan>;
|
|
1796
|
+
/**
|
|
1797
|
+
* Listing-level entitlements.
|
|
1798
|
+
*/
|
|
1799
|
+
entitlements: Array<ListingRecipeEntitlement>;
|
|
1800
|
+
endpoints: ListingRecipeEndpoints;
|
|
1801
|
+
/**
|
|
1802
|
+
* Same value as the `ETag` response header (quoted).
|
|
1803
|
+
*/
|
|
1804
|
+
etag: string;
|
|
1805
|
+
updatedAt: Date;
|
|
1806
|
+
};
|
|
1807
|
+
type ListingRecipeEndpoints = {
|
|
1808
|
+
/**
|
|
1809
|
+
* Absolute URL of `POST /v1/checkout-sessions`.
|
|
1810
|
+
*/
|
|
1811
|
+
checkoutSessions: string;
|
|
1812
|
+
/**
|
|
1813
|
+
* URL template of the checkout receipt, with a `{checkoutId}` placeholder.
|
|
1814
|
+
*/
|
|
1815
|
+
receipt: string;
|
|
1816
|
+
/**
|
|
1817
|
+
* URL template of customer access, with an `{externalCustomerId}` placeholder.
|
|
1818
|
+
*/
|
|
1819
|
+
customerAccess: string;
|
|
1820
|
+
};
|
|
1821
|
+
type ListingRecipeEntitlement = {
|
|
1822
|
+
/**
|
|
1823
|
+
* Entitlement key.
|
|
1824
|
+
*/
|
|
1825
|
+
key: string;
|
|
1826
|
+
/**
|
|
1827
|
+
* Entitlement value: string, number or boolean.
|
|
1828
|
+
*/
|
|
1829
|
+
value: string | number | boolean;
|
|
1830
|
+
};
|
|
1831
|
+
type ListingRecipeEnvironment = 'live' | 'sandbox';
|
|
1832
|
+
type ListingRecipePlan = {
|
|
1833
|
+
/**
|
|
1834
|
+
* Plan key; pass it as `catalog.plan` at checkout.
|
|
1835
|
+
*/
|
|
1836
|
+
key: string;
|
|
1837
|
+
name: string;
|
|
1838
|
+
description: string | null;
|
|
1839
|
+
isDefault: boolean;
|
|
1840
|
+
/**
|
|
1841
|
+
* Default price: the monthly price when there is one, otherwise the first active price.
|
|
1842
|
+
*/
|
|
1843
|
+
price: ListingRecipePlanDefaultPrice;
|
|
1844
|
+
/**
|
|
1845
|
+
* Every active recurring price of the plan.
|
|
1846
|
+
*/
|
|
1847
|
+
prices: Array<ListingRecipePlanPrice>;
|
|
1848
|
+
entitlements: Array<ListingRecipeEntitlement>;
|
|
1849
|
+
};
|
|
1850
|
+
type ListingRecipePlanDefaultPrice = {
|
|
1851
|
+
/**
|
|
1852
|
+
* Price, in cents.
|
|
1853
|
+
*/
|
|
1854
|
+
amountInCents: number;
|
|
1855
|
+
/**
|
|
1856
|
+
* ISO 4217 currency code, for example `usd`.
|
|
1857
|
+
*/
|
|
1858
|
+
currency: string;
|
|
1859
|
+
/**
|
|
1860
|
+
* Billing interval; null for one-time prices.
|
|
1861
|
+
*/
|
|
1862
|
+
interval: PriceRecurringInterval | null;
|
|
1863
|
+
/**
|
|
1864
|
+
* Intervals per period; null for one-time prices.
|
|
1865
|
+
*/
|
|
1866
|
+
intervalCount: number | null;
|
|
1867
|
+
};
|
|
1868
|
+
type ListingRecipePlanPrice = {
|
|
1869
|
+
interval: PriceRecurringInterval;
|
|
1870
|
+
/**
|
|
1871
|
+
* Number of intervals per billing period (at least 1).
|
|
1872
|
+
*/
|
|
1873
|
+
intervalCount: number;
|
|
1874
|
+
/**
|
|
1875
|
+
* Price per period, in cents.
|
|
1876
|
+
*/
|
|
1877
|
+
amountInCents: number;
|
|
1878
|
+
/**
|
|
1879
|
+
* ISO 4217 currency code, for example `usd`.
|
|
1880
|
+
*/
|
|
1881
|
+
currency: string;
|
|
1882
|
+
};
|
|
1883
|
+
type Meter = {
|
|
1884
|
+
/**
|
|
1885
|
+
* Meter id.
|
|
1886
|
+
*/
|
|
1887
|
+
id: string;
|
|
1888
|
+
object: 'meter';
|
|
1889
|
+
/**
|
|
1890
|
+
* Display name.
|
|
1891
|
+
*/
|
|
1892
|
+
name: string;
|
|
1893
|
+
/**
|
|
1894
|
+
* Token passed as `meter` when reporting usage.
|
|
1895
|
+
*/
|
|
1896
|
+
eventName: string;
|
|
1897
|
+
aggregation: MeterAggregation;
|
|
1898
|
+
createdAt: Date;
|
|
1899
|
+
};
|
|
1900
|
+
/**
|
|
1901
|
+
* How reported quantities are aggregated per billing period.
|
|
1902
|
+
*/
|
|
1903
|
+
type MeterAggregation = 'SUM' | 'MAX' | 'LAST';
|
|
1904
|
+
type Payment = {
|
|
1905
|
+
/**
|
|
1906
|
+
* Payment id.
|
|
1907
|
+
*/
|
|
1908
|
+
id: string;
|
|
1909
|
+
object: 'payment';
|
|
1910
|
+
status: PaymentStatus;
|
|
1911
|
+
/**
|
|
1912
|
+
* Amount charged to the buyer, tax included, in cents.
|
|
1913
|
+
*/
|
|
1914
|
+
amountInCents: number;
|
|
1915
|
+
/**
|
|
1916
|
+
* Lowercase ISO currency code.
|
|
1917
|
+
*/
|
|
1918
|
+
currency: string;
|
|
1919
|
+
/**
|
|
1920
|
+
* Sum of completed refunds, in cents.
|
|
1921
|
+
*/
|
|
1922
|
+
amountRefundedInCents: number;
|
|
1923
|
+
customer: CustomerRef | null;
|
|
1924
|
+
/**
|
|
1925
|
+
* Null for payments not tied to a product (for example a pushed invoice).
|
|
1926
|
+
*/
|
|
1927
|
+
product: ProductRef | null;
|
|
1928
|
+
plan: PlanRef | null;
|
|
1929
|
+
/**
|
|
1930
|
+
* Onflay subscription id, for the first payment of a subscription and for invoiced renewals; null otherwise.
|
|
1931
|
+
*/
|
|
1932
|
+
subscriptionId: string | null;
|
|
1933
|
+
/**
|
|
1934
|
+
* Charges of a saved card (`POST /v1/payments`): the decline or error code when the charge failed, for example `card_declined` or `insufficient_funds`. Null otherwise.
|
|
1935
|
+
*/
|
|
1936
|
+
failureCode: string | null;
|
|
1937
|
+
/**
|
|
1938
|
+
* While `status` is `requires_action`: the Onflay page where the customer confirms the payment with their bank. Onflay also emails it to them. Expires after 72 hours.
|
|
1939
|
+
*/
|
|
1940
|
+
confirmUrl: string | null;
|
|
1941
|
+
/**
|
|
1942
|
+
* What has to happen before the payment can complete; null when nothing is needed.
|
|
1943
|
+
*/
|
|
1944
|
+
nextAction: PaymentNextAction | null;
|
|
1945
|
+
/**
|
|
1946
|
+
* The `description` sent with `POST /v1/payments`.
|
|
1947
|
+
*/
|
|
1948
|
+
description: string | null;
|
|
1949
|
+
/**
|
|
1950
|
+
* The `metadata` sent with `POST /v1/payments`.
|
|
1951
|
+
*/
|
|
1952
|
+
metadata: {
|
|
1953
|
+
[key: string]: string;
|
|
1954
|
+
} | null;
|
|
1955
|
+
createdAt: Date;
|
|
1956
|
+
};
|
|
1957
|
+
type PaymentCatalogSelection = {
|
|
1958
|
+
/**
|
|
1959
|
+
* Product key (the product’s catalog key).
|
|
1960
|
+
*/
|
|
1961
|
+
product: string;
|
|
1962
|
+
/**
|
|
1963
|
+
* Plan key within the product.
|
|
1964
|
+
*/
|
|
1965
|
+
plan: string;
|
|
1966
|
+
};
|
|
1967
|
+
type PaymentConfirmation = {
|
|
1968
|
+
object: 'payment_confirmation';
|
|
1969
|
+
/**
|
|
1970
|
+
* Stripe PaymentIntent client secret, to confirm the payment with Stripe.js.
|
|
1971
|
+
*/
|
|
1972
|
+
clientSecret: string;
|
|
1973
|
+
/**
|
|
1974
|
+
* Stripe publishable key to use with the client secret.
|
|
1975
|
+
*/
|
|
1976
|
+
publishableKey: string;
|
|
1977
|
+
/**
|
|
1978
|
+
* Stripe PaymentMethod (`pm_...`) the payment uses: the saved card.
|
|
1979
|
+
*/
|
|
1980
|
+
paymentMethodId: string;
|
|
1981
|
+
amountInCents: number;
|
|
1982
|
+
currency: string;
|
|
1983
|
+
/**
|
|
1984
|
+
* Seller name shown on the page.
|
|
1985
|
+
*/
|
|
1986
|
+
sellerName: string | null;
|
|
1987
|
+
description: string | null;
|
|
1988
|
+
card: PaymentConfirmationCard | null;
|
|
1989
|
+
locale: 'en' | 'es';
|
|
1990
|
+
expiresAt: Date;
|
|
1991
|
+
};
|
|
1992
|
+
type PaymentConfirmationCard = {
|
|
1993
|
+
brand: string | null;
|
|
1994
|
+
last4: string | null;
|
|
1995
|
+
};
|
|
1996
|
+
type PaymentList = {
|
|
1997
|
+
object: 'list';
|
|
1998
|
+
data: Array<Payment>;
|
|
1999
|
+
/**
|
|
2000
|
+
* True when another page exists.
|
|
2001
|
+
*/
|
|
2002
|
+
hasMore: boolean;
|
|
2003
|
+
/**
|
|
2004
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
2005
|
+
*/
|
|
2006
|
+
nextCursor: string | null;
|
|
2007
|
+
};
|
|
2008
|
+
type PaymentMethod = {
|
|
2009
|
+
/**
|
|
2010
|
+
* Payment method id.
|
|
2011
|
+
*/
|
|
2012
|
+
id: string;
|
|
2013
|
+
object: 'payment_method';
|
|
2014
|
+
/**
|
|
2015
|
+
* Stripe PaymentMethod id (`pm_...`).
|
|
2016
|
+
*/
|
|
2017
|
+
externalPaymentMethodId: string;
|
|
2018
|
+
/**
|
|
2019
|
+
* Card brand, for example `visa`.
|
|
2020
|
+
*/
|
|
2021
|
+
brand: string | null;
|
|
2022
|
+
/**
|
|
2023
|
+
* Last four card digits.
|
|
2024
|
+
*/
|
|
2025
|
+
last4: string | null;
|
|
2026
|
+
/**
|
|
2027
|
+
* Card expiry month (1-12).
|
|
2028
|
+
*/
|
|
2029
|
+
expMonth: number | null;
|
|
2030
|
+
/**
|
|
2031
|
+
* Card expiry year (four digits).
|
|
2032
|
+
*/
|
|
2033
|
+
expYear: number | null;
|
|
2034
|
+
/**
|
|
2035
|
+
* True for the card your account charges off-session for this customer (one per customer per account).
|
|
2036
|
+
*/
|
|
2037
|
+
isDefault: boolean;
|
|
2038
|
+
createdAt: Date;
|
|
2039
|
+
};
|
|
2040
|
+
type PaymentNextAction = {
|
|
2041
|
+
type: 'confirm_payment';
|
|
2042
|
+
/**
|
|
2043
|
+
* Onflay-hosted page where the customer confirms the payment.
|
|
2044
|
+
*/
|
|
2045
|
+
confirmUrl: string;
|
|
2046
|
+
};
|
|
2047
|
+
type PaymentPeriodFilter = 'all' | '7d' | '30d' | '90d' | 'custom';
|
|
2048
|
+
type PaymentStatus = 'pending' | 'requires_action' | 'completed' | 'failed' | 'refunded' | 'partially_refunded' | 'disputed';
|
|
2049
|
+
type PaymentStatusFilter = 'pending' | 'completed' | 'failed' | 'refunded' | 'partially_refunded' | 'disputed';
|
|
2050
|
+
type PlanRef = {
|
|
2051
|
+
/**
|
|
2052
|
+
* Plan key; null when the plan has none.
|
|
2053
|
+
*/
|
|
2054
|
+
key: string | null;
|
|
2055
|
+
/**
|
|
2056
|
+
* Plan name.
|
|
2057
|
+
*/
|
|
2058
|
+
name: string;
|
|
2059
|
+
};
|
|
2060
|
+
type PreviewSubscriptionUpdate = {
|
|
2061
|
+
/**
|
|
2062
|
+
* The plan (and optionally interval) to price, as in `PATCH { catalog }`.
|
|
2063
|
+
*/
|
|
2064
|
+
catalog: UpdateSubscriptionCatalog;
|
|
2065
|
+
/**
|
|
2066
|
+
* Proration behaviour to price. Defaults to create_prorations.
|
|
2067
|
+
*/
|
|
2068
|
+
prorationBehavior?: ProrationBehavior;
|
|
2069
|
+
/**
|
|
2070
|
+
* Price an immediate switch (`now`, default) or one at period end.
|
|
2071
|
+
*/
|
|
2072
|
+
effective?: SubscriptionChangeEffective;
|
|
2073
|
+
};
|
|
2074
|
+
type Price = {
|
|
2075
|
+
/**
|
|
2076
|
+
* Price id. A persisted price id, or `<productId>` / `<productId>:<variantId>` for products without persisted prices.
|
|
2077
|
+
*/
|
|
2078
|
+
id: string;
|
|
2079
|
+
object: 'price';
|
|
2080
|
+
/**
|
|
2081
|
+
* Id of the product this price belongs to.
|
|
2082
|
+
*/
|
|
2083
|
+
product: string;
|
|
2084
|
+
/**
|
|
2085
|
+
* Lowercase ISO currency code.
|
|
2086
|
+
*/
|
|
2087
|
+
currency: string;
|
|
2088
|
+
/**
|
|
2089
|
+
* True when both the price and its product are active.
|
|
2090
|
+
*/
|
|
2091
|
+
active: boolean;
|
|
2092
|
+
billingScheme: PriceBillingScheme;
|
|
2093
|
+
/**
|
|
2094
|
+
* Unit amount in cents.
|
|
2095
|
+
*/
|
|
2096
|
+
unitAmount: number | null;
|
|
2097
|
+
/**
|
|
2098
|
+
* Recurring configuration; null for one-time prices.
|
|
2099
|
+
*/
|
|
2100
|
+
recurring: PriceRecurring | null;
|
|
2101
|
+
/**
|
|
2102
|
+
* Arbitrary key/value metadata (product metadata merged with price metadata). Omitted when neither has any.
|
|
2103
|
+
*/
|
|
2104
|
+
metadata?: {
|
|
2105
|
+
[key: string]: unknown;
|
|
2106
|
+
};
|
|
2107
|
+
createdAt: Date;
|
|
2108
|
+
};
|
|
2109
|
+
/**
|
|
2110
|
+
* Only `flat` is supported today; other values return 400.
|
|
2111
|
+
*/
|
|
2112
|
+
type PriceBillingScheme = 'flat' | 'tiered' | 'usage_based';
|
|
2113
|
+
type PriceList = {
|
|
2114
|
+
object: 'list';
|
|
2115
|
+
data: Array<Price>;
|
|
2116
|
+
/**
|
|
2117
|
+
* True when another page exists.
|
|
2118
|
+
*/
|
|
2119
|
+
hasMore: boolean;
|
|
2120
|
+
/**
|
|
2121
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
2122
|
+
*/
|
|
2123
|
+
nextCursor: string | null;
|
|
2124
|
+
};
|
|
2125
|
+
type PriceRecurring = {
|
|
2126
|
+
/**
|
|
2127
|
+
* Billing interval, normally one of `day`, `week`, `month`, `year`.
|
|
2128
|
+
*/
|
|
2129
|
+
interval: string;
|
|
2130
|
+
/**
|
|
2131
|
+
* Number of intervals between charges.
|
|
2132
|
+
*/
|
|
2133
|
+
intervalCount: number;
|
|
2134
|
+
};
|
|
2135
|
+
type PriceRecurringInput = {
|
|
2136
|
+
/**
|
|
2137
|
+
* Billing interval
|
|
2138
|
+
*/
|
|
2139
|
+
interval: PriceRecurringInterval;
|
|
2140
|
+
/**
|
|
2141
|
+
* Number of intervals between charges
|
|
2142
|
+
*/
|
|
2143
|
+
intervalCount?: number;
|
|
2144
|
+
};
|
|
2145
|
+
/**
|
|
2146
|
+
* Recurring prices only.
|
|
2147
|
+
*/
|
|
2148
|
+
type PriceRecurringInterval = 'day' | 'week' | 'month' | 'year';
|
|
2149
|
+
type Product = {
|
|
2150
|
+
/**
|
|
2151
|
+
* Product id (listing id).
|
|
2152
|
+
*/
|
|
2153
|
+
id: string;
|
|
2154
|
+
object: 'product';
|
|
2155
|
+
/**
|
|
2156
|
+
* Product key used by the catalog API and checkout (`catalog.product`), e.g. `acme-saas`.
|
|
2157
|
+
*/
|
|
2158
|
+
key: string | null;
|
|
2159
|
+
/**
|
|
2160
|
+
* Product display name.
|
|
2161
|
+
*/
|
|
2162
|
+
name: string;
|
|
2163
|
+
/**
|
|
2164
|
+
* Long-form description.
|
|
2165
|
+
*/
|
|
2166
|
+
description: string | null;
|
|
2167
|
+
/**
|
|
2168
|
+
* True when the product is published for sale.
|
|
2169
|
+
*/
|
|
2170
|
+
active: boolean;
|
|
2171
|
+
/**
|
|
2172
|
+
* Arbitrary key/value metadata. Omitted when the product has none.
|
|
2173
|
+
*/
|
|
2174
|
+
metadata?: {
|
|
2175
|
+
[key: string]: unknown;
|
|
2176
|
+
};
|
|
2177
|
+
createdAt: Date;
|
|
2178
|
+
updatedAt: Date;
|
|
2179
|
+
};
|
|
2180
|
+
type ProductList = {
|
|
2181
|
+
object: 'list';
|
|
2182
|
+
data: Array<Product>;
|
|
2183
|
+
/**
|
|
2184
|
+
* True when another page exists.
|
|
2185
|
+
*/
|
|
2186
|
+
hasMore: boolean;
|
|
2187
|
+
/**
|
|
2188
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
2189
|
+
*/
|
|
2190
|
+
nextCursor: string | null;
|
|
2191
|
+
};
|
|
2192
|
+
type ProductRef = {
|
|
2193
|
+
/**
|
|
2194
|
+
* Product id.
|
|
2195
|
+
*/
|
|
2196
|
+
id: string;
|
|
2197
|
+
/**
|
|
2198
|
+
* Catalog key; null when the product has none.
|
|
2199
|
+
*/
|
|
2200
|
+
key: string | null;
|
|
2201
|
+
/**
|
|
2202
|
+
* Product name.
|
|
2203
|
+
*/
|
|
2204
|
+
name: string;
|
|
2205
|
+
};
|
|
2206
|
+
type ProductTypeFilter = 'digital' | 'service' | 'appointment' | 'subscription' | 'event';
|
|
2207
|
+
/**
|
|
2208
|
+
* Proration behaviour for catalog plan switches. Defaults to create_prorations. Ignored with `effective: "period_end"` (nothing is prorated).
|
|
2209
|
+
*/
|
|
2210
|
+
type ProrationBehavior = 'create_prorations' | 'none' | 'always_invoice';
|
|
2211
|
+
type RecordIntegrationVerification = {
|
|
2212
|
+
/**
|
|
2213
|
+
* Listing (product) id the verification is for.
|
|
2214
|
+
*/
|
|
2215
|
+
listingId: string;
|
|
2216
|
+
/**
|
|
2217
|
+
* Checkout session used for the test, if any.
|
|
2218
|
+
*/
|
|
2219
|
+
checkoutSessionId?: string;
|
|
2220
|
+
/**
|
|
2221
|
+
* Your app's id for the test customer.
|
|
2222
|
+
*/
|
|
2223
|
+
externalCustomerRef: string;
|
|
2224
|
+
/**
|
|
2225
|
+
* Entitlements the integration expected to see, for example `[{ "key": "pro", "value": true }]`. Stored as is.
|
|
2226
|
+
*/
|
|
2227
|
+
expectedEntitlements: Array<unknown>;
|
|
2228
|
+
result: IntegrationVerificationResult;
|
|
2229
|
+
/**
|
|
2230
|
+
* Free-form details about the run. Stored as is.
|
|
2231
|
+
*/
|
|
2232
|
+
details?: {
|
|
2233
|
+
[key: string]: unknown;
|
|
2234
|
+
};
|
|
2235
|
+
};
|
|
2236
|
+
type Refund = {
|
|
2237
|
+
/**
|
|
2238
|
+
* Refund id.
|
|
2239
|
+
*/
|
|
2240
|
+
id: string;
|
|
2241
|
+
object: 'refund';
|
|
2242
|
+
/**
|
|
2243
|
+
* The refunded payment.
|
|
2244
|
+
*/
|
|
2245
|
+
paymentId: string;
|
|
2246
|
+
/**
|
|
2247
|
+
* `completed`: the money is on its way back to the buyer. `pending`: not confirmed yet; retry the same request to finish it. `failed`: nothing was refunded.
|
|
2248
|
+
*/
|
|
2249
|
+
status: RefundStatus;
|
|
2250
|
+
/**
|
|
2251
|
+
* Refunded to the buyer, tax included, in cents.
|
|
2252
|
+
*/
|
|
2253
|
+
amountInCents: number;
|
|
2254
|
+
/**
|
|
2255
|
+
* Lowercase ISO currency code.
|
|
2256
|
+
*/
|
|
2257
|
+
currency: string;
|
|
2258
|
+
/**
|
|
2259
|
+
* Null when no reason was given.
|
|
2260
|
+
*/
|
|
2261
|
+
reason: RefundReason | null;
|
|
2262
|
+
createdAt: Date;
|
|
2263
|
+
};
|
|
2264
|
+
type RefundList = {
|
|
2265
|
+
object: 'list';
|
|
2266
|
+
data: Array<Refund>;
|
|
2267
|
+
/**
|
|
2268
|
+
* True when another page exists.
|
|
2269
|
+
*/
|
|
2270
|
+
hasMore: boolean;
|
|
2271
|
+
/**
|
|
2272
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
2273
|
+
*/
|
|
2274
|
+
nextCursor: string | null;
|
|
2275
|
+
};
|
|
2276
|
+
type RefundReason = 'requested_by_customer' | 'duplicate' | 'fraudulent';
|
|
2277
|
+
/**
|
|
2278
|
+
* `completed`: the money is on its way back to the buyer. `pending`: not confirmed yet; retry the same request to finish it. `failed`: nothing was refunded.
|
|
2279
|
+
*/
|
|
2280
|
+
type RefundStatus = 'pending' | 'completed' | 'failed';
|
|
2281
|
+
type ReportUsage = {
|
|
2282
|
+
/**
|
|
2283
|
+
* Onflay subscription id.
|
|
2284
|
+
*/
|
|
2285
|
+
subscriptionId: string;
|
|
2286
|
+
/**
|
|
2287
|
+
* Meter id or the meter's `eventName`.
|
|
2288
|
+
*/
|
|
2289
|
+
meter: string;
|
|
2290
|
+
/**
|
|
2291
|
+
* Quantity to record.
|
|
2292
|
+
*/
|
|
2293
|
+
quantity: number;
|
|
2294
|
+
/**
|
|
2295
|
+
* Event time. Defaults to now.
|
|
2296
|
+
*/
|
|
2297
|
+
timestamp?: Date;
|
|
2298
|
+
/**
|
|
2299
|
+
* Stable key per logical event; retries with the same key (for the same meter) are not double-counted.
|
|
2300
|
+
*/
|
|
2301
|
+
idempotencyKey: string;
|
|
2302
|
+
};
|
|
2303
|
+
type SandboxPayoutMethodResult = {
|
|
2304
|
+
/**
|
|
2305
|
+
* Always true on success.
|
|
2306
|
+
*/
|
|
2307
|
+
ok: boolean;
|
|
2308
|
+
message: string;
|
|
2309
|
+
};
|
|
2310
|
+
type SetupIntent = {
|
|
2311
|
+
object: 'setup_intent_session';
|
|
2312
|
+
/**
|
|
2313
|
+
* Setup session token (valid 1 hour). Resolve it with `GET /v1/setup-sessions/{token}`.
|
|
2314
|
+
*/
|
|
2315
|
+
token: string;
|
|
2316
|
+
/**
|
|
2317
|
+
* Hosted "add payment method" page for the customer (`<checkout app>/pm/<token>`).
|
|
2318
|
+
*/
|
|
2319
|
+
hostedUrl: string;
|
|
2320
|
+
/**
|
|
2321
|
+
* Stripe SetupIntent client secret, for collecting the card yourself.
|
|
2322
|
+
*/
|
|
2323
|
+
clientSecret: string;
|
|
2324
|
+
};
|
|
2325
|
+
type SetupSession = {
|
|
2326
|
+
/**
|
|
2327
|
+
* Stripe SetupIntent client secret.
|
|
2328
|
+
*/
|
|
2329
|
+
clientSecret: string;
|
|
2330
|
+
/**
|
|
2331
|
+
* Stripe publishable key to use with the client secret.
|
|
2332
|
+
*/
|
|
2333
|
+
publishableKey: string;
|
|
2334
|
+
customerEmail: string | null;
|
|
2335
|
+
/**
|
|
2336
|
+
* Where to send the customer after the card is saved.
|
|
2337
|
+
*/
|
|
2338
|
+
returnUrl: string | null;
|
|
2339
|
+
/**
|
|
2340
|
+
* Seller name shown on the page.
|
|
2341
|
+
*/
|
|
2342
|
+
creatorDisplayName: string | null;
|
|
2343
|
+
};
|
|
2344
|
+
type Subscription = {
|
|
2345
|
+
/**
|
|
2346
|
+
* Onflay subscription id (not a Stripe `sub_` id).
|
|
2347
|
+
*/
|
|
2348
|
+
id: string;
|
|
2349
|
+
object: 'subscription';
|
|
2350
|
+
status: SubscriptionStatus;
|
|
2351
|
+
customer: CustomerRef;
|
|
2352
|
+
product: ProductRef;
|
|
2353
|
+
/**
|
|
2354
|
+
* Null for subscriptions created before plans existed.
|
|
2355
|
+
*/
|
|
2356
|
+
plan: PlanRef | null;
|
|
2357
|
+
/**
|
|
2358
|
+
* Null for subscriptions created before prices existed.
|
|
2359
|
+
*/
|
|
2360
|
+
price: SubscriptionPrice | null;
|
|
2361
|
+
currentPeriodStart: Date;
|
|
2362
|
+
currentPeriodEnd: Date;
|
|
2363
|
+
/**
|
|
2364
|
+
* True when the subscription is set to cancel at the end of the current period. `status` stays `active` (or `trialing`) until then.
|
|
2365
|
+
*/
|
|
2366
|
+
cancelAtPeriodEnd: boolean;
|
|
2367
|
+
/**
|
|
2368
|
+
* When the cancellation was requested (scheduled or immediate); null when never canceled.
|
|
2369
|
+
*/
|
|
2370
|
+
canceledAt: Date | null;
|
|
2371
|
+
/**
|
|
2372
|
+
* Plan switch scheduled with `effective: "period_end"`; null when none. Cancel it with `PATCH { cancelPendingChange: true }`.
|
|
2373
|
+
*/
|
|
2374
|
+
pendingChange: SubscriptionPendingChange | null;
|
|
2375
|
+
/**
|
|
2376
|
+
* End of the free trial. While `status` is `trialing` the saved card is charged then; kept after the trial converts; null when the subscription had no trial.
|
|
2377
|
+
*/
|
|
2378
|
+
trialEndsAt: Date | null;
|
|
2379
|
+
createdAt: Date;
|
|
2380
|
+
updatedAt: Date;
|
|
2381
|
+
};
|
|
2382
|
+
type SubscriptionCancellation = {
|
|
2383
|
+
object: 'subscription_cancellation';
|
|
2384
|
+
/**
|
|
2385
|
+
* Onflay subscription id.
|
|
2386
|
+
*/
|
|
2387
|
+
id: string;
|
|
2388
|
+
status: SubscriptionStatus;
|
|
2389
|
+
cancelAtPeriodEnd: boolean;
|
|
2390
|
+
canceledAt: Date | null;
|
|
2391
|
+
currentPeriodEnd: Date;
|
|
2392
|
+
/**
|
|
2393
|
+
* Access continues until this time; null when canceled immediately.
|
|
2394
|
+
*/
|
|
2395
|
+
accessUntil: Date | null;
|
|
2396
|
+
/**
|
|
2397
|
+
* The subscription after the change.
|
|
2398
|
+
*/
|
|
2399
|
+
subscription: Subscription;
|
|
2400
|
+
};
|
|
2401
|
+
/**
|
|
2402
|
+
* When a plan switch takes effect. `now` (default) switches at once with `prorationBehavior`. `period_end` keeps the current plan until the paid period ends, then bills and grants the new plan from the next period (no proration); the subscription shows it in `pendingChange` until then and `subscription.updated` fires when it applies.
|
|
2403
|
+
*/
|
|
2404
|
+
type SubscriptionChangeEffective = 'now' | 'period_end';
|
|
2405
|
+
type SubscriptionList = {
|
|
2406
|
+
object: 'list';
|
|
2407
|
+
data: Array<Subscription>;
|
|
2408
|
+
/**
|
|
2409
|
+
* True when another page exists.
|
|
2410
|
+
*/
|
|
2411
|
+
hasMore: boolean;
|
|
2412
|
+
/**
|
|
2413
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
2414
|
+
*/
|
|
2415
|
+
nextCursor: string | null;
|
|
2416
|
+
};
|
|
2417
|
+
type SubscriptionPendingChange = {
|
|
2418
|
+
/**
|
|
2419
|
+
* Plan key the subscription switches to.
|
|
2420
|
+
*/
|
|
2421
|
+
planKey: string;
|
|
2422
|
+
/**
|
|
2423
|
+
* Catalog price id the subscription will bill.
|
|
2424
|
+
*/
|
|
2425
|
+
priceId: string;
|
|
2426
|
+
interval: PriceRecurringInterval;
|
|
2427
|
+
intervalCount: number;
|
|
2428
|
+
/**
|
|
2429
|
+
* When the new plan starts: the end of the current period. Billing, entitlements and `plan` change then.
|
|
2430
|
+
*/
|
|
2431
|
+
effectiveAt: Date;
|
|
2432
|
+
requestedAt: Date;
|
|
2433
|
+
};
|
|
2434
|
+
/**
|
|
2435
|
+
* Billing interval for the plan SKU. Defaults to the subscription’s current interval (month when it has none). Naming the current plan and interval is rejected with `plan_unchanged`.
|
|
2436
|
+
*/
|
|
2437
|
+
type SubscriptionPlanInterval = 'month' | 'year';
|
|
2438
|
+
type SubscriptionPrice = {
|
|
2439
|
+
/**
|
|
2440
|
+
* Price id.
|
|
2441
|
+
*/
|
|
2442
|
+
id: string;
|
|
2443
|
+
/**
|
|
2444
|
+
* Unit amount in cents; null for tiered or usage-based prices.
|
|
2445
|
+
*/
|
|
2446
|
+
amountInCents: number | null;
|
|
2447
|
+
/**
|
|
2448
|
+
* Lowercase ISO currency code.
|
|
2449
|
+
*/
|
|
2450
|
+
currency: string;
|
|
2451
|
+
interval: PriceRecurringInterval | null;
|
|
2452
|
+
/**
|
|
2453
|
+
* Number of intervals per billing period.
|
|
2454
|
+
*/
|
|
2455
|
+
intervalCount: number | null;
|
|
2456
|
+
};
|
|
2457
|
+
type SubscriptionStatus = 'active' | 'past_due' | 'canceled' | 'unpaid' | 'expired' | 'trialing' | 'incomplete';
|
|
2458
|
+
type SubscriptionStatusFilter = 'active' | 'past_due' | 'canceled' | 'unpaid' | 'expired' | 'trialing' | 'incomplete';
|
|
2459
|
+
type SubscriptionUpdatePreview = {
|
|
2460
|
+
object: 'subscription_update_preview';
|
|
2461
|
+
subscriptionId: string;
|
|
2462
|
+
effective: SubscriptionChangeEffective;
|
|
2463
|
+
/**
|
|
2464
|
+
* Proration priced (`none` for period-end switches).
|
|
2465
|
+
*/
|
|
2466
|
+
prorationBehavior: ProrationBehavior;
|
|
2467
|
+
plan: SubscriptionUpdatePreviewPlan;
|
|
2468
|
+
interval: PriceRecurringInterval;
|
|
2469
|
+
intervalCount: number;
|
|
2470
|
+
/**
|
|
2471
|
+
* Charged to the saved card when the switch is made: the prorations with `always_invoice`, the whole new period when the interval changes, otherwise 0 (the difference goes on the next invoice).
|
|
2472
|
+
*/
|
|
2473
|
+
amountDueNow: number;
|
|
2474
|
+
currency: string;
|
|
2475
|
+
nextInvoice: SubscriptionUpdatePreviewNextInvoice;
|
|
2476
|
+
lines: Array<SubscriptionUpdatePreviewLine>;
|
|
2477
|
+
};
|
|
2478
|
+
type SubscriptionUpdatePreviewLine = {
|
|
2479
|
+
description: string | null;
|
|
2480
|
+
/**
|
|
2481
|
+
* Amount in cents; negative for credits for unused time.
|
|
2482
|
+
*/
|
|
2483
|
+
amount: number;
|
|
2484
|
+
/**
|
|
2485
|
+
* True for proration lines (credit or charge for the rest of the current period).
|
|
2486
|
+
*/
|
|
2487
|
+
proration: boolean;
|
|
2488
|
+
periodStart: Date;
|
|
2489
|
+
periodEnd: Date;
|
|
2490
|
+
};
|
|
2491
|
+
type SubscriptionUpdatePreviewNextInvoice = {
|
|
2492
|
+
/**
|
|
2493
|
+
* Amount of the next invoice in cents.
|
|
2494
|
+
*/
|
|
2495
|
+
amount: number;
|
|
2496
|
+
/**
|
|
2497
|
+
* When the next invoice is charged.
|
|
2498
|
+
*/
|
|
2499
|
+
date: Date;
|
|
2500
|
+
};
|
|
2501
|
+
type SubscriptionUpdatePreviewPlan = {
|
|
2502
|
+
key: string;
|
|
2503
|
+
/**
|
|
2504
|
+
* Catalog price id the switch moves to.
|
|
2505
|
+
*/
|
|
2506
|
+
priceId: string;
|
|
2507
|
+
};
|
|
2508
|
+
type TaxPriceBehavior = 'inclusive' | 'exclusive';
|
|
2509
|
+
type UncancelByExternalCustomer = {
|
|
2510
|
+
/**
|
|
2511
|
+
* Developer's app-side customer id (same as checkout externalCustomerId)
|
|
2512
|
+
*/
|
|
2513
|
+
externalCustomerId: string;
|
|
2514
|
+
/**
|
|
2515
|
+
* When the customer has multiple scheduled cancellations, scope to this catalog key
|
|
2516
|
+
*/
|
|
2517
|
+
catalogKey?: string;
|
|
2518
|
+
};
|
|
2519
|
+
type UpdateCustomer = {
|
|
2520
|
+
/**
|
|
2521
|
+
* Customer name.
|
|
2522
|
+
*/
|
|
2523
|
+
name?: string;
|
|
2524
|
+
/**
|
|
2525
|
+
* Deprecated alias of `name`; ignored when `name` is sent.
|
|
2526
|
+
*
|
|
2527
|
+
* @deprecated
|
|
2528
|
+
*/
|
|
2529
|
+
displayName?: string;
|
|
2530
|
+
/**
|
|
2531
|
+
* Customer phone, ideally E.164 (for example `+18095551234`).
|
|
2532
|
+
*/
|
|
2533
|
+
phone?: string;
|
|
2534
|
+
};
|
|
2535
|
+
type UpdateDiscount = {
|
|
2536
|
+
/**
|
|
2537
|
+
* Required for `discount_code`, not allowed for `time_limited_offer`. Stored uppercase; buyers can type it in any case. Unique per account.
|
|
2538
|
+
*/
|
|
2539
|
+
code?: string;
|
|
2540
|
+
/**
|
|
2541
|
+
* Name shown to buyers, for example "Launch week".
|
|
2542
|
+
*/
|
|
2543
|
+
label?: string;
|
|
2544
|
+
valueType?: DiscountValueType;
|
|
2545
|
+
/**
|
|
2546
|
+
* Percent off (1 to 100) for `percentage`; amount off in cents for `fixed_amount`.
|
|
2547
|
+
*/
|
|
2548
|
+
value?: number;
|
|
2549
|
+
/**
|
|
2550
|
+
* Lowercase ISO currency. A `fixed_amount` discount applies only to prices in this currency.
|
|
2551
|
+
*/
|
|
2552
|
+
currency?: string;
|
|
2553
|
+
/**
|
|
2554
|
+
* Product keys the discount applies to. Omit or send `[]` for every product.
|
|
2555
|
+
*/
|
|
2556
|
+
productKeys?: Array<string>;
|
|
2557
|
+
/**
|
|
2558
|
+
* Plan keys of the one product in `productKeys`. Needs exactly one product key. Omit or send `[]` for every plan of the product.
|
|
2559
|
+
*/
|
|
2560
|
+
planKeys?: Array<string>;
|
|
2561
|
+
/**
|
|
2562
|
+
* When the discount starts. Defaults to now.
|
|
2563
|
+
*/
|
|
2564
|
+
startsAt?: Date;
|
|
2565
|
+
/**
|
|
2566
|
+
* When the discount ends; must be after `startsAt`. Omit or send null for no end.
|
|
2567
|
+
*/
|
|
2568
|
+
expiresAt?: Date | null;
|
|
2569
|
+
/**
|
|
2570
|
+
* Total uses allowed; null is unlimited.
|
|
2571
|
+
*/
|
|
2572
|
+
maxRedemptions?: number | null;
|
|
2573
|
+
/**
|
|
2574
|
+
* Uses allowed per customer; null is unlimited.
|
|
2575
|
+
*/
|
|
2576
|
+
maxRedemptionsPerCustomer?: number | null;
|
|
2577
|
+
/**
|
|
2578
|
+
* When true, only customers with no earlier paid purchase from you can use it.
|
|
2579
|
+
*/
|
|
2580
|
+
firstTimePurchaseOnly?: boolean;
|
|
2581
|
+
/**
|
|
2582
|
+
* Minimum subtotal in cents before the discount applies; null for none.
|
|
2583
|
+
*/
|
|
2584
|
+
minPriceInCents?: number | null;
|
|
2585
|
+
/**
|
|
2586
|
+
* Subscriptions only: `once` discounts the first invoice, `repeating` the first `durationInCycles` invoices, `forever` every invoice. One-time payments ignore it.
|
|
2587
|
+
*/
|
|
2588
|
+
duration?: DiscountDuration;
|
|
2589
|
+
/**
|
|
2590
|
+
* Required when `duration` is `repeating`: how many billing cycles (2 or more).
|
|
2591
|
+
*/
|
|
2592
|
+
durationInCycles?: number | null;
|
|
2593
|
+
/**
|
|
2594
|
+
* Whether buyers can use it now. Deactivate instead of deleting.
|
|
2595
|
+
*/
|
|
2596
|
+
active?: boolean;
|
|
2597
|
+
};
|
|
2598
|
+
type UpdatePrice = {
|
|
2599
|
+
/**
|
|
2600
|
+
* Deactivate (false) or reactivate (true) this price. Deactivating the default price pauses the product.
|
|
2601
|
+
*/
|
|
2602
|
+
active?: boolean;
|
|
2603
|
+
/**
|
|
2604
|
+
* Metadata patch, merged into the existing price metadata
|
|
2605
|
+
*/
|
|
2606
|
+
metadata?: {
|
|
2607
|
+
[key: string]: unknown;
|
|
2608
|
+
};
|
|
2609
|
+
};
|
|
2610
|
+
type UpdateProduct = {
|
|
2611
|
+
/**
|
|
2612
|
+
* Product display name
|
|
2613
|
+
*/
|
|
2614
|
+
name?: string;
|
|
2615
|
+
/**
|
|
2616
|
+
* Long-form description. `null` is accepted but currently leaves the description unchanged.
|
|
2617
|
+
*/
|
|
2618
|
+
description?: string | null;
|
|
2619
|
+
/**
|
|
2620
|
+
* Publish (true) or pause (false) the product for sale
|
|
2621
|
+
*/
|
|
2622
|
+
active?: boolean;
|
|
2623
|
+
/**
|
|
2624
|
+
* Merged into the existing metadata (keys not provided are kept)
|
|
2625
|
+
*/
|
|
2626
|
+
metadata?: {
|
|
2627
|
+
[key: string]: unknown;
|
|
2628
|
+
};
|
|
2629
|
+
};
|
|
2630
|
+
type UpdateSubscription = {
|
|
2631
|
+
/**
|
|
2632
|
+
* Schedule cancel at period end (true) or cancel immediately (false). Mutually exclusive with uncancel and catalog.
|
|
2633
|
+
*/
|
|
2634
|
+
cancelAtPeriodEnd?: boolean;
|
|
2635
|
+
/**
|
|
2636
|
+
* When true, clears a previously scheduled period-end cancellation. Prefer this over cancelAtPeriodEnd:false for uncancel.
|
|
2637
|
+
*/
|
|
2638
|
+
uncancel?: boolean;
|
|
2639
|
+
/**
|
|
2640
|
+
* Switch plan / interval in place via catalog keys.
|
|
2641
|
+
*/
|
|
2642
|
+
catalog?: UpdateSubscriptionCatalog;
|
|
2643
|
+
/**
|
|
2644
|
+
* When a plan switch takes effect. `now` (default) switches at once with `prorationBehavior`. `period_end` keeps the current plan until the paid period ends, then bills and grants the new plan from the next period (no proration); the subscription shows it in `pendingChange` until then and `subscription.updated` fires when it applies.
|
|
2645
|
+
*/
|
|
2646
|
+
effective?: SubscriptionChangeEffective;
|
|
2647
|
+
/**
|
|
2648
|
+
* When true, cancels the plan switch scheduled for period end (`pendingChange`); the subscription renews on its current plan.
|
|
2649
|
+
*/
|
|
2650
|
+
cancelPendingChange?: boolean;
|
|
2651
|
+
/**
|
|
2652
|
+
* Proration behaviour for catalog plan switches. Defaults to create_prorations. Ignored with `effective: "period_end"` (nothing is prorated).
|
|
2653
|
+
*/
|
|
2654
|
+
prorationBehavior?: ProrationBehavior;
|
|
2655
|
+
};
|
|
2656
|
+
type UpdateSubscriptionCatalog = {
|
|
2657
|
+
/**
|
|
2658
|
+
* Product key. Must match the subscription's current product. Send `product` or the deprecated alias `listing`.
|
|
2659
|
+
*/
|
|
2660
|
+
product?: string;
|
|
2661
|
+
/**
|
|
2662
|
+
* Deprecated alias of `product`.
|
|
2663
|
+
*
|
|
2664
|
+
* @deprecated
|
|
2665
|
+
*/
|
|
2666
|
+
listing?: string;
|
|
2667
|
+
/**
|
|
2668
|
+
* Plan key, e.g. `pro`.
|
|
2669
|
+
*/
|
|
2670
|
+
plan: string;
|
|
2671
|
+
/**
|
|
2672
|
+
* Billing interval for the plan SKU. Defaults to the subscription’s current interval (month when it has none). Naming the current plan and interval is rejected with `plan_unchanged`.
|
|
2673
|
+
*/
|
|
2674
|
+
interval?: SubscriptionPlanInterval;
|
|
2675
|
+
/**
|
|
2676
|
+
* Number of intervals per billing period, e.g. 3 with `month` for quarterly. Only needed when the plan has several prices with the same interval. Defaults to the subscription’s current count when it keeps its interval, else to the shortest period the plan offers.
|
|
2677
|
+
*/
|
|
2678
|
+
intervalCount?: number;
|
|
2679
|
+
};
|
|
2680
|
+
type UpdateWebhookEndpoint = {
|
|
2681
|
+
/**
|
|
2682
|
+
* Absolute URL (with `https://` or `http://`) the dispatcher posts events to.
|
|
2683
|
+
*/
|
|
2684
|
+
url?: string;
|
|
2685
|
+
/**
|
|
2686
|
+
* Replaces the subscribed event patterns: `*` (every event), `payment.*` (a family) or an exact type such as `payment.completed`.
|
|
2687
|
+
*/
|
|
2688
|
+
events?: Array<string>;
|
|
2689
|
+
/**
|
|
2690
|
+
* Free-form note shown in the dashboard; null clears it.
|
|
2691
|
+
*/
|
|
2692
|
+
description?: string | null;
|
|
2693
|
+
/**
|
|
2694
|
+
* false disables the endpoint (sets `disabledAt` and `disabledReason`); true re-enables it and clears both.
|
|
2695
|
+
*/
|
|
2696
|
+
isActive?: boolean;
|
|
2697
|
+
};
|
|
2698
|
+
type UpsertCatalogPlan = {
|
|
2699
|
+
/**
|
|
2700
|
+
* Plan name shown to buyers.
|
|
2701
|
+
*/
|
|
2702
|
+
name: string;
|
|
2703
|
+
/**
|
|
2704
|
+
* Plan description.
|
|
2705
|
+
*/
|
|
2706
|
+
description?: string;
|
|
2707
|
+
/**
|
|
2708
|
+
* Make this the product’s default plan.
|
|
2709
|
+
*/
|
|
2710
|
+
isDefault?: boolean;
|
|
2711
|
+
/**
|
|
2712
|
+
* What a buyer of this plan gets. Replaces the current list when sent. Added entitlements and new values reach existing customers at once; removed ones stay for customers who bought before (customer access marks them `grandfathered`).
|
|
2713
|
+
*/
|
|
2714
|
+
entitlements?: Array<CatalogEntitlementInput>;
|
|
2715
|
+
/**
|
|
2716
|
+
* Credits a buyer gets on every successful payment of this plan: the one-time purchase, or a subscription’s first payment and each renewal. `expiresInDays` makes each grant expire. Replaces the current list when sent; `[]` removes them. Changing it never touches credits already granted.
|
|
2717
|
+
*/
|
|
2718
|
+
credits?: Array<CatalogCreditGrantInput>;
|
|
2719
|
+
/**
|
|
2720
|
+
* Issue a license key on each one-time purchase of this plan, or on a subscription’s first payment. `{}` issues keys with no limits; `null` stops issuing them. Omit to keep the current setting. Existing keys are never changed.
|
|
2721
|
+
*/
|
|
2722
|
+
licenseKey?: CatalogLicenseKeyInput | null;
|
|
2723
|
+
/**
|
|
2724
|
+
* Free trial days for this subscription plan. Checkout saves the card and charges nothing; the first charge happens when the trial ends. `0` or `null` removes the trial. Omit to keep the current setting. Subscriptions already started keep theirs. Subscription products only.
|
|
2725
|
+
*/
|
|
2726
|
+
trialDays?: number | null;
|
|
2727
|
+
/**
|
|
2728
|
+
* The complete set of prices for the plan; prices not listed stop being sold. Subscription products: a monthly price and optionally a yearly one. Other products: exactly one `one_time` price.
|
|
2729
|
+
*/
|
|
2730
|
+
prices: Array<CatalogPriceInput>;
|
|
2731
|
+
};
|
|
2732
|
+
type UpsertCatalogProduct = {
|
|
2733
|
+
/**
|
|
2734
|
+
* Product name shown to buyers.
|
|
2735
|
+
*/
|
|
2736
|
+
name: string;
|
|
2737
|
+
/**
|
|
2738
|
+
* Product description.
|
|
2739
|
+
*/
|
|
2740
|
+
description?: {
|
|
2741
|
+
[key: string]: unknown;
|
|
2742
|
+
} | null;
|
|
2743
|
+
/**
|
|
2744
|
+
* Required when creating. Cannot change afterwards. Appointment and event products are created in the dashboard.
|
|
2745
|
+
*/
|
|
2746
|
+
type?: UpsertableCatalogProductType;
|
|
2747
|
+
/**
|
|
2748
|
+
* Whether the product is for sale. Default `true` when creating: the product goes live as soon as it has a plan. `false` pauses it.
|
|
2749
|
+
*/
|
|
2750
|
+
active?: boolean;
|
|
2751
|
+
/**
|
|
2752
|
+
* Entitlements granted by every plan of the product. Replaces the current list when sent. Removed ones stay for customers who bought before (`grandfathered`).
|
|
2753
|
+
*/
|
|
2754
|
+
entitlements?: Array<CatalogEntitlementInput>;
|
|
2755
|
+
/**
|
|
2756
|
+
* Who owns this product from now on: `api` (your code or admin panel through the API) or `code` (a config file applied with `onflay catalog apply`). The dashboard warns before edits that the owner may overwrite.
|
|
2757
|
+
*/
|
|
2758
|
+
managedBy?: CatalogManagedBy;
|
|
2759
|
+
};
|
|
2760
|
+
/**
|
|
2761
|
+
* Required when creating. Cannot change afterwards. Appointment and event products are created in the dashboard.
|
|
2762
|
+
*/
|
|
2763
|
+
type UpsertableCatalogProductType = 'subscription' | 'digital' | 'service';
|
|
2764
|
+
type UsageBillingInterval = 'month' | 'year';
|
|
2765
|
+
type UsageBillingPlan = {
|
|
2766
|
+
object: 'usage_billing_plan';
|
|
2767
|
+
/**
|
|
2768
|
+
* Usage billing plan id.
|
|
2769
|
+
*/
|
|
2770
|
+
id: string;
|
|
2771
|
+
/**
|
|
2772
|
+
* Onflay subscription id.
|
|
2773
|
+
*/
|
|
2774
|
+
subscriptionId: string;
|
|
2775
|
+
/**
|
|
2776
|
+
* Meter id.
|
|
2777
|
+
*/
|
|
2778
|
+
meterId: string;
|
|
2779
|
+
/**
|
|
2780
|
+
* Price id.
|
|
2781
|
+
*/
|
|
2782
|
+
priceId: string;
|
|
2783
|
+
billingInterval: UsageBillingInterval;
|
|
2784
|
+
/**
|
|
2785
|
+
* Day of month that anchors billing cycles.
|
|
2786
|
+
*/
|
|
2787
|
+
billingAnchorDay: number;
|
|
2788
|
+
createdAt: Date;
|
|
2789
|
+
updatedAt: Date;
|
|
2790
|
+
};
|
|
2791
|
+
type UsageRecord = {
|
|
2792
|
+
object: 'usage_record';
|
|
2793
|
+
/**
|
|
2794
|
+
* True once the report is buffered (it is persisted asynchronously). Duplicate idempotency keys also return true.
|
|
2795
|
+
*/
|
|
2796
|
+
accepted: boolean;
|
|
2797
|
+
/**
|
|
2798
|
+
* Onflay subscription id the usage was recorded against.
|
|
2799
|
+
*/
|
|
2800
|
+
subscriptionId: string;
|
|
2801
|
+
/**
|
|
2802
|
+
* Resolved meter id.
|
|
2803
|
+
*/
|
|
2804
|
+
meterId: string;
|
|
2805
|
+
};
|
|
2806
|
+
type ValidateLicenseKey = {
|
|
2807
|
+
/**
|
|
2808
|
+
* The license key, e.g. `ONF-7K2M-Q9XD-4TRB-WN0C-8HJF-VZ3P-6A1E`. Case and surrounding spaces are ignored.
|
|
2809
|
+
*/
|
|
2810
|
+
key: string;
|
|
2811
|
+
/**
|
|
2812
|
+
* Your id for this install. When sent, `valid` also requires the instance to be activated.
|
|
2813
|
+
*/
|
|
2814
|
+
instanceId?: string;
|
|
2815
|
+
};
|
|
2816
|
+
type WebhookDelivery = {
|
|
2817
|
+
/**
|
|
2818
|
+
* Webhook delivery id.
|
|
2819
|
+
*/
|
|
2820
|
+
id: string;
|
|
2821
|
+
object: 'webhook_delivery';
|
|
2822
|
+
/**
|
|
2823
|
+
* Id of the webhook endpoint this delivery targets.
|
|
2824
|
+
*/
|
|
2825
|
+
endpointId: string;
|
|
2826
|
+
/**
|
|
2827
|
+
* Event type, for example `payment.completed`.
|
|
2828
|
+
*/
|
|
2829
|
+
eventType: string;
|
|
2830
|
+
status: WebhookDeliveryStatus;
|
|
2831
|
+
/**
|
|
2832
|
+
* Number of delivery attempts made so far.
|
|
2833
|
+
*/
|
|
2834
|
+
attempts: number;
|
|
2835
|
+
/**
|
|
2836
|
+
* HTTP status the endpoint returned on the last attempt; null when no response has been recorded.
|
|
2837
|
+
*/
|
|
2838
|
+
httpStatus: number | null;
|
|
2839
|
+
lastAttemptAt: Date | null;
|
|
2840
|
+
/**
|
|
2841
|
+
* When the next attempt is scheduled; null when none is.
|
|
2842
|
+
*/
|
|
2843
|
+
nextRetryAt: Date | null;
|
|
2844
|
+
/**
|
|
2845
|
+
* Error from the last failed attempt.
|
|
2846
|
+
*/
|
|
2847
|
+
errorMessage: string | null;
|
|
2848
|
+
/**
|
|
2849
|
+
* Response body of the last attempt, truncated to its first 1024 characters.
|
|
2850
|
+
*/
|
|
2851
|
+
responseBody: string | null;
|
|
2852
|
+
/**
|
|
2853
|
+
* The event payload that was sent. Only included by `GET /v1/webhook-deliveries/{id}`; omitted from list and resend responses.
|
|
2854
|
+
*/
|
|
2855
|
+
payload?: {
|
|
2856
|
+
[key: string]: unknown;
|
|
2857
|
+
};
|
|
2858
|
+
createdAt: Date;
|
|
2859
|
+
updatedAt: Date;
|
|
2860
|
+
};
|
|
2861
|
+
type WebhookDeliveryList = {
|
|
2862
|
+
object: 'list';
|
|
2863
|
+
data: Array<WebhookDelivery>;
|
|
2864
|
+
/**
|
|
2865
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
2866
|
+
*/
|
|
2867
|
+
nextCursor: string | null;
|
|
2868
|
+
hasMore: boolean;
|
|
2869
|
+
};
|
|
2870
|
+
type WebhookDeliveryStatus = 'PENDING' | 'DELIVERED' | 'FAILED' | 'EXHAUSTED';
|
|
2871
|
+
type WebhookDeliveryStatusFilter = 'pending' | 'delivered' | 'failed' | 'exhausted';
|
|
2872
|
+
type WebhookEndpoint = {
|
|
2873
|
+
/**
|
|
2874
|
+
* Webhook endpoint id.
|
|
2875
|
+
*/
|
|
2876
|
+
id: string;
|
|
2877
|
+
object: 'webhook_endpoint';
|
|
2878
|
+
/**
|
|
2879
|
+
* Absolute URL the dispatcher posts events to.
|
|
2880
|
+
*/
|
|
2881
|
+
url: string;
|
|
2882
|
+
/**
|
|
2883
|
+
* Subscribed event patterns: `*` (every event), `payment.*` (a family) or an exact type such as `payment.completed`.
|
|
2884
|
+
*/
|
|
2885
|
+
events: Array<string>;
|
|
2886
|
+
description: string | null;
|
|
2887
|
+
/**
|
|
2888
|
+
* False when the endpoint is disabled and receives no deliveries.
|
|
2889
|
+
*/
|
|
2890
|
+
isActive: boolean;
|
|
2891
|
+
/**
|
|
2892
|
+
* When the endpoint was disabled; null while active.
|
|
2893
|
+
*/
|
|
2894
|
+
disabledAt: Date | null;
|
|
2895
|
+
/**
|
|
2896
|
+
* Why the endpoint was disabled (for example `Disabled via API`); null while active.
|
|
2897
|
+
*/
|
|
2898
|
+
disabledReason: string | null;
|
|
2899
|
+
createdAt: Date;
|
|
2900
|
+
updatedAt: Date;
|
|
2901
|
+
};
|
|
2902
|
+
type WebhookEndpointList = {
|
|
2903
|
+
object: 'list';
|
|
2904
|
+
data: Array<WebhookEndpoint>;
|
|
2905
|
+
/**
|
|
2906
|
+
* Always null: every endpoint is returned in one page.
|
|
2907
|
+
*/
|
|
2908
|
+
nextCursor: string | null;
|
|
2909
|
+
/**
|
|
2910
|
+
* Always false.
|
|
2911
|
+
*/
|
|
2912
|
+
hasMore: boolean;
|
|
2913
|
+
};
|
|
2914
|
+
type WebhookEndpointWithSecret = {
|
|
2915
|
+
/**
|
|
2916
|
+
* Webhook endpoint id.
|
|
2917
|
+
*/
|
|
2918
|
+
id: string;
|
|
2919
|
+
object: 'webhook_endpoint';
|
|
2920
|
+
/**
|
|
2921
|
+
* Absolute URL the dispatcher posts events to.
|
|
2922
|
+
*/
|
|
2923
|
+
url: string;
|
|
2924
|
+
/**
|
|
2925
|
+
* Subscribed event patterns: `*` (every event), `payment.*` (a family) or an exact type such as `payment.completed`.
|
|
2926
|
+
*/
|
|
2927
|
+
events: Array<string>;
|
|
2928
|
+
description: string | null;
|
|
2929
|
+
/**
|
|
2930
|
+
* False when the endpoint is disabled and receives no deliveries.
|
|
2931
|
+
*/
|
|
2932
|
+
isActive: boolean;
|
|
2933
|
+
/**
|
|
2934
|
+
* When the endpoint was disabled; null while active.
|
|
2935
|
+
*/
|
|
2936
|
+
disabledAt: Date | null;
|
|
2937
|
+
/**
|
|
2938
|
+
* Why the endpoint was disabled (for example `Disabled via API`); null while active.
|
|
2939
|
+
*/
|
|
2940
|
+
disabledReason: string | null;
|
|
2941
|
+
createdAt: Date;
|
|
2942
|
+
updatedAt: Date;
|
|
2943
|
+
/**
|
|
2944
|
+
* Plaintext signing secret (`whsec_…`) used to verify the Standard Webhooks `webhook-signature` header (and the legacy `X-Onflay-Signature`). Returned only on create; store it now.
|
|
2945
|
+
*/
|
|
2946
|
+
secret: string;
|
|
2947
|
+
};
|
|
2948
|
+
type CatalogListData = {
|
|
2949
|
+
body?: never;
|
|
2950
|
+
path?: never;
|
|
2951
|
+
query?: {
|
|
2952
|
+
/**
|
|
2953
|
+
* Page size, 1–100. Default 20.
|
|
2954
|
+
*/
|
|
2955
|
+
limit?: number;
|
|
2956
|
+
/**
|
|
2957
|
+
* `nextCursor` from the previous page.
|
|
2958
|
+
*/
|
|
2959
|
+
cursor?: string;
|
|
2960
|
+
};
|
|
2961
|
+
url: '/v1/catalog';
|
|
2962
|
+
};
|
|
2963
|
+
type CatalogListingsRetrieveIntegrationGuideData = {
|
|
2964
|
+
body?: never;
|
|
2965
|
+
path: {
|
|
2966
|
+
/**
|
|
2967
|
+
* The listing's catalog key.
|
|
2968
|
+
*/
|
|
2969
|
+
catalogKey: string;
|
|
2970
|
+
};
|
|
2971
|
+
query?: {
|
|
2972
|
+
/**
|
|
2973
|
+
* App builder to generate the guide for. Only `lovable` is supported; anything else returns 404.
|
|
2974
|
+
*/
|
|
2975
|
+
target?: IntegrationGuideTarget;
|
|
2976
|
+
};
|
|
2977
|
+
url: '/v1/catalog/listings/{catalogKey}/integration-guide';
|
|
2978
|
+
};
|
|
2979
|
+
type CatalogListingsRetrieveRecipeData = {
|
|
2980
|
+
body?: never;
|
|
2981
|
+
headers?: {
|
|
2982
|
+
/**
|
|
2983
|
+
* `ETag` from a previous response. When it still matches, the API returns 304 with no body.
|
|
2984
|
+
*/
|
|
2985
|
+
'if-none-match'?: string;
|
|
2986
|
+
};
|
|
2987
|
+
path: {
|
|
2988
|
+
/**
|
|
2989
|
+
* The listing's catalog key.
|
|
2990
|
+
*/
|
|
2991
|
+
catalogKey: string;
|
|
2992
|
+
};
|
|
2993
|
+
query?: never;
|
|
2994
|
+
url: '/v1/catalog/listings/{catalogKey}/recipe';
|
|
2995
|
+
};
|
|
2996
|
+
type CatalogProductsRetrieveData = {
|
|
2997
|
+
body?: never;
|
|
2998
|
+
headers?: {
|
|
2999
|
+
/**
|
|
3000
|
+
* `ETag` from a previous response. When it still matches, the API returns 304 with no body.
|
|
3001
|
+
*/
|
|
3002
|
+
'if-none-match'?: string;
|
|
3003
|
+
};
|
|
3004
|
+
path: {
|
|
3005
|
+
/**
|
|
3006
|
+
* The product's key, e.g. `acme-saas`.
|
|
3007
|
+
*/
|
|
3008
|
+
key: string;
|
|
3009
|
+
};
|
|
3010
|
+
query?: never;
|
|
3011
|
+
url: '/v1/catalog/products/{key}';
|
|
3012
|
+
};
|
|
3013
|
+
type CatalogProductsUpsertData = {
|
|
3014
|
+
body: UpsertCatalogProduct;
|
|
3015
|
+
path: {
|
|
3016
|
+
/**
|
|
3017
|
+
* Product key you choose, e.g. `acme-saas`: lowercase letters, digits, `-` and `_`.
|
|
3018
|
+
*/
|
|
3019
|
+
key: string;
|
|
3020
|
+
};
|
|
3021
|
+
query?: never;
|
|
3022
|
+
url: '/v1/catalog/products/{key}';
|
|
3023
|
+
};
|
|
3024
|
+
type CatalogPlansUpsertData = {
|
|
3025
|
+
body: UpsertCatalogPlan;
|
|
3026
|
+
path: {
|
|
3027
|
+
/**
|
|
3028
|
+
* Product key you choose, e.g. `acme-saas`: lowercase letters, digits, `-` and `_`.
|
|
3029
|
+
*/
|
|
3030
|
+
key: string;
|
|
3031
|
+
/**
|
|
3032
|
+
* Plan key you choose, e.g. `pro`: lowercase letters, digits, `-` and `_`.
|
|
3033
|
+
*/
|
|
3034
|
+
planKey: string;
|
|
3035
|
+
};
|
|
3036
|
+
query?: never;
|
|
3037
|
+
url: '/v1/catalog/products/{key}/plans/{planKey}';
|
|
3038
|
+
};
|
|
3039
|
+
type CheckoutSessionsCreateData = {
|
|
3040
|
+
body: CreateCheckout;
|
|
3041
|
+
headers?: {
|
|
3042
|
+
/**
|
|
3043
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3044
|
+
*/
|
|
3045
|
+
'Idempotency-Key'?: string;
|
|
3046
|
+
};
|
|
3047
|
+
path?: never;
|
|
3048
|
+
query?: never;
|
|
3049
|
+
url: '/v1/checkout-sessions';
|
|
3050
|
+
};
|
|
3051
|
+
type CheckoutSessionsRetrieveData = {
|
|
3052
|
+
body?: never;
|
|
3053
|
+
path: {
|
|
3054
|
+
/**
|
|
3055
|
+
* Checkout session id.
|
|
3056
|
+
*/
|
|
3057
|
+
id: string;
|
|
3058
|
+
};
|
|
3059
|
+
query?: never;
|
|
3060
|
+
url: '/v1/checkout-sessions/{id}';
|
|
3061
|
+
};
|
|
3062
|
+
type CheckoutSessionsRetrieveReceiptData = {
|
|
3063
|
+
body?: never;
|
|
3064
|
+
headers?: {
|
|
3065
|
+
/**
|
|
3066
|
+
* Session-bound return token from success redirect. Omit with ?headless=true for secret-key-only poll.
|
|
3067
|
+
*/
|
|
3068
|
+
'X-Onflay-Return-Token'?: string;
|
|
3069
|
+
};
|
|
3070
|
+
path: {
|
|
3071
|
+
/**
|
|
3072
|
+
* Checkout session id.
|
|
3073
|
+
*/
|
|
3074
|
+
id: string;
|
|
3075
|
+
};
|
|
3076
|
+
query?: {
|
|
3077
|
+
/**
|
|
3078
|
+
* `true` or `1` skips the return-token check (secret-key-only poll). Any other value requires the header.
|
|
3079
|
+
*/
|
|
3080
|
+
headless?: 'true' | 'false' | '1' | '0';
|
|
3081
|
+
};
|
|
3082
|
+
url: '/v1/checkout-sessions/{id}/receipt';
|
|
3083
|
+
};
|
|
3084
|
+
type CreditsAdjustData = {
|
|
3085
|
+
body: AdjustCredits;
|
|
3086
|
+
headers?: {
|
|
3087
|
+
/**
|
|
3088
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3089
|
+
*/
|
|
3090
|
+
'Idempotency-Key'?: string;
|
|
3091
|
+
};
|
|
3092
|
+
path?: never;
|
|
3093
|
+
query?: never;
|
|
3094
|
+
url: '/v1/credits/adjust';
|
|
3095
|
+
};
|
|
3096
|
+
type CreditsConsumeData = {
|
|
3097
|
+
body: ConsumeCredits;
|
|
3098
|
+
headers?: {
|
|
3099
|
+
/**
|
|
3100
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3101
|
+
*/
|
|
3102
|
+
'Idempotency-Key'?: string;
|
|
3103
|
+
};
|
|
3104
|
+
path?: never;
|
|
3105
|
+
query?: never;
|
|
3106
|
+
url: '/v1/credits/consume';
|
|
3107
|
+
};
|
|
3108
|
+
type CreditsRetrieveData = {
|
|
3109
|
+
body?: never;
|
|
3110
|
+
path: {
|
|
3111
|
+
/**
|
|
3112
|
+
* Your app's id for the customer (the `externalCustomerId` sent to checkout).
|
|
3113
|
+
*/
|
|
3114
|
+
externalCustomerId: string;
|
|
3115
|
+
};
|
|
3116
|
+
query?: never;
|
|
3117
|
+
url: '/v1/credits/{externalCustomerId}';
|
|
3118
|
+
};
|
|
3119
|
+
type CreditsListLedgerData = {
|
|
3120
|
+
body?: never;
|
|
3121
|
+
path: {
|
|
3122
|
+
/**
|
|
3123
|
+
* Your app's id for the customer (the `externalCustomerId` sent to checkout).
|
|
3124
|
+
*/
|
|
3125
|
+
externalCustomerId: string;
|
|
3126
|
+
};
|
|
3127
|
+
query?: {
|
|
3128
|
+
/**
|
|
3129
|
+
* Page size.
|
|
3130
|
+
*/
|
|
3131
|
+
limit?: number;
|
|
3132
|
+
/**
|
|
3133
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3134
|
+
*/
|
|
3135
|
+
cursor?: string;
|
|
3136
|
+
/**
|
|
3137
|
+
* Only entries of this credit key.
|
|
3138
|
+
*/
|
|
3139
|
+
key?: string;
|
|
3140
|
+
};
|
|
3141
|
+
url: '/v1/credits/{externalCustomerId}/ledger';
|
|
3142
|
+
};
|
|
3143
|
+
type CustomerAccessRetrieveData = {
|
|
3144
|
+
body?: never;
|
|
3145
|
+
headers?: {
|
|
3146
|
+
/**
|
|
3147
|
+
* `ETag` from a previous response. When it still matches, the API returns 304 with no body.
|
|
3148
|
+
*/
|
|
3149
|
+
'if-none-match'?: string;
|
|
3150
|
+
};
|
|
3151
|
+
path: {
|
|
3152
|
+
/**
|
|
3153
|
+
* Your app's id for the customer (the `externalCustomerId` sent to checkout).
|
|
3154
|
+
*/
|
|
3155
|
+
externalCustomerId: string;
|
|
3156
|
+
};
|
|
3157
|
+
query?: {
|
|
3158
|
+
/**
|
|
3159
|
+
* When `true` (or `1`), the response includes `accessToken`, a 5-minute RS256 JWT.
|
|
3160
|
+
*/
|
|
3161
|
+
includeToken?: boolean;
|
|
3162
|
+
};
|
|
3163
|
+
url: '/v1/customer-access/{externalCustomerId}';
|
|
3164
|
+
};
|
|
3165
|
+
type CustomerPortalSessionsCreateData = {
|
|
3166
|
+
body: CreateCustomerPortalSession;
|
|
3167
|
+
headers?: {
|
|
3168
|
+
/**
|
|
3169
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3170
|
+
*/
|
|
3171
|
+
'Idempotency-Key'?: string;
|
|
3172
|
+
};
|
|
3173
|
+
path?: never;
|
|
3174
|
+
query?: never;
|
|
3175
|
+
url: '/v1/customer-portal/sessions';
|
|
3176
|
+
};
|
|
3177
|
+
type CustomersListData = {
|
|
3178
|
+
body?: never;
|
|
3179
|
+
path?: never;
|
|
3180
|
+
query?: {
|
|
3181
|
+
/**
|
|
3182
|
+
* Page size.
|
|
3183
|
+
*/
|
|
3184
|
+
limit?: number;
|
|
3185
|
+
/**
|
|
3186
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3187
|
+
*/
|
|
3188
|
+
cursor?: string;
|
|
3189
|
+
/**
|
|
3190
|
+
* Case-insensitive substring of the customer email or name.
|
|
3191
|
+
*/
|
|
3192
|
+
search?: string;
|
|
3193
|
+
/**
|
|
3194
|
+
* Only the customer with this app-side id (the checkout `externalCustomerId`).
|
|
3195
|
+
*/
|
|
3196
|
+
externalCustomerId?: string;
|
|
3197
|
+
};
|
|
3198
|
+
url: '/v1/customers';
|
|
3199
|
+
};
|
|
3200
|
+
type CustomersCreateData = {
|
|
3201
|
+
body: CreateCustomer;
|
|
3202
|
+
headers?: {
|
|
3203
|
+
/**
|
|
3204
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3205
|
+
*/
|
|
3206
|
+
'Idempotency-Key'?: string;
|
|
3207
|
+
};
|
|
3208
|
+
path?: never;
|
|
3209
|
+
query?: never;
|
|
3210
|
+
url: '/v1/customers';
|
|
3211
|
+
};
|
|
3212
|
+
type CustomersRetrieveData = {
|
|
3213
|
+
body?: never;
|
|
3214
|
+
path: {
|
|
3215
|
+
/**
|
|
3216
|
+
* Customer id.
|
|
3217
|
+
*/
|
|
3218
|
+
id: string;
|
|
3219
|
+
};
|
|
3220
|
+
query?: never;
|
|
3221
|
+
url: '/v1/customers/{id}';
|
|
3222
|
+
};
|
|
3223
|
+
type CustomersUpdateData = {
|
|
3224
|
+
body: UpdateCustomer;
|
|
3225
|
+
path: {
|
|
3226
|
+
/**
|
|
3227
|
+
* Customer id.
|
|
3228
|
+
*/
|
|
3229
|
+
id: string;
|
|
3230
|
+
};
|
|
3231
|
+
query?: never;
|
|
3232
|
+
url: '/v1/customers/{id}';
|
|
3233
|
+
};
|
|
3234
|
+
type CustomersListPaymentMethodsData = {
|
|
3235
|
+
body?: never;
|
|
3236
|
+
path: {
|
|
3237
|
+
/**
|
|
3238
|
+
* Customer id.
|
|
3239
|
+
*/
|
|
3240
|
+
id: string;
|
|
3241
|
+
};
|
|
3242
|
+
query?: never;
|
|
3243
|
+
url: '/v1/customers/{id}/payment-methods';
|
|
3244
|
+
};
|
|
3245
|
+
type CustomersListPaymentMethodsResponses = {
|
|
3246
|
+
/**
|
|
3247
|
+
* OK
|
|
3248
|
+
*/
|
|
3249
|
+
200: {
|
|
3250
|
+
object: 'list';
|
|
3251
|
+
data: Array<PaymentMethod>;
|
|
3252
|
+
/**
|
|
3253
|
+
* True when another page exists.
|
|
3254
|
+
*/
|
|
3255
|
+
hasMore: boolean;
|
|
3256
|
+
/**
|
|
3257
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
3258
|
+
*/
|
|
3259
|
+
nextCursor: string | null;
|
|
3260
|
+
};
|
|
3261
|
+
};
|
|
3262
|
+
type CustomersListPaymentMethodsResponse = CustomersListPaymentMethodsResponses[keyof CustomersListPaymentMethodsResponses];
|
|
3263
|
+
type CustomersCreateSetupIntentData = {
|
|
3264
|
+
body?: CreateSetupIntentParams;
|
|
3265
|
+
headers?: {
|
|
3266
|
+
/**
|
|
3267
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3268
|
+
*/
|
|
3269
|
+
'Idempotency-Key'?: string;
|
|
3270
|
+
};
|
|
3271
|
+
path: {
|
|
3272
|
+
/**
|
|
3273
|
+
* Customer id.
|
|
3274
|
+
*/
|
|
3275
|
+
id: string;
|
|
3276
|
+
};
|
|
3277
|
+
query?: never;
|
|
3278
|
+
url: '/v1/customers/{id}/setup-intent';
|
|
3279
|
+
};
|
|
3280
|
+
type DiscountsListData = {
|
|
3281
|
+
body?: never;
|
|
3282
|
+
path?: never;
|
|
3283
|
+
query?: {
|
|
3284
|
+
/**
|
|
3285
|
+
* Page size.
|
|
3286
|
+
*/
|
|
3287
|
+
limit?: number;
|
|
3288
|
+
/**
|
|
3289
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3290
|
+
*/
|
|
3291
|
+
cursor?: string;
|
|
3292
|
+
/**
|
|
3293
|
+
* true returns active discounts, false inactive ones. Omit for all.
|
|
3294
|
+
*/
|
|
3295
|
+
active?: boolean;
|
|
3296
|
+
/**
|
|
3297
|
+
* Only discounts of this type.
|
|
3298
|
+
*/
|
|
3299
|
+
type?: DiscountTypeFilter;
|
|
3300
|
+
/**
|
|
3301
|
+
* Only the discount with this code (any case).
|
|
3302
|
+
*/
|
|
3303
|
+
code?: string;
|
|
3304
|
+
};
|
|
3305
|
+
url: '/v1/discounts';
|
|
3306
|
+
};
|
|
3307
|
+
type DiscountsCreateData = {
|
|
3308
|
+
body: CreateDiscount;
|
|
3309
|
+
headers?: {
|
|
3310
|
+
/**
|
|
3311
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3312
|
+
*/
|
|
3313
|
+
'Idempotency-Key'?: string;
|
|
3314
|
+
};
|
|
3315
|
+
path?: never;
|
|
3316
|
+
query?: never;
|
|
3317
|
+
url: '/v1/discounts';
|
|
3318
|
+
};
|
|
3319
|
+
type DiscountsRetrieveData = {
|
|
3320
|
+
body?: never;
|
|
3321
|
+
path: {
|
|
3322
|
+
/**
|
|
3323
|
+
* Discount id (from `POST /v1/discounts` or `GET /v1/discounts`).
|
|
3324
|
+
*/
|
|
3325
|
+
id: string;
|
|
3326
|
+
};
|
|
3327
|
+
query?: never;
|
|
3328
|
+
url: '/v1/discounts/{id}';
|
|
3329
|
+
};
|
|
3330
|
+
type DiscountsUpdateData = {
|
|
3331
|
+
body: UpdateDiscount;
|
|
3332
|
+
headers?: {
|
|
3333
|
+
/**
|
|
3334
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3335
|
+
*/
|
|
3336
|
+
'Idempotency-Key'?: string;
|
|
3337
|
+
};
|
|
3338
|
+
path: {
|
|
3339
|
+
/**
|
|
3340
|
+
* Discount id (from `POST /v1/discounts` or `GET /v1/discounts`).
|
|
3341
|
+
*/
|
|
3342
|
+
id: string;
|
|
3343
|
+
};
|
|
3344
|
+
query?: never;
|
|
3345
|
+
url: '/v1/discounts/{id}';
|
|
3346
|
+
};
|
|
3347
|
+
type DiscountsDeactivateData = {
|
|
3348
|
+
body?: never;
|
|
3349
|
+
headers?: {
|
|
3350
|
+
/**
|
|
3351
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3352
|
+
*/
|
|
3353
|
+
'Idempotency-Key'?: string;
|
|
3354
|
+
};
|
|
3355
|
+
path: {
|
|
3356
|
+
/**
|
|
3357
|
+
* Discount id (from `POST /v1/discounts` or `GET /v1/discounts`).
|
|
3358
|
+
*/
|
|
3359
|
+
id: string;
|
|
3360
|
+
};
|
|
3361
|
+
query?: never;
|
|
3362
|
+
url: '/v1/discounts/{id}/deactivate';
|
|
3363
|
+
};
|
|
3364
|
+
type IntegrationVerificationsListForListingData = {
|
|
3365
|
+
body?: never;
|
|
3366
|
+
path: {
|
|
3367
|
+
/**
|
|
3368
|
+
* Listing (product) id.
|
|
3369
|
+
*/
|
|
3370
|
+
listingId: string;
|
|
3371
|
+
};
|
|
3372
|
+
query?: {
|
|
3373
|
+
/**
|
|
3374
|
+
* Page size.
|
|
3375
|
+
*/
|
|
3376
|
+
limit?: number;
|
|
3377
|
+
/**
|
|
3378
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3379
|
+
*/
|
|
3380
|
+
cursor?: string;
|
|
3381
|
+
};
|
|
3382
|
+
url: '/v1/integration-verifications/listings/{listingId}';
|
|
3383
|
+
};
|
|
3384
|
+
type InvoicesListData = {
|
|
3385
|
+
body?: never;
|
|
3386
|
+
path?: never;
|
|
3387
|
+
query?: {
|
|
3388
|
+
/**
|
|
3389
|
+
* Page size.
|
|
3390
|
+
*/
|
|
3391
|
+
limit?: number;
|
|
3392
|
+
/**
|
|
3393
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3394
|
+
*/
|
|
3395
|
+
cursor?: string;
|
|
3396
|
+
/**
|
|
3397
|
+
* Only invoices for this Onflay customer id.
|
|
3398
|
+
*/
|
|
3399
|
+
customerId?: string;
|
|
3400
|
+
};
|
|
3401
|
+
url: '/v1/invoices';
|
|
3402
|
+
};
|
|
3403
|
+
type InvoicesCreateData = {
|
|
3404
|
+
body: CreateBillingInvoice;
|
|
3405
|
+
headers?: {
|
|
3406
|
+
/**
|
|
3407
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3408
|
+
*/
|
|
3409
|
+
'Idempotency-Key'?: string;
|
|
3410
|
+
};
|
|
3411
|
+
path?: never;
|
|
3412
|
+
query?: never;
|
|
3413
|
+
url: '/v1/invoices';
|
|
3414
|
+
};
|
|
3415
|
+
type InvoicesRetrieveData = {
|
|
3416
|
+
body?: never;
|
|
3417
|
+
path: {
|
|
3418
|
+
/**
|
|
3419
|
+
* Onflay invoice id.
|
|
3420
|
+
*/
|
|
3421
|
+
id: string;
|
|
3422
|
+
};
|
|
3423
|
+
query?: never;
|
|
3424
|
+
url: '/v1/invoices/{id}';
|
|
3425
|
+
};
|
|
3426
|
+
type LicenseKeysListData = {
|
|
3427
|
+
body?: never;
|
|
3428
|
+
path?: never;
|
|
3429
|
+
query?: {
|
|
3430
|
+
/**
|
|
3431
|
+
* Page size.
|
|
3432
|
+
*/
|
|
3433
|
+
limit?: number;
|
|
3434
|
+
/**
|
|
3435
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3436
|
+
*/
|
|
3437
|
+
cursor?: string;
|
|
3438
|
+
/**
|
|
3439
|
+
* Only keys of this customer (your app's id for them).
|
|
3440
|
+
*/
|
|
3441
|
+
externalCustomerId?: string;
|
|
3442
|
+
};
|
|
3443
|
+
url: '/v1/license-keys';
|
|
3444
|
+
};
|
|
3445
|
+
type LicenseKeysRetrieveData = {
|
|
3446
|
+
body?: never;
|
|
3447
|
+
path: {
|
|
3448
|
+
/**
|
|
3449
|
+
* License key id (from customer access `licenseKeys[].id`).
|
|
3450
|
+
*/
|
|
3451
|
+
id: string;
|
|
3452
|
+
};
|
|
3453
|
+
query?: never;
|
|
3454
|
+
url: '/v1/license-keys/{id}';
|
|
3455
|
+
};
|
|
3456
|
+
type LicenseKeysRevokeData = {
|
|
3457
|
+
body?: never;
|
|
3458
|
+
headers?: {
|
|
3459
|
+
/**
|
|
3460
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3461
|
+
*/
|
|
3462
|
+
'Idempotency-Key'?: string;
|
|
3463
|
+
};
|
|
3464
|
+
path: {
|
|
3465
|
+
/**
|
|
3466
|
+
* License key id (from customer access `licenseKeys[].id`).
|
|
3467
|
+
*/
|
|
3468
|
+
id: string;
|
|
3469
|
+
};
|
|
3470
|
+
query?: never;
|
|
3471
|
+
url: '/v1/license-keys/{id}/revoke';
|
|
3472
|
+
};
|
|
3473
|
+
type MetersListResponses = {
|
|
3474
|
+
/**
|
|
3475
|
+
* OK
|
|
3476
|
+
*/
|
|
3477
|
+
200: {
|
|
3478
|
+
object: 'list';
|
|
3479
|
+
data: Array<Meter>;
|
|
3480
|
+
/**
|
|
3481
|
+
* True when another page exists.
|
|
3482
|
+
*/
|
|
3483
|
+
hasMore: boolean;
|
|
3484
|
+
/**
|
|
3485
|
+
* Pass as `cursor` to fetch the next page; null on the last page.
|
|
3486
|
+
*/
|
|
3487
|
+
nextCursor: string | null;
|
|
3488
|
+
};
|
|
3489
|
+
};
|
|
3490
|
+
type MetersListResponse = MetersListResponses[keyof MetersListResponses];
|
|
3491
|
+
type MetersCreateData = {
|
|
3492
|
+
body: CreateMeter;
|
|
3493
|
+
headers?: {
|
|
3494
|
+
/**
|
|
3495
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3496
|
+
*/
|
|
3497
|
+
'Idempotency-Key'?: string;
|
|
3498
|
+
};
|
|
3499
|
+
path?: never;
|
|
3500
|
+
query?: never;
|
|
3501
|
+
url: '/v1/meters';
|
|
3502
|
+
};
|
|
3503
|
+
type PaymentConfirmationsRetrieveData = {
|
|
3504
|
+
body?: never;
|
|
3505
|
+
path: {
|
|
3506
|
+
/**
|
|
3507
|
+
* Confirmation token from `confirmUrl`.
|
|
3508
|
+
*/
|
|
3509
|
+
token: string;
|
|
3510
|
+
};
|
|
3511
|
+
query?: never;
|
|
3512
|
+
url: '/v1/payment-confirmations/{token}';
|
|
3513
|
+
};
|
|
3514
|
+
type PaymentsListData = {
|
|
3515
|
+
body?: never;
|
|
3516
|
+
path?: never;
|
|
3517
|
+
query?: {
|
|
3518
|
+
/**
|
|
3519
|
+
* Page size.
|
|
3520
|
+
*/
|
|
3521
|
+
limit?: number;
|
|
3522
|
+
/**
|
|
3523
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3524
|
+
*/
|
|
3525
|
+
cursor?: string;
|
|
3526
|
+
/**
|
|
3527
|
+
* Only payments with this status (case-insensitive). Payments in `requires_action` are listed under `pending`.
|
|
3528
|
+
*/
|
|
3529
|
+
status?: PaymentStatusFilter;
|
|
3530
|
+
/**
|
|
3531
|
+
* Only payments for this product (listing) id.
|
|
3532
|
+
*/
|
|
3533
|
+
listingId?: string;
|
|
3534
|
+
/**
|
|
3535
|
+
* Only payments for products of this type (case-insensitive).
|
|
3536
|
+
*/
|
|
3537
|
+
listingType?: ProductTypeFilter;
|
|
3538
|
+
/**
|
|
3539
|
+
* Only payments created in this rolling window, or between `startDate` and `endDate` with `custom`.
|
|
3540
|
+
*/
|
|
3541
|
+
period?: PaymentPeriodFilter;
|
|
3542
|
+
/**
|
|
3543
|
+
* Inclusive start date (YYYY-MM-DD) when `period` is `custom`.
|
|
3544
|
+
*/
|
|
3545
|
+
startDate?: string;
|
|
3546
|
+
/**
|
|
3547
|
+
* Inclusive end date (YYYY-MM-DD) when `period` is `custom`.
|
|
3548
|
+
*/
|
|
3549
|
+
endDate?: string;
|
|
3550
|
+
/**
|
|
3551
|
+
* Payment id, or a case-insensitive substring of the customer email or name.
|
|
3552
|
+
*/
|
|
3553
|
+
search?: string;
|
|
3554
|
+
};
|
|
3555
|
+
url: '/v1/payments';
|
|
3556
|
+
};
|
|
3557
|
+
type PaymentsCreateData = {
|
|
3558
|
+
body: CreatePayment;
|
|
3559
|
+
headers: {
|
|
3560
|
+
/**
|
|
3561
|
+
* Required. Unique key (kept 48h) that makes retries safe: the same key and body returns the first response instead of running the request again.
|
|
3562
|
+
*/
|
|
3563
|
+
'Idempotency-Key': string;
|
|
3564
|
+
};
|
|
3565
|
+
path?: never;
|
|
3566
|
+
query?: never;
|
|
3567
|
+
url: '/v1/payments';
|
|
3568
|
+
};
|
|
3569
|
+
type PaymentsRetrieveData = {
|
|
3570
|
+
body?: never;
|
|
3571
|
+
path: {
|
|
3572
|
+
/**
|
|
3573
|
+
* Payment (transaction) id.
|
|
3574
|
+
*/
|
|
3575
|
+
id: string;
|
|
3576
|
+
};
|
|
3577
|
+
query?: never;
|
|
3578
|
+
url: '/v1/payments/{id}';
|
|
3579
|
+
};
|
|
3580
|
+
type PaymentsRefundsListData = {
|
|
3581
|
+
body?: never;
|
|
3582
|
+
path: {
|
|
3583
|
+
/**
|
|
3584
|
+
* Payment id (from `GET /v1/payments` or customer access `ownedProducts[].paymentId`).
|
|
3585
|
+
*/
|
|
3586
|
+
id: string;
|
|
3587
|
+
};
|
|
3588
|
+
query?: {
|
|
3589
|
+
/**
|
|
3590
|
+
* Page size.
|
|
3591
|
+
*/
|
|
3592
|
+
limit?: number;
|
|
3593
|
+
/**
|
|
3594
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3595
|
+
*/
|
|
3596
|
+
cursor?: string;
|
|
3597
|
+
};
|
|
3598
|
+
url: '/v1/payments/{id}/refunds';
|
|
3599
|
+
};
|
|
3600
|
+
type PaymentsRefundsCreateData = {
|
|
3601
|
+
body?: CreateRefund;
|
|
3602
|
+
headers: {
|
|
3603
|
+
/**
|
|
3604
|
+
* Required. Unique key (kept 48h) that makes retries safe: the same key and body returns the first response instead of running the request again.
|
|
3605
|
+
*/
|
|
3606
|
+
'Idempotency-Key': string;
|
|
3607
|
+
};
|
|
3608
|
+
path: {
|
|
3609
|
+
/**
|
|
3610
|
+
* Payment id (from `GET /v1/payments` or customer access `ownedProducts[].paymentId`).
|
|
3611
|
+
*/
|
|
3612
|
+
id: string;
|
|
3613
|
+
};
|
|
3614
|
+
query?: never;
|
|
3615
|
+
url: '/v1/payments/{id}/refunds';
|
|
3616
|
+
};
|
|
3617
|
+
type PaymentsRefundsRetrieveData = {
|
|
3618
|
+
body?: never;
|
|
3619
|
+
path: {
|
|
3620
|
+
/**
|
|
3621
|
+
* Payment id (from `GET /v1/payments` or customer access `ownedProducts[].paymentId`).
|
|
3622
|
+
*/
|
|
3623
|
+
id: string;
|
|
3624
|
+
/**
|
|
3625
|
+
* Refund id.
|
|
3626
|
+
*/
|
|
3627
|
+
refundId: string;
|
|
3628
|
+
};
|
|
3629
|
+
query?: never;
|
|
3630
|
+
url: '/v1/payments/{id}/refunds/{refundId}';
|
|
3631
|
+
};
|
|
3632
|
+
type PricesListData = {
|
|
3633
|
+
body?: never;
|
|
3634
|
+
path?: never;
|
|
3635
|
+
query?: {
|
|
3636
|
+
/**
|
|
3637
|
+
* Page size.
|
|
3638
|
+
*/
|
|
3639
|
+
limit?: number;
|
|
3640
|
+
/**
|
|
3641
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3642
|
+
*/
|
|
3643
|
+
cursor?: string;
|
|
3644
|
+
/**
|
|
3645
|
+
* Only prices of this product id. Unknown or foreign ids answer 404.
|
|
3646
|
+
*/
|
|
3647
|
+
productId?: string;
|
|
3648
|
+
/**
|
|
3649
|
+
* true returns prices of published products; false returns the others. Omit for all.
|
|
3650
|
+
*/
|
|
3651
|
+
active?: boolean;
|
|
3652
|
+
};
|
|
3653
|
+
url: '/v1/prices';
|
|
3654
|
+
};
|
|
3655
|
+
type PricesCreateData = {
|
|
3656
|
+
body: CreatePrice;
|
|
3657
|
+
headers?: {
|
|
3658
|
+
/**
|
|
3659
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3660
|
+
*/
|
|
3661
|
+
'Idempotency-Key'?: string;
|
|
3662
|
+
};
|
|
3663
|
+
path?: never;
|
|
3664
|
+
query?: never;
|
|
3665
|
+
url: '/v1/prices';
|
|
3666
|
+
};
|
|
3667
|
+
type PricesRetrieveData = {
|
|
3668
|
+
body?: never;
|
|
3669
|
+
path: {
|
|
3670
|
+
/**
|
|
3671
|
+
* Price id: a persisted price id, `<productId>` or `<productId>:<variantId>`
|
|
3672
|
+
*/
|
|
3673
|
+
id: string;
|
|
3674
|
+
};
|
|
3675
|
+
query?: never;
|
|
3676
|
+
url: '/v1/prices/{id}';
|
|
3677
|
+
};
|
|
3678
|
+
type PricesUpdateData = {
|
|
3679
|
+
body: UpdatePrice;
|
|
3680
|
+
headers?: {
|
|
3681
|
+
/**
|
|
3682
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3683
|
+
*/
|
|
3684
|
+
'Idempotency-Key'?: string;
|
|
3685
|
+
};
|
|
3686
|
+
path: {
|
|
3687
|
+
/**
|
|
3688
|
+
* Price id: a persisted price id, `<productId>` or `<productId>:<variantId>`
|
|
3689
|
+
*/
|
|
3690
|
+
id: string;
|
|
3691
|
+
};
|
|
3692
|
+
query?: never;
|
|
3693
|
+
url: '/v1/prices/{id}';
|
|
3694
|
+
};
|
|
3695
|
+
type ProductsListData = {
|
|
3696
|
+
body?: never;
|
|
3697
|
+
path?: never;
|
|
3698
|
+
query?: {
|
|
3699
|
+
/**
|
|
3700
|
+
* Page size.
|
|
3701
|
+
*/
|
|
3702
|
+
limit?: number;
|
|
3703
|
+
/**
|
|
3704
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3705
|
+
*/
|
|
3706
|
+
cursor?: string;
|
|
3707
|
+
/**
|
|
3708
|
+
* true returns published products; false returns paused products (drafts are excluded). Omit for all.
|
|
3709
|
+
*/
|
|
3710
|
+
active?: boolean;
|
|
3711
|
+
};
|
|
3712
|
+
url: '/v1/products';
|
|
3713
|
+
};
|
|
3714
|
+
type ProductsCreateData = {
|
|
3715
|
+
body: CreateProduct;
|
|
3716
|
+
headers?: {
|
|
3717
|
+
/**
|
|
3718
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3719
|
+
*/
|
|
3720
|
+
'Idempotency-Key'?: string;
|
|
3721
|
+
};
|
|
3722
|
+
path?: never;
|
|
3723
|
+
query?: never;
|
|
3724
|
+
url: '/v1/products';
|
|
3725
|
+
};
|
|
3726
|
+
type ProductsRetrieveData = {
|
|
3727
|
+
body?: never;
|
|
3728
|
+
path: {
|
|
3729
|
+
/**
|
|
3730
|
+
* Product id
|
|
3731
|
+
*/
|
|
3732
|
+
id: string;
|
|
3733
|
+
};
|
|
3734
|
+
query?: never;
|
|
3735
|
+
url: '/v1/products/{id}';
|
|
3736
|
+
};
|
|
3737
|
+
type ProductsUpdateData = {
|
|
3738
|
+
body: UpdateProduct;
|
|
3739
|
+
headers?: {
|
|
3740
|
+
/**
|
|
3741
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3742
|
+
*/
|
|
3743
|
+
'Idempotency-Key'?: string;
|
|
3744
|
+
};
|
|
3745
|
+
path: {
|
|
3746
|
+
/**
|
|
3747
|
+
* Product id
|
|
3748
|
+
*/
|
|
3749
|
+
id: string;
|
|
3750
|
+
};
|
|
3751
|
+
query?: never;
|
|
3752
|
+
url: '/v1/products/{id}';
|
|
3753
|
+
};
|
|
3754
|
+
type SetupSessionsRetrieveData = {
|
|
3755
|
+
body?: never;
|
|
3756
|
+
path: {
|
|
3757
|
+
/**
|
|
3758
|
+
* Setup session token.
|
|
3759
|
+
*/
|
|
3760
|
+
token: string;
|
|
3761
|
+
};
|
|
3762
|
+
query?: never;
|
|
3763
|
+
url: '/v1/setup-sessions/{token}';
|
|
3764
|
+
};
|
|
3765
|
+
type SubscriptionsListData = {
|
|
3766
|
+
body?: never;
|
|
3767
|
+
path?: never;
|
|
3768
|
+
query?: {
|
|
3769
|
+
/**
|
|
3770
|
+
* Page size.
|
|
3771
|
+
*/
|
|
3772
|
+
limit?: number;
|
|
3773
|
+
/**
|
|
3774
|
+
* Opaque `nextCursor` from the previous page. Omit for the first page. A malformed cursor answers 400 `invalid_cursor`.
|
|
3775
|
+
*/
|
|
3776
|
+
cursor?: string;
|
|
3777
|
+
/**
|
|
3778
|
+
* Only subscriptions with this status (case-insensitive).
|
|
3779
|
+
*/
|
|
3780
|
+
status?: SubscriptionStatusFilter;
|
|
3781
|
+
/**
|
|
3782
|
+
* Only subscriptions of the customer with this app-side id (the checkout `externalCustomerId`).
|
|
3783
|
+
*/
|
|
3784
|
+
externalCustomerId?: string;
|
|
3785
|
+
};
|
|
3786
|
+
url: '/v1/subscriptions';
|
|
3787
|
+
};
|
|
3788
|
+
type SubscriptionsCancelByExternalCustomerData = {
|
|
3789
|
+
body: CancelByExternalCustomer;
|
|
3790
|
+
headers?: {
|
|
3791
|
+
/**
|
|
3792
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3793
|
+
*/
|
|
3794
|
+
'Idempotency-Key'?: string;
|
|
3795
|
+
};
|
|
3796
|
+
path?: never;
|
|
3797
|
+
query?: never;
|
|
3798
|
+
url: '/v1/subscriptions/cancel';
|
|
3799
|
+
};
|
|
3800
|
+
type SubscriptionsUncancelByExternalCustomerData = {
|
|
3801
|
+
body: UncancelByExternalCustomer;
|
|
3802
|
+
headers?: {
|
|
3803
|
+
/**
|
|
3804
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3805
|
+
*/
|
|
3806
|
+
'Idempotency-Key'?: string;
|
|
3807
|
+
};
|
|
3808
|
+
path?: never;
|
|
3809
|
+
query?: never;
|
|
3810
|
+
url: '/v1/subscriptions/uncancel';
|
|
3811
|
+
};
|
|
3812
|
+
type SubscriptionsRetrieveData = {
|
|
3813
|
+
body?: never;
|
|
3814
|
+
path: {
|
|
3815
|
+
/**
|
|
3816
|
+
* Onflay subscription id (from customer-access `activePlans[].subscriptionId`), not a Stripe `sub_` id.
|
|
3817
|
+
*/
|
|
3818
|
+
id: string;
|
|
3819
|
+
};
|
|
3820
|
+
query?: never;
|
|
3821
|
+
url: '/v1/subscriptions/{id}';
|
|
3822
|
+
};
|
|
3823
|
+
type SubscriptionsUpdateData = {
|
|
3824
|
+
body: UpdateSubscription;
|
|
3825
|
+
headers?: {
|
|
3826
|
+
/**
|
|
3827
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3828
|
+
*/
|
|
3829
|
+
'Idempotency-Key'?: string;
|
|
3830
|
+
};
|
|
3831
|
+
path: {
|
|
3832
|
+
/**
|
|
3833
|
+
* Onflay subscription id (from customer-access `activePlans[].subscriptionId`), not a Stripe `sub_` id.
|
|
3834
|
+
*/
|
|
3835
|
+
id: string;
|
|
3836
|
+
};
|
|
3837
|
+
query?: never;
|
|
3838
|
+
url: '/v1/subscriptions/{id}';
|
|
3839
|
+
};
|
|
3840
|
+
type SubscriptionsUpdateResponses = {
|
|
3841
|
+
/**
|
|
3842
|
+
* A `SubscriptionCancellation` for cancel intents, otherwise the updated `Subscription`.
|
|
3843
|
+
*/
|
|
3844
|
+
200: SubscriptionCancellation | Subscription;
|
|
3845
|
+
};
|
|
3846
|
+
type SubscriptionsUpdateResponse = SubscriptionsUpdateResponses[keyof SubscriptionsUpdateResponses];
|
|
3847
|
+
type SubscriptionsCancelData = {
|
|
3848
|
+
body?: CancelSubscription;
|
|
3849
|
+
headers?: {
|
|
3850
|
+
/**
|
|
3851
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3852
|
+
*/
|
|
3853
|
+
'Idempotency-Key'?: string;
|
|
3854
|
+
};
|
|
3855
|
+
path: {
|
|
3856
|
+
/**
|
|
3857
|
+
* Onflay subscription id (from customer-access `activePlans[].subscriptionId`), not a Stripe `sub_` id.
|
|
3858
|
+
*/
|
|
3859
|
+
id: string;
|
|
3860
|
+
};
|
|
3861
|
+
query?: never;
|
|
3862
|
+
url: '/v1/subscriptions/{id}/cancel';
|
|
3863
|
+
};
|
|
3864
|
+
type SubscriptionsPreviewUpdateData = {
|
|
3865
|
+
body: PreviewSubscriptionUpdate;
|
|
3866
|
+
path: {
|
|
3867
|
+
/**
|
|
3868
|
+
* Onflay subscription id (from customer-access `activePlans[].subscriptionId`), not a Stripe `sub_` id.
|
|
3869
|
+
*/
|
|
3870
|
+
id: string;
|
|
3871
|
+
};
|
|
3872
|
+
query?: never;
|
|
3873
|
+
url: '/v1/subscriptions/{id}/preview';
|
|
3874
|
+
};
|
|
3875
|
+
type UsageBillingPlansCreateData = {
|
|
3876
|
+
body: CreateBillingPlan;
|
|
3877
|
+
headers?: {
|
|
3878
|
+
/**
|
|
3879
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3880
|
+
*/
|
|
3881
|
+
'Idempotency-Key'?: string;
|
|
3882
|
+
};
|
|
3883
|
+
path?: never;
|
|
3884
|
+
query?: never;
|
|
3885
|
+
url: '/v1/usage/billing-plans';
|
|
3886
|
+
};
|
|
3887
|
+
type UsageBillingPlansRetrieveData = {
|
|
3888
|
+
body?: never;
|
|
3889
|
+
path: {
|
|
3890
|
+
/**
|
|
3891
|
+
* Onflay subscription id.
|
|
3892
|
+
*/
|
|
3893
|
+
subscriptionId: string;
|
|
3894
|
+
};
|
|
3895
|
+
query?: never;
|
|
3896
|
+
url: '/v1/usage/billing-plans/{subscriptionId}';
|
|
3897
|
+
};
|
|
3898
|
+
type WebhookDeliveriesListData = {
|
|
3899
|
+
body?: never;
|
|
3900
|
+
path?: never;
|
|
3901
|
+
query?: {
|
|
3902
|
+
/**
|
|
3903
|
+
* Only deliveries for this webhook endpoint id.
|
|
3904
|
+
*/
|
|
3905
|
+
endpointId?: string;
|
|
3906
|
+
/**
|
|
3907
|
+
* Only deliveries with this status (case-insensitive).
|
|
3908
|
+
*/
|
|
3909
|
+
status?: WebhookDeliveryStatusFilter;
|
|
3910
|
+
/**
|
|
3911
|
+
* `nextCursor` from the previous page.
|
|
3912
|
+
*/
|
|
3913
|
+
cursor?: string;
|
|
3914
|
+
/**
|
|
3915
|
+
* Page size.
|
|
3916
|
+
*/
|
|
3917
|
+
limit?: number;
|
|
3918
|
+
};
|
|
3919
|
+
url: '/v1/webhook-deliveries';
|
|
3920
|
+
};
|
|
3921
|
+
type WebhookDeliveriesRetrieveData = {
|
|
3922
|
+
body?: never;
|
|
3923
|
+
path: {
|
|
3924
|
+
/**
|
|
3925
|
+
* Webhook delivery id.
|
|
3926
|
+
*/
|
|
3927
|
+
id: string;
|
|
3928
|
+
};
|
|
3929
|
+
query?: never;
|
|
3930
|
+
url: '/v1/webhook-deliveries/{id}';
|
|
3931
|
+
};
|
|
3932
|
+
type WebhookDeliveriesResendData = {
|
|
3933
|
+
body?: never;
|
|
3934
|
+
path: {
|
|
3935
|
+
/**
|
|
3936
|
+
* Webhook delivery id.
|
|
3937
|
+
*/
|
|
3938
|
+
id: string;
|
|
3939
|
+
};
|
|
3940
|
+
query?: never;
|
|
3941
|
+
url: '/v1/webhook-deliveries/{id}/resend';
|
|
3942
|
+
};
|
|
3943
|
+
type WebhookEndpointsCreateData = {
|
|
3944
|
+
body: CreateWebhookEndpoint;
|
|
3945
|
+
headers?: {
|
|
3946
|
+
/**
|
|
3947
|
+
* Unique key (kept 48h) that makes retries safe: the same key and body returns the first response.
|
|
3948
|
+
*/
|
|
3949
|
+
'Idempotency-Key'?: string;
|
|
3950
|
+
};
|
|
3951
|
+
path?: never;
|
|
3952
|
+
query?: never;
|
|
3953
|
+
url: '/v1/webhook-endpoints';
|
|
3954
|
+
};
|
|
3955
|
+
type WebhookEndpointsDeleteData = {
|
|
3956
|
+
body?: never;
|
|
3957
|
+
path: {
|
|
3958
|
+
/**
|
|
3959
|
+
* Webhook endpoint id.
|
|
3960
|
+
*/
|
|
3961
|
+
id: string;
|
|
3962
|
+
};
|
|
3963
|
+
query?: never;
|
|
3964
|
+
url: '/v1/webhook-endpoints/{id}';
|
|
3965
|
+
};
|
|
3966
|
+
type WebhookEndpointsRetrieveData = {
|
|
3967
|
+
body?: never;
|
|
3968
|
+
path: {
|
|
3969
|
+
/**
|
|
3970
|
+
* Webhook endpoint id.
|
|
3971
|
+
*/
|
|
3972
|
+
id: string;
|
|
3973
|
+
};
|
|
3974
|
+
query?: never;
|
|
3975
|
+
url: '/v1/webhook-endpoints/{id}';
|
|
3976
|
+
};
|
|
3977
|
+
type WebhookEndpointsUpdateData = {
|
|
3978
|
+
body: UpdateWebhookEndpoint;
|
|
3979
|
+
path: {
|
|
3980
|
+
/**
|
|
3981
|
+
* Webhook endpoint id.
|
|
3982
|
+
*/
|
|
3983
|
+
id: string;
|
|
3984
|
+
};
|
|
3985
|
+
query?: never;
|
|
3986
|
+
url: '/v1/webhook-endpoints/{id}';
|
|
3987
|
+
};
|
|
3988
|
+
|
|
3989
|
+
export type { CatalogProductList as $, ActivateLicenseKey as A, UsageRecord as B, CatalogProduct as C, Discount as D, WebhookEndpointList as E, WebhookEndpointWithSecret as F, WebhookEndpoint as G, ApiErrorDetail as H, IntegrationGuide as I, Jwks as J, ApiFieldError as K, ListingRecipe as L, MetersListResponse as M, CatalogListingsRetrieveIntegrationGuideData as N, CatalogListingsRetrieveRecipeData as O, PaymentConfirmation as P, CatalogProductsRetrieveData as Q, RecordIntegrationVerification as R, SetupIntent as S, CatalogProductsUpsertData as T, UsageBillingPlan as U, ValidateLicenseKey as V, WebhookDelivery as W, UpsertCatalogProduct as X, CatalogPlansUpsertData as Y, UpsertCatalogPlan as Z, CatalogListData as _, CheckoutSessionCreateResponse as a, ProductsListData as a$, CheckoutSessionsCreateData as a0, CreateCheckout as a1, CheckoutSessionsRetrieveData as a2, CheckoutSessionsRetrieveReceiptData as a3, CreditsAdjustData as a4, AdjustCredits as a5, CreditsConsumeData as a6, ConsumeCredits as a7, CreditsRetrieveData as a8, CreditsListLedgerData as a9, InvoicesCreateData as aA, CreateBillingInvoice as aB, InvoicesRetrieveData as aC, LicenseKeysListData as aD, LicenseKeyList as aE, LicenseKeysRetrieveData as aF, LicenseKeysRevokeData as aG, MetersCreateData as aH, CreateMeter as aI, PaymentConfirmationsRetrieveData as aJ, PaymentsRefundsListData as aK, RefundList as aL, PaymentsRefundsCreateData as aM, CreateRefund as aN, PaymentsRefundsRetrieveData as aO, PaymentsListData as aP, PaymentList as aQ, PaymentsCreateData as aR, CreatePayment as aS, PaymentsRetrieveData as aT, PricesListData as aU, PriceList as aV, PricesCreateData as aW, CreatePrice as aX, PricesRetrieveData as aY, PricesUpdateData as aZ, UpdatePrice as a_, CreditLedgerEntryList as aa, CustomerAccessRetrieveData as ab, CustomerPortalSessionsCreateData as ac, CreateCustomerPortalSession as ad, CustomersListData as ae, CustomerList as af, CustomersCreateData as ag, CreateCustomer as ah, CustomersRetrieveData as ai, CustomersUpdateData as aj, UpdateCustomer as ak, CustomersListPaymentMethodsData as al, CustomersCreateSetupIntentData as am, CreateSetupIntentParams as an, DiscountsListData as ao, DiscountList as ap, DiscountsCreateData as aq, CreateDiscount as ar, DiscountsRetrieveData as as, DiscountsUpdateData as at, UpdateDiscount as au, DiscountsDeactivateData as av, IntegrationVerificationsListForListingData as aw, IntegrationVerificationList as ax, InvoicesListData as ay, InvoiceList as az, CheckoutSession as b, CreditBalance as b$, ProductList as b0, ProductsCreateData as b1, CreateProduct as b2, ProductsRetrieveData as b3, ProductsUpdateData as b4, UpdateProduct as b5, SetupSessionsRetrieveData as b6, SubscriptionsListData as b7, SubscriptionList as b8, SubscriptionsCancelByExternalCustomerData as b9, CatalogCheckoutInterval as bA, CatalogCheckoutSelection as bB, CatalogCreditGrant as bC, CatalogCreditGrantInput as bD, CatalogEntitlementInput as bE, CatalogEnvironment as bF, CatalogLicenseKeyConfig as bG, CatalogLicenseKeyInput as bH, CatalogManagedBy as bI, CatalogPlan as bJ, CatalogPrice as bK, CatalogPriceInput as bL, CatalogPriceType as bM, CatalogProductManagedBy as bN, CatalogProductSummary as bO, CatalogProductSummaryPlan as bP, CatalogProductType as bQ, CatalogSelection as bR, CheckoutAttribution as bS, CheckoutCatalogInterval as bT, CheckoutReceiptCatalog as bU, CheckoutReceiptStatus as bV, CheckoutSessionCatalog as bW, CheckoutSessionMode as bX, CheckoutSessionPricing as bY, CheckoutSessionStatus as bZ, CheckoutUiMode as b_, CancelByExternalCustomer as ba, SubscriptionsUncancelByExternalCustomerData as bb, UncancelByExternalCustomer as bc, SubscriptionsRetrieveData as bd, SubscriptionsUpdateData as be, UpdateSubscription as bf, SubscriptionsCancelData as bg, CancelSubscription as bh, SubscriptionsPreviewUpdateData as bi, PreviewSubscriptionUpdate as bj, UsageBillingPlansCreateData as bk, CreateBillingPlan as bl, UsageBillingPlansRetrieveData as bm, WebhookDeliveriesListData as bn, WebhookDeliveryList as bo, WebhookDeliveriesRetrieveData as bp, WebhookDeliveriesResendData as bq, WebhookEndpointsCreateData as br, CreateWebhookEndpoint as bs, WebhookEndpointsRetrieveData as bt, WebhookEndpointsDeleteData as bu, WebhookEndpointsUpdateData as bv, UpdateWebhookEndpoint as bw, ApiError as bx, AppointmentSlotCheckout as by, BillingLineItem as bz, CheckoutReceipt as c, SubscriptionPlanInterval as c$, CreditLedgerEntry as c0, CreditLedgerReason as c1, CustomPrice as c2, CustomerAccessActivePlan as c3, CustomerAccessBooking as c4, CustomerAccessBookingStatus as c5, CustomerAccessCredit as c6, CustomerAccessEntitlement as c7, CustomerAccessEntitlementSource as c8, CustomerAccessKeyRef as c9, ListingBusinessModel as cA, ListingRecipeEndpoints as cB, ListingRecipeEntitlement as cC, ListingRecipeEnvironment as cD, ListingRecipePlan as cE, ListingRecipePlanDefaultPrice as cF, ListingRecipePlanPrice as cG, MeterAggregation as cH, PaymentCatalogSelection as cI, PaymentConfirmationCard as cJ, PaymentMethod as cK, PaymentNextAction as cL, PaymentPeriodFilter as cM, PaymentStatus as cN, PaymentStatusFilter as cO, PlanRef as cP, PriceBillingScheme as cQ, PriceRecurring as cR, PriceRecurringInput as cS, PriceRecurringInterval as cT, ProductRef as cU, ProductTypeFilter as cV, ProrationBehavior as cW, RefundReason as cX, RefundStatus as cY, SubscriptionChangeEffective as cZ, SubscriptionPendingChange as c_, CustomerAccessLicenseKey as ca, CustomerAccessOwnedProduct as cb, CustomerAccessPlanRef as cc, CustomerAccessPlanStatus as cd, CustomerAccessProductRef as ce, CustomerAccessTicket as cf, CustomerAccessTicketStatus as cg, CustomerRef as ch, DiscountDuration as ci, DiscountType as cj, DiscountTypeFilter as ck, DiscountValueType as cl, EventSeatAttendee as cm, IntegrationGuideTarget as cn, IntegrationVerificationResult as co, InvoiceLineItem as cp, InvoiceSource as cq, InvoiceStatus as cr, JwksKey as cs, LicenseKeyActivation as ct, LicenseKeyActivationCount as cu, LicenseKeyCustomerRef as cv, LicenseKeyInstanceState as cw, LicenseKeyKeyRef as cx, LicenseKeyNamedRef as cy, LicenseKeyState as cz, CreditOperation as d, SubscriptionPrice as d0, SubscriptionStatus as d1, SubscriptionStatusFilter as d2, SubscriptionUpdatePreviewLine as d3, SubscriptionUpdatePreviewNextInvoice as d4, SubscriptionUpdatePreviewPlan as d5, TaxPriceBehavior as d6, UpdateSubscriptionCatalog as d7, UpsertableCatalogProductType as d8, UsageBillingInterval as d9, WebhookDeliveryStatus as da, WebhookDeliveryStatusFilter as db, CreditBalances as e, CustomerAccess as f, CustomerPortalSession as g, Customer as h, CustomersListPaymentMethodsResponse as i, IntegrationVerification as j, Invoice as k, LicenseKeyStatus as l, DeactivateLicenseKey as m, LicenseKey as n, Meter as o, Refund as p, Payment as q, Price as r, Product as s, SandboxPayoutMethodResult as t, SetupSession as u, SubscriptionCancellation as v, Subscription as w, SubscriptionsUpdateResponse as x, SubscriptionUpdatePreview as y, ReportUsage as z };
|