@proveanything/smartlinks 2.2.11 → 2.2.12

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.
@@ -1,4 +1,4 @@
1
- import type { PaymentsPublicConfig, PaymentIntentInput, PaymentIntentResult, PaymentsStatus, PaymentsConnectInput, PaymentListParams, PaymentList, PaymentSyncInput, PaymentSyncResult, PaymentDomainResult } from '../types/payments.js';
1
+ import type { PaymentsPublicConfig, PaymentIntentInput, PaymentIntentResult, PaymentsStatus, PaymentsConnectInput, PaymentListParams, PaymentList, PaymentSyncInput, PaymentSyncResult, PaymentDomainResult, PaymentSetupRequest, PaymentSetupRequestInput } from '../types/payments.js';
2
2
  export declare namespace payments {
3
3
  /**
4
4
  * Can this business take payments, and what Stripe.js needs. `ready` is false until the business has
@@ -52,6 +52,21 @@ export declare namespace payments {
52
52
  connected: false;
53
53
  disconnectedAccountId: string | null;
54
54
  }>;
55
+ /**
56
+ * Ask someone outside Studio (the finance team, the client a business was built for) to connect the
57
+ * business's Stripe account. SmartLinks emails them a link to a page that starts Stripe's set-up: no
58
+ * SmartLinks login, nothing else in reach. The link works for 7 days; a new request replaces it. The
59
+ * admin who sent it is emailed when it's done (naming the Stripe account) or if the person wasn't
60
+ * expecting it. Refused (409 ALREADY_CONNECTED) once payments are set up: disconnect first.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * await payments.admin.requestSetup(collectionId, { email: 'finance@example.org', name: 'Sam' })
65
+ * ```
66
+ */
67
+ function requestSetup(collectionId: string, input: PaymentSetupRequestInput): Promise<PaymentSetupRequest>;
68
+ /** Cancel the waiting set-up request: its link stops working. → the request, or null when there was none. */
69
+ function cancelSetupRequest(collectionId: string): Promise<PaymentSetupRequest | null>;
55
70
  /** An app's in-page payments on the business's account, newest first (for reconciling). */
56
71
  function intents(collectionId: string, params?: PaymentListParams): Promise<PaymentList>;
57
72
  /**
@@ -3,7 +3,7 @@
3
3
  // takes money on it: no Stripe keys in apps. Pages use `payments.config` and `payments.createIntent` for
4
4
  // in-page payments (Payment Element, Apple Pay, Google Pay); Studio and admin screens use `payments.admin`.
5
5
  // Fixed-price sales use a hosted checkout instead: `shop.checkout`, `memberships`.
6
- import { request, post } from '../http.js';
6
+ import { request, post, del } from '../http.js';
7
7
  const pub = (collectionId) => `/public/collection/${encodeURIComponent(collectionId)}/payments`;
8
8
  const adm = (collectionId) => `/admin/collection/${encodeURIComponent(collectionId)}/payments`;
9
9
  export var payments;
@@ -70,6 +70,27 @@ export var payments;
70
70
  return post(`${adm(collectionId)}/disconnect`, {});
71
71
  }
72
72
  admin.disconnect = disconnect;
73
+ /**
74
+ * Ask someone outside Studio (the finance team, the client a business was built for) to connect the
75
+ * business's Stripe account. SmartLinks emails them a link to a page that starts Stripe's set-up: no
76
+ * SmartLinks login, nothing else in reach. The link works for 7 days; a new request replaces it. The
77
+ * admin who sent it is emailed when it's done (naming the Stripe account) or if the person wasn't
78
+ * expecting it. Refused (409 ALREADY_CONNECTED) once payments are set up: disconnect first.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * await payments.admin.requestSetup(collectionId, { email: 'finance@example.org', name: 'Sam' })
83
+ * ```
84
+ */
85
+ async function requestSetup(collectionId, input) {
86
+ return post(`${adm(collectionId)}/setup-request`, input);
87
+ }
88
+ admin.requestSetup = requestSetup;
89
+ /** Cancel the waiting set-up request: its link stops working. → the request, or null when there was none. */
90
+ async function cancelSetupRequest(collectionId) {
91
+ return del(`${adm(collectionId)}/setup-request`);
92
+ }
93
+ admin.cancelSetupRequest = cancelSetupRequest;
73
94
  /** An app's in-page payments on the business's account, newest first (for reconciling). */
74
95
  async function intents(collectionId, params) {
75
96
  const q = new URLSearchParams();
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.2.11 | Generated: 2026-12-05T10:45:08.620Z
3
+ Version: 2.2.12 | Generated: 2026-12-05T13:57:29.945Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -11673,12 +11673,41 @@ interface PaymentIntentResult {
11673
11673
  interface PaymentsStatus {
11674
11674
  connected: boolean
11675
11675
  accountId?: string
11676
+ name?: string | null
11676
11677
  chargesEnabled?: boolean | null
11677
11678
  detailsSubmitted?: boolean | null
11678
11679
  payoutsEnabled?: boolean | null
11679
11680
  platformReady: boolean
11680
11681
  publishableKeySet: boolean
11681
11682
  fees: Array<{ appId: string; bps: number; percent: number }>
11683
+ setupRequest?: PaymentSetupRequest | null
11684
+ }
11685
+ ```
11686
+
11687
+ **PaymentSetupRequest** (interface)
11688
+ ```typescript
11689
+ interface PaymentSetupRequest {
11690
+ id: string
11691
+ email: string
11692
+ name: string | null
11693
+ note: string | null
11694
+ sentByEmail: string | null
11695
+ sentByName: string | null
11696
+ sentAt: string
11697
+ expiresAt: string
11698
+ status: 'pending' | 'expired' | 'done' | 'cancelled' | 'reported'
11699
+ startedAt: string | null
11700
+ finishedAt: string | null
11701
+ stripeAccountName: string | null
11702
+ }
11703
+ ```
11704
+
11705
+ **PaymentSetupRequestInput** (interface)
11706
+ ```typescript
11707
+ interface PaymentSetupRequestInput {
11708
+ email: string
11709
+ name?: string
11710
+ note?: string
11682
11711
  }
11683
11712
  ```
11684
11713
 
@@ -16469,6 +16498,12 @@ Stripe's page to connect (or finish connecting) the business's Stripe account. S
16469
16498
  **disconnect**(collectionId: string) → `Promise<`
16470
16499
  Stop using the business's Stripe account. SmartLinks forgets it (apps can no longer take payments until one is connected again); the Stripe account itself stays the business's own, with the payments already in it. Connecting again makes a new account.
16471
16500
 
16501
+ **requestSetup**(collectionId: string, input: PaymentSetupRequestInput) → `Promise<PaymentSetupRequest>`
16502
+ Ask someone outside Studio (the finance team, the client a business was built for) to connect the business's Stripe account. SmartLinks emails them a link to a page that starts Stripe's set-up: no SmartLinks login, nothing else in reach. The link works for 7 days; a new request replaces it. The admin who sent it is emailed when it's done (naming the Stripe account) or if the person wasn't expecting it. Refused (409 ALREADY_CONNECTED) once payments are set up: disconnect first. ```typescript await payments.admin.requestSetup(collectionId, { email: 'finance@example.org', name: 'Sam' }) ```
16503
+
16504
+ **cancelSetupRequest**(collectionId: string) → `Promise<PaymentSetupRequest | null>`
16505
+ Cancel the waiting set-up request: its link stops working. → the request, or null when there was none.
16506
+
16472
16507
  **intents**(collectionId: string, params?: PaymentListParams) → `Promise<PaymentList>`
16473
16508
  An app's in-page payments on the business's account, newest first (for reconciling).
16474
16509
 
@@ -82,6 +82,23 @@ await payments.admin.disconnect(collectionId) // → { connected: false, discon
82
82
  Disconnecting stops every app taking payments until an account is connected again. SmartLinks forgets the
83
83
  account; the Stripe account stays the business's own, with its payments. Connecting again makes a new one.
84
84
 
85
+ ### Asking someone else to set it up
86
+
87
+ Often the person with the business's Stripe login isn't the one in Studio: the finance team, or the client
88
+ a business was built for. Email them a link instead of giving them a login:
89
+
90
+ ```typescript
91
+ await payments.admin.requestSetup(collectionId, { email: 'finance@example.org', name: 'Sam', note: 'For the donations page' })
92
+ // status(…).setupRequest → { email, status: 'pending' | 'expired' | 'done' | 'cancelled' | 'reported', stripeAccountName, … }
93
+ await payments.admin.cancelSetupRequest(collectionId) // the link stops working
94
+ ```
95
+
96
+ SmartLinks sends the email. Its link opens a SmartLinks page that only starts Stripe's set-up for this
97
+ business, with no login. It works for 7 days, and a new request replaces it. It can't be used once payments
98
+ are set up, and `requestSetup` is refused then (409 `ALREADY_CONNECTED`): disconnect first. The admin who
99
+ sent it is emailed when it's done, naming the Stripe account now taking the money, or if the person says
100
+ they weren't expecting it (which cancels it).
101
+
85
102
  ### Reconciling an app's payments
86
103
 
87
104
  ```typescript
package/dist/openapi.yaml CHANGED
@@ -36561,6 +36561,8 @@ components:
36561
36561
  type: boolean
36562
36562
  accountId:
36563
36563
  type: string
36564
+ name:
36565
+ type: string
36564
36566
  chargesEnabled:
36565
36567
  type: boolean
36566
36568
  detailsSubmitted:
@@ -36576,11 +36578,70 @@ components:
36576
36578
  items:
36577
36579
  type: object
36578
36580
  additionalProperties: true
36581
+ setupRequest:
36582
+ $ref: "#/components/schemas/PaymentSetupRequest"
36579
36583
  required:
36580
36584
  - connected
36581
36585
  - platformReady
36582
36586
  - publishableKeySet
36583
36587
  - fees
36588
+ PaymentSetupRequest:
36589
+ type: object
36590
+ properties:
36591
+ id:
36592
+ type: string
36593
+ email:
36594
+ type: string
36595
+ name:
36596
+ type: string
36597
+ note:
36598
+ type: string
36599
+ sentByEmail:
36600
+ type: string
36601
+ sentByName:
36602
+ type: string
36603
+ sentAt:
36604
+ type: string
36605
+ expiresAt:
36606
+ type: string
36607
+ status:
36608
+ type: string
36609
+ enum:
36610
+ - pending
36611
+ - expired
36612
+ - done
36613
+ - cancelled
36614
+ - reported
36615
+ startedAt:
36616
+ type: string
36617
+ finishedAt:
36618
+ type: string
36619
+ stripeAccountName:
36620
+ type: string
36621
+ required:
36622
+ - id
36623
+ - email
36624
+ - name
36625
+ - note
36626
+ - sentByEmail
36627
+ - sentByName
36628
+ - sentAt
36629
+ - expiresAt
36630
+ - status
36631
+ - startedAt
36632
+ - finishedAt
36633
+ - stripeAccountName
36634
+ PaymentSetupRequestInput:
36635
+ type: object
36636
+ properties:
36637
+ email:
36638
+ type: string
36639
+ name:
36640
+ type: string
36641
+ note:
36642
+ type: string
36643
+ required:
36644
+ - email
36584
36645
  PaymentsConnectInput:
36585
36646
  type: object
36586
36647
  properties:
@@ -42,6 +42,8 @@ export interface PaymentIntentResult {
42
42
  export interface PaymentsStatus {
43
43
  connected: boolean;
44
44
  accountId?: string;
45
+ /** The connected Stripe account's business name, when Stripe has one. */
46
+ name?: string | null;
45
47
  /** Stripe can take payments for this business. Null when this server can't ask Stripe. */
46
48
  chargesEnabled?: boolean | null;
47
49
  /** The business has given Stripe all it asked for. */
@@ -58,6 +60,39 @@ export interface PaymentsStatus {
58
60
  bps: number;
59
61
  percent: number;
60
62
  }>;
63
+ /** The latest request for someone else to set up payments (`payments.admin.requestSetup`), if any. */
64
+ setupRequest?: PaymentSetupRequest | null;
65
+ }
66
+ /**
67
+ * A request for someone outside Studio (the finance team, the client) to connect the business's Stripe
68
+ * account. They get an email from SmartLinks with a link that works for 7 days and needs no login.
69
+ *
70
+ * status: `pending` (waiting), `expired`, `done` (connected; `stripeAccountName` is the account they chose),
71
+ * `cancelled` (by an admin, a newer request, or payments set up another way), `reported` (the person said
72
+ * they weren't expecting it).
73
+ */
74
+ export interface PaymentSetupRequest {
75
+ id: string;
76
+ email: string;
77
+ name: string | null;
78
+ note: string | null;
79
+ sentByEmail: string | null;
80
+ sentByName: string | null;
81
+ sentAt: string;
82
+ expiresAt: string;
83
+ status: 'pending' | 'expired' | 'done' | 'cancelled' | 'reported';
84
+ /** When they first went on to Stripe. */
85
+ startedAt: string | null;
86
+ finishedAt: string | null;
87
+ stripeAccountName: string | null;
88
+ }
89
+ export interface PaymentSetupRequestInput {
90
+ /** Who will set up payments. */
91
+ email: string;
92
+ /** Their name, for the email's greeting. */
93
+ name?: string;
94
+ /** A short note shown in the email and on the set-up page (up to 500 characters). */
95
+ note?: string;
61
96
  }
62
97
  export interface PaymentsConnectInput {
63
98
  /** Where Stripe sends the person back when they finish (or stop): check `payments.admin.status`. */
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.2.11";
1
+ export declare const SDK_VERSION = "2.2.12";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/write-version.mjs from package.json. Do not edit.
2
- export const SDK_VERSION = "2.2.11";
2
+ export const SDK_VERSION = "2.2.12";
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.2.11 | Generated: 2026-12-05T10:45:08.620Z
3
+ Version: 2.2.12 | Generated: 2026-12-05T13:57:29.945Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -11673,12 +11673,41 @@ interface PaymentIntentResult {
11673
11673
  interface PaymentsStatus {
11674
11674
  connected: boolean
11675
11675
  accountId?: string
11676
+ name?: string | null
11676
11677
  chargesEnabled?: boolean | null
11677
11678
  detailsSubmitted?: boolean | null
11678
11679
  payoutsEnabled?: boolean | null
11679
11680
  platformReady: boolean
11680
11681
  publishableKeySet: boolean
11681
11682
  fees: Array<{ appId: string; bps: number; percent: number }>
11683
+ setupRequest?: PaymentSetupRequest | null
11684
+ }
11685
+ ```
11686
+
11687
+ **PaymentSetupRequest** (interface)
11688
+ ```typescript
11689
+ interface PaymentSetupRequest {
11690
+ id: string
11691
+ email: string
11692
+ name: string | null
11693
+ note: string | null
11694
+ sentByEmail: string | null
11695
+ sentByName: string | null
11696
+ sentAt: string
11697
+ expiresAt: string
11698
+ status: 'pending' | 'expired' | 'done' | 'cancelled' | 'reported'
11699
+ startedAt: string | null
11700
+ finishedAt: string | null
11701
+ stripeAccountName: string | null
11702
+ }
11703
+ ```
11704
+
11705
+ **PaymentSetupRequestInput** (interface)
11706
+ ```typescript
11707
+ interface PaymentSetupRequestInput {
11708
+ email: string
11709
+ name?: string
11710
+ note?: string
11682
11711
  }
11683
11712
  ```
11684
11713
 
@@ -16469,6 +16498,12 @@ Stripe's page to connect (or finish connecting) the business's Stripe account. S
16469
16498
  **disconnect**(collectionId: string) → `Promise<`
16470
16499
  Stop using the business's Stripe account. SmartLinks forgets it (apps can no longer take payments until one is connected again); the Stripe account itself stays the business's own, with the payments already in it. Connecting again makes a new account.
16471
16500
 
16501
+ **requestSetup**(collectionId: string, input: PaymentSetupRequestInput) → `Promise<PaymentSetupRequest>`
16502
+ Ask someone outside Studio (the finance team, the client a business was built for) to connect the business's Stripe account. SmartLinks emails them a link to a page that starts Stripe's set-up: no SmartLinks login, nothing else in reach. The link works for 7 days; a new request replaces it. The admin who sent it is emailed when it's done (naming the Stripe account) or if the person wasn't expecting it. Refused (409 ALREADY_CONNECTED) once payments are set up: disconnect first. ```typescript await payments.admin.requestSetup(collectionId, { email: 'finance@example.org', name: 'Sam' }) ```
16503
+
16504
+ **cancelSetupRequest**(collectionId: string) → `Promise<PaymentSetupRequest | null>`
16505
+ Cancel the waiting set-up request: its link stops working. → the request, or null when there was none.
16506
+
16472
16507
  **intents**(collectionId: string, params?: PaymentListParams) → `Promise<PaymentList>`
16473
16508
  An app's in-page payments on the business's account, newest first (for reconciling).
16474
16509
 
package/docs/payments.md CHANGED
@@ -82,6 +82,23 @@ await payments.admin.disconnect(collectionId) // → { connected: false, discon
82
82
  Disconnecting stops every app taking payments until an account is connected again. SmartLinks forgets the
83
83
  account; the Stripe account stays the business's own, with its payments. Connecting again makes a new one.
84
84
 
85
+ ### Asking someone else to set it up
86
+
87
+ Often the person with the business's Stripe login isn't the one in Studio: the finance team, or the client
88
+ a business was built for. Email them a link instead of giving them a login:
89
+
90
+ ```typescript
91
+ await payments.admin.requestSetup(collectionId, { email: 'finance@example.org', name: 'Sam', note: 'For the donations page' })
92
+ // status(…).setupRequest → { email, status: 'pending' | 'expired' | 'done' | 'cancelled' | 'reported', stripeAccountName, … }
93
+ await payments.admin.cancelSetupRequest(collectionId) // the link stops working
94
+ ```
95
+
96
+ SmartLinks sends the email. Its link opens a SmartLinks page that only starts Stripe's set-up for this
97
+ business, with no login. It works for 7 days, and a new request replaces it. It can't be used once payments
98
+ are set up, and `requestSetup` is refused then (409 `ALREADY_CONNECTED`): disconnect first. The admin who
99
+ sent it is emailed when it's done, naming the Stripe account now taking the money, or if the person says
100
+ they weren't expecting it (which cancels it).
101
+
85
102
  ### Reconciling an app's payments
86
103
 
87
104
  ```typescript
package/openapi.yaml CHANGED
@@ -36561,6 +36561,8 @@ components:
36561
36561
  type: boolean
36562
36562
  accountId:
36563
36563
  type: string
36564
+ name:
36565
+ type: string
36564
36566
  chargesEnabled:
36565
36567
  type: boolean
36566
36568
  detailsSubmitted:
@@ -36576,11 +36578,70 @@ components:
36576
36578
  items:
36577
36579
  type: object
36578
36580
  additionalProperties: true
36581
+ setupRequest:
36582
+ $ref: "#/components/schemas/PaymentSetupRequest"
36579
36583
  required:
36580
36584
  - connected
36581
36585
  - platformReady
36582
36586
  - publishableKeySet
36583
36587
  - fees
36588
+ PaymentSetupRequest:
36589
+ type: object
36590
+ properties:
36591
+ id:
36592
+ type: string
36593
+ email:
36594
+ type: string
36595
+ name:
36596
+ type: string
36597
+ note:
36598
+ type: string
36599
+ sentByEmail:
36600
+ type: string
36601
+ sentByName:
36602
+ type: string
36603
+ sentAt:
36604
+ type: string
36605
+ expiresAt:
36606
+ type: string
36607
+ status:
36608
+ type: string
36609
+ enum:
36610
+ - pending
36611
+ - expired
36612
+ - done
36613
+ - cancelled
36614
+ - reported
36615
+ startedAt:
36616
+ type: string
36617
+ finishedAt:
36618
+ type: string
36619
+ stripeAccountName:
36620
+ type: string
36621
+ required:
36622
+ - id
36623
+ - email
36624
+ - name
36625
+ - note
36626
+ - sentByEmail
36627
+ - sentByName
36628
+ - sentAt
36629
+ - expiresAt
36630
+ - status
36631
+ - startedAt
36632
+ - finishedAt
36633
+ - stripeAccountName
36634
+ PaymentSetupRequestInput:
36635
+ type: object
36636
+ properties:
36637
+ email:
36638
+ type: string
36639
+ name:
36640
+ type: string
36641
+ note:
36642
+ type: string
36643
+ required:
36644
+ - email
36584
36645
  PaymentsConnectInput:
36585
36646
  type: object
36586
36647
  properties:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "2.2.11",
3
+ "version": "2.2.12",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",