@invonetwork/web-sdk 3.24.1 → 3.25.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/CHANGELOG.md +1340 -1332
- package/README.md +31 -0
- package/dist/server.cjs +334 -161
- package/dist/server.d.cts +203 -9
- package/dist/server.d.ts +203 -9
- package/dist/server.js +335 -163
- package/package.json +77 -77
package/README.md
CHANGED
|
@@ -2450,6 +2450,37 @@ before the network. `redeemReward` is never auto-retried.
|
|
|
2450
2450
|
|
|
2451
2451
|
---
|
|
2452
2452
|
|
|
2453
|
+
## Partner and creator payouts
|
|
2454
|
+
|
|
2455
|
+
Platform partners can have INVO pay out the earnings INVO owes them, and can register creators that INVO verifies and pays for them. Creators verify directly with INVO on INVO's own page; you see their status only. See [creator payouts](https://docs.invo.network/docs/partners#creator-payouts).
|
|
2456
|
+
|
|
2457
|
+
```ts
|
|
2458
|
+
import { InvoServer } from "@invonetwork/web-sdk/server";
|
|
2459
|
+
|
|
2460
|
+
const invo = new InvoServer({ gameSecret: process.env.INVO_GAME_SECRET!, baseUrl: "https://invo.network" });
|
|
2461
|
+
|
|
2462
|
+
// 1. Register the creator. INVO emails them a link to verify with INVO.
|
|
2463
|
+
const { payee, invite } = await invo.payouts.registerPayee({
|
|
2464
|
+
partnerReference: "creator-001", // your own id; no personal data
|
|
2465
|
+
legalName: "Sam Creator",
|
|
2466
|
+
email: "sam@example.com",
|
|
2467
|
+
country: "GB",
|
|
2468
|
+
payeeType: "individual",
|
|
2469
|
+
});
|
|
2470
|
+
|
|
2471
|
+
// 2. Wait for the payee.status_changed webhook with status "verified".
|
|
2472
|
+
|
|
2473
|
+
// 3. Pay them from the earnings INVO owes you. The payout fee is taken from the payout.
|
|
2474
|
+
const { payout } = await invo.payouts.requestPayout({
|
|
2475
|
+
amountUsd: "250.00",
|
|
2476
|
+
contactEmail: "ops@example.com",
|
|
2477
|
+
payeeId: payee.payee_id,
|
|
2478
|
+
clientRequestId: crypto.randomUUID(),
|
|
2479
|
+
});
|
|
2480
|
+
```
|
|
2481
|
+
|
|
2482
|
+
A creator payout still `requested` can be cancelled with `invo.payouts.cancelPayout(payout.id)`. Refusals carry `err.code`: `PAYEE_NOT_FOUND`, `PAYEE_NOT_VERIFIED`, `PAYEE_VERIFICATION_EXPIRED`, `PAYEE_BANK_NOT_VERIFIED`, `PAYEE_NOT_PAYABLE` (INVO can't pay this creator right now and never says why; no action is needed from you), `INSUFFICIENT_OWED_BALANCE`, `PAYOUT_NOT_CANCELLABLE`.
|
|
2483
|
+
|
|
2453
2484
|
## Webhooks
|
|
2454
2485
|
|
|
2455
2486
|
The synchronous responses are for UX; **reconcile and grant value off webhooks.** They're HMAC-signed; **dedupe on the `X-Invo-Idempotency-Key` header** (stable across retries/replays — *not* `X-Invo-Event-Id`, which changes per delivery).
|