@conto_finance/sdk 0.6.0 → 0.6.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/browserbase.d.mts +1 -0
- package/dist/browserbase.d.ts +1 -0
- package/dist/browserbase.mjs +1 -1
- package/dist/checkout-verifier.mjs +1 -1
- package/dist/{chunk-WSIKPUZJ.mjs → chunk-TGOYFBKZ.mjs} +3 -1
- package/dist/index.d.mts +976 -11
- package/dist/index.d.ts +976 -11
- package/dist/index.js +1035 -32
- package/dist/index.mjs +1019 -29
- package/dist/link-wallet.d.mts +120 -0
- package/dist/link-wallet.d.ts +120 -0
- package/dist/link-wallet.js +400 -0
- package/dist/link-wallet.mjs +365 -0
- package/dist/playwright.d.mts +1 -0
- package/dist/playwright.d.ts +1 -0
- package/dist/playwright.mjs +1 -1
- package/package.json +10 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,785 @@
|
|
|
1
|
+
import { LinkWallet, LinkCardCredential } from './link-wallet.js';
|
|
2
|
+
export { LinkCallOptions, LinkCardRequestInput, LinkSpendRequest, LinkSpendRequestStatus, LinkWaitOptions } from './link-wallet.js';
|
|
3
|
+
|
|
4
|
+
type PurchaseStatus = 'queued' | 'running' | 'awaiting_action' | 'submitting' | 'reconciling' | 'succeeded' | 'blocked' | 'failed' | 'cancelled';
|
|
5
|
+
type PurchasePhase = 'queued' | 'shopping' | 'checkout' | 'review' | 'scheduled' | 'authorization' | 'payment' | 'reconciliation' | 'closed_unconfirmed' | 'complete';
|
|
6
|
+
type PurchaseActionKind = 'buyer_details' | 'purchase_review' | 'organization_approval' | 'card_verification' | 'merchant_signin' | 'merchant_challenge' | 'budget_increase';
|
|
7
|
+
type PurchaseActionAuthority = 'agent_or_buyer' | 'buyer' | 'cardholder' | 'organization';
|
|
8
|
+
interface PurchaseMoney {
|
|
9
|
+
/** Positive integer in minor units. */
|
|
10
|
+
amountMinor: number;
|
|
11
|
+
/** Uppercase ISO 4217. Purchases support USD only. */
|
|
12
|
+
currency: string;
|
|
13
|
+
}
|
|
14
|
+
interface PurchaseItem {
|
|
15
|
+
url: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
quantity?: number;
|
|
18
|
+
options?: string[];
|
|
19
|
+
}
|
|
20
|
+
/** One grocery to find, in the shopper's words. Conto never substitutes a different product. */
|
|
21
|
+
interface PurchaseGroceryItem {
|
|
22
|
+
/** A short name, such as `Bananas`. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Plain search words, such as `bananas`. No prices, quantities or package sizes. */
|
|
25
|
+
query: string;
|
|
26
|
+
/** 1 to 20. */
|
|
27
|
+
quantity: number;
|
|
28
|
+
/** A package size, such as `1 pint`. */
|
|
29
|
+
size?: string;
|
|
30
|
+
/** How the item is sold, such as `bunch`, `bag` or `lb`. */
|
|
31
|
+
unit?: string;
|
|
32
|
+
brand?: string;
|
|
33
|
+
/** Words the item must not match, such as `organic`. */
|
|
34
|
+
exclude?: string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Groceries for one grocery store: an Instacart store link, or Conto Test
|
|
38
|
+
* Grocery in test mode. Up to 20 items. Use instead of `items`.
|
|
39
|
+
*/
|
|
40
|
+
interface PurchaseGroceryList {
|
|
41
|
+
items: PurchaseGroceryItem[];
|
|
42
|
+
}
|
|
43
|
+
interface PurchaseRequest {
|
|
44
|
+
url: string;
|
|
45
|
+
task?: string;
|
|
46
|
+
items?: PurchaseItem[];
|
|
47
|
+
groceryList?: PurchaseGroceryList;
|
|
48
|
+
}
|
|
49
|
+
interface PurchaseAction {
|
|
50
|
+
id: string;
|
|
51
|
+
kind: PurchaseActionKind;
|
|
52
|
+
/** Only `agent_or_buyer` accepts `purchases.respond()`. */
|
|
53
|
+
authority: PurchaseActionAuthority;
|
|
54
|
+
revision: number;
|
|
55
|
+
expiresAt: string;
|
|
56
|
+
/** For buyer_details: the form and the field names it accepts. */
|
|
57
|
+
form?: 'delivery' | 'billing' | 'store_order_contact';
|
|
58
|
+
fields?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* For budget_increase: the maximum is above maxCost. Answer
|
|
61
|
+
* `{ decision: 'raise', maxCostMinor }` with at least the maximum, or
|
|
62
|
+
* `{ decision: 'decline' }`.
|
|
63
|
+
*/
|
|
64
|
+
budget?: {
|
|
65
|
+
estimate: PurchaseMoney;
|
|
66
|
+
maximum: PurchaseMoney;
|
|
67
|
+
maxCost: PurchaseMoney;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* For buyer, cardholder and reviewer actions: the Conto page that completes
|
|
71
|
+
* it. It works only inside a hosted buyer session or the dashboard, so it is
|
|
72
|
+
* safe to show. For a seamless buyer handoff, have your server create a
|
|
73
|
+
* hosted action link with `ContoAdmin.purchasing.purchases.createActionLink()`.
|
|
74
|
+
*/
|
|
75
|
+
url?: string;
|
|
76
|
+
}
|
|
77
|
+
interface PurchaseEvidence {
|
|
78
|
+
authorization: {
|
|
79
|
+
state: 'not_requested' | 'pending_review' | 'issued' | 'denied' | 'cancelled' | 'unknown';
|
|
80
|
+
};
|
|
81
|
+
merchant: {
|
|
82
|
+
state: 'not_submitted' | 'confirmed' | 'unknown';
|
|
83
|
+
source?: string;
|
|
84
|
+
reference?: string;
|
|
85
|
+
amount?: PurchaseMoney;
|
|
86
|
+
amountVerified?: boolean;
|
|
87
|
+
observedAt?: string;
|
|
88
|
+
};
|
|
89
|
+
/** Never observed: the card provider reports issuance only. */
|
|
90
|
+
settlement: {
|
|
91
|
+
state: 'unknown';
|
|
92
|
+
reason: 'NOT_REPORTED_BY_PROVIDER';
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
interface Purchase {
|
|
96
|
+
id: string;
|
|
97
|
+
object: 'purchase';
|
|
98
|
+
buyerId: string;
|
|
99
|
+
agentId: string;
|
|
100
|
+
environment: 'live' | 'test';
|
|
101
|
+
status: PurchaseStatus;
|
|
102
|
+
phase: PurchasePhase;
|
|
103
|
+
/** Increases by one with every visible change. */
|
|
104
|
+
version: number;
|
|
105
|
+
request: PurchaseRequest;
|
|
106
|
+
maxCost: PurchaseMoney;
|
|
107
|
+
quote: {
|
|
108
|
+
merchant: string;
|
|
109
|
+
description: string | null;
|
|
110
|
+
/** What limits and the card are held to: the maximum, until a receipt records the final total. */
|
|
111
|
+
total: PurchaseMoney;
|
|
112
|
+
/** The store's own total. */
|
|
113
|
+
estimate: PurchaseMoney;
|
|
114
|
+
/** The most the order can come to. The same as the estimate for an exact total. */
|
|
115
|
+
maximum: PurchaseMoney;
|
|
116
|
+
estimatedTax: boolean;
|
|
117
|
+
} | null;
|
|
118
|
+
requiredAction: PurchaseAction | null;
|
|
119
|
+
result: {
|
|
120
|
+
outcome: 'merchant_confirmed' | 'checkout_reported' | 'credential_unused' | 'not_completed' | 'denied' | 'cancelled';
|
|
121
|
+
merchantReference: string | null;
|
|
122
|
+
} | null;
|
|
123
|
+
paymentEvidence: PurchaseEvidence;
|
|
124
|
+
progress: {
|
|
125
|
+
steps: number;
|
|
126
|
+
message: string | null;
|
|
127
|
+
};
|
|
128
|
+
reasonCode: string | null;
|
|
129
|
+
/** With POLICY_DENIED on a company card: which limit refused the purchase. */
|
|
130
|
+
limitReached?: 'buyer_daily' | 'buyer_monthly' | 'buyer_daily_count' | 'store' | 'card_or_policy';
|
|
131
|
+
cancellation: {
|
|
132
|
+
requestedAt: string;
|
|
133
|
+
} | null;
|
|
134
|
+
/** Present when the purchase pays under one of the buyer's open allowances. */
|
|
135
|
+
allowance?: {
|
|
136
|
+
id: string;
|
|
137
|
+
reviewSkipped: boolean;
|
|
138
|
+
};
|
|
139
|
+
/** Present when the purchase is one cycle of a repeat order. */
|
|
140
|
+
recurrence?: {
|
|
141
|
+
id: string;
|
|
142
|
+
cycleKey: string;
|
|
143
|
+
payAt: string | null;
|
|
144
|
+
changes: {
|
|
145
|
+
previousTotal?: {
|
|
146
|
+
amountMinor: number;
|
|
147
|
+
currency: string;
|
|
148
|
+
};
|
|
149
|
+
itemsChanged: boolean;
|
|
150
|
+
} | null;
|
|
151
|
+
};
|
|
152
|
+
createdAt: string;
|
|
153
|
+
updatedAt: string;
|
|
154
|
+
completedAt: string | null;
|
|
155
|
+
}
|
|
156
|
+
interface PurchaseEvent {
|
|
157
|
+
id: string;
|
|
158
|
+
purchaseId: string;
|
|
159
|
+
version: number;
|
|
160
|
+
/** purchase.created, purchase.updated, purchase.action_required, purchase.<final status>, or purchase.resync */
|
|
161
|
+
type: string;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
data: Purchase;
|
|
164
|
+
}
|
|
165
|
+
interface PurchaseEventPage {
|
|
166
|
+
items: PurchaseEvent[];
|
|
167
|
+
latestVersion: number;
|
|
168
|
+
nextCursor: number;
|
|
169
|
+
hasMore: boolean;
|
|
170
|
+
}
|
|
171
|
+
interface PurchaseList {
|
|
172
|
+
items: Purchase[];
|
|
173
|
+
total: number;
|
|
174
|
+
limit: number;
|
|
175
|
+
offset: number;
|
|
176
|
+
}
|
|
177
|
+
interface CreatePurchaseInput {
|
|
178
|
+
buyerId: string;
|
|
179
|
+
request: PurchaseRequest;
|
|
180
|
+
/** The most this purchase may cost, delivered. It narrows the delegation, never widens it. */
|
|
181
|
+
maxCost: PurchaseMoney;
|
|
182
|
+
/**
|
|
183
|
+
* The card and delegation to pay with. Leave it out when the buyer has one
|
|
184
|
+
* active delegation for the store: a test card for a Conto test store, a
|
|
185
|
+
* live card otherwise. With more than one, the API refuses with
|
|
186
|
+
* `PAYMENT_METHOD_REQUIRED`.
|
|
187
|
+
*/
|
|
188
|
+
payment?: {
|
|
189
|
+
methodId: string;
|
|
190
|
+
delegationId: string;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* The buyer's saved delivery details answer the store's delivery form when
|
|
194
|
+
* the buyer has them. Leave out to use them when present, pass the buyer id
|
|
195
|
+
* to require them, or null to never use them.
|
|
196
|
+
*/
|
|
197
|
+
buyerProfileId?: string | null;
|
|
198
|
+
}
|
|
199
|
+
interface PurchaseResponseAck {
|
|
200
|
+
id: string;
|
|
201
|
+
object: 'purchase_response';
|
|
202
|
+
purchaseId: string;
|
|
203
|
+
actionId: string;
|
|
204
|
+
/** accepted: recorded, not yet applied. applied: used. rejected: could not be used. */
|
|
205
|
+
status: 'accepted' | 'applied' | 'rejected';
|
|
206
|
+
reasonCode: string | null;
|
|
207
|
+
acceptedAt: string;
|
|
208
|
+
appliedAt: string | null;
|
|
209
|
+
replayed: boolean;
|
|
210
|
+
}
|
|
211
|
+
type CancellationOutcome = 'cancelled' | 'requested' | 'too_late' | 'already_final';
|
|
212
|
+
interface WatchPurchaseOptions {
|
|
213
|
+
/** Resume after this version. Defaults to 0, the full history. */
|
|
214
|
+
after?: number;
|
|
215
|
+
signal?: AbortSignal;
|
|
216
|
+
/** auto streams and falls back to polling. Defaults to auto. */
|
|
217
|
+
mode?: 'auto' | 'stream' | 'poll';
|
|
218
|
+
/** Polling interval. Defaults to 2000 ms. */
|
|
219
|
+
pollIntervalMs?: number;
|
|
220
|
+
/** Stop observing after this many milliseconds (0 stops immediately). Does not cancel the purchase. */
|
|
221
|
+
maxWaitMs?: number;
|
|
222
|
+
}
|
|
223
|
+
declare const isFinalPurchaseStatus: (status: PurchaseStatus) => boolean;
|
|
224
|
+
interface PurchaseTransport {
|
|
225
|
+
request<T>(method: string, path: string, body?: Record<string, unknown>, options?: {
|
|
226
|
+
idempotent?: boolean;
|
|
227
|
+
maxRetries?: number;
|
|
228
|
+
}): Promise<T>;
|
|
229
|
+
openStream(path: string, init: {
|
|
230
|
+
signal?: AbortSignal;
|
|
231
|
+
lastEventId?: string;
|
|
232
|
+
}): Promise<Response>;
|
|
233
|
+
}
|
|
234
|
+
type SseFrame = {
|
|
235
|
+
id?: string;
|
|
236
|
+
event: string;
|
|
237
|
+
data: string;
|
|
238
|
+
};
|
|
239
|
+
/** Parses server-sent events from a byte stream. */
|
|
240
|
+
declare function parseServerSentEvents(body: ReadableStream<Uint8Array>, signal?: AbortSignal): AsyncGenerator<SseFrame>;
|
|
241
|
+
type RecurringPurchaseCycleStatus = 'checking' | 'scheduled' | 'needs_review' | 'paying' | 'paid' | 'skipped' | 'missed' | 'failed' | 'cancelled';
|
|
242
|
+
/** A repeat order the buyer set up while approving a purchase on Conto's hosted page. */
|
|
243
|
+
interface RecurringPurchase {
|
|
244
|
+
id: string;
|
|
245
|
+
object: 'recurring_purchase';
|
|
246
|
+
buyerId: string;
|
|
247
|
+
agentId: string;
|
|
248
|
+
paymentMethodId: string;
|
|
249
|
+
environment: 'live' | 'test';
|
|
250
|
+
status: 'active' | 'paused' | 'cancelled' | 'ended';
|
|
251
|
+
merchant: {
|
|
252
|
+
name: string;
|
|
253
|
+
};
|
|
254
|
+
description: string | null;
|
|
255
|
+
request: Record<string, unknown>;
|
|
256
|
+
cadence: {
|
|
257
|
+
unit: 'day' | 'month';
|
|
258
|
+
every: number;
|
|
259
|
+
label: string;
|
|
260
|
+
};
|
|
261
|
+
limits: {
|
|
262
|
+
/** The most one order may cost and still go through without the buyer's review. */
|
|
263
|
+
maxOrderMinor: number;
|
|
264
|
+
baselineMinor: number;
|
|
265
|
+
priceToleranceBps: number;
|
|
266
|
+
currency: 'USD';
|
|
267
|
+
};
|
|
268
|
+
/** How long before each order the buyer gets a heads-up. */
|
|
269
|
+
noticeMinutes: number;
|
|
270
|
+
skipNext: boolean;
|
|
271
|
+
nextDueAt: string | null;
|
|
272
|
+
expiresAt: string;
|
|
273
|
+
createdAt: string;
|
|
274
|
+
endedAt: string | null;
|
|
275
|
+
cycles: Array<{
|
|
276
|
+
cycleKey: string;
|
|
277
|
+
status: RecurringPurchaseCycleStatus;
|
|
278
|
+
purchaseId: string | null;
|
|
279
|
+
payAt: string | null;
|
|
280
|
+
total: {
|
|
281
|
+
amountMinor: number;
|
|
282
|
+
currency: string;
|
|
283
|
+
} | null;
|
|
284
|
+
createdAt: string;
|
|
285
|
+
}>;
|
|
286
|
+
}
|
|
287
|
+
interface RecurringPurchaseCycleResult {
|
|
288
|
+
recurrence: RecurringPurchase;
|
|
289
|
+
cycle: {
|
|
290
|
+
cycleKey: string;
|
|
291
|
+
status: RecurringPurchaseCycleStatus;
|
|
292
|
+
purchaseId: string | null;
|
|
293
|
+
};
|
|
294
|
+
/** The order's purchase when this call started it. Follow it like any purchase. */
|
|
295
|
+
purchase?: Purchase;
|
|
296
|
+
created: boolean;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Repeat orders. The buyer sets one up while approving a purchase. The agent
|
|
300
|
+
* starts each order with a cycle key that names it, such as `2026-W41`, so a
|
|
301
|
+
* retry never orders twice. Conto sends the buyer a heads-up and pays at the
|
|
302
|
+
* order's payment time, or asks the buyer when the order changed.
|
|
303
|
+
*/
|
|
304
|
+
declare class RecurringPurchasesClient {
|
|
305
|
+
#private;
|
|
306
|
+
constructor(transport: PurchaseTransport, basePath?: string);
|
|
307
|
+
list(buyerId?: string): Promise<{
|
|
308
|
+
items: RecurringPurchase[];
|
|
309
|
+
}>;
|
|
310
|
+
get(id: string): Promise<RecurringPurchase>;
|
|
311
|
+
/** Starts one order. The same cycle key returns the same order. */
|
|
312
|
+
startCycle(id: string, cycleKey: string): Promise<RecurringPurchaseCycleResult>;
|
|
313
|
+
/** Skips one order, also before it starts. */
|
|
314
|
+
skipCycle(id: string, cycleKey: string): Promise<RecurringPurchaseCycleResult['cycle']>;
|
|
315
|
+
}
|
|
316
|
+
/** The organization's view of its buyers' repeat orders. It can also cancel one. */
|
|
317
|
+
declare class OrganizationRecurringPurchasesClient extends RecurringPurchasesClient {
|
|
318
|
+
#private;
|
|
319
|
+
constructor(client: PurchaseTransport);
|
|
320
|
+
/** Stops a repeat order. An order waiting for its payment time closes unpaid. */
|
|
321
|
+
cancel(id: string): Promise<RecurringPurchase>;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The agent's purchases. Card data, browser sessions and provider handles
|
|
325
|
+
* never appear here. Actions the agent may not complete (review, approval,
|
|
326
|
+
* card verification) are refused by the API and carry a Conto page `url`.
|
|
327
|
+
*/
|
|
328
|
+
declare class PurchasesClient {
|
|
329
|
+
#private;
|
|
330
|
+
constructor(transport: PurchaseTransport, basePath?: string);
|
|
331
|
+
/**
|
|
332
|
+
* Starts a purchase and returns at once. Reusing the idempotency key with the
|
|
333
|
+
* same input returns the same purchase, so retrying after a lost response is safe.
|
|
334
|
+
*/
|
|
335
|
+
create(input: CreatePurchaseInput, options: {
|
|
336
|
+
idempotencyKey: string;
|
|
337
|
+
}): Promise<Purchase>;
|
|
338
|
+
list(params?: {
|
|
339
|
+
limit?: number;
|
|
340
|
+
offset?: number;
|
|
341
|
+
status?: PurchaseStatus;
|
|
342
|
+
}): Promise<PurchaseList>;
|
|
343
|
+
get(id: string): Promise<Purchase>;
|
|
344
|
+
/**
|
|
345
|
+
* Answers an open action whose authority is `agent_or_buyer` with the fields
|
|
346
|
+
* it lists. The acknowledgment means recorded; the purchase shows the result.
|
|
347
|
+
* The same answer again returns the same acknowledgment.
|
|
348
|
+
*/
|
|
349
|
+
respond(id: string, input: {
|
|
350
|
+
actionId: string;
|
|
351
|
+
fields: Record<string, unknown>;
|
|
352
|
+
revision?: number;
|
|
353
|
+
}): Promise<PurchaseResponseAck>;
|
|
354
|
+
events(id: string, params?: {
|
|
355
|
+
after?: number;
|
|
356
|
+
limit?: number;
|
|
357
|
+
}): Promise<PurchaseEventPage>;
|
|
358
|
+
/**
|
|
359
|
+
* Requests cancellation. Before payment the purchase stops. Once payment may
|
|
360
|
+
* have been submitted, `cancellationOutcome` is `too_late` and the purchase
|
|
361
|
+
* stays in reconciliation. Nothing is refunded by this call.
|
|
362
|
+
*/
|
|
363
|
+
cancel(id: string): Promise<Purchase & {
|
|
364
|
+
cancellationOutcome: CancellationOutcome;
|
|
365
|
+
}>;
|
|
366
|
+
/**
|
|
367
|
+
* Yields the purchase's events in version order until it reaches a final
|
|
368
|
+
* status. Streams with server-sent events and reconnects from the last
|
|
369
|
+
* version; falls back to polling where streaming is unavailable. A duplicate
|
|
370
|
+
* after a reconnect is dropped. A `purchase.resync` event carries the
|
|
371
|
+
* current purchase when the cursor could not be resumed.
|
|
372
|
+
*/
|
|
373
|
+
watch(id: string, options?: WatchPurchaseOptions): AsyncGenerator<PurchaseEvent>;
|
|
374
|
+
}
|
|
375
|
+
interface PurchaseBuyer {
|
|
376
|
+
id: string;
|
|
377
|
+
object: 'buyer';
|
|
378
|
+
externalId: string;
|
|
379
|
+
agentId: string;
|
|
380
|
+
status: 'active' | 'stopped';
|
|
381
|
+
limits: {
|
|
382
|
+
perPurchaseMinor: number;
|
|
383
|
+
dailyMinor: number;
|
|
384
|
+
currency: 'USD';
|
|
385
|
+
confirmed: boolean;
|
|
386
|
+
};
|
|
387
|
+
createdAt: string;
|
|
388
|
+
}
|
|
389
|
+
interface PurchasePaymentMethod {
|
|
390
|
+
id: string;
|
|
391
|
+
object: 'payment_method';
|
|
392
|
+
buyerId: string;
|
|
393
|
+
type: 'card';
|
|
394
|
+
environment: 'live' | 'test';
|
|
395
|
+
brand: string;
|
|
396
|
+
last4: string;
|
|
397
|
+
status: 'active' | 'removed';
|
|
398
|
+
/** `organization`: your company card, which this buyer draws from. */
|
|
399
|
+
owner: 'buyer' | 'organization';
|
|
400
|
+
companyCardId?: string;
|
|
401
|
+
createdAt: string;
|
|
402
|
+
}
|
|
403
|
+
/** A card your organization pays its buyers' purchases with. */
|
|
404
|
+
interface PurchaseCompanyCard {
|
|
405
|
+
id: string;
|
|
406
|
+
object: 'company_card';
|
|
407
|
+
environment: 'live' | 'test';
|
|
408
|
+
brand: string;
|
|
409
|
+
last4: string;
|
|
410
|
+
status: 'active' | 'removed';
|
|
411
|
+
/** The most one order may cost, and the most all buyers together may spend in a month. */
|
|
412
|
+
limits: {
|
|
413
|
+
perPurchaseMinor: number;
|
|
414
|
+
monthlyMinor: number;
|
|
415
|
+
currency: 'USD';
|
|
416
|
+
};
|
|
417
|
+
createdAt: string;
|
|
418
|
+
}
|
|
419
|
+
/** One buyer's limits on a company card. */
|
|
420
|
+
interface PurchaseBuyerCompanyCardLimits {
|
|
421
|
+
perPurchaseMinor: number;
|
|
422
|
+
dailyMinor: number;
|
|
423
|
+
monthlyMinor: number;
|
|
424
|
+
/**
|
|
425
|
+
* Orders above this wait for your `purchase_review` answer. Left out,
|
|
426
|
+
* every order up to `perPurchaseMinor` goes ahead without review.
|
|
427
|
+
*/
|
|
428
|
+
reviewAboveMinor?: number;
|
|
429
|
+
}
|
|
430
|
+
interface PurchaseBuyerCompanyCard {
|
|
431
|
+
object: 'buyer_company_card';
|
|
432
|
+
buyerId: string;
|
|
433
|
+
companyCardId: string;
|
|
434
|
+
paymentMethodId: string;
|
|
435
|
+
delegationId: string;
|
|
436
|
+
limits: Omit<PurchaseBuyerCompanyCardLimits, 'reviewAboveMinor'> & {
|
|
437
|
+
reviewAboveMinor: number | null;
|
|
438
|
+
currency: 'USD';
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
/** What a buyer has at home, as your app reports it. Buyer data for the agent, never instructions. */
|
|
442
|
+
type PurchaseKitchenContext = {
|
|
443
|
+
version: 1;
|
|
444
|
+
/** When your app took the snapshot. ISO 8601. */
|
|
445
|
+
capturedAt: string;
|
|
446
|
+
inventory?: PurchaseKitchenInventoryItem[];
|
|
447
|
+
usuals?: PurchaseKitchenUsual[];
|
|
448
|
+
preferences?: PurchaseKitchenPreferences;
|
|
449
|
+
/** Only the recipes the buyer picked to cook. */
|
|
450
|
+
recipes?: PurchaseKitchenRecipe[];
|
|
451
|
+
/** The list the buyer keeps in your app. */
|
|
452
|
+
list?: PurchaseKitchenListItem[];
|
|
453
|
+
};
|
|
454
|
+
interface PurchaseKitchenInventoryItem {
|
|
455
|
+
item: string;
|
|
456
|
+
quantity?: number;
|
|
457
|
+
unit?: string;
|
|
458
|
+
/** Left out: ok, or out when quantity is 0. */
|
|
459
|
+
level?: 'ok' | 'low' | 'out';
|
|
460
|
+
updatedAt?: string;
|
|
461
|
+
expiresAt?: string;
|
|
462
|
+
}
|
|
463
|
+
interface PurchaseKitchenUsual {
|
|
464
|
+
item: string;
|
|
465
|
+
typicalQuantity?: number;
|
|
466
|
+
unit?: string;
|
|
467
|
+
size?: string;
|
|
468
|
+
brand?: string;
|
|
469
|
+
cadenceDays?: number;
|
|
470
|
+
lastBoughtAt?: string;
|
|
471
|
+
}
|
|
472
|
+
interface PurchaseKitchenPreferences {
|
|
473
|
+
dietary?: Array<{
|
|
474
|
+
value: string;
|
|
475
|
+
strength: 'required' | 'preferred';
|
|
476
|
+
}>;
|
|
477
|
+
avoidBrands?: string[];
|
|
478
|
+
likeBrands?: string[];
|
|
479
|
+
organic?: 'prefer' | 'avoid' | 'none';
|
|
480
|
+
substitutions?: 'allow' | 'ask' | 'never';
|
|
481
|
+
/** An https store link, such as an Instacart storefront. */
|
|
482
|
+
preferredStore?: string;
|
|
483
|
+
householdSize?: number;
|
|
484
|
+
weeklyBudgetMinor?: number;
|
|
485
|
+
}
|
|
486
|
+
interface PurchaseKitchenRecipe {
|
|
487
|
+
id?: string;
|
|
488
|
+
title: string;
|
|
489
|
+
servings?: number;
|
|
490
|
+
/** The planned day, as YYYY-MM-DD. */
|
|
491
|
+
cookOn?: string;
|
|
492
|
+
/** Whether your app finds it cookable from what is at home. */
|
|
493
|
+
cookable?: boolean;
|
|
494
|
+
ingredients: Array<{
|
|
495
|
+
item: string;
|
|
496
|
+
quantity?: number;
|
|
497
|
+
unit?: string;
|
|
498
|
+
optional?: boolean;
|
|
499
|
+
}>;
|
|
500
|
+
}
|
|
501
|
+
interface PurchaseKitchenListItem {
|
|
502
|
+
item: string;
|
|
503
|
+
quantity?: number;
|
|
504
|
+
unit?: string;
|
|
505
|
+
note?: string;
|
|
506
|
+
}
|
|
507
|
+
interface PurchaseBuyerKitchenContext {
|
|
508
|
+
object: 'buyer_kitchen_context';
|
|
509
|
+
buyerId: string;
|
|
510
|
+
/** Null when nothing was pushed. */
|
|
511
|
+
context: PurchaseKitchenContext | null;
|
|
512
|
+
summary: {
|
|
513
|
+
capturedAt: string;
|
|
514
|
+
inventory: number;
|
|
515
|
+
low: number;
|
|
516
|
+
out: number;
|
|
517
|
+
usuals: number;
|
|
518
|
+
recipes: number;
|
|
519
|
+
list: number;
|
|
520
|
+
} | null;
|
|
521
|
+
/** When Conto received the snapshot. */
|
|
522
|
+
receivedAt: string | null;
|
|
523
|
+
}
|
|
524
|
+
interface PurchaseDelegation {
|
|
525
|
+
id: string;
|
|
526
|
+
object: 'delegation';
|
|
527
|
+
buyerId: string;
|
|
528
|
+
agentId: string;
|
|
529
|
+
paymentMethodId: string;
|
|
530
|
+
status: 'active' | 'revoked';
|
|
531
|
+
scope: 'merchant_bound_single_use';
|
|
532
|
+
limits: {
|
|
533
|
+
perPurchaseMinor: number;
|
|
534
|
+
dailyMinor: number;
|
|
535
|
+
/** Company card only. */
|
|
536
|
+
monthlyMinor?: number;
|
|
537
|
+
/** Company card only: orders above this wait for your review. */
|
|
538
|
+
reviewAboveMinor?: number;
|
|
539
|
+
currency: 'USD';
|
|
540
|
+
};
|
|
541
|
+
/** false for a company card delegation, which you review above `reviewAboveMinor` only. */
|
|
542
|
+
requiresPurchaseReview: boolean;
|
|
543
|
+
requiresCardVerification: boolean;
|
|
544
|
+
createdAt: string;
|
|
545
|
+
revokedAt: string | null;
|
|
546
|
+
}
|
|
547
|
+
interface PurchaseHostedLink {
|
|
548
|
+
id: string;
|
|
549
|
+
object: 'hosted_link';
|
|
550
|
+
purpose: 'setup' | 'purchase';
|
|
551
|
+
buyerId: string;
|
|
552
|
+
purchaseId: string | null;
|
|
553
|
+
/** Single use. Send the buyer here. Expires in 10 minutes. */
|
|
554
|
+
url: string;
|
|
555
|
+
expiresAt: string;
|
|
556
|
+
}
|
|
557
|
+
/** Buyer-approved spending at one store; not a merchant-independent allowance. */
|
|
558
|
+
interface PurchaseAllowance {
|
|
559
|
+
id: string;
|
|
560
|
+
object: 'allowance';
|
|
561
|
+
buyerId: string;
|
|
562
|
+
agentId: string;
|
|
563
|
+
delegationId: string;
|
|
564
|
+
paymentMethodId: string;
|
|
565
|
+
environment: 'live' | 'test';
|
|
566
|
+
status: 'pending_verification' | 'active' | 'revoked' | 'expired';
|
|
567
|
+
kind: 'store' | 'recurrence';
|
|
568
|
+
merchant: {
|
|
569
|
+
name: string;
|
|
570
|
+
origin: string;
|
|
571
|
+
};
|
|
572
|
+
limits: {
|
|
573
|
+
perPurchaseMinor: number;
|
|
574
|
+
periodMinor: number;
|
|
575
|
+
period: 'day' | 'week' | 'month';
|
|
576
|
+
totalMinor: number;
|
|
577
|
+
currency: 'USD';
|
|
578
|
+
};
|
|
579
|
+
expiresAt: string;
|
|
580
|
+
createdAt: string;
|
|
581
|
+
activatedAt: string | null;
|
|
582
|
+
revokedAt: string | null;
|
|
583
|
+
}
|
|
584
|
+
interface PurchasingSettings {
|
|
585
|
+
/** Origins a hosted page may return the buyer to. */
|
|
586
|
+
allowedReturnOrigins: string[];
|
|
587
|
+
/** Whether Conto emails buyers about their purchases. On by default. */
|
|
588
|
+
buyerEmails: boolean;
|
|
589
|
+
}
|
|
590
|
+
interface PurchasingCapabilities {
|
|
591
|
+
object: 'purchasing_capabilities';
|
|
592
|
+
/** Test mode is open to every organization. Live needs Conto to enable it. */
|
|
593
|
+
environments: Record<'test' | 'live', {
|
|
594
|
+
available: boolean;
|
|
595
|
+
reason?: string;
|
|
596
|
+
}>;
|
|
597
|
+
currencies: string[];
|
|
598
|
+
cardNetworks: string[];
|
|
599
|
+
/** Checkout paths: `browser_checkout`, `store_order` and `test_store`. */
|
|
600
|
+
executors: Array<{
|
|
601
|
+
executor: string;
|
|
602
|
+
available: boolean;
|
|
603
|
+
[key: string]: unknown;
|
|
604
|
+
}>;
|
|
605
|
+
/** Whether buyers can let their agent buy at a store without review, per environment. */
|
|
606
|
+
allowances?: Record<'test' | 'live', {
|
|
607
|
+
available: boolean;
|
|
608
|
+
}>;
|
|
609
|
+
/** Whether your app can push what its buyers have at home. */
|
|
610
|
+
kitchenContext?: {
|
|
611
|
+
available: boolean;
|
|
612
|
+
};
|
|
613
|
+
unsupported: Array<{
|
|
614
|
+
capability: string;
|
|
615
|
+
reason: string;
|
|
616
|
+
}>;
|
|
617
|
+
}
|
|
618
|
+
/** The organization client's transport. Same shape as the agent client's. */
|
|
619
|
+
type AdminTransport = PurchaseTransport;
|
|
620
|
+
/** The organization's purchases. Adds buyer filtering and hosted action links. */
|
|
621
|
+
declare class OrganizationPurchasesClient extends PurchasesClient {
|
|
622
|
+
#private;
|
|
623
|
+
constructor(client: AdminTransport);
|
|
624
|
+
list(params?: {
|
|
625
|
+
limit?: number;
|
|
626
|
+
offset?: number;
|
|
627
|
+
status?: PurchaseStatus;
|
|
628
|
+
buyerId?: string;
|
|
629
|
+
}): Promise<PurchaseList>;
|
|
630
|
+
/** A single-use link that opens the purchase's buyer actions on Conto's hosted page. */
|
|
631
|
+
createActionLink(id: string, input?: {
|
|
632
|
+
returnUrl?: string;
|
|
633
|
+
}): Promise<PurchaseHostedLink>;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Buyers, hosted setup, payment methods, delegations and purchase oversight.
|
|
637
|
+
* Only a buyer on Conto's hosted page can add a card or create a delegation.
|
|
638
|
+
*/
|
|
639
|
+
declare class AdminPurchasingClient {
|
|
640
|
+
#private;
|
|
641
|
+
constructor(client: AdminTransport);
|
|
642
|
+
/** Buyers' repeat orders: list, read, start or skip an order, and cancel. */
|
|
643
|
+
readonly recurringPurchases: OrganizationRecurringPurchasesClient;
|
|
644
|
+
/** Inspect or revoke buyer-approved allowances. Grants remain on the buyer's hosted page. */
|
|
645
|
+
readonly allowances: {
|
|
646
|
+
/** Returns up to 50 allowances for this buyer, newest first. */
|
|
647
|
+
list: (params: {
|
|
648
|
+
buyerId: string;
|
|
649
|
+
}) => Promise<{
|
|
650
|
+
items: PurchaseAllowance[];
|
|
651
|
+
}>;
|
|
652
|
+
get: (id: string) => Promise<PurchaseAllowance>;
|
|
653
|
+
/** Stops future credential release; does not undo payments already submitted. */
|
|
654
|
+
revoke: (id: string) => Promise<PurchaseAllowance>;
|
|
655
|
+
};
|
|
656
|
+
readonly buyers: {
|
|
657
|
+
/** Maps one of your users to a buyer with its own agent, or returns the existing one. */
|
|
658
|
+
create: (input: {
|
|
659
|
+
externalId: string;
|
|
660
|
+
email: string;
|
|
661
|
+
}) => Promise<PurchaseBuyer>;
|
|
662
|
+
get: (id: string) => Promise<PurchaseBuyer>;
|
|
663
|
+
list: (params?: {
|
|
664
|
+
limit?: number;
|
|
665
|
+
offset?: number;
|
|
666
|
+
}) => Promise<{
|
|
667
|
+
items: PurchaseBuyer[];
|
|
668
|
+
total: number;
|
|
669
|
+
limit: number;
|
|
670
|
+
offset: number;
|
|
671
|
+
}>;
|
|
672
|
+
/** Stops the buyer's agent. Purchases that may already be paid stay visible. */
|
|
673
|
+
stop: (id: string) => Promise<PurchaseBuyer>;
|
|
674
|
+
/**
|
|
675
|
+
* Lets the buyer pay with your company card within limits you set for
|
|
676
|
+
* them, or replaces those limits. The buyer must not have their own card.
|
|
677
|
+
*/
|
|
678
|
+
setCompanyCard: (id: string, input: {
|
|
679
|
+
companyCardId: string;
|
|
680
|
+
limits: PurchaseBuyerCompanyCardLimits;
|
|
681
|
+
}) => Promise<PurchaseBuyerCompanyCard>;
|
|
682
|
+
/** The buyer stops paying with your company card. */
|
|
683
|
+
removeCompanyCard: (id: string) => Promise<{
|
|
684
|
+
buyerId: string;
|
|
685
|
+
object: "buyer_company_card";
|
|
686
|
+
removed: true;
|
|
687
|
+
}>;
|
|
688
|
+
/**
|
|
689
|
+
* Replaces what the buyer has at home: inventory, usuals, preferences,
|
|
690
|
+
* chosen recipes and their list. The whole snapshot, every time. Needs
|
|
691
|
+
* Conto to enable kitchen context for your organization.
|
|
692
|
+
*/
|
|
693
|
+
setKitchenContext: (id: string, context: PurchaseKitchenContext) => Promise<PurchaseBuyerKitchenContext>;
|
|
694
|
+
/** The snapshot Conto holds, with context null when nothing was pushed. */
|
|
695
|
+
getKitchenContext: (id: string) => Promise<PurchaseBuyerKitchenContext>;
|
|
696
|
+
clearKitchenContext: (id: string) => Promise<{
|
|
697
|
+
buyerId: string;
|
|
698
|
+
object: "buyer_kitchen_context";
|
|
699
|
+
removed: true;
|
|
700
|
+
}>;
|
|
701
|
+
};
|
|
702
|
+
/** Cards your organization pays its buyers' purchases with. Test cards only for now. */
|
|
703
|
+
readonly companyCards: {
|
|
704
|
+
create: (input: {
|
|
705
|
+
environment: "live" | "test";
|
|
706
|
+
limits: {
|
|
707
|
+
perPurchaseMinor: number;
|
|
708
|
+
monthlyMinor: number;
|
|
709
|
+
};
|
|
710
|
+
}) => Promise<PurchaseCompanyCard>;
|
|
711
|
+
list: () => Promise<{
|
|
712
|
+
items: PurchaseCompanyCard[];
|
|
713
|
+
}>;
|
|
714
|
+
get: (id: string) => Promise<PurchaseCompanyCard>;
|
|
715
|
+
/** Changes the card's own caps. Each buyer's limits stay as they are. */
|
|
716
|
+
update: (id: string, input: {
|
|
717
|
+
limits: {
|
|
718
|
+
perPurchaseMinor: number;
|
|
719
|
+
monthlyMinor: number;
|
|
720
|
+
};
|
|
721
|
+
}) => Promise<PurchaseCompanyCard>;
|
|
722
|
+
/** No buyer can start or pay a purchase with the card after this. */
|
|
723
|
+
remove: (id: string) => Promise<PurchaseCompanyCard>;
|
|
724
|
+
};
|
|
725
|
+
readonly paymentMethods: {
|
|
726
|
+
/** A single-use link to the hosted setup page: limits, card and delegation. */
|
|
727
|
+
createSetupLink: (input: {
|
|
728
|
+
buyerId: string;
|
|
729
|
+
returnUrl?: string;
|
|
730
|
+
environment?: "live" | "test";
|
|
731
|
+
}) => Promise<PurchaseHostedLink>;
|
|
732
|
+
list: (buyerId: string) => Promise<{
|
|
733
|
+
items: PurchasePaymentMethod[];
|
|
734
|
+
}>;
|
|
735
|
+
remove: (id: string) => Promise<{
|
|
736
|
+
id: string;
|
|
737
|
+
removed: true;
|
|
738
|
+
}>;
|
|
739
|
+
};
|
|
740
|
+
readonly delegations: {
|
|
741
|
+
list: (buyerId: string) => Promise<{
|
|
742
|
+
items: PurchaseDelegation[];
|
|
743
|
+
}>;
|
|
744
|
+
get: (id: string) => Promise<PurchaseDelegation>;
|
|
745
|
+
revoke: (id: string) => Promise<PurchaseDelegation>;
|
|
746
|
+
};
|
|
747
|
+
/**
|
|
748
|
+
* Purchases with the organization key: start one for a buyer, answer its
|
|
749
|
+
* ordinary forms, follow it and cancel it, with the same methods as the
|
|
750
|
+
* agent client. Buyer actions open on Conto's hosted page from `createActionLink`.
|
|
751
|
+
*/
|
|
752
|
+
readonly purchases: OrganizationPurchasesClient;
|
|
753
|
+
readonly settings: {
|
|
754
|
+
get: () => Promise<PurchasingSettings>;
|
|
755
|
+
/** Changes only the fields you pass. */
|
|
756
|
+
update: (input: {
|
|
757
|
+
allowedReturnOrigins?: string[];
|
|
758
|
+
buyerEmails?: boolean;
|
|
759
|
+
}) => Promise<PurchasingSettings>;
|
|
760
|
+
};
|
|
761
|
+
/** What this organization can run now: test mode always, live once Conto enables it. */
|
|
762
|
+
capabilities(): Promise<PurchasingCapabilities>;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Verifies a purchase webhook. Pass the raw request body exactly as received,
|
|
766
|
+
* the X-Conto-Signature header and your organization's webhook signing secret.
|
|
767
|
+
* Refuses a bad signature and a delivery older than the tolerance. Deduplicate
|
|
768
|
+
* on the returned deliveryId, which is the same on every retry.
|
|
769
|
+
*/
|
|
770
|
+
declare function verifyPurchaseWebhook(input: {
|
|
771
|
+
body: string;
|
|
772
|
+
signature: string | null | undefined;
|
|
773
|
+
secret: string;
|
|
774
|
+
toleranceSeconds?: number;
|
|
775
|
+
now?: Date;
|
|
776
|
+
}): {
|
|
777
|
+
event: string;
|
|
778
|
+
timestamp: string;
|
|
779
|
+
deliveryId: string;
|
|
780
|
+
data: PurchaseEvent;
|
|
781
|
+
};
|
|
782
|
+
|
|
1
783
|
interface ApiErrorMetadata {
|
|
2
784
|
code: string;
|
|
3
785
|
status: number;
|
|
@@ -647,9 +1429,25 @@ declare class ContoAdmin {
|
|
|
647
1429
|
cards: AdminCardsClient;
|
|
648
1430
|
policies: PoliciesClient;
|
|
649
1431
|
team: TeamClient;
|
|
1432
|
+
/** Buyers, hosted setup, payment methods, delegations and purchases. */
|
|
1433
|
+
purchasing: AdminPurchasingClient;
|
|
650
1434
|
constructor(config: ContoAdminConfig);
|
|
651
|
-
/**
|
|
652
|
-
|
|
1435
|
+
/**
|
|
1436
|
+
* Opens an authenticated server-sent event stream. Used by
|
|
1437
|
+
* `purchasing.purchases.watch()`. The server closes it after about 50 seconds.
|
|
1438
|
+
* @internal
|
|
1439
|
+
*/
|
|
1440
|
+
openStream(path: string, init?: {
|
|
1441
|
+
signal?: AbortSignal;
|
|
1442
|
+
lastEventId?: string;
|
|
1443
|
+
}): Promise<Response>;
|
|
1444
|
+
/**
|
|
1445
|
+
* Make an authenticated request to the Conto API. Reads retry. A write retries
|
|
1446
|
+
* only when `idempotent` says the API deduplicates it, as purchase creation does.
|
|
1447
|
+
*/
|
|
1448
|
+
request<T>(method: string, path: string, body?: Record<string, unknown>, options?: {
|
|
1449
|
+
idempotent?: boolean;
|
|
1450
|
+
}): Promise<T>;
|
|
653
1451
|
}
|
|
654
1452
|
declare class AdminCardsClient {
|
|
655
1453
|
private client;
|
|
@@ -1179,7 +1977,7 @@ interface PaymentRequestResult {
|
|
|
1179
1977
|
/** Unique request ID - use this to execute or check status */
|
|
1180
1978
|
requestId: string;
|
|
1181
1979
|
/** Current status */
|
|
1182
|
-
status: 'APPROVED' | 'DENIED' | 'REQUIRES_APPROVAL' | 'PROCESSING';
|
|
1980
|
+
status: 'APPROVED' | 'DENIED' | 'REQUIRES_APPROVAL' | 'PROCESSING' | 'COMPLETED';
|
|
1183
1981
|
/** Requested amount */
|
|
1184
1982
|
amount: number;
|
|
1185
1983
|
/** Currency selected for the payment */
|
|
@@ -1479,6 +2277,23 @@ interface ConnectedCardDrawResult {
|
|
|
1479
2277
|
/** Provider expiration of the one-time credential; present with a fresh credential. */
|
|
1480
2278
|
credentialExpiresAt?: string;
|
|
1481
2279
|
}
|
|
2280
|
+
/**
|
|
2281
|
+
* What happened with a card number the agent received. `USED` with no
|
|
2282
|
+
* `amountMinor` means the full approved amount.
|
|
2283
|
+
*/
|
|
2284
|
+
interface ConnectedCardOutcomeReport {
|
|
2285
|
+
outcome: 'USED' | 'NOT_USED';
|
|
2286
|
+
/** `USED` only: the amount charged in USD cents, at most the approved amount. */
|
|
2287
|
+
amountMinor?: number;
|
|
2288
|
+
}
|
|
2289
|
+
interface ConnectedCardOutcomeReportResult {
|
|
2290
|
+
recorded: true;
|
|
2291
|
+
/** True when the report closed the draw: used at the full approved amount. */
|
|
2292
|
+
closed: boolean;
|
|
2293
|
+
/** True when a person must confirm before any held amount is released. */
|
|
2294
|
+
reviewRequired: boolean;
|
|
2295
|
+
settlementVerified: false;
|
|
2296
|
+
}
|
|
1482
2297
|
interface ConnectedCardMandateMerchant {
|
|
1483
2298
|
name: string | null;
|
|
1484
2299
|
categoryCode: string | null;
|
|
@@ -1666,21 +2481,34 @@ interface BeginCheckoutCheckpointInput {
|
|
|
1666
2481
|
/** Defaults to one Total entry equal to amountMinor. */
|
|
1667
2482
|
totals?: CommerceTotalInput[];
|
|
1668
2483
|
}
|
|
2484
|
+
/**
|
|
2485
|
+
* The payment behind a checkout, such as the Link spend request that issued a
|
|
2486
|
+
* Link card. An id only, never card data.
|
|
2487
|
+
*/
|
|
2488
|
+
interface CheckoutPaymentReference {
|
|
2489
|
+
provider: 'LINK';
|
|
2490
|
+
/** The Link spend request id, such as lsrq_... */
|
|
2491
|
+
id: string;
|
|
2492
|
+
}
|
|
1669
2493
|
/** Second checkpoint: the final total shown right before the payment is submitted. */
|
|
1670
2494
|
interface ConfirmCheckoutCheckpointInput {
|
|
1671
2495
|
amountMinor: number;
|
|
1672
2496
|
currency?: 'USD';
|
|
1673
|
-
/**
|
|
2497
|
+
/** Observed final items. Supplied items are checked even when the total is unchanged. */
|
|
1674
2498
|
lineItems?: CommerceLineItemInput[];
|
|
1675
|
-
/**
|
|
2499
|
+
/** Observed final charges. Supplied charges are checked even when the total is unchanged. */
|
|
1676
2500
|
totals?: CommerceTotalInput[];
|
|
1677
2501
|
/** Page where the payment is submitted: the merchant's site or the payment method's. */
|
|
1678
2502
|
pageUrl?: string;
|
|
2503
|
+
/** The Link card's spend request, from getLinkCard(). */
|
|
2504
|
+
paymentReference?: CheckoutPaymentReference;
|
|
1679
2505
|
}
|
|
1680
2506
|
interface ReportCheckoutOutcomeInput {
|
|
1681
2507
|
outcome: CheckoutOutcome;
|
|
1682
2508
|
/** Merchant order or receipt number. Never a payment credential. */
|
|
1683
2509
|
reference?: string;
|
|
2510
|
+
/** The Link card's spend request, from getLinkCard(). */
|
|
2511
|
+
paymentReference?: CheckoutPaymentReference;
|
|
1684
2512
|
}
|
|
1685
2513
|
interface CheckoutCheckpoint {
|
|
1686
2514
|
id: string;
|
|
@@ -1707,6 +2535,8 @@ interface CheckoutCheckpoint {
|
|
|
1707
2535
|
/** Present when the agent's rules sent this purchase to the owner for approval. */
|
|
1708
2536
|
approval?: CheckoutCheckpointApproval;
|
|
1709
2537
|
outcomeReference?: string;
|
|
2538
|
+
/** The payment your checkout reported at confirm or outcome, such as a Link spend request. */
|
|
2539
|
+
paymentReference?: CheckoutPaymentReference;
|
|
1710
2540
|
/** Outcomes are reported by your checkout. Conto does not verify settlement here. */
|
|
1711
2541
|
settlementVerified: false;
|
|
1712
2542
|
}
|
|
@@ -1723,6 +2553,45 @@ interface WaitForCheckoutApprovalOptions {
|
|
|
1723
2553
|
pollIntervalMs?: number;
|
|
1724
2554
|
signal?: AbortSignal;
|
|
1725
2555
|
}
|
|
2556
|
+
|
|
2557
|
+
/**
|
|
2558
|
+
* A Link card for one purchase: the checkpoint begin input plus the Link
|
|
2559
|
+
* wallet that runs in your environment. The checkout method is always LINK.
|
|
2560
|
+
*/
|
|
2561
|
+
interface GetLinkCardInput extends Omit<BeginCheckoutCheckpointInput, 'checkoutMethod'> {
|
|
2562
|
+
/** For example linkCliWallet() from @conto_finance/sdk/link-wallet. */
|
|
2563
|
+
wallet: LinkWallet;
|
|
2564
|
+
/** How long to wait for the owner when a rule requires approval. Defaults to 10 minutes. */
|
|
2565
|
+
ownerApprovalTimeoutMs?: number;
|
|
2566
|
+
/** How long to wait for the person to approve in Link. Defaults to 10 minutes. */
|
|
2567
|
+
linkApprovalTimeoutMs?: number;
|
|
2568
|
+
signal?: AbortSignal;
|
|
2569
|
+
}
|
|
2570
|
+
/** A new Link card for a changed final total. */
|
|
2571
|
+
interface ReplaceLinkCardInput {
|
|
2572
|
+
wallet: LinkWallet;
|
|
2573
|
+
/** The final total in cents, including shipping and tax. */
|
|
2574
|
+
amountMinor: number;
|
|
2575
|
+
/** Final line items. Defaults to the approved items. */
|
|
2576
|
+
lineItems?: CommerceLineItemInput[];
|
|
2577
|
+
/** Final totals, such as tax and shipping. Defaults to one Total entry. */
|
|
2578
|
+
totals?: CommerceTotalInput[];
|
|
2579
|
+
ownerApprovalTimeoutMs?: number;
|
|
2580
|
+
linkApprovalTimeoutMs?: number;
|
|
2581
|
+
signal?: AbortSignal;
|
|
2582
|
+
}
|
|
2583
|
+
interface LinkCardResult {
|
|
2584
|
+
/** The approved checkpoint. Pass it to confirm() right before paying. */
|
|
2585
|
+
checkpoint: CheckoutCheckpoint;
|
|
2586
|
+
/**
|
|
2587
|
+
* Live card data for this purchase only. It stays in this process: printing
|
|
2588
|
+
* or serializing the result shows only the last four digits.
|
|
2589
|
+
*/
|
|
2590
|
+
card: LinkCardCredential;
|
|
2591
|
+
linkRequestId: string;
|
|
2592
|
+
/** Pass to confirm() and reportOutcome() so the owner sees which Link request paid. */
|
|
2593
|
+
paymentReference: CheckoutPaymentReference;
|
|
2594
|
+
}
|
|
1726
2595
|
/** Exact Stripe Link purchase intent evaluated and bound by Conto policy. */
|
|
1727
2596
|
interface BeginCommerceExecutionCommonInput {
|
|
1728
2597
|
/** Stable key for this exact intent. Reuse it when reconciling or retrying begin. */
|
|
@@ -2414,6 +3283,41 @@ declare class CheckoutApprovalTimeoutError extends ContoError {
|
|
|
2414
3283
|
readonly checkpoint: CheckoutCheckpoint;
|
|
2415
3284
|
constructor(checkpoint: CheckoutCheckpoint);
|
|
2416
3285
|
}
|
|
3286
|
+
/**
|
|
3287
|
+
* getLinkCard() or replaceLinkCard() stopped after Conto approved the purchase.
|
|
3288
|
+
* No card was returned. Conto cancelled the checkpoint to release the held
|
|
3289
|
+
* spend unless holdReleased is false. Do not pay.
|
|
3290
|
+
*/
|
|
3291
|
+
declare class LinkCardError extends ContoError {
|
|
3292
|
+
readonly checkpoint: CheckoutCheckpoint;
|
|
3293
|
+
readonly linkRequestId?: string;
|
|
3294
|
+
/** True when Conto cancelled the checkpoint and released the held spend. */
|
|
3295
|
+
readonly holdReleased: boolean;
|
|
3296
|
+
constructor(input: {
|
|
3297
|
+
message: string;
|
|
3298
|
+
code: string;
|
|
3299
|
+
checkpoint: CheckoutCheckpoint;
|
|
3300
|
+
linkRequestId?: string;
|
|
3301
|
+
holdReleased: boolean;
|
|
3302
|
+
retryGuidance?: string;
|
|
3303
|
+
});
|
|
3304
|
+
}
|
|
3305
|
+
/** The person declined the Link card request, or it was cancelled in Link. */
|
|
3306
|
+
declare class LinkCardDeniedError extends LinkCardError {
|
|
3307
|
+
constructor(input: ConstructorParameters<typeof LinkCardError>[0]);
|
|
3308
|
+
}
|
|
3309
|
+
/** The Link card request expired before the person approved it. */
|
|
3310
|
+
declare class LinkCardExpiredError extends LinkCardError {
|
|
3311
|
+
constructor(input: ConstructorParameters<typeof LinkCardError>[0]);
|
|
3312
|
+
}
|
|
3313
|
+
/** The person did not approve in Link before linkApprovalTimeoutMs. Conto cancelled the request. */
|
|
3314
|
+
declare class LinkCardTimeoutError extends LinkCardError {
|
|
3315
|
+
constructor(input: ConstructorParameters<typeof LinkCardError>[0]);
|
|
3316
|
+
}
|
|
3317
|
+
/** The Link wallet cannot run here: link-cli is not installed or not logged in. */
|
|
3318
|
+
declare class LinkWalletUnavailableError extends LinkCardError {
|
|
3319
|
+
constructor(input: ConstructorParameters<typeof LinkCardError>[0]);
|
|
3320
|
+
}
|
|
2417
3321
|
interface ContoRequestOptions {
|
|
2418
3322
|
/** Set only when repeating this request cannot create an additional side effect. */
|
|
2419
3323
|
idempotent?: boolean;
|
|
@@ -2432,6 +3336,10 @@ declare class Conto {
|
|
|
2432
3336
|
testCards: TestCardsClient;
|
|
2433
3337
|
x402: X402Client;
|
|
2434
3338
|
mpp: MppClient;
|
|
3339
|
+
/** Purchases from a product URL and task to a merchant-confirmed order. */
|
|
3340
|
+
purchases: PurchasesClient;
|
|
3341
|
+
/** Repeat orders the agent's buyer set up. The agent starts each order. */
|
|
3342
|
+
recurringPurchases: RecurringPurchasesClient;
|
|
2435
3343
|
constructor(config: ContoConfig);
|
|
2436
3344
|
/**
|
|
2437
3345
|
* Normalize and durably revise a partial agent purchase proposal without
|
|
@@ -2510,6 +3418,15 @@ declare class Conto {
|
|
|
2510
3418
|
* diagnostics without creating a payment.
|
|
2511
3419
|
*/
|
|
2512
3420
|
setup(): Promise<AgentSetupResult>;
|
|
3421
|
+
/**
|
|
3422
|
+
* Opens an authenticated server-sent event stream. Used by
|
|
3423
|
+
* `purchases.watch()`. The server closes it after about 50 seconds.
|
|
3424
|
+
* @internal
|
|
3425
|
+
*/
|
|
3426
|
+
openStream(path: string, init?: {
|
|
3427
|
+
signal?: AbortSignal;
|
|
3428
|
+
lastEventId?: string;
|
|
3429
|
+
}): Promise<Response>;
|
|
2513
3430
|
/** Make an authenticated request to the Conto API */
|
|
2514
3431
|
request<T>(method: string, path: string, body?: Record<string, unknown>, options?: ContoRequestOptions): Promise<T>;
|
|
2515
3432
|
}
|
|
@@ -2597,17 +3514,34 @@ declare class ConnectedCardsClient {
|
|
|
2597
3514
|
* ```
|
|
2598
3515
|
*/
|
|
2599
3516
|
draw(input: ConnectedCardDrawInput): Promise<ConnectedCardDrawResult>;
|
|
3517
|
+
/** Record receipt after a fresh draw. Does not confirm checkout or payment settlement. */
|
|
3518
|
+
acknowledgeDelivery(requestId: string): Promise<{
|
|
3519
|
+
acknowledged: boolean;
|
|
3520
|
+
settlementVerified: false;
|
|
3521
|
+
}>;
|
|
3522
|
+
/**
|
|
3523
|
+
* Report what happened with the card number after checkout.
|
|
3524
|
+
*
|
|
3525
|
+
* `USED` at the full approved amount closes the draw. `NOT_USED`, or `USED`
|
|
3526
|
+
* with a smaller `amountMinor`, is recorded and shown to a person, who
|
|
3527
|
+
* confirms it before the held amount is released. A report never releases
|
|
3528
|
+
* held spend by itself and does not confirm settlement. Safe to repeat with
|
|
3529
|
+
* the same report. A different second report gets HTTP 409.
|
|
3530
|
+
*
|
|
3531
|
+
* @example
|
|
3532
|
+
* ```typescript
|
|
3533
|
+
* await conto.connectedCards.reportOutcome(draw.requestId, { outcome: 'USED' });
|
|
3534
|
+
* await conto.connectedCards.reportOutcome(draw.requestId, { outcome: 'USED', amountMinor: 1850 });
|
|
3535
|
+
* await conto.connectedCards.reportOutcome(draw.requestId, { outcome: 'NOT_USED' });
|
|
3536
|
+
* ```
|
|
3537
|
+
*/
|
|
3538
|
+
reportOutcome(requestId: string, report: ConnectedCardOutcomeReport): Promise<ConnectedCardOutcomeReportResult>;
|
|
2600
3539
|
/**
|
|
2601
3540
|
* List the connected cards and active mandates this agent may draw against.
|
|
2602
3541
|
*
|
|
2603
3542
|
* The response is masked: no PAN and no provider tokens. This is a read-only
|
|
2604
3543
|
* GET, so transport retry on transient failures is safe.
|
|
2605
3544
|
*/
|
|
2606
|
-
/** Record receipt after a fresh draw. Does not confirm checkout or payment settlement. */
|
|
2607
|
-
acknowledgeDelivery(requestId: string): Promise<{
|
|
2608
|
-
acknowledged: boolean;
|
|
2609
|
-
settlementVerified: false;
|
|
2610
|
-
}>;
|
|
2611
3545
|
list(): Promise<ConnectedCardListResult>;
|
|
2612
3546
|
}
|
|
2613
3547
|
/**
|
|
@@ -2823,6 +3757,37 @@ declare class CheckoutClient {
|
|
|
2823
3757
|
*/
|
|
2824
3758
|
cancel(checkpointId: string): Promise<CheckoutCheckpoint>;
|
|
2825
3759
|
get(checkpointId: string): Promise<CheckoutCheckpoint>;
|
|
3760
|
+
/**
|
|
3761
|
+
* Get a Stripe Link card for one purchase, issued only after Conto approves
|
|
3762
|
+
* it. Call this at the payment step, once the final total with shipping and
|
|
3763
|
+
* tax is known.
|
|
3764
|
+
*
|
|
3765
|
+
* 1. Conto runs checkpoint 1 and holds the spend. When a rule requires the
|
|
3766
|
+
* owner's approval, this waits for it.
|
|
3767
|
+
* 2. Only then does the wallet ask Link for a card for exactly the approved
|
|
3768
|
+
* amount at this merchant. The person approves it in their Link app.
|
|
3769
|
+
* 3. The card is returned. It never reaches Conto.
|
|
3770
|
+
*
|
|
3771
|
+
* Then fill in the card, call confirm(result.checkpoint, { amountMinor,
|
|
3772
|
+
* paymentReference: result.paymentReference }) right before paying, pay only
|
|
3773
|
+
* if it resolves, and report the outcome. If the final total differs, call
|
|
3774
|
+
* replaceLinkCard() instead of confirming.
|
|
3775
|
+
*
|
|
3776
|
+
* A Conto denial throws before Link is called. When Link declines, expires,
|
|
3777
|
+
* times out, or is unavailable, this cancels the checkpoint to release the
|
|
3778
|
+
* held spend and throws a LinkCardError. When Conto cannot cancel an open Link
|
|
3779
|
+
* request, it keeps the hold and throws LINK_CARD_NOT_CANCELLED with the
|
|
3780
|
+
* request id. Retrying with the same input resumes the same checkpoint and
|
|
3781
|
+
* Link request.
|
|
3782
|
+
*/
|
|
3783
|
+
getLinkCard(input: GetLinkCardInput): Promise<LinkCardResult>;
|
|
3784
|
+
/**
|
|
3785
|
+
* The final total differs from the one the Link card covers. This cancels
|
|
3786
|
+
* the old Link request and checkpoint, begins a checkpoint at the final
|
|
3787
|
+
* total (waiting for the owner when a rule requires it), and gets a new card
|
|
3788
|
+
* for it. Confirm the returned checkpoint with the same total.
|
|
3789
|
+
*/
|
|
3790
|
+
replaceLinkCard(previous: LinkCardResult, input: ReplaceLinkCardInput): Promise<LinkCardResult>;
|
|
2826
3791
|
}
|
|
2827
3792
|
|
|
2828
|
-
export { type AdminExternalCardOverlayEnforcement, type Agent, type AgentCheckoutAction, type AgentCheckoutActionKind, type AgentExternalCard, type AgentSetupResult, type AgentStatus, type AgentType, type AgentWalletLink, type ApprovedExternalCardExecution, type AssignExternalCardInput, type AssignedPolicy, type AuthorizeCheckoutActionResult, type BeginCheckoutCheckpointInput, type BeginCommerceExecutionInput, type BrowserActionClaimResult, type BrowserActionDispatchObservationInput, BrowserActionFinalizationPendingError, type BrowserActionFinalizeResult, type BrowserCheckoutAction, type BrowserCheckoutTargetResolver, type BrowserCheckoutTargetSnapshot, type BrowserCheckoutTargetVerificationCode, BrowserCheckoutTargetVerificationError, type CanonicalBrowserCheckoutTargetSnapshot, CardsClient, type ChainType, type CheckoutActionAuthorization, CheckoutApprovalDeniedError, CheckoutApprovalExpiredError, CheckoutApprovalPendingError, CheckoutApprovalTimeoutError, type CheckoutCheckpoint, type CheckoutCheckpointApproval, CheckoutCheckpointClosedError, type CheckoutCheckpointMethod, type CheckoutCheckpointNextAction, type CheckoutCheckpointStage, CheckoutClient, type CheckoutOutcome, type CommerceCheckoutMethod, type CommerceContextRequirement, type CommerceExecution, type CommerceExecutionAdapterKind, type CommerceExecutionArtifactKind, type CommerceExecutionChannel, type CommerceExecutionConstraint, type CommerceExecutionConstraintCoverage, type CommerceExecutionConstraintCoverageLevel, type CommerceExecutionDeliveryMode, type CommerceExecutionEvidence, type CommerceExecutionProvider, type CommerceExecutionResult, type CommerceExecutionSourceKind, type CommerceExecutionStatus, type CommerceFactConfidence, type CommerceFactProvenanceInput, type CommerceFactSource, type CommerceFulfillmentInput, type CommerceLineItemInput, type CommerceProposalFactKey, type CommerceProposalMissingFact, type CommerceProposalResolution, type CommerceProposalState, type CommerceSettlementRail, type CommerceTotalInput, type CommerceTotalType, type ComparePolicyVersionsResponse, type ConfirmCheckoutCheckpointInput, type ConnectedCardBrief, type ConnectedCardCredential, type ConnectedCardDrawInput, type ConnectedCardDrawMerchant, type ConnectedCardDrawResult, type ConnectedCardDrawable, type ConnectedCardListResult, type ConnectedCardMandate, type ConnectedCardMandateMerchant, type ConnectedCardReference, ConnectedCardsClient, Conto, ContoAdmin, type ContoAdminConfig, ContoAdminError, type ContoConfig, ContoError, type ContoRequestOptions, type ControlledExternalCardPaymentResult, ControlledExternalCardPaymentTool, type CreateAgentInput, type CreatePolicyInput, type CreatePolicyRuleInput, type CreateSdkKeyInput, type CreateSdkKeyResult, type CreateWalletInput, type CustodyType, type CustomerCustodyMode, type CustomerWalletControlModel, type CustomerWalletKeyAccess, type DelegationType, type ExecuteCommerceExecutionResult, type ExternalCard, type ExternalCardApprovalInput, type ExternalCardApprovalResult, type ExternalCardConfirmationInput, ExternalCardConfirmationPendingError, type ExternalCardConfirmationResult, type ExternalCardExecutionClaimResult, type ExternalCardExecutionResult, type ExternalCardExecutor, type ExternalCardOverlayEnforcement, type ExternalCardRequestStatusResult, type ExternalWalletApprovalInput, type ExternalWalletApprovalResult, type ExternalWalletConfirmationInput, type ExternalWalletConfirmationResult, type FreezeAgentInput, Conto as Giro, type ContoConfig as GiroConfig, ContoError as GiroError, type GuardCheckoutResult, type GuardedBrowserDispatchResult, type GuardedCheckoutInput, type LinkWalletInput, type ListAgentsParams, type ListAgentsResponse, type ListPoliciesParams, type ListPoliciesResponse, type ListPolicyVersionsResponse, type ListWalletsParams, type ListWalletsResponse, type MppBudgetResult, type MppPreAuthorizeInput, type MppPreAuthorizeResult, type MppRecordInput, type MppRecordResult, type NormalizeCommerceProposalInput, type OrganizationMember, type PaginatedResponse, type PaginationParams, type PauseExternalCardAssignmentResult, type PaymentExecuteResult, type PaymentRequestInput, type PaymentRequestResult, type PaymentStatusResult, type Policy, type PolicyRule, type PolicyType, type PolicyVersionChangeType, type PolicyVersionDetail, type PolicyVersionDiff, type PolicyVersionFieldChange, type PolicyVersionSnapshot, type PolicyVersionSnapshotRule, type PolicyVersionSummary, type PrivilegedBrowserCheckoutDriver, type ProtocolBudgetResult, type ProtocolPreAuthorizeResult, type ProtocolRecordGrant, type ProtocolRecordGrantResult, type ProtocolServiceSummary, type ProtocolServicesResult, type ProvisionWalletResult, type RefreshBalanceResult, type RegisterExternalCardInput, type ReportCheckoutOutcomeInput, type RollbackPolicyVersionResponse, type RuleAction, type RuleOperator, type RuleType, type RunGuardedCheckoutResult, type SdkKey, type SdkKeyType, type SetupCapabilityState, type SetupCardDiagnostics, type SetupDiagnosticAction, type SetupDiagnosticIssue, type SetupDiagnosticIssueCode, type SetupDiagnostics, type SetupWalletDiagnostics, type TestCardCredential, type TestCardDrawResult, type TestCardDrawable, type TestCardListResult, type TestCardReceipt, TestCardsClient, type TestCheckoutInput, type TestCheckoutResult, type TestMerchant, type TestMerchantProduct, type UnfreezeAgentInput, type UpdateAgentInput, type UpdateExternalCardAssignmentInput, type UpdatePolicyInput, type UpdatePolicyRuleInput, type UpdateWalletInput, type VerifiedBrowserCheckoutTarget, type WaitForCheckoutApprovalOptions, type Wallet, type WalletChainBalanceSnapshot, type WalletStatus, type WalletType, type X402Authorization, type X402BudgetResult, type X402PayInput, type X402PayResult, type X402PaymentRequirements, type X402PreAuthorizeInput, type X402PreAuthorizeResult, type X402RecordInput, type X402RecordResult, canonicalizeBrowserCheckoutTarget, createVerifiedBrowserCheckoutDriver, Conto as default, fingerprintBrowserCheckoutTarget };
|
|
3793
|
+
export { type AdminExternalCardOverlayEnforcement, AdminPurchasingClient, type Agent, type AgentCheckoutAction, type AgentCheckoutActionKind, type AgentExternalCard, type AgentSetupResult, type AgentStatus, type AgentType, type AgentWalletLink, type ApprovedExternalCardExecution, type AssignExternalCardInput, type AssignedPolicy, type AuthorizeCheckoutActionResult, type BeginCheckoutCheckpointInput, type BeginCommerceExecutionInput, type BrowserActionClaimResult, type BrowserActionDispatchObservationInput, BrowserActionFinalizationPendingError, type BrowserActionFinalizeResult, type BrowserCheckoutAction, type BrowserCheckoutTargetResolver, type BrowserCheckoutTargetSnapshot, type BrowserCheckoutTargetVerificationCode, BrowserCheckoutTargetVerificationError, type CancellationOutcome, type CanonicalBrowserCheckoutTargetSnapshot, CardsClient, type ChainType, type CheckoutActionAuthorization, CheckoutApprovalDeniedError, CheckoutApprovalExpiredError, CheckoutApprovalPendingError, CheckoutApprovalTimeoutError, type CheckoutCheckpoint, type CheckoutCheckpointApproval, CheckoutCheckpointClosedError, type CheckoutCheckpointMethod, type CheckoutCheckpointNextAction, type CheckoutCheckpointStage, CheckoutClient, type CheckoutOutcome, type CheckoutPaymentReference, type CommerceCheckoutMethod, type CommerceContextRequirement, type CommerceExecution, type CommerceExecutionAdapterKind, type CommerceExecutionArtifactKind, type CommerceExecutionChannel, type CommerceExecutionConstraint, type CommerceExecutionConstraintCoverage, type CommerceExecutionConstraintCoverageLevel, type CommerceExecutionDeliveryMode, type CommerceExecutionEvidence, type CommerceExecutionProvider, type CommerceExecutionResult, type CommerceExecutionSourceKind, type CommerceExecutionStatus, type CommerceFactConfidence, type CommerceFactProvenanceInput, type CommerceFactSource, type CommerceFulfillmentInput, type CommerceLineItemInput, type CommerceProposalFactKey, type CommerceProposalMissingFact, type CommerceProposalResolution, type CommerceProposalState, type CommerceSettlementRail, type CommerceTotalInput, type CommerceTotalType, type ComparePolicyVersionsResponse, type ConfirmCheckoutCheckpointInput, type ConnectedCardBrief, type ConnectedCardCredential, type ConnectedCardDrawInput, type ConnectedCardDrawMerchant, type ConnectedCardDrawResult, type ConnectedCardDrawable, type ConnectedCardListResult, type ConnectedCardMandate, type ConnectedCardMandateMerchant, type ConnectedCardOutcomeReport, type ConnectedCardOutcomeReportResult, type ConnectedCardReference, ConnectedCardsClient, Conto, ContoAdmin, type ContoAdminConfig, ContoAdminError, type ContoConfig, ContoError, type ContoRequestOptions, type ControlledExternalCardPaymentResult, ControlledExternalCardPaymentTool, type CreateAgentInput, type CreatePolicyInput, type CreatePolicyRuleInput, type CreatePurchaseInput, type CreateSdkKeyInput, type CreateSdkKeyResult, type CreateWalletInput, type CustodyType, type CustomerCustodyMode, type CustomerWalletControlModel, type CustomerWalletKeyAccess, type DelegationType, type ExecuteCommerceExecutionResult, type ExternalCard, type ExternalCardApprovalInput, type ExternalCardApprovalResult, type ExternalCardConfirmationInput, ExternalCardConfirmationPendingError, type ExternalCardConfirmationResult, type ExternalCardExecutionClaimResult, type ExternalCardExecutionResult, type ExternalCardExecutor, type ExternalCardOverlayEnforcement, type ExternalCardRequestStatusResult, type ExternalWalletApprovalInput, type ExternalWalletApprovalResult, type ExternalWalletConfirmationInput, type ExternalWalletConfirmationResult, type FreezeAgentInput, type GetLinkCardInput, Conto as Giro, type ContoConfig as GiroConfig, ContoError as GiroError, type GuardCheckoutResult, type GuardedBrowserDispatchResult, type GuardedCheckoutInput, LinkCardCredential, LinkCardDeniedError, LinkCardError, LinkCardExpiredError, type LinkCardResult, LinkCardTimeoutError, LinkWallet, type LinkWalletInput, LinkWalletUnavailableError, type ListAgentsParams, type ListAgentsResponse, type ListPoliciesParams, type ListPoliciesResponse, type ListPolicyVersionsResponse, type ListWalletsParams, type ListWalletsResponse, type MppBudgetResult, type MppPreAuthorizeInput, type MppPreAuthorizeResult, type MppRecordInput, type MppRecordResult, type NormalizeCommerceProposalInput, type OrganizationMember, OrganizationPurchasesClient, OrganizationRecurringPurchasesClient, type PaginatedResponse, type PaginationParams, type PauseExternalCardAssignmentResult, type PaymentExecuteResult, type PaymentRequestInput, type PaymentRequestResult, type PaymentStatusResult, type Policy, type PolicyRule, type PolicyType, type PolicyVersionChangeType, type PolicyVersionDetail, type PolicyVersionDiff, type PolicyVersionFieldChange, type PolicyVersionSnapshot, type PolicyVersionSnapshotRule, type PolicyVersionSummary, type PrivilegedBrowserCheckoutDriver, type ProtocolBudgetResult, type ProtocolPreAuthorizeResult, type ProtocolRecordGrant, type ProtocolRecordGrantResult, type ProtocolServiceSummary, type ProtocolServicesResult, type ProvisionWalletResult, type Purchase, type PurchaseAction, type PurchaseActionAuthority, type PurchaseActionKind, type PurchaseAllowance, type PurchaseBuyer, type PurchaseBuyerCompanyCard, type PurchaseBuyerCompanyCardLimits, type PurchaseBuyerKitchenContext, type PurchaseCompanyCard, type PurchaseDelegation, type PurchaseEvent, type PurchaseEventPage, type PurchaseEvidence, type PurchaseGroceryItem, type PurchaseGroceryList, type PurchaseHostedLink, type PurchaseItem, type PurchaseKitchenContext, type PurchaseKitchenInventoryItem, type PurchaseKitchenListItem, type PurchaseKitchenPreferences, type PurchaseKitchenRecipe, type PurchaseKitchenUsual, type PurchaseList, type PurchaseMoney, type PurchasePaymentMethod, type PurchasePhase, type PurchaseRequest, type PurchaseResponseAck, type PurchaseStatus, PurchasesClient, type PurchasingCapabilities, type PurchasingSettings, type RecurringPurchase, type RecurringPurchaseCycleResult, type RecurringPurchaseCycleStatus, RecurringPurchasesClient, type RefreshBalanceResult, type RegisterExternalCardInput, type ReplaceLinkCardInput, type ReportCheckoutOutcomeInput, type RollbackPolicyVersionResponse, type RuleAction, type RuleOperator, type RuleType, type RunGuardedCheckoutResult, type SdkKey, type SdkKeyType, type SetupCapabilityState, type SetupCardDiagnostics, type SetupDiagnosticAction, type SetupDiagnosticIssue, type SetupDiagnosticIssueCode, type SetupDiagnostics, type SetupWalletDiagnostics, type TestCardCredential, type TestCardDrawResult, type TestCardDrawable, type TestCardListResult, type TestCardReceipt, TestCardsClient, type TestCheckoutInput, type TestCheckoutResult, type TestMerchant, type TestMerchantProduct, type UnfreezeAgentInput, type UpdateAgentInput, type UpdateExternalCardAssignmentInput, type UpdatePolicyInput, type UpdatePolicyRuleInput, type UpdateWalletInput, type VerifiedBrowserCheckoutTarget, type WaitForCheckoutApprovalOptions, type Wallet, type WalletChainBalanceSnapshot, type WalletStatus, type WalletType, type WatchPurchaseOptions, type X402Authorization, type X402BudgetResult, type X402PayInput, type X402PayResult, type X402PaymentRequirements, type X402PreAuthorizeInput, type X402PreAuthorizeResult, type X402RecordInput, type X402RecordResult, canonicalizeBrowserCheckoutTarget, createVerifiedBrowserCheckoutDriver, Conto as default, fingerprintBrowserCheckoutTarget, isFinalPurchaseStatus, parseServerSentEvents, verifyPurchaseWebhook };
|