@spritz-finance/api-client 0.26.0 → 0.27.0

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 CHANGED
@@ -361,15 +361,22 @@ Spritz agreements are the user's consent to Spritz's own Terms of Service, Priva
361
361
  Your backend creates a presentation, and the user's own client submits the acceptance:
362
362
 
363
363
  ```typescript
364
- // Backend
365
- const presentation = await client.agreements.present()
364
+ // Backend. Pass placement: 'kyc' when the screen sits inside the step that starts identity verification.
365
+ const presentation = await client.agreements.present({ placement: 'standalone' })
366
366
  if ('nothingToPresent' in presentation) return
367
367
 
368
368
  // Send these to the user's client:
369
- const { presentationId, copySha256, submissionToken, statementKey, copy, items } = presentation
369
+ const { presentationId, screenSha256, submissionToken, screen, items } = presentation
370
370
  ```
371
371
 
372
- On the client, render `copy[statementKey]` verbatim directly above a button labelled `copy.buttonLabel`, with each `copy.links` entry as a visible link. Do not translate or rephrase it. Link URLs are relative to the Spritz API origin (`https://platform.spritz.finance`, or `https://sandbox.spritz.finance` in sandbox). When the user taps the button, the client sends the acceptance itself:
372
+ `screen` is the one consent screen to show, already chosen for the user's state (`first_time`, `updated`, `privacy_only` or `esign_only`). Render it exactly as given; do not translate, rephrase or reorder it:
373
+
374
+ - `screen.title` as the heading, when not `null`.
375
+ - `screen.statement` as one paragraph, when not `null`: the segments in order, each segment with a `link` as a link to `link.url` (absolute).
376
+ - `screen.checkbox`, when not `null`: an **unchecked** checkbox labelled by `checkbox.label` (segments, as above). Enable the button only once it is checked.
377
+ - A button labelled `screen.buttonLabel`.
378
+
379
+ When the user selects the button, the client sends the acceptance itself:
373
380
 
374
381
  ```typescript
375
382
  // User's client, not your backend
@@ -382,7 +389,8 @@ const response = await fetch(`${SPRITZ_API_ORIGIN}/v1/agreements/acceptances`, {
382
389
  body: JSON.stringify({
383
390
  presentationId,
384
391
  accept: items.map((item) => item.type), // every presented type
385
- copySha256,
392
+ screenSha256, // echoed unchanged
393
+ ...(screen.checkbox ? { esignCheckboxChecked: true } : {}),
386
394
  }),
387
395
  })
388
396
  if (!response.ok) {
@@ -392,21 +400,24 @@ if (!response.ok) {
392
400
  const receipt = await response.json() // same shape as getReceipt()
393
401
  ```
394
402
 
395
- `copy.consentPattern` is `'clickwrap'` by default, as above. If it is `'esign_checkbox'`, also show an unchecked checkbox labelled `copy.esignCheckboxLabel` and send `esignCheckboxChecked` with the user's choice. When it is unchecked, leave `esign_consent` out of `accept`; E-Sign then stays outstanding and needs a new presentation later.
403
+ After a `200`, refetch `user.getMe()` for the new state rather than reading `receipt.agreements`. On a network error, resend the identical body: a repeated acceptance returns the original receipt.
396
404
 
397
405
  The `submissionToken` lasts 15 minutes and works only for its presentation. Spritz refuses an acceptance sent from your backend or from the network that created the presentation (`403 client_submission_required`), which is why this SDK does not send it. Repeating the same acceptance returns the original receipt. If the client loses the response, recover it from your backend with `client.agreements.getReceipt(presentationId)`.
398
406
 
399
- | HTTP | `code` | What to do |
400
- | ---- | ------------------------------------- | ---------------------------------------------------- |
401
- | 400 | `invalid_agreement_selection` | Accept every presented type. |
402
- | 403 | `client_submission_required` | Submit from the user's client, not your backend. |
403
- | 409 | `presentation_consumed` | Recover the receipt with `getReceipt`. |
404
- | 409 | `presentation_expired` | Create a new presentation. |
405
- | 409 | `agreement_version_outdated` | New documents are active: present again. |
406
- | 409 | `agreement_state_changed` | Refresh `getMe()` and present again. |
407
- | 409 | `copy_mismatch` | Render the returned copy and present again. |
408
- | 429 | `agreement_presentation_rate_limited` | Back off; at most ten presentations per user/minute. |
409
- | 503 | `agreements_unavailable` | Retry later. |
407
+ | HTTP | `code` | What to do |
408
+ | ---- | ------------------------------------- | ------------------------------------------------------------------- |
409
+ | 400 | `invalid_agreement_selection` | Build `accept` from the presentation's `items`. |
410
+ | 400 | `esign_consent_required` | Keep the screen; send `esignCheckboxChecked: true` once checked. |
411
+ | 400 | `unexpected_esign_checkbox` | Send `esignCheckboxChecked` only when `screen.checkbox` is present. |
412
+ | 403 | `client_submission_required` | Submit from the user's client, not your backend. |
413
+ | 403 | `presentation_token_mismatch` | Use this presentation's `submissionToken`. |
414
+ | 409 | `presentation_consumed` | Recover the receipt with `getReceipt`. |
415
+ | 409 | `presentation_expired` | Create a new presentation. |
416
+ | 409 | `agreement_version_outdated` | New documents are active: present again. |
417
+ | 409 | `agreement_state_changed` | Refresh `getMe()` and present again. |
418
+ | 409 | `copy_mismatch` | Echo `screenSha256` unchanged; present again. |
419
+ | 429 | `agreement_presentation_rate_limited` | Back off; at most ten presentations per user/minute. |
420
+ | 503 | `agreements_unavailable` | Retry later. |
410
421
 
411
422
  Every acceptance `409` includes the current `agreements` state.
412
423
 
