@conto_finance/sdk 0.6.0-beta.2 → 0.6.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/dist/index.d.mts CHANGED
@@ -1,3 +1,513 @@
1
+ type PurchaseStatus = 'queued' | 'running' | 'awaiting_action' | 'submitting' | 'reconciling' | 'succeeded' | 'blocked' | 'failed' | 'cancelled';
2
+ type PurchasePhase = 'queued' | 'shopping' | 'checkout' | 'review' | 'scheduled' | 'authorization' | 'payment' | 'reconciliation' | 'closed_unconfirmed' | 'complete';
3
+ type PurchaseActionKind = 'buyer_details' | 'purchase_review' | 'organization_approval' | 'card_verification' | 'merchant_signin' | 'merchant_challenge';
4
+ type PurchaseActionAuthority = 'agent_or_buyer' | 'buyer' | 'cardholder' | 'organization';
5
+ interface PurchaseMoney {
6
+ /** Positive integer in minor units. */
7
+ amountMinor: number;
8
+ /** Uppercase ISO 4217. Purchases support USD only. */
9
+ currency: string;
10
+ }
11
+ interface PurchaseItem {
12
+ url: string;
13
+ title?: string;
14
+ quantity?: number;
15
+ options?: string[];
16
+ }
17
+ interface PurchaseAction {
18
+ id: string;
19
+ kind: PurchaseActionKind;
20
+ /** Only `agent_or_buyer` accepts `purchases.respond()`. */
21
+ authority: PurchaseActionAuthority;
22
+ revision: number;
23
+ expiresAt: string;
24
+ /** For buyer_details: the form and the field names it accepts. */
25
+ form?: 'delivery' | 'billing' | 'store_order_contact';
26
+ fields?: string[];
27
+ /**
28
+ * For buyer, cardholder and reviewer actions: the Conto page that completes
29
+ * it. It works only inside a hosted buyer session or the dashboard, so it is
30
+ * safe to show. For a seamless buyer handoff, have your server create a
31
+ * hosted action link with `ContoAdmin.purchasing.purchases.createActionLink()`.
32
+ */
33
+ url?: string;
34
+ }
35
+ interface PurchaseEvidence {
36
+ authorization: {
37
+ state: 'not_requested' | 'pending_review' | 'issued' | 'denied' | 'cancelled' | 'unknown';
38
+ };
39
+ merchant: {
40
+ state: 'not_submitted' | 'confirmed' | 'unknown';
41
+ source?: string;
42
+ reference?: string;
43
+ amount?: PurchaseMoney;
44
+ amountVerified?: boolean;
45
+ observedAt?: string;
46
+ };
47
+ /** Never observed: the card provider reports issuance only. */
48
+ settlement: {
49
+ state: 'unknown';
50
+ reason: 'NOT_REPORTED_BY_PROVIDER';
51
+ };
52
+ }
53
+ interface Purchase {
54
+ id: string;
55
+ object: 'purchase';
56
+ buyerId: string;
57
+ agentId: string;
58
+ environment: 'live' | 'test';
59
+ status: PurchaseStatus;
60
+ phase: PurchasePhase;
61
+ /** Increases by one with every visible change. */
62
+ version: number;
63
+ request: {
64
+ url: string;
65
+ task?: string;
66
+ items?: PurchaseItem[];
67
+ };
68
+ maxCost: PurchaseMoney;
69
+ quote: {
70
+ merchant: string;
71
+ description: string | null;
72
+ total: PurchaseMoney;
73
+ estimatedTax: boolean;
74
+ } | null;
75
+ requiredAction: PurchaseAction | null;
76
+ result: {
77
+ outcome: 'merchant_confirmed' | 'checkout_reported' | 'credential_unused' | 'not_completed' | 'denied' | 'cancelled';
78
+ merchantReference: string | null;
79
+ } | null;
80
+ paymentEvidence: PurchaseEvidence;
81
+ progress: {
82
+ steps: number;
83
+ message: string | null;
84
+ };
85
+ reasonCode: string | null;
86
+ cancellation: {
87
+ requestedAt: string;
88
+ } | null;
89
+ /** Present when the purchase pays under one of the buyer's open allowances. */
90
+ allowance?: {
91
+ id: string;
92
+ reviewSkipped: boolean;
93
+ };
94
+ /** Present when the purchase is one cycle of a repeat order. */
95
+ recurrence?: {
96
+ id: string;
97
+ cycleKey: string;
98
+ payAt: string | null;
99
+ changes: {
100
+ previousTotal?: {
101
+ amountMinor: number;
102
+ currency: string;
103
+ };
104
+ itemsChanged: boolean;
105
+ } | null;
106
+ };
107
+ createdAt: string;
108
+ updatedAt: string;
109
+ completedAt: string | null;
110
+ }
111
+ interface PurchaseEvent {
112
+ id: string;
113
+ purchaseId: string;
114
+ version: number;
115
+ /** purchase.created, purchase.updated, purchase.action_required, purchase.<final status>, or purchase.resync */
116
+ type: string;
117
+ createdAt: string;
118
+ data: Purchase;
119
+ }
120
+ interface PurchaseEventPage {
121
+ items: PurchaseEvent[];
122
+ latestVersion: number;
123
+ nextCursor: number;
124
+ hasMore: boolean;
125
+ }
126
+ interface PurchaseList {
127
+ items: Purchase[];
128
+ total: number;
129
+ limit: number;
130
+ offset: number;
131
+ }
132
+ interface CreatePurchaseInput {
133
+ buyerId: string;
134
+ request: {
135
+ url: string;
136
+ task?: string;
137
+ items?: PurchaseItem[];
138
+ };
139
+ /** The most this purchase may cost, delivered. It narrows the delegation, never widens it. */
140
+ maxCost: PurchaseMoney;
141
+ /**
142
+ * The card and delegation to pay with. Leave it out when the buyer has one
143
+ * active delegation for the store: a test card for a Conto test store, a
144
+ * live card otherwise. With more than one, the API refuses with
145
+ * `PAYMENT_METHOD_REQUIRED`.
146
+ */
147
+ payment?: {
148
+ methodId: string;
149
+ delegationId: string;
150
+ };
151
+ /** The buyer id, to use the buyer's saved delivery details. */
152
+ buyerProfileId?: string;
153
+ }
154
+ interface PurchaseResponseAck {
155
+ id: string;
156
+ object: 'purchase_response';
157
+ purchaseId: string;
158
+ actionId: string;
159
+ /** accepted: recorded, not yet applied. applied: used. rejected: could not be used. */
160
+ status: 'accepted' | 'applied' | 'rejected';
161
+ reasonCode: string | null;
162
+ acceptedAt: string;
163
+ appliedAt: string | null;
164
+ replayed: boolean;
165
+ }
166
+ type CancellationOutcome = 'cancelled' | 'requested' | 'too_late' | 'already_final';
167
+ interface WatchPurchaseOptions {
168
+ /** Resume after this version. Defaults to 0, the full history. */
169
+ after?: number;
170
+ signal?: AbortSignal;
171
+ /** auto streams and falls back to polling. Defaults to auto. */
172
+ mode?: 'auto' | 'stream' | 'poll';
173
+ /** Polling interval. Defaults to 2000 ms. */
174
+ pollIntervalMs?: number;
175
+ /** Stop waiting after this long. Defaults to no limit. */
176
+ maxWaitMs?: number;
177
+ }
178
+ declare const isFinalPurchaseStatus: (status: PurchaseStatus) => boolean;
179
+ interface PurchaseTransport {
180
+ request<T>(method: string, path: string, body?: Record<string, unknown>, options?: {
181
+ idempotent?: boolean;
182
+ maxRetries?: number;
183
+ }): Promise<T>;
184
+ openStream(path: string, init: {
185
+ signal?: AbortSignal;
186
+ lastEventId?: string;
187
+ }): Promise<Response>;
188
+ }
189
+ type SseFrame = {
190
+ id?: string;
191
+ event: string;
192
+ data: string;
193
+ };
194
+ /** Parses server-sent events from a byte stream. */
195
+ declare function parseServerSentEvents(body: ReadableStream<Uint8Array>): AsyncGenerator<SseFrame>;
196
+ type RecurringPurchaseCycleStatus = 'checking' | 'scheduled' | 'needs_review' | 'paying' | 'paid' | 'skipped' | 'missed' | 'failed' | 'cancelled';
197
+ /** A repeat order the buyer set up while approving a purchase on Conto's hosted page. */
198
+ interface RecurringPurchase {
199
+ id: string;
200
+ object: 'recurring_purchase';
201
+ buyerId: string;
202
+ agentId: string;
203
+ paymentMethodId: string;
204
+ environment: 'live' | 'test';
205
+ status: 'active' | 'paused' | 'cancelled' | 'ended';
206
+ merchant: {
207
+ name: string;
208
+ };
209
+ description: string | null;
210
+ request: Record<string, unknown>;
211
+ cadence: {
212
+ unit: 'day' | 'month';
213
+ every: number;
214
+ label: string;
215
+ };
216
+ limits: {
217
+ /** The most one order may cost and still go through without the buyer's review. */
218
+ maxOrderMinor: number;
219
+ baselineMinor: number;
220
+ priceToleranceBps: number;
221
+ currency: 'USD';
222
+ };
223
+ /** How long before each order the buyer gets a heads-up. */
224
+ noticeMinutes: number;
225
+ skipNext: boolean;
226
+ nextDueAt: string | null;
227
+ expiresAt: string;
228
+ createdAt: string;
229
+ endedAt: string | null;
230
+ cycles: Array<{
231
+ cycleKey: string;
232
+ status: RecurringPurchaseCycleStatus;
233
+ purchaseId: string | null;
234
+ payAt: string | null;
235
+ total: {
236
+ amountMinor: number;
237
+ currency: string;
238
+ } | null;
239
+ createdAt: string;
240
+ }>;
241
+ }
242
+ interface RecurringPurchaseCycleResult {
243
+ recurrence: RecurringPurchase;
244
+ cycle: {
245
+ cycleKey: string;
246
+ status: RecurringPurchaseCycleStatus;
247
+ purchaseId: string | null;
248
+ };
249
+ /** The order's purchase when this call started it. Follow it like any purchase. */
250
+ purchase?: Purchase;
251
+ created: boolean;
252
+ }
253
+ /**
254
+ * Repeat orders. The buyer sets one up while approving a purchase. The agent
255
+ * starts each order with a cycle key that names it, such as `2026-W41`, so a
256
+ * retry never orders twice. Conto sends the buyer a heads-up and pays at the
257
+ * order's payment time, or asks the buyer when the order changed.
258
+ */
259
+ declare class RecurringPurchasesClient {
260
+ #private;
261
+ constructor(transport: PurchaseTransport, basePath?: string);
262
+ list(buyerId?: string): Promise<{
263
+ items: RecurringPurchase[];
264
+ }>;
265
+ get(id: string): Promise<RecurringPurchase>;
266
+ /** Starts one order. The same cycle key returns the same order. */
267
+ startCycle(id: string, cycleKey: string): Promise<RecurringPurchaseCycleResult>;
268
+ /** Skips one order, also before it starts. */
269
+ skipCycle(id: string, cycleKey: string): Promise<RecurringPurchaseCycleResult['cycle']>;
270
+ }
271
+ /** The organization's view of its buyers' repeat orders. It can also cancel one. */
272
+ declare class OrganizationRecurringPurchasesClient extends RecurringPurchasesClient {
273
+ #private;
274
+ constructor(client: PurchaseTransport);
275
+ /** Stops a repeat order. An order waiting for its payment time closes unpaid. */
276
+ cancel(id: string): Promise<RecurringPurchase>;
277
+ }
278
+ /**
279
+ * The agent's purchases. Card data, browser sessions and provider handles
280
+ * never appear here. Actions the agent may not complete (review, approval,
281
+ * card verification) are refused by the API and carry a Conto page `url`.
282
+ */
283
+ declare class PurchasesClient {
284
+ #private;
285
+ constructor(transport: PurchaseTransport, basePath?: string);
286
+ /**
287
+ * Starts a purchase and returns at once. Reusing the idempotency key with the
288
+ * same input returns the same purchase, so retrying after a lost response is safe.
289
+ */
290
+ create(input: CreatePurchaseInput, options: {
291
+ idempotencyKey: string;
292
+ }): Promise<Purchase>;
293
+ list(params?: {
294
+ limit?: number;
295
+ offset?: number;
296
+ status?: PurchaseStatus;
297
+ }): Promise<PurchaseList>;
298
+ get(id: string): Promise<Purchase>;
299
+ /**
300
+ * Answers an open action whose authority is `agent_or_buyer` with the fields
301
+ * it lists. The acknowledgment means recorded; the purchase shows the result.
302
+ * The same answer again returns the same acknowledgment.
303
+ */
304
+ respond(id: string, input: {
305
+ actionId: string;
306
+ fields: Record<string, unknown>;
307
+ revision?: number;
308
+ }): Promise<PurchaseResponseAck>;
309
+ events(id: string, params?: {
310
+ after?: number;
311
+ limit?: number;
312
+ }): Promise<PurchaseEventPage>;
313
+ /**
314
+ * Requests cancellation. Before payment the purchase stops. Once payment may
315
+ * have been submitted, `cancellationOutcome` is `too_late` and the purchase
316
+ * stays in reconciliation. Nothing is refunded by this call.
317
+ */
318
+ cancel(id: string): Promise<Purchase & {
319
+ cancellationOutcome: CancellationOutcome;
320
+ }>;
321
+ /**
322
+ * Yields the purchase's events in version order until it reaches a final
323
+ * status. Streams with server-sent events and reconnects from the last
324
+ * version; falls back to polling where streaming is unavailable. A duplicate
325
+ * after a reconnect is dropped. A `purchase.resync` event carries the
326
+ * current purchase when the cursor could not be resumed.
327
+ */
328
+ watch(id: string, options?: WatchPurchaseOptions): AsyncGenerator<PurchaseEvent>;
329
+ }
330
+ interface PurchaseBuyer {
331
+ id: string;
332
+ object: 'buyer';
333
+ externalId: string;
334
+ agentId: string;
335
+ status: 'active' | 'stopped';
336
+ limits: {
337
+ perPurchaseMinor: number;
338
+ dailyMinor: number;
339
+ currency: 'USD';
340
+ confirmed: boolean;
341
+ };
342
+ createdAt: string;
343
+ }
344
+ interface PurchasePaymentMethod {
345
+ id: string;
346
+ object: 'payment_method';
347
+ buyerId: string;
348
+ type: 'card';
349
+ environment: 'live' | 'test';
350
+ brand: string;
351
+ last4: string;
352
+ status: 'active' | 'removed';
353
+ createdAt: string;
354
+ }
355
+ interface PurchaseDelegation {
356
+ id: string;
357
+ object: 'delegation';
358
+ buyerId: string;
359
+ agentId: string;
360
+ paymentMethodId: string;
361
+ status: 'active' | 'revoked';
362
+ scope: 'merchant_bound_single_use';
363
+ limits: {
364
+ perPurchaseMinor: number;
365
+ dailyMinor: number;
366
+ currency: 'USD';
367
+ };
368
+ requiresPurchaseReview: true;
369
+ requiresCardVerification: boolean;
370
+ createdAt: string;
371
+ revokedAt: string | null;
372
+ }
373
+ interface PurchaseHostedLink {
374
+ id: string;
375
+ object: 'hosted_link';
376
+ purpose: 'setup' | 'purchase';
377
+ buyerId: string;
378
+ purchaseId: string | null;
379
+ /** Single use. Send the buyer here. Expires in 10 minutes. */
380
+ url: string;
381
+ expiresAt: string;
382
+ }
383
+ interface PurchasingCapabilities {
384
+ object: 'purchasing_capabilities';
385
+ /** Test mode is open to every organization. Live needs Conto to enable it. */
386
+ environments: Record<'test' | 'live', {
387
+ available: boolean;
388
+ reason?: string;
389
+ }>;
390
+ currencies: string[];
391
+ cardNetworks: string[];
392
+ executors: Array<{
393
+ executor: string;
394
+ available: boolean;
395
+ [key: string]: unknown;
396
+ }>;
397
+ /** Whether buyers can let their agent buy at a store without review, per environment. */
398
+ allowances?: Record<'test' | 'live', {
399
+ available: boolean;
400
+ }>;
401
+ unsupported: Array<{
402
+ capability: string;
403
+ reason: string;
404
+ }>;
405
+ }
406
+ /** The organization client's transport. Same shape as the agent client's. */
407
+ type AdminTransport = PurchaseTransport;
408
+ /** The organization's purchases. Adds buyer filtering and hosted action links. */
409
+ declare class OrganizationPurchasesClient extends PurchasesClient {
410
+ #private;
411
+ constructor(client: AdminTransport);
412
+ list(params?: {
413
+ limit?: number;
414
+ offset?: number;
415
+ status?: PurchaseStatus;
416
+ buyerId?: string;
417
+ }): Promise<PurchaseList>;
418
+ /** A single-use link that opens the purchase's buyer actions on Conto's hosted page. */
419
+ createActionLink(id: string, input?: {
420
+ returnUrl?: string;
421
+ }): Promise<PurchaseHostedLink>;
422
+ }
423
+ /**
424
+ * Buyers, hosted setup, payment methods, delegations and purchase oversight.
425
+ * Only a buyer on Conto's hosted page can add a card or create a delegation.
426
+ */
427
+ declare class AdminPurchasingClient {
428
+ #private;
429
+ constructor(client: AdminTransport);
430
+ /** Buyers' repeat orders: list, read, start or skip an order, and cancel. */
431
+ readonly recurringPurchases: OrganizationRecurringPurchasesClient;
432
+ readonly buyers: {
433
+ /** Maps one of your users to a buyer with its own agent, or returns the existing one. */
434
+ create: (input: {
435
+ externalId: string;
436
+ email: string;
437
+ }) => Promise<PurchaseBuyer>;
438
+ get: (id: string) => Promise<PurchaseBuyer>;
439
+ list: (params?: {
440
+ limit?: number;
441
+ offset?: number;
442
+ }) => Promise<{
443
+ items: PurchaseBuyer[];
444
+ total: number;
445
+ limit: number;
446
+ offset: number;
447
+ }>;
448
+ /** Stops the buyer's agent. Purchases that may already be paid stay visible. */
449
+ stop: (id: string) => Promise<PurchaseBuyer>;
450
+ };
451
+ readonly paymentMethods: {
452
+ /** A single-use link to the hosted setup page: limits, card and delegation. */
453
+ createSetupLink: (input: {
454
+ buyerId: string;
455
+ returnUrl?: string;
456
+ environment?: "live" | "test";
457
+ }) => Promise<PurchaseHostedLink>;
458
+ list: (buyerId: string) => Promise<{
459
+ items: PurchasePaymentMethod[];
460
+ }>;
461
+ remove: (id: string) => Promise<{
462
+ id: string;
463
+ removed: true;
464
+ }>;
465
+ };
466
+ readonly delegations: {
467
+ list: (buyerId: string) => Promise<{
468
+ items: PurchaseDelegation[];
469
+ }>;
470
+ get: (id: string) => Promise<PurchaseDelegation>;
471
+ revoke: (id: string) => Promise<PurchaseDelegation>;
472
+ };
473
+ /**
474
+ * Purchases with the organization key: start one for a buyer, answer its
475
+ * ordinary forms, follow it and cancel it, with the same methods as the
476
+ * agent client. Buyer actions open on Conto's hosted page from `createActionLink`.
477
+ */
478
+ readonly purchases: OrganizationPurchasesClient;
479
+ readonly settings: {
480
+ get: () => Promise<{
481
+ allowedReturnOrigins: string[];
482
+ }>;
483
+ update: (input: {
484
+ allowedReturnOrigins: string[];
485
+ }) => Promise<{
486
+ allowedReturnOrigins: string[];
487
+ }>;
488
+ };
489
+ /** What this organization can run now: test mode always, live once Conto enables it. */
490
+ capabilities(): Promise<PurchasingCapabilities>;
491
+ }
492
+ /**
493
+ * Verifies a purchase webhook. Pass the raw request body exactly as received,
494
+ * the X-Conto-Signature header and your organization's webhook signing secret.
495
+ * Refuses a bad signature and a delivery older than the tolerance. Deduplicate
496
+ * on the returned deliveryId, which is the same on every retry.
497
+ */
498
+ declare function verifyPurchaseWebhook(input: {
499
+ body: string;
500
+ signature: string | null | undefined;
501
+ secret: string;
502
+ toleranceSeconds?: number;
503
+ now?: Date;
504
+ }): {
505
+ event: string;
506
+ timestamp: string;
507
+ deliveryId: string;
508
+ data: PurchaseEvent;
509
+ };
510
+
1
511
  interface ApiErrorMetadata {
2
512
  code: string;
3
513
  status: number;
@@ -638,40 +1148,6 @@ interface RollbackPolicyVersionResponse extends Policy {
638
1148
  restoredFromVersion: number;
639
1149
  newVersion: number | null;
640
1150
  }
641
- type StripeLinkCheckoutReadinessStatus = 'NOT_READY' | 'READY_FOR_VERIFICATION' | 'VERIFIED' | 'VERIFICATION_FAILED';
642
- type StripeLinkCheckoutVerification = 'NOT_RUN' | 'NOT_READY' | 'VERIFIED' | 'ACCOUNT_MISMATCH' | 'PROVIDER_UNAVAILABLE';
643
- /**
644
- * Non-identifying readiness projection for the configured Stripe Link
645
- * Checkout adapter. Merchant/account identifiers, URLs, credentials, hashes,
646
- * Stripe objects, and raw provider errors are intentionally absent.
647
- */
648
- interface StripeLinkCheckoutReadiness {
649
- readonly status: StripeLinkCheckoutReadinessStatus;
650
- readonly mode: 'TEST' | 'LIVE' | null;
651
- readonly checks: {
652
- readonly providerEnabled: boolean;
653
- readonly checkoutEnabled: boolean;
654
- readonly organizationAllowed: boolean;
655
- readonly configurationValid: boolean;
656
- readonly accountVerified: boolean;
657
- };
658
- readonly canVerify: boolean;
659
- readonly verifiedAt: string | null;
660
- readonly verification: StripeLinkCheckoutVerification;
661
- readonly scope: {
662
- readonly configuredMerchantCheckoutOnly: true;
663
- readonly statement: string;
664
- };
665
- readonly link: {
666
- readonly eligibilityGuaranteed: false;
667
- readonly displayGuaranteed: false;
668
- readonly selectionGuaranteed: false;
669
- readonly statement: string;
670
- };
671
- }
672
- interface StripeLinkCheckoutReadinessResult {
673
- readonly readiness: StripeLinkCheckoutReadiness;
674
- }
675
1151
  declare class ContoAdmin {
676
1152
  #private;
677
1153
  private baseUrl;
@@ -681,21 +1157,25 @@ declare class ContoAdmin {
681
1157
  cards: AdminCardsClient;
682
1158
  policies: PoliciesClient;
683
1159
  team: TeamClient;
684
- paymentRails: PaymentRailsClient;
1160
+ /** Buyers, hosted setup, payment methods, delegations and purchases. */
1161
+ purchasing: AdminPurchasingClient;
685
1162
  constructor(config: ContoAdminConfig);
686
- /** Make an authenticated request to the Conto API */
687
- request<T>(method: string, path: string, body?: Record<string, unknown>): Promise<T>;
688
- }
689
- declare class PaymentRailsClient {
690
- private client;
691
- constructor(client: ContoAdmin);
692
- /** Read gate and configuration readiness without calling Stripe. */
693
- getStripeLinkCheckoutReadiness(): Promise<StripeLinkCheckoutReadinessResult>;
694
1163
  /**
695
- * Ask Conto to verify that its configured Stripe credential resolves to its
696
- * configured merchant account. This call never returns either identifier.
1164
+ * Opens an authenticated server-sent event stream. Used by
1165
+ * `purchasing.purchases.watch()`. The server closes it after about 50 seconds.
1166
+ * @internal
1167
+ */
1168
+ openStream(path: string, init?: {
1169
+ signal?: AbortSignal;
1170
+ lastEventId?: string;
1171
+ }): Promise<Response>;
1172
+ /**
1173
+ * Make an authenticated request to the Conto API. Reads retry. A write retries
1174
+ * only when `idempotent` says the API deduplicates it, as purchase creation does.
697
1175
  */
698
- verifyStripeLinkCheckoutAccount(): Promise<StripeLinkCheckoutReadinessResult>;
1176
+ request<T>(method: string, path: string, body?: Record<string, unknown>, options?: {
1177
+ idempotent?: boolean;
1178
+ }): Promise<T>;
699
1179
  }
700
1180
  declare class AdminCardsClient {
701
1181
  private client;
@@ -992,8 +1472,6 @@ interface ContoConfig {
992
1472
  baseUrl?: string;
993
1473
  /** Request timeout in milliseconds. Defaults to 30000 */
994
1474
  timeout?: number;
995
- /** Defaults for the configured live Link checkout pilot. These are IDs, never Link credentials. */
996
- link?: LinkPaymentDefaults;
997
1475
  }
998
1476
  interface PaymentRequestInput {
999
1477
  /** Amount in the wallet chain stablecoin */
@@ -1227,7 +1705,7 @@ interface PaymentRequestResult {
1227
1705
  /** Unique request ID - use this to execute or check status */
1228
1706
  requestId: string;
1229
1707
  /** Current status */
1230
- status: 'APPROVED' | 'DENIED' | 'REQUIRES_APPROVAL' | 'PROCESSING';
1708
+ status: 'APPROVED' | 'DENIED' | 'REQUIRES_APPROVAL' | 'PROCESSING' | 'COMPLETED';
1231
1709
  /** Requested amount */
1232
1710
  amount: number;
1233
1711
  /** Currency selected for the payment */
@@ -1527,6 +2005,23 @@ interface ConnectedCardDrawResult {
1527
2005
  /** Provider expiration of the one-time credential; present with a fresh credential. */
1528
2006
  credentialExpiresAt?: string;
1529
2007
  }
2008
+ /**
2009
+ * What happened with a card number the agent received. `USED` with no
2010
+ * `amountMinor` means the full approved amount.
2011
+ */
2012
+ interface ConnectedCardOutcomeReport {
2013
+ outcome: 'USED' | 'NOT_USED';
2014
+ /** `USED` only: the amount charged in USD cents, at most the approved amount. */
2015
+ amountMinor?: number;
2016
+ }
2017
+ interface ConnectedCardOutcomeReportResult {
2018
+ recorded: true;
2019
+ /** True when the report closed the draw: used at the full approved amount. */
2020
+ closed: boolean;
2021
+ /** True when a person must confirm before any held amount is released. */
2022
+ reviewRequired: boolean;
2023
+ settlementVerified: false;
2024
+ }
1530
2025
  interface ConnectedCardMandateMerchant {
1531
2026
  name: string | null;
1532
2027
  categoryCode: string | null;
@@ -1666,21 +2161,6 @@ interface TestCheckoutResult extends TestCardReceipt {
1666
2161
  replayed: boolean;
1667
2162
  status: 'COMPLETED';
1668
2163
  }
1669
- interface StripeLinkPaymentMethod {
1670
- id: string;
1671
- type: string;
1672
- isDefault: boolean;
1673
- displayLabel: string;
1674
- last4?: string;
1675
- eligibleCredentialTypes: string[];
1676
- }
1677
- interface ListStripeLinkPaymentMethodsResult {
1678
- /** Authenticated tenant context, returned so operators can verify a target before writes. */
1679
- organizationId: string;
1680
- connectionId: string;
1681
- /** Masked Link payment methods eligible for the bound agent. */
1682
- paymentMethods: StripeLinkPaymentMethod[];
1683
- }
1684
2164
  type CommerceTotalType = 'subtotal' | 'tax' | 'total' | 'items_base_amount' | 'items_discount' | 'discount' | 'fulfillment' | 'shipping' | 'fee' | 'gift_wrap' | 'tip' | 'store_credit';
1685
2165
  interface CommerceLineItemInput {
1686
2166
  name: string;
@@ -1705,8 +2185,8 @@ interface CommerceFulfillmentInput {
1705
2185
  countryCode?: string;
1706
2186
  }
1707
2187
  type CheckoutCheckpointMethod = 'LINK' | 'CARD' | 'SHOP_PAY' | 'PAYPAL';
1708
- type CheckoutCheckpointStage = 'APPROVED' | 'CONFIRMING' | 'CONFIRMED' | 'PAID' | 'NOT_PAID' | 'OUTCOME_UNKNOWN' | 'DENIED' | 'CANCELLED' | 'EXPIRED';
1709
- type CheckoutCheckpointNextAction = 'CONFIRM_BEFORE_PAYING' | 'PAY_THEN_REPORT_OUTCOME' | 'REPORT_OUTCOME' | 'WAIT' | 'NONE';
2188
+ type CheckoutCheckpointStage = 'AWAITING_APPROVAL' | 'APPROVED' | 'CONFIRMING' | 'CONFIRMED' | 'PAID' | 'NOT_PAID' | 'OUTCOME_UNKNOWN' | 'DENIED' | 'CANCELLED' | 'EXPIRED';
2189
+ type CheckoutCheckpointNextAction = 'WAIT_FOR_APPROVAL' | 'CONFIRM_BEFORE_PAYING' | 'PAY_THEN_REPORT_OUTCOME' | 'REPORT_OUTCOME' | 'WAIT' | 'NONE';
1710
2190
  type CheckoutOutcome = 'PAID' | 'NOT_PAID' | 'UNKNOWN';
1711
2191
  /** First checkpoint: the purchase as the checkout shows it before the payment method opens. */
1712
2192
  interface BeginCheckoutCheckpointInput {
@@ -1765,11 +2245,27 @@ interface CheckoutCheckpoint {
1765
2245
  lineItems: CommerceLineItemInput[];
1766
2246
  totals: CommerceTotalInput[];
1767
2247
  };
2248
+ /** While AWAITING_APPROVAL, when the owner's decision window closes. Otherwise when the approval lapses. */
1768
2249
  expiresAt: string;
2250
+ /** Present when the agent's rules sent this purchase to the owner for approval. */
2251
+ approval?: CheckoutCheckpointApproval;
1769
2252
  outcomeReference?: string;
1770
2253
  /** Outcomes are reported by your checkout. Conto does not verify settlement here. */
1771
2254
  settlementVerified: false;
1772
2255
  }
2256
+ interface CheckoutCheckpointApproval {
2257
+ requestId: string;
2258
+ status: 'PENDING' | 'APPROVED' | 'DENIED' | 'EXPIRED' | 'CANCELLED';
2259
+ /** Set while PENDING. */
2260
+ expiresAt?: string;
2261
+ }
2262
+ interface WaitForCheckoutApprovalOptions {
2263
+ /** Stop waiting after this long. Defaults to 10 minutes. The spend stays held until you cancel. */
2264
+ timeoutMs?: number;
2265
+ /** Time between status reads. Defaults to 5 seconds, minimum 1 second. */
2266
+ pollIntervalMs?: number;
2267
+ signal?: AbortSignal;
2268
+ }
1773
2269
  /** Exact Stripe Link purchase intent evaluated and bound by Conto policy. */
1774
2270
  interface BeginCommerceExecutionCommonInput {
1775
2271
  /** Stable key for this exact intent. Reuse it when reconciling or retrying begin. */
@@ -1861,66 +2357,6 @@ type BeginCommerceExecutionInput = (BeginConnectedLinkExecutionInput & {
1861
2357
  checkoutUrl: string;
1862
2358
  };
1863
2359
  });
1864
- /** Configuration inspection only: no policy evaluation, credential retrieval, or purchase. */
1865
- interface LinkSetupInput {
1866
- connectionId?: string;
1867
- paymentMethodId?: string;
1868
- merchantId?: string;
1869
- }
1870
- interface LinkSetupCheck {
1871
- code: string;
1872
- status: 'PASS' | 'BLOCKED' | 'WARNING';
1873
- actor: 'developer' | 'owner' | 'operator';
1874
- message: string;
1875
- }
1876
- interface LinkSetupResult {
1877
- version: 'conto.link-setup.v1';
1878
- mode: 'LIVE' | 'SIMULATED';
1879
- configurationStatus: 'CONFIGURED' | 'INCOMPLETE';
1880
- checks: LinkSetupCheck[];
1881
- missingScopes: string[];
1882
- checkout?: {
1883
- merchantId: string;
1884
- origin: string;
1885
- currency: 'USD';
1886
- maxAmountMinor: number;
1887
- };
1888
- paymentAuthorization: 'NOT_EVALUATED';
1889
- providerVerified: false;
1890
- settlementVerified: false;
1891
- }
1892
- /** Reusable owner-provisioned identifiers. Per-purchase values can override these defaults. */
1893
- interface LinkPaymentDefaults {
1894
- connectionId: string;
1895
- paymentMethodId: string;
1896
- }
1897
- /** Exact purchase facts for a configured USD digital-goods checkout. */
1898
- interface LinkPaymentInput {
1899
- /** Persist this key before calling pay; reuse it for this exact purchase across restarts. */
1900
- idempotencyKey: string;
1901
- connectionId?: string;
1902
- paymentMethodId?: string;
1903
- /** Canonical ID of a checkout profile already configured by the deployment operator. */
1904
- merchantId: string;
1905
- checkoutUrl: string;
1906
- amountMinor: number;
1907
- currency?: 'USD';
1908
- purpose: string;
1909
- category?: string;
1910
- lineItems: CommerceLineItemInput[];
1911
- /** Required when the final amount differs from the line-item sum. Include the exact total breakdown. */
1912
- totals?: CommerceTotalInput[];
1913
- }
1914
- type LinkPaymentNextAction = 'APPROVE_IN_LINK' | 'WAIT' | 'RESUME' | 'RECONCILE' | 'NONE';
1915
- /** Safe payment state; submission and completion are not proof of settlement. */
1916
- interface LinkPaymentResult extends CommerceExecutionResult {
1917
- executionId: string;
1918
- status: CommerceExecutionStatus;
1919
- nextAction: LinkPaymentNextAction;
1920
- /** Present only while Link approval is needed. Show it to the account owner. */
1921
- approvalUrl?: string;
1922
- checkout?: ExecuteCommerceExecutionResult['checkout'];
1923
- }
1924
2360
  type CommerceExecutionStatus = 'DRAFT' | 'ACTION_REQUIRED' | 'AUTHORIZING' | 'AWAITING_APPROVAL' | 'READY' | 'PROCESSING' | 'SETTLED' | 'COMPLETED' | 'DENIED' | 'CANCELLED' | 'FAILED' | 'RETURNED' | 'EXPIRED' | 'NEEDS_RECONCILIATION';
1925
2361
  type CommerceExecutionProvider = 'STABLECOIN' | 'TOKENIZED_CARD' | 'STRIPE_LINK';
1926
2362
  type CommerceExecutionChannel = 'BROWSER' | 'MERCHANT_API' | 'CREDENTIAL_BROKER' | 'BANK_API' | 'WALLET_SIGNER';
@@ -2327,6 +2763,13 @@ interface MppPreAuthorizeInput {
2327
2763
  credentialId?: string;
2328
2764
  challengeId?: string;
2329
2765
  paymentMethod?: string;
2766
+ /**
2767
+ * Wallet address your MPP client pays from. Provide together with network
2768
+ * when the agent has more than one wallet it signs with.
2769
+ */
2770
+ payerAddress?: string;
2771
+ /** CAIP-2 network of payerAddress, for example eip155:42431. */
2772
+ network?: string;
2330
2773
  }
2331
2774
  interface MppPreAuthorizeResult extends ProtocolPreAuthorizeResult {
2332
2775
  mpp: {
@@ -2452,12 +2895,6 @@ declare class ContoError extends Error {
2452
2895
  readonly diagnostics?: SetupDiagnostics;
2453
2896
  constructor(message: string, metadata: ApiErrorMetadata, diagnostics?: unknown);
2454
2897
  }
2455
- /** Execution was attempted. Inspect this existing execution before any further payment action. */
2456
- declare class LinkPaymentExecutionError extends ContoError {
2457
- readonly executionId: string;
2458
- readonly nextAction: "RECONCILE";
2459
- constructor(executionId: string, error: unknown);
2460
- }
2461
2898
  /**
2462
2899
  * The customer executor returned a receipt, but Conto did not acknowledge the
2463
2900
  * confirmation. Persist confirmationInput and retry cards.confirm(); never run
@@ -2485,6 +2922,41 @@ declare class BrowserActionFinalizationPendingError<TResult = unknown> extends C
2485
2922
  observation: BrowserActionDispatchObservationInput;
2486
2923
  });
2487
2924
  }
2925
+ /**
2926
+ * The checkpoint is closed and approves nothing: denied, cancelled, expired, or
2927
+ * reported not paid. Stop this checkout. Start a new purchase with a new
2928
+ * idempotency key if the buyer still wants it.
2929
+ */
2930
+ declare class CheckoutCheckpointClosedError extends ContoError {
2931
+ readonly checkpoint: CheckoutCheckpoint;
2932
+ readonly stage: CheckoutCheckpointStage;
2933
+ constructor(checkpoint: CheckoutCheckpoint, message?: string, code?: string);
2934
+ }
2935
+ /** The owner rejected this purchase. Its spend was released. Do not pay. */
2936
+ declare class CheckoutApprovalDeniedError extends CheckoutCheckpointClosedError {
2937
+ constructor(checkpoint: CheckoutCheckpoint);
2938
+ }
2939
+ /** The owner did not decide before the approval expired. Its spend was released. Do not pay. */
2940
+ declare class CheckoutApprovalExpiredError extends CheckoutCheckpointClosedError {
2941
+ constructor(checkpoint: CheckoutCheckpoint);
2942
+ }
2943
+ /**
2944
+ * The owner has not approved this purchase yet. Do not pay. Wait with
2945
+ * waitForApproval(error.checkpoint), then confirm the approved checkpoint, or
2946
+ * cancel it to release the spend.
2947
+ */
2948
+ declare class CheckoutApprovalPendingError extends ContoError {
2949
+ readonly checkpoint: CheckoutCheckpoint;
2950
+ constructor(checkpoint: CheckoutCheckpoint);
2951
+ }
2952
+ /**
2953
+ * waitForApproval stopped before the owner decided. The spend is still held:
2954
+ * wait again, or cancel the checkpoint to release it.
2955
+ */
2956
+ declare class CheckoutApprovalTimeoutError extends ContoError {
2957
+ readonly checkpoint: CheckoutCheckpoint;
2958
+ constructor(checkpoint: CheckoutCheckpoint);
2959
+ }
2488
2960
  interface ContoRequestOptions {
2489
2961
  /** Set only when repeating this request cannot create an additional side effect. */
2490
2962
  idempotent?: boolean;
@@ -2495,7 +2967,6 @@ declare class Conto {
2495
2967
  #private;
2496
2968
  private baseUrl;
2497
2969
  private timeout;
2498
- link: LinkClient;
2499
2970
  /** Lightweight checkpoints before the payment method opens and before payment. */
2500
2971
  checkout: CheckoutClient;
2501
2972
  payments: PaymentsClient;
@@ -2504,17 +2975,11 @@ declare class Conto {
2504
2975
  testCards: TestCardsClient;
2505
2976
  x402: X402Client;
2506
2977
  mpp: MppClient;
2978
+ /** Purchases from a product URL and task to a merchant-confirmed order. */
2979
+ purchases: PurchasesClient;
2980
+ /** Repeat orders the agent's buyer set up. The agent starts each order. */
2981
+ recurringPurchases: RecurringPurchasesClient;
2507
2982
  constructor(config: ContoConfig);
2508
- /**
2509
- * List masked Link payment methods for a session-created connection that is
2510
- * explicitly bound to this agent. No Link token or payment artifact is
2511
- * returned through the agent SDK.
2512
- */
2513
- listStripeLinkPaymentMethods(connectionId: string, options?: {
2514
- mode?: 'TEST' | 'LIVE';
2515
- }): Promise<ListStripeLinkPaymentMethodsResult>;
2516
- /** Read live Link configuration diagnostics without retrieving credentials or authorizing payment. */
2517
- getLinkSetup(input?: LinkSetupInput): Promise<LinkSetupResult>;
2518
2983
  /**
2519
2984
  * Normalize and durably revise a partial agent purchase proposal without
2520
2985
  * creating a payment side effect. Missing facts return as NEEDS_CONTEXT
@@ -2532,6 +2997,12 @@ declare class Conto {
2532
2997
  beginCommerceExecution(input: BeginCommerceExecutionInput): Promise<CommerceExecutionResult>;
2533
2998
  /** Atomically consume the Conto authorization for one exact browser action. */
2534
2999
  authorizeCheckoutAction(executionId: string, browserSessionId: string, action: AgentCheckoutAction | BrowserCheckoutAction): Promise<AuthorizeCheckoutActionResult>;
3000
+ /**
3001
+ * Report whether an authorized guarded browser checkout was paid. PAID keeps
3002
+ * the held spend counted, NOT_PAID releases it, and UNKNOWN keeps it held for
3003
+ * the owner to review. Safe to repeat with the same outcome.
3004
+ */
3005
+ reportCommerceExecutionOutcome(executionId: string, input: ReportCheckoutOutcomeInput): Promise<CommerceExecutionResult>;
2535
3006
  /** Claim a durable browser action for one stable privileged-runtime attempt. */
2536
3007
  claimBrowserAction(authorizationId: string, dispatchAttemptId: string, browserSessionId: string, action: AgentCheckoutAction | BrowserCheckoutAction): Promise<BrowserActionClaimResult>;
2537
3008
  /** Finalize the exact dispatch attempt; this never performs the browser side effect. */
@@ -2586,6 +3057,15 @@ declare class Conto {
2586
3057
  * diagnostics without creating a payment.
2587
3058
  */
2588
3059
  setup(): Promise<AgentSetupResult>;
3060
+ /**
3061
+ * Opens an authenticated server-sent event stream. Used by
3062
+ * `purchases.watch()`. The server closes it after about 50 seconds.
3063
+ * @internal
3064
+ */
3065
+ openStream(path: string, init?: {
3066
+ signal?: AbortSignal;
3067
+ lastEventId?: string;
3068
+ }): Promise<Response>;
2589
3069
  /** Make an authenticated request to the Conto API */
2590
3070
  request<T>(method: string, path: string, body?: Record<string, unknown>, options?: ContoRequestOptions): Promise<T>;
2591
3071
  }
@@ -2673,17 +3153,34 @@ declare class ConnectedCardsClient {
2673
3153
  * ```
2674
3154
  */
2675
3155
  draw(input: ConnectedCardDrawInput): Promise<ConnectedCardDrawResult>;
3156
+ /** Record receipt after a fresh draw. Does not confirm checkout or payment settlement. */
3157
+ acknowledgeDelivery(requestId: string): Promise<{
3158
+ acknowledged: boolean;
3159
+ settlementVerified: false;
3160
+ }>;
3161
+ /**
3162
+ * Report what happened with the card number after checkout.
3163
+ *
3164
+ * `USED` at the full approved amount closes the draw. `NOT_USED`, or `USED`
3165
+ * with a smaller `amountMinor`, is recorded and shown to a person, who
3166
+ * confirms it before the held amount is released. A report never releases
3167
+ * held spend by itself and does not confirm settlement. Safe to repeat with
3168
+ * the same report. A different second report gets HTTP 409.
3169
+ *
3170
+ * @example
3171
+ * ```typescript
3172
+ * await conto.connectedCards.reportOutcome(draw.requestId, { outcome: 'USED' });
3173
+ * await conto.connectedCards.reportOutcome(draw.requestId, { outcome: 'USED', amountMinor: 1850 });
3174
+ * await conto.connectedCards.reportOutcome(draw.requestId, { outcome: 'NOT_USED' });
3175
+ * ```
3176
+ */
3177
+ reportOutcome(requestId: string, report: ConnectedCardOutcomeReport): Promise<ConnectedCardOutcomeReportResult>;
2676
3178
  /**
2677
3179
  * List the connected cards and active mandates this agent may draw against.
2678
3180
  *
2679
3181
  * The response is masked: no PAN and no provider tokens. This is a read-only
2680
3182
  * GET, so transport retry on transient failures is safe.
2681
3183
  */
2682
- /** Record receipt after a fresh draw. Does not confirm checkout or payment settlement. */
2683
- acknowledgeDelivery(requestId: string): Promise<{
2684
- acknowledged: boolean;
2685
- settlementVerified: false;
2686
- }>;
2687
3184
  list(): Promise<ConnectedCardListResult>;
2688
3185
  }
2689
3186
  /**
@@ -2854,57 +3351,51 @@ declare class MppClient {
2854
3351
  }): Promise<ProtocolServicesResult>;
2855
3352
  }
2856
3353
 
2857
- /** Narrow transport contract used by the isolated, credential-free test client. */
2858
- type LinkCommerceClient = Pick<Conto, 'getLinkSetup' | 'listStripeLinkPaymentMethods' | 'beginCommerceExecution' | 'getCommerceExecution' | 'refreshCommerceExecution' | 'executeCommerceExecution' | 'cancelCommerceExecution'>;
2859
3354
  /**
2860
3355
  * Lightweight checkout checkpoints for any agent runtime. Call begin() before the
2861
3356
  * payment method opens and confirm() right before the payment is submitted. Pay
2862
3357
  * only after confirm() succeeds, then report the outcome. Conto decides and
2863
3358
  * records each step; your checkout enforces the answer.
3359
+ *
3360
+ * When the agent's rules require approval, begin() returns stage
3361
+ * AWAITING_APPROVAL with the spend held. Do not open the payment method yet:
3362
+ * call waitForApproval() and continue with the checkpoint it returns.
2864
3363
  */
2865
3364
  declare class CheckoutClient {
2866
3365
  #private;
2867
3366
  constructor(client: Pick<Conto, 'request'>);
2868
- /** First checkpoint. A ContoError means Conto did not approve: stop the checkout. */
3367
+ /**
3368
+ * First checkpoint. Open the payment method only when the stage is APPROVED.
3369
+ * AWAITING_APPROVAL means the owner must decide first: call waitForApproval().
3370
+ * A ContoError means Conto did not approve: stop the checkout. A
3371
+ * CheckoutCheckpointClosedError means this idempotency key belongs to a
3372
+ * checkpoint that already closed.
3373
+ */
2869
3374
  begin(input: BeginCheckoutCheckpointInput): Promise<CheckoutCheckpoint>;
3375
+ /**
3376
+ * Waits while the owner decides on a checkpoint in AWAITING_APPROVAL and
3377
+ * resolves to the approved checkpoint. Throws CheckoutApprovalDeniedError,
3378
+ * CheckoutApprovalExpiredError, CheckoutCheckpointClosedError, or
3379
+ * CheckoutApprovalTimeoutError (the spend stays held until you cancel).
3380
+ */
3381
+ waitForApproval(checkpoint: CheckoutCheckpoint, options?: WaitForCheckoutApprovalOptions): Promise<CheckoutCheckpoint>;
2870
3382
  /**
2871
3383
  * Second checkpoint, right before the payment is submitted. If the total
2872
3384
  * changed since begin() (tax or shipping, for example), this cancels the
2873
3385
  * approved checkpoint and starts a new one at the final total, so the agent's
2874
- * rules see the amount actually being paid. Pay only if this resolves.
3386
+ * rules see the amount actually being paid. Pay only if this resolves. A
3387
+ * CheckoutApprovalPendingError means the owner must approve first: call
3388
+ * waitForApproval(error.checkpoint), then confirm the checkpoint it returns.
2875
3389
  */
2876
3390
  confirm(checkpoint: CheckoutCheckpoint, input: ConfirmCheckoutCheckpointInput): Promise<CheckoutCheckpoint>;
2877
3391
  /** Report what happened after a confirmed checkpoint. Safe to repeat with the same outcome. */
2878
3392
  reportOutcome(checkpointId: string, input: ReportCheckoutOutcomeInput): Promise<CheckoutCheckpoint>;
2879
- /** Cancel a checkpoint that was not confirmed and release its spend. */
2880
- cancel(checkpointId: string): Promise<CheckoutCheckpoint>;
2881
- get(checkpointId: string): Promise<CheckoutCheckpoint>;
2882
- }
2883
- declare class LinkClient {
2884
- #private;
2885
- constructor(client: LinkCommerceClient, defaults?: LinkPaymentDefaults);
2886
- /** Inspect the configured live path. This is not a payment authorization or provider connectivity test. */
2887
- setup(input?: LinkSetupInput): Promise<LinkSetupResult>;
2888
- /** Read masked LIVE funding sources; never selects a source or initiates payment. */
2889
- paymentMethods(connectionId?: string): Promise<ListStripeLinkPaymentMethodsResult>;
2890
3393
  /**
2891
- * Begin one exact intent and execute only if already READY. Otherwise return
2892
- * the owner's approval action or existing state immediately, without polling.
3394
+ * Cancel a checkpoint that was not confirmed and release its spend. A
3395
+ * checkpoint waiting for the owner can be cancelled too.
2893
3396
  */
2894
- pay(input: LinkPaymentInput): Promise<LinkPaymentResult>;
2895
- /**
2896
- * Continue the existing payment after approval. Reads before any mutation and
2897
- * never submits an execution already processing or requiring reconciliation.
2898
- */
2899
- resume(executionId: string): Promise<LinkPaymentResult>;
2900
- /** Observe and reconcile provider state. This method never submits a payment. */
2901
- status(executionId: string): Promise<LinkPaymentResult>;
2902
- /** Request cancellation of this existing Link payment; never retried automatically. */
2903
- cancel(executionId: string): Promise<LinkPaymentResult>;
2904
- private identifier;
2905
- private assertLinkExecution;
2906
- private executeIfReady;
2907
- private result;
3397
+ cancel(checkpointId: string): Promise<CheckoutCheckpoint>;
3398
+ get(checkpointId: string): Promise<CheckoutCheckpoint>;
2908
3399
  }
2909
3400
 
2910
- 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, type CheckoutCheckpoint, 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, LinkClient, type LinkCommerceClient, type LinkPaymentDefaults, LinkPaymentExecutionError, type LinkPaymentInput, type LinkPaymentNextAction, type LinkPaymentResult, type LinkSetupCheck, type LinkSetupInput, type LinkSetupResult, type LinkWalletInput, type ListAgentsParams, type ListAgentsResponse, type ListPoliciesParams, type ListPoliciesResponse, type ListPolicyVersionsResponse, type ListStripeLinkPaymentMethodsResult, 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 StripeLinkCheckoutReadiness, type StripeLinkCheckoutReadinessResult, type StripeLinkCheckoutReadinessStatus, type StripeLinkCheckoutVerification, type StripeLinkPaymentMethod, 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 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 };
3401
+ 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 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, 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, 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 PurchaseBuyer, type PurchaseDelegation, type PurchaseEvent, type PurchaseEventPage, type PurchaseEvidence, type PurchaseHostedLink, type PurchaseItem, type PurchaseList, type PurchaseMoney, type PurchasePaymentMethod, type PurchasePhase, type PurchaseResponseAck, type PurchaseStatus, PurchasesClient, type PurchasingCapabilities, type RecurringPurchase, type RecurringPurchaseCycleResult, type RecurringPurchaseCycleStatus, RecurringPurchasesClient, 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 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 };