@spritz-finance/api-client 0.12.0 → 0.14.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 +8 -4
- package/dist/spritz-api-client.cjs +59 -59
- package/dist/spritz-api-client.d.ts +89 -49
- package/dist/spritz-api-client.mjs +59 -59
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,13 +168,15 @@ const userData = await client.user.getCurrentUser()
|
|
|
168
168
|
```typescript
|
|
169
169
|
const me = await client.user.getMe()
|
|
170
170
|
|
|
171
|
-
me.verification.status // 'not_started' | 'verified' | 'failed' | 'disabled' | 'retry'
|
|
171
|
+
me.verification.status // 'not_started' | 'verified' | 'failed' | 'disabled' | 'retry' | 'under_review'
|
|
172
|
+
me.verification.failureReason // e.g. 'documentary_verification', or null unless failed / retry / under_review
|
|
173
|
+
me.verification.provider // 'persona' | 'plaid' — the provider the next verification session will use
|
|
172
174
|
me.verification.country // e.g. 'US', or null
|
|
173
175
|
me.verification.requirement // outstanding requirement, if any ({ type, status, actionUrl?, retryable? })
|
|
174
176
|
me.capabilities // [{ product, method?, name, status, nextRequirement?, requirements }]
|
|
175
177
|
```
|
|
176
178
|
|
|
177
|
-
|
|
179
|
+
`status: 'retry'` (with an `identity_verification` requirement whose `retryable` is `true`) means a failed verification can be retried by calling `verification.createSession()` again; `under_review` means a decision is pending and no new session can be started. This is the REST replacement for `getCurrentUser()` verification state and `retryFailedVerification()`.
|
|
178
180
|
|
|
179
181
|
### Identity Verification
|
|
180
182
|
|
|
@@ -207,7 +209,9 @@ const { sessionId, provider, sessionToken, verificationUrl, verificationUrlExpir
|
|
|
207
209
|
// verificationUrl: provider-hosted URL, or null
|
|
208
210
|
```
|
|
209
211
|
|
|
210
|
-
|
|
212
|
+
The same call retries a failed verification: when `getMe().verification.status` is `retry`, it starts a new inquiry and returns the new session. There is no separate retry endpoint.
|
|
213
|
+
|
|
214
|
+
Tokens and URLs may expire, so create the session just in time rather than caching it. The call throws a `ConflictError` (409) with one of `VERIFICATION_NOT_RETRYABLE` (permanent failure), `VERIFICATION_UNDER_REVIEW`, `VERIFICATION_ALREADY_VERIFIED`, or `VERIFICATION_SESSION_UNAVAILABLE`, a 409 with no code while another session request for the same user is still in progress (retry after it completes), and an `InternalServerError` (503, with `retryAfter` seconds in the error body) when the provider is temporarily unavailable.
|
|
211
215
|
|
|
212
216
|
#### Option 1: Verification URL
|
|
213
217
|
|
|
@@ -1010,7 +1014,7 @@ ACH onramp lets users convert USD from their bank account into USDC delivered to
|
|
|
1010
1014
|
4. **Server:** find an active funding source and fetch limits with `client.fundingSource.getDepositLimits(id)`
|
|
1011
1015
|
5. **Server:** prepare a quote with `client.deposit.prepare(...)`
|
|
1012
1016
|
6. **Client:** show the quote and ACH authorization message to the user
|
|
1013
|
-
7. **Server:** create the deposit with `client.deposit.create(
|
|
1017
|
+
7. **Server:** create the deposit with `client.deposit.create(input, { idempotencyKey })`; Spritz runs risk checks before initiating the ACH pull. Persist one unique key per deposit intent and reuse it verbatim on retries so a timed-out request replays the original response instead of authorizing a second debit
|
|
1014
1018
|
|
|
1015
1019
|
Authorization is derived from the verified ACH funding source — no wallet signature is required.
|
|
1016
1020
|
|