@@ -4566,7 +4566,7 @@ interface operations {
4566
4566
  /**
4567
4567
  * Format: date-time
4568
4568
  * @description Creation timestamp
4569
- * @example 2026-11-12T14:22:22.182Z
4569
+ * @example 2026-11-13T11:49:12.976Z
4570
4570
  */
4571
4571
  createdAt?: string;
4572
4572
  }[];
@@ -4804,7 +4804,7 @@ interface operations {
4804
4804
  "application/json": {
4805
4805
  /**
4806
4806
  * @description Destination account ID
4807
- * @example 6af5cb9e79eb018a8628fb10
4807
+ * @example 6af6f9380974dd7f7609c738
4808
4808
  */
4809
4809
  accountId: string;
4810
4810
  /**
@@ -4832,7 +4832,7 @@ interface operations {
4832
4832
  "application/x-www-form-urlencoded": {
4833
4833
  /**
4834
4834
  * @description Destination account ID
4835
- * @example 6af5cb9e79eb018a8628fb10
4835
+ * @example 6af6f9380974dd7f7609c738
4836
4836
  */
4837
4837
  accountId: string;
4838
4838
  /**
@@ -4860,7 +4860,7 @@ interface operations {
4860
4860
  "multipart/form-data": {
4861
4861
  /**
4862
4862
  * @description Destination account ID
4863
- * @example 6af5cb9e79eb018a8628fb10
4863
+ * @example 6af6f9380974dd7f7609c738
4864
4864
  */
4865
4865
  accountId: string;
4866
4866
  /**
@@ -4907,7 +4907,7 @@ interface operations {
4907
4907
  /**
4908
4908
  * Format: date-time
4909
4909
  * @description When the quote was created
4910
- * @example 2026-11-12T14:22:22.164Z
4910
+ * @example 2026-11-13T11:49:12.955Z
4911
4911
  */
4912
4912
  createdAt: string;
4913
4913
  /** @description Exact USD value collected by Spritz and the token route used to fund it. The exact token quantity is returned by the transaction endpoint. */
@@ -4946,7 +4946,7 @@ interface operations {
4946
4946
  rail: "ach_standard" | "ach_same_day" | "rtp" | "wire" | "eft" | "sepa" | "faster_payments" | "push_to_card" | "bill_pay" | "card_deposit";
4947
4947
  /**
4948
4948
  * @description Destination account ID
4949
- * @example 6af5cb9e79eb018a8628fb11
4949
+ * @example 6af6f9380974dd7f7609c739
4950
4950
  */
4951
4951
  accountId: string;
4952
4952
  /** @description True when this quote does not lock the destination amount. EUR quotes remain estimates; actual settlement is reported by the off-ramp resource. */
@@ -5276,7 +5276,7 @@ interface operations {
5276
5276
  /**
5277
5277
  * Format: date-time
5278
5278
  * @description When the quote was created
5279
- * @example 2026-11-12T14:22:22.164Z
5279
+ * @example 2026-11-13T11:49:12.955Z
5280
5280
  */
5281
5281
  createdAt: string;
5282
5282
  /** @description Exact USD value collected by Spritz and the token route used to fund it. The exact token quantity is returned by the transaction endpoint. */
@@ -5315,7 +5315,7 @@ interface operations {
5315
5315
  rail: "ach_standard" | "ach_same_day" | "rtp" | "wire" | "eft" | "sepa" | "faster_payments" | "push_to_card" | "bill_pay" | "card_deposit";
5316
5316
  /**
5317
5317
  * @description Destination account ID
5318
- * @example 6af5cb9e79eb018a8628fb11
5318
+ * @example 6af6f9380974dd7f7609c739
5319
5319
  */
5320
5320
  accountId: string;
5321
5321
  /** @description True when this quote does not lock the destination amount. EUR quotes remain estimates; actual settlement is reported by the off-ramp resource. */
@@ -6270,7 +6270,7 @@ interface operations {
6270
6270
  /**
6271
6271
  * Format: date-time
6272
6272
  * @description When the quote was created
6273
- * @example 2026-11-12T14:22:22.164Z
6273
+ * @example 2026-11-13T11:49:12.955Z
6274
6274
  */
6275
6275
  createdAt: string;
6276
6276
  /** @description Exact USD value collected by Spritz and the token route used to fund it. The exact token quantity is returned by the transaction endpoint. */
@@ -6309,7 +6309,7 @@ interface operations {
6309
6309
  rail: "ach_standard" | "ach_same_day" | "rtp" | "wire" | "eft" | "sepa" | "faster_payments" | "push_to_card" | "bill_pay" | "card_deposit";
6310
6310
  /**
6311
6311
  * @description Destination account ID
6312
- * @example 6af5cb9e79eb018a8628fb11
6312
+ * @example 6af6f9380974dd7f7609c739
6313
6313
  */
6314
6314
  accountId: string;
6315
6315
  /** @description True when this quote does not lock the destination amount. EUR quotes remain estimates; actual settlement is reported by the off-ramp resource. */
@@ -6685,7 +6685,7 @@ interface operations {
6685
6685
  currency: string;
6686
6686
  /**
6687
6687
  * @description Destination account ID
6688
- * @example 6af5cb9e79eb018a8628fb12
6688
+ * @example 6af6f9380974dd7f7609c73a
6689
6689
  */
6690
6690
  accountId: string;
6691
6691
  /**
@@ -7049,7 +7049,7 @@ interface operations {
7049
7049
  currency: string;
7050
7050
  /**
7051
7051
  * @description Destination account ID
7052
- * @example 6af5cb9e79eb018a8628fb12
7052
+ * @example 6af6f9380974dd7f7609c73a
7053
7053
  */
7054
7054
  accountId: string;
7055
7055
  /**
@@ -7363,7 +7363,7 @@ interface operations {
7363
7363
  method: "account";
7364
7364
  /**
7365
7365
  * @description Destination account to reissue the payout to. Omit to reuse the off-ramp's original destination account.
7366
- * @example 6af5cb9e79eb018a8628fb13
7366
+ * @example 6af6f9380974dd7f7609c73b
7367
7367
  */
7368
7368
  accountId?: string;
7369
7369
  };
@@ -7381,7 +7381,7 @@ interface operations {
7381
7381
  method: "account";
7382
7382
  /**
7383
7383
  * @description Destination account to reissue the payout to. Omit to reuse the off-ramp's original destination account.
7384
- * @example 6af5cb9e79eb018a8628fb13
7384
+ * @example 6af6f9380974dd7f7609c73b
7385
7385
  */
7386
7386
  accountId?: string;
7387
7387
  };
@@ -7399,7 +7399,7 @@ interface operations {
7399
7399
  method: "account";
7400
7400
  /**
7401
7401
  * @description Destination account to reissue the payout to. Omit to reuse the off-ramp's original destination account.
7402
- * @example 6af5cb9e79eb018a8628fb13
7402
+ * @example 6af6f9380974dd7f7609c73b
7403
7403
  */
7404
7404
  accountId?: string;
7405
7405
  };
@@ -7465,7 +7465,7 @@ interface operations {
7465
7465
  currency: string;
7466
7466
  /**
7467
7467
  * @description Destination account ID
7468
- * @example 6af5cb9e79eb018a8628fb12
7468
+ * @example 6af6f9380974dd7f7609c73a
7469
7469
  */
7470
7470
  accountId: string;
7471
7471
  /**
@@ -22826,7 +22826,7 @@ interface operations {
22826
22826
  data: {
22827
22827
  /**
22828
22828
  * @description Unique identifier for the debit card
22829
- * @example 6af5cb9e79eb018a8628fb17
22829
+ * @example 6af6f9380974dd7f7609c73f
22830
22830
  */
22831
22831
  id: string;
22832
22832
  /** @enum {string} */
@@ -23347,7 +23347,7 @@ interface operations {
23347
23347
  "application/json": {
23348
23348
  /**
23349
23349
  * @description Unique identifier for the debit card
23350
- * @example 6af5cb9e79eb018a8628fb17
23350
+ * @example 6af6f9380974dd7f7609c73f
23351
23351
  */
23352
23352
  id: string;
23353
23353
  /** @enum {string} */
@@ -23637,7 +23637,7 @@ interface operations {
23637
23637
  "application/json": {
23638
23638
  /**
23639
23639
  * @description Unique identifier for the debit card
23640
- * @example 6af5cb9e79eb018a8628fb17
23640
+ * @example 6af6f9380974dd7f7609c73f
23641
23641
  */
23642
23642
  id: string;
23643
23643
  /** @enum {string} */
@@ -24304,7 +24304,7 @@ interface operations {
24304
24304
  "application/json": {
24305
24305
  /**
24306
24306
  * @description Unique identifier for the debit card
24307
- * @example 6af5cb9e79eb018a8628fb17
24307
+ * @example 6af6f9380974dd7f7609c73f
24308
24308
  */
24309
24309
  id: string;
24310
24310
  /** @enum {string} */
@@ -24639,7 +24639,7 @@ interface operations {
24639
24639
  accessToken: string;
24640
24640
  /**
24641
24641
  * @description The internal ID of the authorized user
24642
- * @example 6af5cb9e79eb018a8628fb1b
24642
+ * @example 6af6f9390974dd7f7609c743
24643
24643
  */
24644
24644
  userId: string;
24645
24645
  /**
@@ -24655,7 +24655,7 @@ interface operations {
24655
24655
  /**
24656
24656
  * Format: date-time
24657
24657
  * @description ISO 8601 timestamp when token expires
24658
- * @example 2026-11-12T15:22:22.542Z
24658
+ * @example 2026-11-13T12:49:13.268Z
24659
24659
  */
24660
24660
  expiresAt: string;
24661
24661
  };
@@ -24927,7 +24927,7 @@ interface operations {
24927
24927
  /**
24928
24928
  * Format: date-time
24929
24929
  * @description ISO 8601 timestamp of when the integrator was created
24930
- * @example 2026-11-12T14:22:22.541Z
24930
+ * @example 2026-11-13T11:49:13.267Z
24931
24931
  */
24932
24932
  createdAt: string;
24933
24933
  };
@@ -25213,7 +25213,7 @@ interface operations {
25213
25213
  "application/json": {
25214
25214
  /**
25215
25215
  * @description ID of the account this request resolved to: the account it created or, where account reuse is enabled, the existing account this email resolves to for you (your own, or one you are currently authorized for through an existing authorization). With reuse enabled, a repeat for the same email returns the same ID.
25216
- * @example 6af5cb9e79eb018a8628fb1d
25216
+ * @example 6af6f9390974dd7f7609c745
25217
25217
  */
25218
25218
  userId: string;
25219
25219
  /**
@@ -25705,7 +25705,7 @@ interface operations {
25705
25705
  depositId: string;
25706
25706
  /**
25707
25707
  * @description Spritz user ID associated with the returned deposit
25708
- * @example 6af5cb9e79eb018a8628fb1a
25708
+ * @example 6af6f9390974dd7f7609c742
25709
25709
  */
25710
25710
  userId: string;
25711
25711
  /**
@@ -25990,7 +25990,7 @@ interface operations {
25990
25990
  depositId: string;
25991
25991
  /**
25992
25992
  * @description Spritz user ID associated with the returned deposit
25993
- * @example 6af5cb9e79eb018a8628fb1a
25993
+ * @example 6af6f9390974dd7f7609c742
25994
25994
  */
25995
25995
  userId: string;
25996
25996
  /**
@@ -26256,7 +26256,7 @@ interface operations {
26256
26256
  "application/json": {
26257
26257
  /**
26258
26258
  * @description Unique identifier for the webhook
26259
- * @example 6af5cb9e79eb018a8628fb1c
26259
+ * @example 6af6f9390974dd7f7609c744
26260
26260
  */
26261
26261
  id: string;
26262
26262
  /** @description List of event types this webhook is subscribed to */
@@ -26560,7 +26560,7 @@ interface operations {
26560
26560
  "application/json": {
26561
26561
  /**
26562
26562
  * @description Unique identifier for the webhook
26563
- * @example 6af5cb9e79eb018a8628fb1c
26563
+ * @example 6af6f9390974dd7f7609c744
26564
26564
  */
26565
26565
  id: string;
26566
26566
  /** @description List of event types this webhook is subscribed to */
@@ -30417,7 +30417,7 @@ interface operations {
30417
30417
  "application/json": {
30418
30418
  /**
30419
30419
  * @description Unique identifier for the webhook
30420
- * @example 6af5cb9e79eb018a8628fb1c
30420
+ * @example 6af6f9390974dd7f7609c744
30421
30421
  */
30422
30422
  id: string;
30423
30423
  /** @description List of event types this webhook is subscribed to */
@@ -31057,7 +31057,7 @@ interface operations {
31057
31057
  /**
31058
31058
  * Format: date-time
31059
31059
  * @description ISO 8601 timestamp when the old secret will expire. Only present if a grace period was specified.
31060
- * @example 2026-11-12T14:27:22.542Z
31060
+ * @example 2026-11-13T11:54:13.268Z
31061
31061
  */
31062
31062
  oldSecretExpiresAt?: string;
31063
31063
  };
@@ -31301,7 +31301,7 @@ interface operations {
31301
31301
  "application/json": {
31302
31302
  /**
31303
31303
  * @description Unique identifier for the user
31304
- * @example 6af5cb9e79eb018a8628fb18
31304
+ * @example 6af6f9390974dd7f7609c740
31305
31305
  */
31306
31306
  id: string;
31307
31307
  /**
@@ -31318,7 +31318,7 @@ interface operations {
31318
31318
  /**
31319
31319
  * Format: date-time
31320
31320
  * @description ISO 8601 timestamp of when the user was created
31321
- * @example 2026-11-12T14:22:22.466Z
31321
+ * @example 2026-11-13T11:49:13.255Z
31322
31322
  */
31323
31323
  signedUpAt: string;
31324
31324
  /**
@@ -31797,7 +31797,7 @@ interface operations {
31797
31797
  "application/json": {
31798
31798
  /**
31799
31799
  * @description Unique identifier for the user
31800
- * @example 6af5cb9e79eb018a8628fb18
31800
+ * @example 6af6f9390974dd7f7609c740
31801
31801
  */
31802
31802
  id: string;
31803
31803
  /**
@@ -31814,7 +31814,7 @@ interface operations {
31814
31814
  /**
31815
31815
  * Format: date-time
31816
31816
  * @description ISO 8601 timestamp of when the user was created
31817
- * @example 2026-11-12T14:22:22.466Z
31817
+ * @example 2026-11-13T11:49:13.255Z
31818
31818
  */
31819
31819
  signedUpAt: string;
31820
31820
  /**
@@ -32657,7 +32657,7 @@ interface operations {
32657
32657
  "application/json": {
32658
32658
  /**
32659
32659
  * @description Unique identifier for the user
32660
- * @example 6af5cb9e79eb018a8628fb18
32660
+ * @example 6af6f9390974dd7f7609c740
32661
32661
  */
32662
32662
  id: string;
32663
32663
  /**
@@ -32674,7 +32674,7 @@ interface operations {
32674
32674
  /**
32675
32675
  * Format: date-time
32676
32676
  * @description ISO 8601 timestamp of when the user was created
32677
- * @example 2026-11-12T14:22:22.466Z
32677
+ * @example 2026-11-13T11:49:13.255Z
32678
32678
  */
32679
32679
  signedUpAt: string;
32680
32680
  /**
@@ -34677,13 +34677,16 @@ interface operations {
34677
34677
  requestBody: {
34678
34678
  content: {
34679
34679
  "application/json": {
34680
- types?: ("terms_of_service" | "privacy_policy" | "esign_consent")[];
34680
+ /** @enum {string} */
34681
+ placement?: "standalone" | "kyc";
34681
34682
  };
34682
34683
  "application/x-www-form-urlencoded": {
34683
- types?: ("terms_of_service" | "privacy_policy" | "esign_consent")[];
34684
+ /** @enum {string} */
34685
+ placement?: "standalone" | "kyc";
34684
34686
  };
34685
34687
  "multipart/form-data": {
34686
- types?: ("terms_of_service" | "privacy_policy" | "esign_consent")[];
34688
+ /** @enum {string} */
34689
+ placement?: "standalone" | "kyc";
34687
34690
  };
34688
34691
  };
34689
34692
  };
@@ -34699,31 +34702,47 @@ interface operations {
34699
34702
  nothingToPresent: true;
34700
34703
  } | {
34701
34704
  presentationId: string;
34702
- /** @enum {string} */
34703
- statementKey: "continueStatement" | "updatedStatement" | "privacyOnlyStatement";
34704
34705
  /** Format: date-time */
34705
34706
  expiresAt: string;
34706
34707
  baseRevision: string;
34707
- copySha256: string;
34708
34708
  submissionToken?: string;
34709
- copy: {
34710
- copyVersion: string;
34709
+ copyVersion: string;
34710
+ /** @description Echo on acceptance. Never compute it yourself. */
34711
+ screenSha256: string;
34712
+ /** @enum {string} */
34713
+ language: "en";
34714
+ /** @description The consent screen to render exactly as given. */
34715
+ screen: {
34716
+ /**
34717
+ * @description For analytics only; never choose text by it.
34718
+ * @enum {string}
34719
+ */
34720
+ kind: "first_time" | "updated" | "privacy_only" | "esign_only";
34711
34721
  /** @enum {string} */
34712
- language: "en";
34713
- continueStatement: string;
34714
- updatedStatement: string;
34715
- privacyOnlyStatement: string;
34722
+ placement: "standalone" | "kyc";
34723
+ title: string | null;
34724
+ /** @description Render the segments in order as one paragraph. A segment with `link` opens `link.url` as given. */
34725
+ statement: {
34726
+ text: string;
34727
+ link?: {
34728
+ /** @enum {string} */
34729
+ type: "terms_of_service" | "privacy_policy" | "esign_consent";
34730
+ url: string;
34731
+ };
34732
+ }[] | null;
34733
+ /** @description Present exactly when E-SIGN consent is presented. Show it unchecked; enable the button only once it is checked. */
34734
+ checkbox: {
34735
+ /** @description Render the segments in order as one paragraph. A segment with `link` opens `link.url` as given. */
34736
+ label: {
34737
+ text: string;
34738
+ link?: {
34739
+ /** @enum {string} */
34740
+ type: "terms_of_service" | "privacy_policy" | "esign_consent";
34741
+ url: string;
34742
+ };
34743
+ }[];
34744
+ } | null;
34716
34745
  buttonLabel: string;
34717
- supportEmail: string;
34718
- /** @enum {string} */
34719
- consentPattern: "clickwrap" | "esign_checkbox";
34720
- esignCheckboxLabel?: string;
34721
- links: {
34722
- /** @enum {string} */
34723
- type: "terms_of_service" | "privacy_policy" | "esign_consent";
34724
- label: string;
34725
- url: string;
34726
- }[];
34727
34746
  };
34728
34747
  items: {
34729
34748
  /** @enum {string} */
@@ -35238,21 +35257,27 @@ interface operations {
35238
35257
  /** Format: uuid */
35239
35258
  presentationId: string;
35240
35259
  accept: ("terms_of_service" | "privacy_policy" | "esign_consent")[];
35241
- copySha256?: string;
35260
+ /** @description The presentation's `screenSha256`, echoed unchanged. */
35261
+ screenSha256: string;
35262
+ /** @description Send only when `screen.checkbox` is present, and only `true`: otherwise the acceptance is refused with `esign_consent_required` or `unexpected_esign_checkbox`. */
35242
35263
  esignCheckboxChecked?: boolean;
35243
35264
  };
35244
35265
  "application/x-www-form-urlencoded": {
35245
35266
  /** Format: uuid */
35246
35267
  presentationId: string;
35247
35268
  accept: ("terms_of_service" | "privacy_policy" | "esign_consent")[];
35248
- copySha256?: string;
35269
+ /** @description The presentation's `screenSha256`, echoed unchanged. */
35270
+ screenSha256: string;
35271
+ /** @description Send only when `screen.checkbox` is present, and only `true`: otherwise the acceptance is refused with `esign_consent_required` or `unexpected_esign_checkbox`. */
35249
35272
  esignCheckboxChecked?: boolean;
35250
35273
  };
35251
35274
  "multipart/form-data": {
35252
35275
  /** Format: uuid */
35253
35276
  presentationId: string;
35254
35277
  accept: ("terms_of_service" | "privacy_policy" | "esign_consent")[];
35255
- copySha256?: string;
35278
+ /** @description The presentation's `screenSha256`, echoed unchanged. */
35279
+ screenSha256: string;
35280
+ /** @description Send only when `screen.checkbox` is present, and only `true`: otherwise the acceptance is refused with `esign_consent_required` or `unexpected_esign_checkbox`. */
35256
35281
  esignCheckboxChecked?: boolean;
35257
35282
  };
35258
35283
  };
@@ -52749,6 +52774,10 @@ type AgreementsReceipt = PathResponse<'/v1/users/me/agreements/operations/{prese
52749
52774
  type AgreementsAcceptanceRequest = PathRequestBody<'/v1/agreements/acceptances', 'post'>;
52750
52775
  type AgreementsState = AgreementsReceipt['agreements'];
52751
52776
  type AgreementType = AgreementsPresentation['items'][number]['type'];
52777
+ type AgreementsScreen = AgreementsPresentation['screen'];
52778
+ type AgreementsScreenKind = AgreementsScreen['kind'];
52779
+ type AgreementsPlacement = AgreementsScreen['placement'];
52780
+ type AgreementsTextSegment = NonNullable<AgreementsScreen['statement']>[number];
52752
52781
  /**
52753
52782
  * Spritz agreements (Terms of Service, Privacy Policy, E-Sign Consent) are the
52754
52783
  * user's relationship-level consent with Spritz, separate from provider terms
@@ -52766,20 +52795,23 @@ declare class AgreementsService {
52766
52795
  * (`POST /v1/users/me/agreements/presentations`).
52767
52796
  *
52768
52797
  * Resolves with `{ nothingToPresent: true }` when the user has nothing to
52769
- * accept. Otherwise render `copy[statementKey]` verbatim directly above a
52770
- * button labelled `copy.buttonLabel`, linking each document from
52771
- * `copy.links`. Do not translate or rephrase it. Document URLs are relative
52772
- * to the Spritz API origin.
52798
+ * accept. Otherwise `screen` is the one consent screen to show: render its
52799
+ * `title`, `statement` segments, `checkbox` (unchecked; the button stays
52800
+ * disabled until it is checked) and `buttonLabel` exactly as given. Pass
52801
+ * `placement: 'kyc'` when the screen sits inside the step that starts
52802
+ * identity verification. Document URLs are absolute.
52773
52803
  *
52774
- * Forward `presentationId`, `copySha256`, the presented `items[].type` and
52775
- * the short-lived `submissionToken` (15 minutes, this presentation only) to
52776
- * the user's client. That client sends `POST /v1/agreements/acceptances`
52777
- * itself, with `Authorization: Bearer <submissionToken>` and body
52778
- * `{ presentationId, accept, copySha256 }`. Spritz refuses an acceptance sent
52804
+ * Forward `presentationId`, `screenSha256`, the presented `items[].type`
52805
+ * and the short-lived `submissionToken` (15 minutes, this presentation
52806
+ * only) to the user's client. That client sends
52807
+ * `POST /v1/agreements/acceptances` itself, with
52808
+ * `Authorization: Bearer <submissionToken>` and body
52809
+ * `{ presentationId, accept, screenSha256 }`, plus
52810
+ * `esignCheckboxChecked: true` exactly when `screen.checkbox` is present.
52811
+ * `accept` lists every presented type. Spritz refuses an acceptance sent
52779
52812
  * from your backend, including one sent from the network that created the
52780
52813
  * presentation (`403 client_submission_required`), so this SDK does not
52781
- * make that request. Under the default `clickwrap` pattern, `accept` must
52782
- * list every presented type.
52814
+ * make that request.
52783
52815
  *
52784
52816
  * Throws a `RateLimitError` with `problem.code ===
52785
52817
  * 'agreement_presentation_rate_limited'` after ten presentations for one user
@@ -56663,4 +56695,4 @@ declare function hasProblemCode<T extends string>(error: unknown, code: T): erro
56663
56695
  };
56664
56696
 
56665
56697
  export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, AmountMode, AuthenticationError, BadRequestError, BankAccountSubType, BankAccountType, BillType, CardFeatureType, ConflictError, DebitCardNetwork, Environment, InternalServerError, NotFoundError, OfframpFeatureType, OnrampFeatureType, PayableAccountType, PaymentDeliveryMethod, PaymentNetwork, DirectPaymentStatus as PaymentRequestStatus, PaymentStatus, PermissionDeniedError, RateLimitError, RequirementType, SpritzApiClient, SpritzApiError, UnprocessableEntityError, VirtualCardType, hasProblemCode, hasProblemType, isAPIError, onrampSupportedTokens };
56666
- export type { AcceptTermsRequest, AcceptTermsResponse, AccountPayments, AccountPaymentsVariables, AccountPayments_paymentsForAccount, AccountPayments_paymentsForAccount_transaction, AchDebitEligibilityRequest, AchDebitEligibilityResponse, AchDebitExposureResponse, AchDebitReturn, AchDebitReturnListQuery, AchDebitReturnListResponse, AgreementType, AgreementsAcceptanceRequest, AgreementsPresentation, AgreementsReceipt, AgreementsState, AutoRampAccount, AutoRampAccountEstimate, AutoRampAccountList, BankAccount, BankAccountFragment, BankAccountFragment_bankAccountDetails, BankAccountFragment_bankAccountDetails_CanadianBankAccountDetails, BankAccountFragment_bankAccountDetails_USBankAccountDetails, BankAccountFragment_institution, BankAccountFragment_paymentAddresses, BankAccountInput, BankAccountList, BillFragment, BillFragment_billAccountDetails, BillFragment_dataSync, BillFragment_institution, BillFragment_paymentAddresses, BypassKycRequest, CancelDepositResponse, CategoryAccess, ClientOptions, CompleteLinkingRequest, CompleteLinkingResponse, ComplianceRequirementField, ComplianceRequirements, CreateAgreementsPresentationRequest, CreateAgreementsPresentationResponse, CreateAutoRampAccountRequest, CreateBankAccountInput, CreateBankAccountResponse, CreateDepositOptions, CreateDepositRequest, CreateDepositWithReturnRequest, CreateDepositWithReturnResponse, CreateDirectPaymentInput, CreateOffRampQuoteRequest, CreateOnrampPaymentInput, CreatePaymentRequestInput, CreateVirtualAccountInput, CreateWebhookParams, CurrentUser, CurrentUser_me, CurrentUser_verification, CurrentUser_verification_identity, CurrentUser_verification_identity_verificationMetadata, CurrentUser_verification_identity_verificationMetadata_details, DebitCardFragment, DebitCardInput, DeleteBankAccountResponse, DeleteFundingSourceResponse, Deposit, DepositCancelRefusalReason, DepositListQuery, DepositListResponse, FullBridgeUser, FundingSource, FundingSourceDepositLimits, GetSolanaPayParams, GetSolanaPayParamsVariables, GetSolanaPayParams_solanaParams, GetSpritzPayParams, GetSpritzPayParamsVariables, GetSpritzPayParams_spritzPayParams, IntegratorWebhook, KycStatus, LinkBankAccountRequest, LinkBankAccountResponse, LinkTokenResponse, OffRampQuote, OffRampQuoteTransaction, OffRampQuoteTransactionRequest, OffRampRefundRequest, OffRampRefundResponse, OnRamp, OnRampDetail, OnRampListQuery, OnRampListResponse, OnrampPaymentFragment, OnrampPaymentFragment_depositInstructions, OnrampPayments, OnrampPayments_onrampPayments, OnrampPayments_onrampPayments_depositInstructions, PathParams, PathQuery, PathRequestBody, PathResponse, PayableAccountFragment, PayableAccountFragment_BankAccount, PayableAccountFragment_BankAccount_bankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_CanadianBankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_USBankAccountDetails, PayableAccountFragment_BankAccount_dataSync, PayableAccountFragment_BankAccount_institution, PayableAccountFragment_Bill, PayableAccountFragment_Bill_billAccountDetails, PayableAccountFragment_Bill_dataSync, PayableAccountFragment_Bill_institution, PayableAccountFragment_DebitCard, PayableAccountFragment_DebitCard_dataSync, PayableAccountFragment_DebitCard_institution, PayableAccountFragment_VirtualCard, PayableAccountFragment_VirtualCard_billingInfo, PayableAccountFragment_VirtualCard_billingInfo_address, PayableAccountFragment_VirtualCard_dataSync, PayableAccountFragment_VirtualCard_institution, PayableAccountInstitutionFragment, Payment, PaymentFragment, PaymentFragment_transaction, PaymentLimits, PaymentLimitsResponse, PaymentLimitsVariables, PaymentLimits_paymentLimits, PaymentRequestFragment, PaymentRequestPayment, PaymentRequestPaymentVariables, PaymentRequestPayment_paymentForPaymentRequest, PaymentRequestPayment_paymentForPaymentRequest_transaction, PaymentVariables, Payment_payment, Payment_payment_transaction, PopularBillInstitutions, PopularBillInstitutionsVariables, PopularBillInstitutions_popularUSBillInstitutions, PrepareDepositRequest, PrepareDepositResponse, PrepareDepositWithProgramControlRequest, PrepareDepositWithProgramControlResponse, ProblemDetails, ProblemFieldError, ProblemSuggestedAction, Requirement, operations as RestApiOperations, paths as RestApiPaths, SearchUSBillInstitutions, SearchUSBillInstitutionsVariables, SearchUSBillInstitutions_searchUSBillInstitutions, SetAchDebitExposureCapRequest, SetAchDebitExposureCapResponse, SimulateAutoRampDepositRequest, SimulateAutoRampDepositResponse, SubmitComplianceRequest, SubmitComplianceResponse, SubmitOffRampQuoteRequest, TokenBalanceFragment, UpdateWebhookParams, UpdateWebhookSecretResponse, UserAccess, UserAccessCapabilities, UserAccess_bridgeUser, UserAccess_me, UserAccess_verification, UserAccess_verification_identity, UserAccess_verification_identity_verificationMetadata, UserAccess_verification_identity_verificationMetadata_details, UserBankAccounts, UserBankAccounts_bankAccounts, UserBankAccounts_bankAccounts_bankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_CanadianBankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_USBankAccountDetails, UserBankAccounts_bankAccounts_institution, UserBankAccounts_bankAccounts_paymentAddresses, UserBills, UserBills_bills, UserBills_bills_billAccountDetails, UserBills_bills_dataSync, UserBills_bills_institution, UserBills_bills_paymentAddresses, UserDebitCards, UserDebitCards_debitCards, UserFragment, UserPayableAccounts, UserPayableAccounts_payableAccounts, UserPayableAccounts_payableAccounts_BankAccount, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_CanadianBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_USBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_dataSync, UserPayableAccounts_payableAccounts_BankAccount_institution, UserPayableAccounts_payableAccounts_Bill, UserPayableAccounts_payableAccounts_Bill_billAccountDetails, UserPayableAccounts_payableAccounts_Bill_dataSync, UserPayableAccounts_payableAccounts_Bill_institution, UserPayableAccounts_payableAccounts_DebitCard, UserPayableAccounts_payableAccounts_DebitCard_dataSync, UserPayableAccounts_payableAccounts_DebitCard_institution, UserPayableAccounts_payableAccounts_VirtualCard, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo_address, UserPayableAccounts_payableAccounts_VirtualCard_dataSync, UserPayableAccounts_payableAccounts_VirtualCard_institution, UserProfile, UserVerification, UserVerification_verification, UserVerification_verification_identity, UserVerification_verification_identity_user, UserVerification_verification_identity_verificationMetadata, UserVerification_verification_identity_verificationMetadata_details, UserVirtualDebitCard, UserVirtualDebitCard_virtualDebitCard, UserVirtualDebitCard_virtualDebitCard_billingInfo, UserVirtualDebitCard_virtualDebitCard_billingInfo_address, UserVirtualDebitCard_virtualDebitCard_paymentAddresses, VerificationFragment, VerificationFragment_identity, VerificationFragment_identity_verificationMetadata, VerificationFragment_identity_verificationMetadata_details, VerificationSession, VirtualAccountFragment, VirtualAccountFragment_depositInstructions, VirtualAccounts, VirtualAccounts_virtualAccounts, VirtualAccounts_virtualAccounts_depositInstructions, VirtualDebitCardFragment, VirtualDebitCardFragment_billingInfo, VirtualDebitCardFragment_billingInfo_address, VirtualDebitCardFragment_paymentAddresses, WalletTokenBalances, WalletTokenBalancesVariables, WalletTokenBalances_tokenBalances, WebhookEvent };
56698
+ export type { AcceptTermsRequest, AcceptTermsResponse, AccountPayments, AccountPaymentsVariables, AccountPayments_paymentsForAccount, AccountPayments_paymentsForAccount_transaction, AchDebitEligibilityRequest, AchDebitEligibilityResponse, AchDebitExposureResponse, AchDebitReturn, AchDebitReturnListQuery, AchDebitReturnListResponse, AgreementType, AgreementsAcceptanceRequest, AgreementsPlacement, AgreementsPresentation, AgreementsReceipt, AgreementsScreen, AgreementsScreenKind, AgreementsState, AgreementsTextSegment, AutoRampAccount, AutoRampAccountEstimate, AutoRampAccountList, BankAccount, BankAccountFragment, BankAccountFragment_bankAccountDetails, BankAccountFragment_bankAccountDetails_CanadianBankAccountDetails, BankAccountFragment_bankAccountDetails_USBankAccountDetails, BankAccountFragment_institution, BankAccountFragment_paymentAddresses, BankAccountInput, BankAccountList, BillFragment, BillFragment_billAccountDetails, BillFragment_dataSync, BillFragment_institution, BillFragment_paymentAddresses, BypassKycRequest, CancelDepositResponse, CategoryAccess, ClientOptions, CompleteLinkingRequest, CompleteLinkingResponse, ComplianceRequirementField, ComplianceRequirements, CreateAgreementsPresentationRequest, CreateAgreementsPresentationResponse, CreateAutoRampAccountRequest, CreateBankAccountInput, CreateBankAccountResponse, CreateDepositOptions, CreateDepositRequest, CreateDepositWithReturnRequest, CreateDepositWithReturnResponse, CreateDirectPaymentInput, CreateOffRampQuoteRequest, CreateOnrampPaymentInput, CreatePaymentRequestInput, CreateVirtualAccountInput, CreateWebhookParams, CurrentUser, CurrentUser_me, CurrentUser_verification, CurrentUser_verification_identity, CurrentUser_verification_identity_verificationMetadata, CurrentUser_verification_identity_verificationMetadata_details, DebitCardFragment, DebitCardInput, DeleteBankAccountResponse, DeleteFundingSourceResponse, Deposit, DepositCancelRefusalReason, DepositListQuery, DepositListResponse, FullBridgeUser, FundingSource, FundingSourceDepositLimits, GetSolanaPayParams, GetSolanaPayParamsVariables, GetSolanaPayParams_solanaParams, GetSpritzPayParams, GetSpritzPayParamsVariables, GetSpritzPayParams_spritzPayParams, IntegratorWebhook, KycStatus, LinkBankAccountRequest, LinkBankAccountResponse, LinkTokenResponse, OffRampQuote, OffRampQuoteTransaction, OffRampQuoteTransactionRequest, OffRampRefundRequest, OffRampRefundResponse, OnRamp, OnRampDetail, OnRampListQuery, OnRampListResponse, OnrampPaymentFragment, OnrampPaymentFragment_depositInstructions, OnrampPayments, OnrampPayments_onrampPayments, OnrampPayments_onrampPayments_depositInstructions, PathParams, PathQuery, PathRequestBody, PathResponse, PayableAccountFragment, PayableAccountFragment_BankAccount, PayableAccountFragment_BankAccount_bankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_CanadianBankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_USBankAccountDetails, PayableAccountFragment_BankAccount_dataSync, PayableAccountFragment_BankAccount_institution, PayableAccountFragment_Bill, PayableAccountFragment_Bill_billAccountDetails, PayableAccountFragment_Bill_dataSync, PayableAccountFragment_Bill_institution, PayableAccountFragment_DebitCard, PayableAccountFragment_DebitCard_dataSync, PayableAccountFragment_DebitCard_institution, PayableAccountFragment_VirtualCard, PayableAccountFragment_VirtualCard_billingInfo, PayableAccountFragment_VirtualCard_billingInfo_address, PayableAccountFragment_VirtualCard_dataSync, PayableAccountFragment_VirtualCard_institution, PayableAccountInstitutionFragment, Payment, PaymentFragment, PaymentFragment_transaction, PaymentLimits, PaymentLimitsResponse, PaymentLimitsVariables, PaymentLimits_paymentLimits, PaymentRequestFragment, PaymentRequestPayment, PaymentRequestPaymentVariables, PaymentRequestPayment_paymentForPaymentRequest, PaymentRequestPayment_paymentForPaymentRequest_transaction, PaymentVariables, Payment_payment, Payment_payment_transaction, PopularBillInstitutions, PopularBillInstitutionsVariables, PopularBillInstitutions_popularUSBillInstitutions, PrepareDepositRequest, PrepareDepositResponse, PrepareDepositWithProgramControlRequest, PrepareDepositWithProgramControlResponse, ProblemDetails, ProblemFieldError, ProblemSuggestedAction, Requirement, operations as RestApiOperations, paths as RestApiPaths, SearchUSBillInstitutions, SearchUSBillInstitutionsVariables, SearchUSBillInstitutions_searchUSBillInstitutions, SetAchDebitExposureCapRequest, SetAchDebitExposureCapResponse, SimulateAutoRampDepositRequest, SimulateAutoRampDepositResponse, SubmitComplianceRequest, SubmitComplianceResponse, SubmitOffRampQuoteRequest, TokenBalanceFragment, UpdateWebhookParams, UpdateWebhookSecretResponse, UserAccess, UserAccessCapabilities, UserAccess_bridgeUser, UserAccess_me, UserAccess_verification, UserAccess_verification_identity, UserAccess_verification_identity_verificationMetadata, UserAccess_verification_identity_verificationMetadata_details, UserBankAccounts, UserBankAccounts_bankAccounts, UserBankAccounts_bankAccounts_bankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_CanadianBankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_USBankAccountDetails, UserBankAccounts_bankAccounts_institution, UserBankAccounts_bankAccounts_paymentAddresses, UserBills, UserBills_bills, UserBills_bills_billAccountDetails, UserBills_bills_dataSync, UserBills_bills_institution, UserBills_bills_paymentAddresses, UserDebitCards, UserDebitCards_debitCards, UserFragment, UserPayableAccounts, UserPayableAccounts_payableAccounts, UserPayableAccounts_payableAccounts_BankAccount, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_CanadianBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_USBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_dataSync, UserPayableAccounts_payableAccounts_BankAccount_institution, UserPayableAccounts_payableAccounts_Bill, UserPayableAccounts_payableAccounts_Bill_billAccountDetails, UserPayableAccounts_payableAccounts_Bill_dataSync, UserPayableAccounts_payableAccounts_Bill_institution, UserPayableAccounts_payableAccounts_DebitCard, UserPayableAccounts_payableAccounts_DebitCard_dataSync, UserPayableAccounts_payableAccounts_DebitCard_institution, UserPayableAccounts_payableAccounts_VirtualCard, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo_address, UserPayableAccounts_payableAccounts_VirtualCard_dataSync, UserPayableAccounts_payableAccounts_VirtualCard_institution, UserProfile, UserVerification, UserVerification_verification, UserVerification_verification_identity, UserVerification_verification_identity_user, UserVerification_verification_identity_verificationMetadata, UserVerification_verification_identity_verificationMetadata_details, UserVirtualDebitCard, UserVirtualDebitCard_virtualDebitCard, UserVirtualDebitCard_virtualDebitCard_billingInfo, UserVirtualDebitCard_virtualDebitCard_billingInfo_address, UserVirtualDebitCard_virtualDebitCard_paymentAddresses, VerificationFragment, VerificationFragment_identity, VerificationFragment_identity_verificationMetadata, VerificationFragment_identity_verificationMetadata_details, VerificationSession, VirtualAccountFragment, VirtualAccountFragment_depositInstructions, VirtualAccounts, VirtualAccounts_virtualAccounts, VirtualAccounts_virtualAccounts_depositInstructions, VirtualDebitCardFragment, VirtualDebitCardFragment_billingInfo, VirtualDebitCardFragment_billingInfo_address, VirtualDebitCardFragment_paymentAddresses, WalletTokenBalances, WalletTokenBalancesVariables, WalletTokenBalances_tokenBalances, WebhookEvent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/api-client",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "packageManager": "yarn@1.22.22",
5
5
  "description": "Typescript library for interacting with the Spritz Finance API",
6
6
  "type": "module",