@spritz-finance/api-client 0.15.0 → 0.16.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 +11 -0
- package/dist/spritz-api-client.cjs +55 -55
- package/dist/spritz-api-client.d.ts +534 -40
- package/dist/spritz-api-client.mjs +35 -35
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1034,6 +1034,17 @@ console.log(deposit.status, deposit.debitStatus, deposit.releaseStatus)
|
|
|
1034
1034
|
|
|
1035
1035
|
Authorization is derived from the verified ACH funding source — no wallet signature is required.
|
|
1036
1036
|
|
|
1037
|
+
**A backend `create` must send `clientIp`** — the public address your edge observed for the authorizing client, distinct from your backend's own address. The generated type marks it optional because the contract allows omitting it only for a direct client submission authenticated with a `submissionToken`, which this SDK does not send; a backend create without it fails at runtime, not at compile time.
|
|
1038
|
+
|
|
1039
|
+
```typescript
|
|
1040
|
+
const deposit = await client.deposit.create(
|
|
1041
|
+
{ preparationId: preparation.preparationId, clientIp: req.ip },
|
|
1042
|
+
{ idempotencyKey }
|
|
1043
|
+
)
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
To move submission onto the customer's device, pass `clientNetwork: { ipAddresses: [req.ip] }` to `prepare` and forward the returned `submissionToken` to that client. The client then calls `POST /v1/deposits/direct` itself with `Authorization: Bearer ach_submit_...` as its only credential — no user API key, no integrator key, no HMAC headers — plus the `Idempotency-Key` header and a body of just `{ preparationId }`. This SDK signs every REST call with integrator HMAC, so that request should not go through it; see the [ACH Onramp Integration Guide](docs/ach-onramp-guide.md) for the full request.
|
|
1047
|
+
|
|
1037
1048
|
If risk checks block the create step, the API returns 409 before any ACH debit is pulled. Prepare a new quote before retrying; blocked create attempts consume the original `preparationId`.
|
|
1038
1049
|
|
|
1039
1050
|
For a complete walkthrough with code examples, request/response schemas, and deposit lifecycle documentation, see the **[ACH Onramp Integration Guide](docs/ach-onramp-guide.md)**.
|