@invonetwork/web-sdk 3.24.1 → 3.26.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 +18 -0
- package/README.md +2782 -2749
- package/dist/server.cjs +354 -161
- package/dist/server.d.cts +238 -11
- package/dist/server.d.ts +238 -11
- package/dist/server.js +355 -163
- package/package.json +1 -1
package/dist/server.d.cts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { I as InvoError, H as Http, $ as AuthHeader,
|
|
1
|
+
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as CardSetupSessionInput, a1 as CardSetupSessionResult, a2 as CardSetupInput, a3 as CardSetupResult, a4 as CardSetupConfirmInput, a5 as CardSetupConfirmResult, a6 as PlayerCardsResult, a7 as PlatformPurchaseInput, a8 as PlatformPurchaseResult, a9 as PlatformOrderStatusResult, aa as PlatformPurchaseHistoryQuery, ab as PlatformPurchaseHistoryResult, ac as PlatformRefundInput, ad as PlatformRefundResult, ae as CreateSubscriptionInput, af as SubscriptionResult, ag as GetSubscriptionOptions, ah as GetSubscriptionResult, ai as ListSubscriptionsOptions, aj as SubscriptionListResult, ak as CancelSubscriptionOptions, al as CancelResult, am as ChangeAmountResult, an as SetPaymentMethodInput, ao as SetPaymentMethodResult, ap as RefundSubscriptionInput, aq as RefundResult, ar as SteamSubscriptionInitInput, as as SteamInitResult, at as SteamFinalizeSubscriptionResult, au as SandboxClockResult, av as SandboxFailureOutcome, aw as SandboxForceFailureOptions, ax as SandboxForceAuthChallengeOptions, ay as ServerConfig, az as MintPlayerTokenInput, aA as PlayerToken, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, aH as PhoneChangeRequest, aI as InitiateSendInput, aJ as InitiateResult, aK as InitiateTransferInput, aL as CreateCheckoutInput, aM as CreateCheckoutResult, aN as PurchaseInput, aO as PurchaseResult, aP as CurrencyPurchaseQuoteInput, aQ as CurrencyPurchaseQuote, aR as ConfirmPaymentResult, aS as OrderDetailsResult, aT as SteamPacksQuery, aU as SteamPacksResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, aZ as PurchaseItemInput, a_ as PurchaseItemResult, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, b4 as PlayerActivityEntry, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, o as LoyaltyCardsResult, b7 as InboundPendingQuery, b8 as InboundPendingResult, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bb as SmsVerifyResult, bc as ClaimTransferInput, bd as ClaimResult, be as ClaimCurrencyInput, bf as TransactionStatusResult, bg as GuardianApprovalStatusResult, bh as ServerDestinationsQuery, n as DestinationsResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bm as PhoneShareStatusResult, bn as BeginDeviceApprovalInput, bo as DeviceApprovalGrant, bp as PollDeviceApprovalInput, bq as DeviceApprovalPollResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, bt as ApproveWithDeviceCodeInput, bu as DeviceApprovalSettleResult, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult } from './types-Cjd4SAR8.cjs';
|
|
2
2
|
export { bx as CardSetupStatus, by as CheckoutWarning, w as ClaimDelivery, bz as CurrencyBalance, bA as CurrencyPurchaseQuoteBreakdown, x as DestinationGame, bB as DeviceApprovalChannel, bC as DeviceApprovalEnrollment, bD as DeviceApprovalFlow, bE as DeviceApprovalPollStatus, bF as DeviceEnrollmentDecision, bG as DeviceEnrollmentRespond, bH as ExpiryReason, bI as FeeTakenFrom, bJ as FirstCharge, bK as FirstChargeStatus, bL as FundingSource, bM as InboundPendingItem, y as InvoErrorInfo, z as InvoHooks, F as InvoRequestInfo, G as InvoResponseInfo, bN as LinkedIdentityEmail, J as LoyaltyCard, K as LoyaltyCardReward, N as LoyaltyCardStep, O as LoyaltyRewardState, Q as LoyaltyStepProgress, S as LoyaltyStepState, bO as MinPurchaseWarning, bP as PhoneChangeConfirmation, bQ as PhoneChangeRequestStatus, bR as PlatformPurchaseStatus, bS as PlayerActivityType, Z as Rail, bT as RefundInitiation, bU as RefundPendingApproval, bV as RefundProcessingFeeBasis, bW as RefundReceipt, bX as RefundRevenueShareAttribution, bY as RefundWarning, bZ as SandboxClockState, b_ as SavedCard, b$ as SteamPack, c0 as SteamUserSession, c1 as Subscription, c2 as SubscriptionBaseInput, c3 as SubscriptionConsent, c4 as SubscriptionConsentInput, c5 as SubscriptionFundingRail, c6 as SubscriptionInterval, c7 as SubscriptionRevenueShare, c8 as SubscriptionRevenueShareInput, c9 as SubscriptionStatus, ca as UnacknowledgedPurchaseOutcome, _ as VerificationMethod, cb as isRefundPendingApproval } from './types-Cjd4SAR8.cjs';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* The package version, as sent in the server User-Agent. A test pins this to
|
|
6
|
-
* `package.json` so it cannot drift silently (it did: the UA read 3.0.0 through 3.7.0).
|
|
7
|
-
* Bump it with the changeset flow.
|
|
8
|
-
*/
|
|
9
|
-
declare const SDK_VERSION = "3.24.1";
|
|
10
|
-
|
|
11
4
|
interface VerifyWebhookOptions {
|
|
12
5
|
/** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
|
|
13
6
|
toleranceSec?: number;
|
|
@@ -327,10 +320,14 @@ interface TransferEventData {
|
|
|
327
320
|
* money fields are decimal strings (USD) or `null`. The payout fee fields are `null` on a
|
|
328
321
|
* payout recorded before the fee existed.
|
|
329
322
|
*/
|
|
323
|
+
/** Payout statuses. `cancelled` and `returned` are 3.25.0. */
|
|
324
|
+
type PayoutStatus = "requested" | "approved" | "processing" | "completed" | "rejected" | "failed" | "cancelled" | "returned" | (string & {});
|
|
325
|
+
/** Why a completed payout came back. A creator payout always reads `"returned"`. */
|
|
326
|
+
type ReturnReasonCode = "account_closed" | "no_account" | "invalid_account" | "refused" | "other" | "returned" | (string & {});
|
|
330
327
|
interface PayoutStatusChangedData {
|
|
331
328
|
payout_id: string | number;
|
|
332
|
-
status:
|
|
333
|
-
previous_status:
|
|
329
|
+
status: PayoutStatus;
|
|
330
|
+
previous_status: PayoutStatus | null;
|
|
334
331
|
requested_amount_usd: string | null;
|
|
335
332
|
/** The payout fee rate applied, percent (for example `"1"`). */
|
|
336
333
|
offboarding_fee_pct?: string | null;
|
|
@@ -340,6 +337,39 @@ interface PayoutStatusChangedData {
|
|
|
340
337
|
net_payout_usd?: string | null;
|
|
341
338
|
/** The cap on the payout fee per payout (for example `"500.00"`); `null` means no cap. */
|
|
342
339
|
offboarding_fee_cap_usd?: string | null;
|
|
340
|
+
/**
|
|
341
|
+
* Additive (3.25.0). On a creator payout, the creator INVO paid (`cp_...`); `null` on a
|
|
342
|
+
* payout to your own bank. Never carries the creator's bank or personal details.
|
|
343
|
+
*/
|
|
344
|
+
payee_id?: string | null;
|
|
345
|
+
/** Additive (3.25.0). `"standard"` or `"manual"`; `null` before approval. */
|
|
346
|
+
payout_method?: "standard" | "manual" | (string & {}) | null;
|
|
347
|
+
/** Additive (3.25.0). On `status: "returned"`: when the receiving bank sent it back. */
|
|
348
|
+
returned_at?: string | null;
|
|
349
|
+
/** On `status: "returned"`. Always `"returned"` on a creator payout. */
|
|
350
|
+
return_reason_code?: ReturnReasonCode | null;
|
|
351
|
+
/** Additive (3.26.0). A note INVO wrote for you, or `null`. */
|
|
352
|
+
partner_message?: string | null;
|
|
353
|
+
/** Additive (3.26.0). The payout waits for the account owner's confirmation in the console. */
|
|
354
|
+
owner_confirmation_required?: boolean;
|
|
355
|
+
[key: string]: unknown;
|
|
356
|
+
}
|
|
357
|
+
/** Creator statuses (3.25.0). */
|
|
358
|
+
type PayeeStatus = "invited" | "details_submitted" | "verified" | "rejected" | "suspended" | "expired" | "closed" | (string & {});
|
|
359
|
+
/**
|
|
360
|
+
* `payee.status_changed` (3.25.0): a creator you registered for creator payouts was
|
|
361
|
+
* registered or changed status. Never carries the creator's name or email. Subscribe to it
|
|
362
|
+
* by name.
|
|
363
|
+
*/
|
|
364
|
+
interface PayeeStatusChangedData {
|
|
365
|
+
payee_id: string;
|
|
366
|
+
partner_reference: string;
|
|
367
|
+
status: PayeeStatus;
|
|
368
|
+
previous_status: PayeeStatus | null;
|
|
369
|
+
payee_type: "individual" | "business" | (string & {});
|
|
370
|
+
country: string;
|
|
371
|
+
created_via: "api" | "console" | (string & {});
|
|
372
|
+
status_changed_at: string;
|
|
343
373
|
[key: string]: unknown;
|
|
344
374
|
}
|
|
345
375
|
/**
|
|
@@ -824,6 +854,9 @@ type InvoWebhookEvent = (WebhookBase & {
|
|
|
824
854
|
}) | (WebhookBase & {
|
|
825
855
|
event_type: "payout.status_changed";
|
|
826
856
|
data: PayoutStatusChangedData;
|
|
857
|
+
}) | (WebhookBase & {
|
|
858
|
+
event_type: "payee.status_changed";
|
|
859
|
+
data: PayeeStatusChangedData;
|
|
827
860
|
}) | (WebhookBase & {
|
|
828
861
|
event_type: "player.phone_changed";
|
|
829
862
|
data: PlayerPhoneChangedData;
|
|
@@ -887,6 +920,194 @@ interface WebhookHandlerOptions {
|
|
|
887
920
|
*/
|
|
888
921
|
declare function createWebhookHandler(opts: WebhookHandlerOptions): (request: Request) => Promise<Response>;
|
|
889
922
|
|
|
923
|
+
/**
|
|
924
|
+
* Partner payouts and creator payouts (3.25.0).
|
|
925
|
+
*
|
|
926
|
+
* A platform partner can ask INVO to pay out the earnings INVO owes it, and can register
|
|
927
|
+
* creators that INVO verifies and pays directly, as INVO's own payees. Creators are INVO's
|
|
928
|
+
* customers: you never see their documents, tax id or bank details, only their status and
|
|
929
|
+
* the details you registered. Server only: these calls use your game secret key.
|
|
930
|
+
*
|
|
931
|
+
* Fields keep the server's snake_case names, exactly as the API returns them.
|
|
932
|
+
*/
|
|
933
|
+
|
|
934
|
+
interface Payee {
|
|
935
|
+
/** Opaque id, `cp_` followed by 24 hex characters. Store it as a string. */
|
|
936
|
+
payee_id: string;
|
|
937
|
+
game_id: number | string;
|
|
938
|
+
partner_reference: string;
|
|
939
|
+
legal_name: string;
|
|
940
|
+
email: string;
|
|
941
|
+
country: string;
|
|
942
|
+
payee_type: "individual" | "business" | (string & {});
|
|
943
|
+
status: PayeeStatus;
|
|
944
|
+
created_via: "api" | "console" | (string & {});
|
|
945
|
+
status_changed_at: string | null;
|
|
946
|
+
created_at: string | null;
|
|
947
|
+
updated_at: string | null;
|
|
948
|
+
/** 3.26.0. `true` once the creator's details were erased; such a creator can't be invited or paid. */
|
|
949
|
+
erased?: boolean;
|
|
950
|
+
[key: string]: unknown;
|
|
951
|
+
}
|
|
952
|
+
interface PayeeInvite {
|
|
953
|
+
sent: boolean;
|
|
954
|
+
expires_at?: string | null;
|
|
955
|
+
error_code?: string;
|
|
956
|
+
error?: string;
|
|
957
|
+
}
|
|
958
|
+
interface RegisterPayeeInput {
|
|
959
|
+
/** Your own id for the creator: 1 to 128 of `A-Z a-z 0-9 . _ : @ -`, unique in your account. No personal data. */
|
|
960
|
+
partnerReference: string;
|
|
961
|
+
/** The creator's legal name, or the registered business name. */
|
|
962
|
+
legalName: string;
|
|
963
|
+
email: string;
|
|
964
|
+
/** ISO 3166-1 alpha-2, for example `"GB"`. */
|
|
965
|
+
country: string;
|
|
966
|
+
payeeType: "individual" | "business";
|
|
967
|
+
}
|
|
968
|
+
interface RegisterPayeeResult {
|
|
969
|
+
payee: Payee;
|
|
970
|
+
/** Present on a new registration. */
|
|
971
|
+
invite?: PayeeInvite;
|
|
972
|
+
/** `true` when this `partnerReference` was already registered with the same details. */
|
|
973
|
+
duplicate: boolean;
|
|
974
|
+
raw: Record<string, unknown>;
|
|
975
|
+
}
|
|
976
|
+
interface ListPayeesQuery {
|
|
977
|
+
limit?: number;
|
|
978
|
+
offset?: number;
|
|
979
|
+
status?: PayeeStatus;
|
|
980
|
+
}
|
|
981
|
+
interface ListPayeesResult {
|
|
982
|
+
total: number;
|
|
983
|
+
limit: number;
|
|
984
|
+
offset: number;
|
|
985
|
+
items: Payee[];
|
|
986
|
+
raw: Record<string, unknown>;
|
|
987
|
+
}
|
|
988
|
+
interface Payout {
|
|
989
|
+
id: number;
|
|
990
|
+
game_id: number | string;
|
|
991
|
+
status: PayoutStatus;
|
|
992
|
+
requested_amount_usd: string | null;
|
|
993
|
+
offboarding_fee_pct?: string | null;
|
|
994
|
+
offboarding_fee_usd?: string | null;
|
|
995
|
+
offboarding_fee_cap_usd?: string | null;
|
|
996
|
+
net_payout_usd?: string | null;
|
|
997
|
+
/** On a creator payout, the creator INVO pays; `null` on a payout to your own bank. */
|
|
998
|
+
payee_id?: string | null;
|
|
999
|
+
/** `null` on a creator payout: INVO pays the creator's verified account. */
|
|
1000
|
+
bank_account?: Record<string, unknown> | null;
|
|
1001
|
+
client_request_id?: string | null;
|
|
1002
|
+
paid_at?: string | null;
|
|
1003
|
+
returned_at?: string | null;
|
|
1004
|
+
/** On `returned`: the bank's reason for a payout to your own bank; always `"returned"` on a creator payout. */
|
|
1005
|
+
return_reason_code?: ReturnReasonCode | null;
|
|
1006
|
+
/** 3.26.0. A note INVO wrote for you, or `null`. */
|
|
1007
|
+
partner_message?: string | null;
|
|
1008
|
+
/**
|
|
1009
|
+
* 3.26.0. `true` on the first payout to a creator registered with the game secret key: INVO
|
|
1010
|
+
* approves it only after the account owner confirms it in the console.
|
|
1011
|
+
*/
|
|
1012
|
+
owner_confirmation_required?: boolean;
|
|
1013
|
+
owner_confirmed_at?: string | null;
|
|
1014
|
+
created_at?: string | null;
|
|
1015
|
+
[key: string]: unknown;
|
|
1016
|
+
}
|
|
1017
|
+
interface RequestPayoutInput {
|
|
1018
|
+
/** USD, positive, at most two decimal places. */
|
|
1019
|
+
amountUsd: string | number;
|
|
1020
|
+
contactEmail: string;
|
|
1021
|
+
/** Pay a verified creator. Send exactly one of `payeeId` or `bankAccountId`. */
|
|
1022
|
+
payeeId?: string;
|
|
1023
|
+
/** Pay your own verified bank account (id from the INVO console). */
|
|
1024
|
+
bankAccountId?: number;
|
|
1025
|
+
/** Idempotency key. Reuse it to retry the same request safely. */
|
|
1026
|
+
clientRequestId?: string;
|
|
1027
|
+
partnerNote?: string;
|
|
1028
|
+
additionalEmails?: string[];
|
|
1029
|
+
}
|
|
1030
|
+
interface RequestPayoutResult {
|
|
1031
|
+
payout: Payout;
|
|
1032
|
+
/** `true` when `clientRequestId` matched an earlier request with the same amount and creator. */
|
|
1033
|
+
duplicate: boolean;
|
|
1034
|
+
raw: Record<string, unknown>;
|
|
1035
|
+
}
|
|
1036
|
+
interface ListPayoutsQuery {
|
|
1037
|
+
limit?: number;
|
|
1038
|
+
offset?: number;
|
|
1039
|
+
status?: PayoutStatus;
|
|
1040
|
+
/** Only this creator's payouts. */
|
|
1041
|
+
payeeId?: string;
|
|
1042
|
+
}
|
|
1043
|
+
interface ListPayoutsResult {
|
|
1044
|
+
total: number;
|
|
1045
|
+
items: Payout[];
|
|
1046
|
+
raw: Record<string, unknown>;
|
|
1047
|
+
}
|
|
1048
|
+
/** `InvoServer.payouts`: partner payouts and creator payouts. */
|
|
1049
|
+
declare class PayoutsServer {
|
|
1050
|
+
private readonly http;
|
|
1051
|
+
private readonly auth;
|
|
1052
|
+
constructor(http: Http, auth: AuthHeader);
|
|
1053
|
+
/**
|
|
1054
|
+
* Register a creator (`POST /api/partner-payees`). INVO emails the creator a link to INVO's
|
|
1055
|
+
* own page to give INVO their identity, tax and bank details. `invite.sent` is `false` when
|
|
1056
|
+
* INVO did not email the link (`invite.error_code` says why); the creator is registered
|
|
1057
|
+
* either way. Refusals: `409 PARTNER_REFERENCE_CONFLICT`, `400 INVALID_INPUT`,
|
|
1058
|
+
* `400 COUNTRY_NOT_SUPPORTED`.
|
|
1059
|
+
*/
|
|
1060
|
+
registerPayee(input: RegisterPayeeInput, opts?: CallOptions): Promise<RegisterPayeeResult>;
|
|
1061
|
+
/** This game's creators, newest first (`GET /api/partner-payees`). */
|
|
1062
|
+
listPayees(q?: ListPayeesQuery, opts?: CallOptions): Promise<ListPayeesResult>;
|
|
1063
|
+
/** One creator (`GET /api/partner-payees/{payeeId}`); `404 NOT_FOUND` if not this game's. */
|
|
1064
|
+
getPayee(payeeId: string, opts?: CallOptions): Promise<Payee>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Email the creator a new link (`POST /api/partner-payees/{payeeId}/resend-invite`); the old
|
|
1067
|
+
* link stops working. Allowed while the creator is `invited`, `rejected` or `expired`
|
|
1068
|
+
* (`409 INVITE_NOT_NEEDED` otherwise); `409 PAYEE_ERASED`; `429 INVITE_RATE_LIMITED` with
|
|
1069
|
+
* `retry_after_seconds`. If INVO asked the creator to update their details, the resend sends
|
|
1070
|
+
* INVO's update notice again. Never auto-retried.
|
|
1071
|
+
*/
|
|
1072
|
+
resendPayeeInvite(payeeId: string, opts?: CallOptions): Promise<PayeeInvite>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Remove a creator from your program (`POST /api/partner-payees/{payeeId}/remove`, 3.26.0).
|
|
1075
|
+
* The status becomes `closed`. `409 PAYEE_HAS_PAYOUTS_IN_FLIGHT` while a payout to them is in
|
|
1076
|
+
* progress, `409 ALREADY_CLOSED`, `409 PAYEE_NOT_CLOSABLE`. Not a block: the same person can
|
|
1077
|
+
* be registered again under a new reference. Never auto-retried.
|
|
1078
|
+
*/
|
|
1079
|
+
removePayee(payeeId: string, opts?: CallOptions): Promise<Payee>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Ask INVO to pay out (`POST /api/partner-payouts/request`). Send exactly one of `payeeId`
|
|
1082
|
+
* (INVO pays that verified creator's bank account) or `bankAccountId` (your own verified bank
|
|
1083
|
+
* account). The money comes from the earnings INVO owes your game, and the payout fee is
|
|
1084
|
+
* taken from the payout. Creator refusals: `404 PAYEE_NOT_FOUND`, `409 PAYEE_NOT_VERIFIED`,
|
|
1085
|
+
* `409 PAYEE_VERIFICATION_EXPIRED`, `409 PAYEE_BANK_NOT_VERIFIED`, `409 PAYEE_CLOSED`,
|
|
1086
|
+
* `409 PAYEE_NOT_PAYABLE` (can't be paid right now; no action needed; try again later),
|
|
1087
|
+
* `409 IDEMPOTENCY_KEY_REUSED`. The first payout to a creator registered with the game key
|
|
1088
|
+
* carries `owner_confirmation_required: true`. Retried safely only when `clientRequestId` is
|
|
1089
|
+
* set.
|
|
1090
|
+
*/
|
|
1091
|
+
requestPayout(input: RequestPayoutInput, opts?: CallOptions): Promise<RequestPayoutResult>;
|
|
1092
|
+
/** One payout (`GET /api/partner-payouts/{payoutId}`). */
|
|
1093
|
+
getPayout(payoutIdValue: number, opts?: CallOptions): Promise<Payout>;
|
|
1094
|
+
/** Your payouts (`GET /api/partner-payouts`), optionally one creator's (`payeeId`). */
|
|
1095
|
+
listPayouts(q?: ListPayoutsQuery, opts?: CallOptions): Promise<ListPayoutsResult>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Cancel a creator payout that is still `requested`
|
|
1098
|
+
* (`POST /api/partner-payouts/{payoutId}/cancel`). Anything past `requested` is
|
|
1099
|
+
* `409 PAYOUT_NOT_CANCELLABLE`; a payout to your own bank is `404 NOT_FOUND`.
|
|
1100
|
+
*/
|
|
1101
|
+
cancelPayout(payoutIdValue: number, opts?: CallOptions): Promise<Payout>;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* The package version, as sent in the server User-Agent. A test pins this to
|
|
1106
|
+
* `package.json` so it cannot drift silently (it did: the UA read 3.0.0 through 3.7.0).
|
|
1107
|
+
* Bump it with the changeset flow.
|
|
1108
|
+
*/
|
|
1109
|
+
declare const SDK_VERSION = "3.26.0";
|
|
1110
|
+
|
|
890
1111
|
/**
|
|
891
1112
|
* @invonetwork/web-sdk/server — NODE entry.
|
|
892
1113
|
*
|
|
@@ -1356,6 +1577,12 @@ declare class InvoServer {
|
|
|
1356
1577
|
* `forceFailure` / `forceAuthChallenge`. Needs `sandboxClockKey`. See {@link SandboxSubscriptionsServer}.
|
|
1357
1578
|
*/
|
|
1358
1579
|
readonly sandbox: SandboxServer;
|
|
1580
|
+
/**
|
|
1581
|
+
* Partner payouts and creator payouts (3.25.0): `registerPayee` / `listPayees` /
|
|
1582
|
+
* `getPayee` / `resendPayeeInvite` / `requestPayout` / `getPayout` / `listPayouts` /
|
|
1583
|
+
* `cancelPayout`. See {@link PayoutsServer}.
|
|
1584
|
+
*/
|
|
1585
|
+
readonly payouts: PayoutsServer;
|
|
1359
1586
|
constructor(config: ServerConfig);
|
|
1360
1587
|
/**
|
|
1361
1588
|
* Mint a short-lived, game-scoped player token to hand to the browser InvoClient.
|
|
@@ -1879,4 +2106,4 @@ declare class InvoServer {
|
|
|
1879
2106
|
private toInitiateResult;
|
|
1880
2107
|
}
|
|
1881
2108
|
|
|
1882
|
-
export { ApproveWithDeviceCodeInput, BeginDeviceApprovalInput, CallOptions, CancelResult, CancelSubscriptionOptions, CardSetupConfirmInput, CardSetupConfirmResult, CardSetupInput, CardSetupResult, CardSetupSessionInput, CardSetupSessionResult, CardsServer, ChangeAmountResult, ClaimCurrencyInput, ClaimResult, ClaimTransferInput, CompleteDeviceApprovalInput, CompleteDeviceApprovalResult, ConfirmDeviceEnrollmentInput, ConfirmDeviceEnrollmentResult, ConfirmPaymentResult, CreateCheckoutInput, CreateCheckoutResult, CreateSubscriptionInput, CurrencyPurchaseQuote, CurrencyPurchaseQuoteInput, DestinationsResult, DeviceApprovalGrant, DeviceApprovalPollResult, DeviceApprovalSettleResult, GetSubscriptionOptions, GetSubscriptionResult, GuardianApprovalStatusResult, type IdentityPasskeyResetData, InboundPendingQuery, InboundPendingResult, InitiateResult, InitiateSendInput, InitiateTransferInput, InvoError, InvoServer, type InvoWebhookEvent, ItemHistoryQuery, ItemHistoryResult, ItemOrderQuery, type ItemPurchasedData, LinkedIdentitiesQuery, LinkedIdentitiesResult, ListSubscriptionsOptions, LoyaltyCardsResult, MintPlayerTokenInput, OrderDetailsResult, type PayoutStatusChangedData, PhoneChangeRequest, PhoneShareApproveInput, PhoneShareApproveResult, PhoneShareContact, PhoneShareInitiateResult, PhoneShareStatusResult, type PlatformCommercePurchasedData, type PlatformCommerceRefundedData, PlatformCommerceServer, PlatformOrderStatusResult, PlatformPurchaseHistoryQuery, PlatformPurchaseHistoryResult, PlatformPurchaseInput, PlatformPurchaseResult, PlatformRefundInput, PlatformRefundResult, PlayerActivityEntry, PlayerActivityQuery, PlayerActivityResult, PlayerBalanceQuery, PlayerBalanceResult, PlayerCardsResult, type PlayerPhoneChangedData, PlayerToken, PollDeviceApprovalInput, type PurchaseCompletedData, type PurchaseEventData, PurchaseInput, PurchaseItemInput, PurchaseItemResult, PurchaseResult, RefundResult, RefundSubscriptionInput, RegisterPlayerInput, RegisterPlayerResult, RequestPhoneChangeInput, RequestPhoneChangeResult, SDK_VERSION, SandboxClockResult, SandboxFailureOutcome, SandboxForceAuthChallengeOptions, SandboxForceFailureOptions, SandboxServer, SandboxSubscriptionsServer, ServerConfig, ServerDestinationsQuery, SetPaymentMethodInput, SetPaymentMethodResult, SmsVerifyResult, SteamFinalizeInput, SteamFinalizeResult, SteamFinalizeSubscriptionResult, SteamInitPurchaseInput, SteamInitPurchaseResult, SteamInitResult, SteamPacksQuery, SteamPacksResult, SteamSubscriptionInitInput, type SubscriptionAuthenticationRequiredData, type SubscriptionCanceledData, type SubscriptionEventCommon, type SubscriptionExpiredData, SubscriptionListResult, type SubscriptionPastDueData, type SubscriptionPaymentFailedData, type SubscriptionRefundApprovedData, type SubscriptionRefundDetail, type SubscriptionRefundRejectedData, type SubscriptionRefundRequestData, type SubscriptionRefundedData, type SubscriptionRenewalFunding, type SubscriptionRenewalSplit, type SubscriptionRenewedData, SubscriptionResult, type SubscriptionRevenueShareAttribution, type SubscriptionTrialEventFields, SubscriptionsServer, TransactionStatusResult, type TransferEventData, UpdatePlayerPhoneInput, UpdatePlayerPhoneResult, type VerifyWebhookOptions, type WebhookHandlerOptions, createWebhookHandler, verifyWebhook, verifyWebhookAsync };
|
|
2109
|
+
export { ApproveWithDeviceCodeInput, BeginDeviceApprovalInput, CallOptions, CancelResult, CancelSubscriptionOptions, CardSetupConfirmInput, CardSetupConfirmResult, CardSetupInput, CardSetupResult, CardSetupSessionInput, CardSetupSessionResult, CardsServer, ChangeAmountResult, ClaimCurrencyInput, ClaimResult, ClaimTransferInput, CompleteDeviceApprovalInput, CompleteDeviceApprovalResult, ConfirmDeviceEnrollmentInput, ConfirmDeviceEnrollmentResult, ConfirmPaymentResult, CreateCheckoutInput, CreateCheckoutResult, CreateSubscriptionInput, CurrencyPurchaseQuote, CurrencyPurchaseQuoteInput, DestinationsResult, DeviceApprovalGrant, DeviceApprovalPollResult, DeviceApprovalSettleResult, GetSubscriptionOptions, GetSubscriptionResult, GuardianApprovalStatusResult, type IdentityPasskeyResetData, InboundPendingQuery, InboundPendingResult, InitiateResult, InitiateSendInput, InitiateTransferInput, InvoError, InvoServer, type InvoWebhookEvent, ItemHistoryQuery, ItemHistoryResult, ItemOrderQuery, type ItemPurchasedData, LinkedIdentitiesQuery, LinkedIdentitiesResult, type ListPayeesQuery, type ListPayeesResult, type ListPayoutsQuery, type ListPayoutsResult, ListSubscriptionsOptions, LoyaltyCardsResult, MintPlayerTokenInput, OrderDetailsResult, type Payee, type PayeeInvite, type PayeeStatus, type PayeeStatusChangedData, type Payout, type PayoutStatus, type PayoutStatusChangedData, PayoutsServer, PhoneChangeRequest, PhoneShareApproveInput, PhoneShareApproveResult, PhoneShareContact, PhoneShareInitiateResult, PhoneShareStatusResult, type PlatformCommercePurchasedData, type PlatformCommerceRefundedData, PlatformCommerceServer, PlatformOrderStatusResult, PlatformPurchaseHistoryQuery, PlatformPurchaseHistoryResult, PlatformPurchaseInput, PlatformPurchaseResult, PlatformRefundInput, PlatformRefundResult, PlayerActivityEntry, PlayerActivityQuery, PlayerActivityResult, PlayerBalanceQuery, PlayerBalanceResult, PlayerCardsResult, type PlayerPhoneChangedData, PlayerToken, PollDeviceApprovalInput, type PurchaseCompletedData, type PurchaseEventData, PurchaseInput, PurchaseItemInput, PurchaseItemResult, PurchaseResult, RefundResult, RefundSubscriptionInput, type RegisterPayeeInput, type RegisterPayeeResult, RegisterPlayerInput, RegisterPlayerResult, type RequestPayoutInput, type RequestPayoutResult, RequestPhoneChangeInput, RequestPhoneChangeResult, type ReturnReasonCode, SDK_VERSION, SandboxClockResult, SandboxFailureOutcome, SandboxForceAuthChallengeOptions, SandboxForceFailureOptions, SandboxServer, SandboxSubscriptionsServer, ServerConfig, ServerDestinationsQuery, SetPaymentMethodInput, SetPaymentMethodResult, SmsVerifyResult, SteamFinalizeInput, SteamFinalizeResult, SteamFinalizeSubscriptionResult, SteamInitPurchaseInput, SteamInitPurchaseResult, SteamInitResult, SteamPacksQuery, SteamPacksResult, SteamSubscriptionInitInput, type SubscriptionAuthenticationRequiredData, type SubscriptionCanceledData, type SubscriptionEventCommon, type SubscriptionExpiredData, SubscriptionListResult, type SubscriptionPastDueData, type SubscriptionPaymentFailedData, type SubscriptionRefundApprovedData, type SubscriptionRefundDetail, type SubscriptionRefundRejectedData, type SubscriptionRefundRequestData, type SubscriptionRefundedData, type SubscriptionRenewalFunding, type SubscriptionRenewalSplit, type SubscriptionRenewedData, SubscriptionResult, type SubscriptionRevenueShareAttribution, type SubscriptionTrialEventFields, SubscriptionsServer, TransactionStatusResult, type TransferEventData, UpdatePlayerPhoneInput, UpdatePlayerPhoneResult, type VerifyWebhookOptions, type WebhookHandlerOptions, createWebhookHandler, verifyWebhook, verifyWebhookAsync };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { I as InvoError, H as Http, $ as AuthHeader,
|
|
1
|
+
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as CardSetupSessionInput, a1 as CardSetupSessionResult, a2 as CardSetupInput, a3 as CardSetupResult, a4 as CardSetupConfirmInput, a5 as CardSetupConfirmResult, a6 as PlayerCardsResult, a7 as PlatformPurchaseInput, a8 as PlatformPurchaseResult, a9 as PlatformOrderStatusResult, aa as PlatformPurchaseHistoryQuery, ab as PlatformPurchaseHistoryResult, ac as PlatformRefundInput, ad as PlatformRefundResult, ae as CreateSubscriptionInput, af as SubscriptionResult, ag as GetSubscriptionOptions, ah as GetSubscriptionResult, ai as ListSubscriptionsOptions, aj as SubscriptionListResult, ak as CancelSubscriptionOptions, al as CancelResult, am as ChangeAmountResult, an as SetPaymentMethodInput, ao as SetPaymentMethodResult, ap as RefundSubscriptionInput, aq as RefundResult, ar as SteamSubscriptionInitInput, as as SteamInitResult, at as SteamFinalizeSubscriptionResult, au as SandboxClockResult, av as SandboxFailureOutcome, aw as SandboxForceFailureOptions, ax as SandboxForceAuthChallengeOptions, ay as ServerConfig, az as MintPlayerTokenInput, aA as PlayerToken, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, aH as PhoneChangeRequest, aI as InitiateSendInput, aJ as InitiateResult, aK as InitiateTransferInput, aL as CreateCheckoutInput, aM as CreateCheckoutResult, aN as PurchaseInput, aO as PurchaseResult, aP as CurrencyPurchaseQuoteInput, aQ as CurrencyPurchaseQuote, aR as ConfirmPaymentResult, aS as OrderDetailsResult, aT as SteamPacksQuery, aU as SteamPacksResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, aZ as PurchaseItemInput, a_ as PurchaseItemResult, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, b4 as PlayerActivityEntry, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, o as LoyaltyCardsResult, b7 as InboundPendingQuery, b8 as InboundPendingResult, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bb as SmsVerifyResult, bc as ClaimTransferInput, bd as ClaimResult, be as ClaimCurrencyInput, bf as TransactionStatusResult, bg as GuardianApprovalStatusResult, bh as ServerDestinationsQuery, n as DestinationsResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bm as PhoneShareStatusResult, bn as BeginDeviceApprovalInput, bo as DeviceApprovalGrant, bp as PollDeviceApprovalInput, bq as DeviceApprovalPollResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, bt as ApproveWithDeviceCodeInput, bu as DeviceApprovalSettleResult, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult } from './types-Cjd4SAR8.js';
|
|
2
2
|
export { bx as CardSetupStatus, by as CheckoutWarning, w as ClaimDelivery, bz as CurrencyBalance, bA as CurrencyPurchaseQuoteBreakdown, x as DestinationGame, bB as DeviceApprovalChannel, bC as DeviceApprovalEnrollment, bD as DeviceApprovalFlow, bE as DeviceApprovalPollStatus, bF as DeviceEnrollmentDecision, bG as DeviceEnrollmentRespond, bH as ExpiryReason, bI as FeeTakenFrom, bJ as FirstCharge, bK as FirstChargeStatus, bL as FundingSource, bM as InboundPendingItem, y as InvoErrorInfo, z as InvoHooks, F as InvoRequestInfo, G as InvoResponseInfo, bN as LinkedIdentityEmail, J as LoyaltyCard, K as LoyaltyCardReward, N as LoyaltyCardStep, O as LoyaltyRewardState, Q as LoyaltyStepProgress, S as LoyaltyStepState, bO as MinPurchaseWarning, bP as PhoneChangeConfirmation, bQ as PhoneChangeRequestStatus, bR as PlatformPurchaseStatus, bS as PlayerActivityType, Z as Rail, bT as RefundInitiation, bU as RefundPendingApproval, bV as RefundProcessingFeeBasis, bW as RefundReceipt, bX as RefundRevenueShareAttribution, bY as RefundWarning, bZ as SandboxClockState, b_ as SavedCard, b$ as SteamPack, c0 as SteamUserSession, c1 as Subscription, c2 as SubscriptionBaseInput, c3 as SubscriptionConsent, c4 as SubscriptionConsentInput, c5 as SubscriptionFundingRail, c6 as SubscriptionInterval, c7 as SubscriptionRevenueShare, c8 as SubscriptionRevenueShareInput, c9 as SubscriptionStatus, ca as UnacknowledgedPurchaseOutcome, _ as VerificationMethod, cb as isRefundPendingApproval } from './types-Cjd4SAR8.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* The package version, as sent in the server User-Agent. A test pins this to
|
|
6
|
-
* `package.json` so it cannot drift silently (it did: the UA read 3.0.0 through 3.7.0).
|
|
7
|
-
* Bump it with the changeset flow.
|
|
8
|
-
*/
|
|
9
|
-
declare const SDK_VERSION = "3.24.1";
|
|
10
|
-
|
|
11
4
|
interface VerifyWebhookOptions {
|
|
12
5
|
/** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
|
|
13
6
|
toleranceSec?: number;
|
|
@@ -327,10 +320,14 @@ interface TransferEventData {
|
|
|
327
320
|
* money fields are decimal strings (USD) or `null`. The payout fee fields are `null` on a
|
|
328
321
|
* payout recorded before the fee existed.
|
|
329
322
|
*/
|
|
323
|
+
/** Payout statuses. `cancelled` and `returned` are 3.25.0. */
|
|
324
|
+
type PayoutStatus = "requested" | "approved" | "processing" | "completed" | "rejected" | "failed" | "cancelled" | "returned" | (string & {});
|
|
325
|
+
/** Why a completed payout came back. A creator payout always reads `"returned"`. */
|
|
326
|
+
type ReturnReasonCode = "account_closed" | "no_account" | "invalid_account" | "refused" | "other" | "returned" | (string & {});
|
|
330
327
|
interface PayoutStatusChangedData {
|
|
331
328
|
payout_id: string | number;
|
|
332
|
-
status:
|
|
333
|
-
previous_status:
|
|
329
|
+
status: PayoutStatus;
|
|
330
|
+
previous_status: PayoutStatus | null;
|
|
334
331
|
requested_amount_usd: string | null;
|
|
335
332
|
/** The payout fee rate applied, percent (for example `"1"`). */
|
|
336
333
|
offboarding_fee_pct?: string | null;
|
|
@@ -340,6 +337,39 @@ interface PayoutStatusChangedData {
|
|
|
340
337
|
net_payout_usd?: string | null;
|
|
341
338
|
/** The cap on the payout fee per payout (for example `"500.00"`); `null` means no cap. */
|
|
342
339
|
offboarding_fee_cap_usd?: string | null;
|
|
340
|
+
/**
|
|
341
|
+
* Additive (3.25.0). On a creator payout, the creator INVO paid (`cp_...`); `null` on a
|
|
342
|
+
* payout to your own bank. Never carries the creator's bank or personal details.
|
|
343
|
+
*/
|
|
344
|
+
payee_id?: string | null;
|
|
345
|
+
/** Additive (3.25.0). `"standard"` or `"manual"`; `null` before approval. */
|
|
346
|
+
payout_method?: "standard" | "manual" | (string & {}) | null;
|
|
347
|
+
/** Additive (3.25.0). On `status: "returned"`: when the receiving bank sent it back. */
|
|
348
|
+
returned_at?: string | null;
|
|
349
|
+
/** On `status: "returned"`. Always `"returned"` on a creator payout. */
|
|
350
|
+
return_reason_code?: ReturnReasonCode | null;
|
|
351
|
+
/** Additive (3.26.0). A note INVO wrote for you, or `null`. */
|
|
352
|
+
partner_message?: string | null;
|
|
353
|
+
/** Additive (3.26.0). The payout waits for the account owner's confirmation in the console. */
|
|
354
|
+
owner_confirmation_required?: boolean;
|
|
355
|
+
[key: string]: unknown;
|
|
356
|
+
}
|
|
357
|
+
/** Creator statuses (3.25.0). */
|
|
358
|
+
type PayeeStatus = "invited" | "details_submitted" | "verified" | "rejected" | "suspended" | "expired" | "closed" | (string & {});
|
|
359
|
+
/**
|
|
360
|
+
* `payee.status_changed` (3.25.0): a creator you registered for creator payouts was
|
|
361
|
+
* registered or changed status. Never carries the creator's name or email. Subscribe to it
|
|
362
|
+
* by name.
|
|
363
|
+
*/
|
|
364
|
+
interface PayeeStatusChangedData {
|
|
365
|
+
payee_id: string;
|
|
366
|
+
partner_reference: string;
|
|
367
|
+
status: PayeeStatus;
|
|
368
|
+
previous_status: PayeeStatus | null;
|
|
369
|
+
payee_type: "individual" | "business" | (string & {});
|
|
370
|
+
country: string;
|
|
371
|
+
created_via: "api" | "console" | (string & {});
|
|
372
|
+
status_changed_at: string;
|
|
343
373
|
[key: string]: unknown;
|
|
344
374
|
}
|
|
345
375
|
/**
|
|
@@ -824,6 +854,9 @@ type InvoWebhookEvent = (WebhookBase & {
|
|
|
824
854
|
}) | (WebhookBase & {
|
|
825
855
|
event_type: "payout.status_changed";
|
|
826
856
|
data: PayoutStatusChangedData;
|
|
857
|
+
}) | (WebhookBase & {
|
|
858
|
+
event_type: "payee.status_changed";
|
|
859
|
+
data: PayeeStatusChangedData;
|
|
827
860
|
}) | (WebhookBase & {
|
|
828
861
|
event_type: "player.phone_changed";
|
|
829
862
|
data: PlayerPhoneChangedData;
|
|
@@ -887,6 +920,194 @@ interface WebhookHandlerOptions {
|
|
|
887
920
|
*/
|
|
888
921
|
declare function createWebhookHandler(opts: WebhookHandlerOptions): (request: Request) => Promise<Response>;
|
|
889
922
|
|
|
923
|
+
/**
|
|
924
|
+
* Partner payouts and creator payouts (3.25.0).
|
|
925
|
+
*
|
|
926
|
+
* A platform partner can ask INVO to pay out the earnings INVO owes it, and can register
|
|
927
|
+
* creators that INVO verifies and pays directly, as INVO's own payees. Creators are INVO's
|
|
928
|
+
* customers: you never see their documents, tax id or bank details, only their status and
|
|
929
|
+
* the details you registered. Server only: these calls use your game secret key.
|
|
930
|
+
*
|
|
931
|
+
* Fields keep the server's snake_case names, exactly as the API returns them.
|
|
932
|
+
*/
|
|
933
|
+
|
|
934
|
+
interface Payee {
|
|
935
|
+
/** Opaque id, `cp_` followed by 24 hex characters. Store it as a string. */
|
|
936
|
+
payee_id: string;
|
|
937
|
+
game_id: number | string;
|
|
938
|
+
partner_reference: string;
|
|
939
|
+
legal_name: string;
|
|
940
|
+
email: string;
|
|
941
|
+
country: string;
|
|
942
|
+
payee_type: "individual" | "business" | (string & {});
|
|
943
|
+
status: PayeeStatus;
|
|
944
|
+
created_via: "api" | "console" | (string & {});
|
|
945
|
+
status_changed_at: string | null;
|
|
946
|
+
created_at: string | null;
|
|
947
|
+
updated_at: string | null;
|
|
948
|
+
/** 3.26.0. `true` once the creator's details were erased; such a creator can't be invited or paid. */
|
|
949
|
+
erased?: boolean;
|
|
950
|
+
[key: string]: unknown;
|
|
951
|
+
}
|
|
952
|
+
interface PayeeInvite {
|
|
953
|
+
sent: boolean;
|
|
954
|
+
expires_at?: string | null;
|
|
955
|
+
error_code?: string;
|
|
956
|
+
error?: string;
|
|
957
|
+
}
|
|
958
|
+
interface RegisterPayeeInput {
|
|
959
|
+
/** Your own id for the creator: 1 to 128 of `A-Z a-z 0-9 . _ : @ -`, unique in your account. No personal data. */
|
|
960
|
+
partnerReference: string;
|
|
961
|
+
/** The creator's legal name, or the registered business name. */
|
|
962
|
+
legalName: string;
|
|
963
|
+
email: string;
|
|
964
|
+
/** ISO 3166-1 alpha-2, for example `"GB"`. */
|
|
965
|
+
country: string;
|
|
966
|
+
payeeType: "individual" | "business";
|
|
967
|
+
}
|
|
968
|
+
interface RegisterPayeeResult {
|
|
969
|
+
payee: Payee;
|
|
970
|
+
/** Present on a new registration. */
|
|
971
|
+
invite?: PayeeInvite;
|
|
972
|
+
/** `true` when this `partnerReference` was already registered with the same details. */
|
|
973
|
+
duplicate: boolean;
|
|
974
|
+
raw: Record<string, unknown>;
|
|
975
|
+
}
|
|
976
|
+
interface ListPayeesQuery {
|
|
977
|
+
limit?: number;
|
|
978
|
+
offset?: number;
|
|
979
|
+
status?: PayeeStatus;
|
|
980
|
+
}
|
|
981
|
+
interface ListPayeesResult {
|
|
982
|
+
total: number;
|
|
983
|
+
limit: number;
|
|
984
|
+
offset: number;
|
|
985
|
+
items: Payee[];
|
|
986
|
+
raw: Record<string, unknown>;
|
|
987
|
+
}
|
|
988
|
+
interface Payout {
|
|
989
|
+
id: number;
|
|
990
|
+
game_id: number | string;
|
|
991
|
+
status: PayoutStatus;
|
|
992
|
+
requested_amount_usd: string | null;
|
|
993
|
+
offboarding_fee_pct?: string | null;
|
|
994
|
+
offboarding_fee_usd?: string | null;
|
|
995
|
+
offboarding_fee_cap_usd?: string | null;
|
|
996
|
+
net_payout_usd?: string | null;
|
|
997
|
+
/** On a creator payout, the creator INVO pays; `null` on a payout to your own bank. */
|
|
998
|
+
payee_id?: string | null;
|
|
999
|
+
/** `null` on a creator payout: INVO pays the creator's verified account. */
|
|
1000
|
+
bank_account?: Record<string, unknown> | null;
|
|
1001
|
+
client_request_id?: string | null;
|
|
1002
|
+
paid_at?: string | null;
|
|
1003
|
+
returned_at?: string | null;
|
|
1004
|
+
/** On `returned`: the bank's reason for a payout to your own bank; always `"returned"` on a creator payout. */
|
|
1005
|
+
return_reason_code?: ReturnReasonCode | null;
|
|
1006
|
+
/** 3.26.0. A note INVO wrote for you, or `null`. */
|
|
1007
|
+
partner_message?: string | null;
|
|
1008
|
+
/**
|
|
1009
|
+
* 3.26.0. `true` on the first payout to a creator registered with the game secret key: INVO
|
|
1010
|
+
* approves it only after the account owner confirms it in the console.
|
|
1011
|
+
*/
|
|
1012
|
+
owner_confirmation_required?: boolean;
|
|
1013
|
+
owner_confirmed_at?: string | null;
|
|
1014
|
+
created_at?: string | null;
|
|
1015
|
+
[key: string]: unknown;
|
|
1016
|
+
}
|
|
1017
|
+
interface RequestPayoutInput {
|
|
1018
|
+
/** USD, positive, at most two decimal places. */
|
|
1019
|
+
amountUsd: string | number;
|
|
1020
|
+
contactEmail: string;
|
|
1021
|
+
/** Pay a verified creator. Send exactly one of `payeeId` or `bankAccountId`. */
|
|
1022
|
+
payeeId?: string;
|
|
1023
|
+
/** Pay your own verified bank account (id from the INVO console). */
|
|
1024
|
+
bankAccountId?: number;
|
|
1025
|
+
/** Idempotency key. Reuse it to retry the same request safely. */
|
|
1026
|
+
clientRequestId?: string;
|
|
1027
|
+
partnerNote?: string;
|
|
1028
|
+
additionalEmails?: string[];
|
|
1029
|
+
}
|
|
1030
|
+
interface RequestPayoutResult {
|
|
1031
|
+
payout: Payout;
|
|
1032
|
+
/** `true` when `clientRequestId` matched an earlier request with the same amount and creator. */
|
|
1033
|
+
duplicate: boolean;
|
|
1034
|
+
raw: Record<string, unknown>;
|
|
1035
|
+
}
|
|
1036
|
+
interface ListPayoutsQuery {
|
|
1037
|
+
limit?: number;
|
|
1038
|
+
offset?: number;
|
|
1039
|
+
status?: PayoutStatus;
|
|
1040
|
+
/** Only this creator's payouts. */
|
|
1041
|
+
payeeId?: string;
|
|
1042
|
+
}
|
|
1043
|
+
interface ListPayoutsResult {
|
|
1044
|
+
total: number;
|
|
1045
|
+
items: Payout[];
|
|
1046
|
+
raw: Record<string, unknown>;
|
|
1047
|
+
}
|
|
1048
|
+
/** `InvoServer.payouts`: partner payouts and creator payouts. */
|
|
1049
|
+
declare class PayoutsServer {
|
|
1050
|
+
private readonly http;
|
|
1051
|
+
private readonly auth;
|
|
1052
|
+
constructor(http: Http, auth: AuthHeader);
|
|
1053
|
+
/**
|
|
1054
|
+
* Register a creator (`POST /api/partner-payees`). INVO emails the creator a link to INVO's
|
|
1055
|
+
* own page to give INVO their identity, tax and bank details. `invite.sent` is `false` when
|
|
1056
|
+
* INVO did not email the link (`invite.error_code` says why); the creator is registered
|
|
1057
|
+
* either way. Refusals: `409 PARTNER_REFERENCE_CONFLICT`, `400 INVALID_INPUT`,
|
|
1058
|
+
* `400 COUNTRY_NOT_SUPPORTED`.
|
|
1059
|
+
*/
|
|
1060
|
+
registerPayee(input: RegisterPayeeInput, opts?: CallOptions): Promise<RegisterPayeeResult>;
|
|
1061
|
+
/** This game's creators, newest first (`GET /api/partner-payees`). */
|
|
1062
|
+
listPayees(q?: ListPayeesQuery, opts?: CallOptions): Promise<ListPayeesResult>;
|
|
1063
|
+
/** One creator (`GET /api/partner-payees/{payeeId}`); `404 NOT_FOUND` if not this game's. */
|
|
1064
|
+
getPayee(payeeId: string, opts?: CallOptions): Promise<Payee>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Email the creator a new link (`POST /api/partner-payees/{payeeId}/resend-invite`); the old
|
|
1067
|
+
* link stops working. Allowed while the creator is `invited`, `rejected` or `expired`
|
|
1068
|
+
* (`409 INVITE_NOT_NEEDED` otherwise); `409 PAYEE_ERASED`; `429 INVITE_RATE_LIMITED` with
|
|
1069
|
+
* `retry_after_seconds`. If INVO asked the creator to update their details, the resend sends
|
|
1070
|
+
* INVO's update notice again. Never auto-retried.
|
|
1071
|
+
*/
|
|
1072
|
+
resendPayeeInvite(payeeId: string, opts?: CallOptions): Promise<PayeeInvite>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Remove a creator from your program (`POST /api/partner-payees/{payeeId}/remove`, 3.26.0).
|
|
1075
|
+
* The status becomes `closed`. `409 PAYEE_HAS_PAYOUTS_IN_FLIGHT` while a payout to them is in
|
|
1076
|
+
* progress, `409 ALREADY_CLOSED`, `409 PAYEE_NOT_CLOSABLE`. Not a block: the same person can
|
|
1077
|
+
* be registered again under a new reference. Never auto-retried.
|
|
1078
|
+
*/
|
|
1079
|
+
removePayee(payeeId: string, opts?: CallOptions): Promise<Payee>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Ask INVO to pay out (`POST /api/partner-payouts/request`). Send exactly one of `payeeId`
|
|
1082
|
+
* (INVO pays that verified creator's bank account) or `bankAccountId` (your own verified bank
|
|
1083
|
+
* account). The money comes from the earnings INVO owes your game, and the payout fee is
|
|
1084
|
+
* taken from the payout. Creator refusals: `404 PAYEE_NOT_FOUND`, `409 PAYEE_NOT_VERIFIED`,
|
|
1085
|
+
* `409 PAYEE_VERIFICATION_EXPIRED`, `409 PAYEE_BANK_NOT_VERIFIED`, `409 PAYEE_CLOSED`,
|
|
1086
|
+
* `409 PAYEE_NOT_PAYABLE` (can't be paid right now; no action needed; try again later),
|
|
1087
|
+
* `409 IDEMPOTENCY_KEY_REUSED`. The first payout to a creator registered with the game key
|
|
1088
|
+
* carries `owner_confirmation_required: true`. Retried safely only when `clientRequestId` is
|
|
1089
|
+
* set.
|
|
1090
|
+
*/
|
|
1091
|
+
requestPayout(input: RequestPayoutInput, opts?: CallOptions): Promise<RequestPayoutResult>;
|
|
1092
|
+
/** One payout (`GET /api/partner-payouts/{payoutId}`). */
|
|
1093
|
+
getPayout(payoutIdValue: number, opts?: CallOptions): Promise<Payout>;
|
|
1094
|
+
/** Your payouts (`GET /api/partner-payouts`), optionally one creator's (`payeeId`). */
|
|
1095
|
+
listPayouts(q?: ListPayoutsQuery, opts?: CallOptions): Promise<ListPayoutsResult>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Cancel a creator payout that is still `requested`
|
|
1098
|
+
* (`POST /api/partner-payouts/{payoutId}/cancel`). Anything past `requested` is
|
|
1099
|
+
* `409 PAYOUT_NOT_CANCELLABLE`; a payout to your own bank is `404 NOT_FOUND`.
|
|
1100
|
+
*/
|
|
1101
|
+
cancelPayout(payoutIdValue: number, opts?: CallOptions): Promise<Payout>;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* The package version, as sent in the server User-Agent. A test pins this to
|
|
1106
|
+
* `package.json` so it cannot drift silently (it did: the UA read 3.0.0 through 3.7.0).
|
|
1107
|
+
* Bump it with the changeset flow.
|
|
1108
|
+
*/
|
|
1109
|
+
declare const SDK_VERSION = "3.26.0";
|
|
1110
|
+
|
|
890
1111
|
/**
|
|
891
1112
|
* @invonetwork/web-sdk/server — NODE entry.
|
|
892
1113
|
*
|
|
@@ -1356,6 +1577,12 @@ declare class InvoServer {
|
|
|
1356
1577
|
* `forceFailure` / `forceAuthChallenge`. Needs `sandboxClockKey`. See {@link SandboxSubscriptionsServer}.
|
|
1357
1578
|
*/
|
|
1358
1579
|
readonly sandbox: SandboxServer;
|
|
1580
|
+
/**
|
|
1581
|
+
* Partner payouts and creator payouts (3.25.0): `registerPayee` / `listPayees` /
|
|
1582
|
+
* `getPayee` / `resendPayeeInvite` / `requestPayout` / `getPayout` / `listPayouts` /
|
|
1583
|
+
* `cancelPayout`. See {@link PayoutsServer}.
|
|
1584
|
+
*/
|
|
1585
|
+
readonly payouts: PayoutsServer;
|
|
1359
1586
|
constructor(config: ServerConfig);
|
|
1360
1587
|
/**
|
|
1361
1588
|
* Mint a short-lived, game-scoped player token to hand to the browser InvoClient.
|
|
@@ -1879,4 +2106,4 @@ declare class InvoServer {
|
|
|
1879
2106
|
private toInitiateResult;
|
|
1880
2107
|
}
|
|
1881
2108
|
|
|
1882
|
-
export { ApproveWithDeviceCodeInput, BeginDeviceApprovalInput, CallOptions, CancelResult, CancelSubscriptionOptions, CardSetupConfirmInput, CardSetupConfirmResult, CardSetupInput, CardSetupResult, CardSetupSessionInput, CardSetupSessionResult, CardsServer, ChangeAmountResult, ClaimCurrencyInput, ClaimResult, ClaimTransferInput, CompleteDeviceApprovalInput, CompleteDeviceApprovalResult, ConfirmDeviceEnrollmentInput, ConfirmDeviceEnrollmentResult, ConfirmPaymentResult, CreateCheckoutInput, CreateCheckoutResult, CreateSubscriptionInput, CurrencyPurchaseQuote, CurrencyPurchaseQuoteInput, DestinationsResult, DeviceApprovalGrant, DeviceApprovalPollResult, DeviceApprovalSettleResult, GetSubscriptionOptions, GetSubscriptionResult, GuardianApprovalStatusResult, type IdentityPasskeyResetData, InboundPendingQuery, InboundPendingResult, InitiateResult, InitiateSendInput, InitiateTransferInput, InvoError, InvoServer, type InvoWebhookEvent, ItemHistoryQuery, ItemHistoryResult, ItemOrderQuery, type ItemPurchasedData, LinkedIdentitiesQuery, LinkedIdentitiesResult, ListSubscriptionsOptions, LoyaltyCardsResult, MintPlayerTokenInput, OrderDetailsResult, type PayoutStatusChangedData, PhoneChangeRequest, PhoneShareApproveInput, PhoneShareApproveResult, PhoneShareContact, PhoneShareInitiateResult, PhoneShareStatusResult, type PlatformCommercePurchasedData, type PlatformCommerceRefundedData, PlatformCommerceServer, PlatformOrderStatusResult, PlatformPurchaseHistoryQuery, PlatformPurchaseHistoryResult, PlatformPurchaseInput, PlatformPurchaseResult, PlatformRefundInput, PlatformRefundResult, PlayerActivityEntry, PlayerActivityQuery, PlayerActivityResult, PlayerBalanceQuery, PlayerBalanceResult, PlayerCardsResult, type PlayerPhoneChangedData, PlayerToken, PollDeviceApprovalInput, type PurchaseCompletedData, type PurchaseEventData, PurchaseInput, PurchaseItemInput, PurchaseItemResult, PurchaseResult, RefundResult, RefundSubscriptionInput, RegisterPlayerInput, RegisterPlayerResult, RequestPhoneChangeInput, RequestPhoneChangeResult, SDK_VERSION, SandboxClockResult, SandboxFailureOutcome, SandboxForceAuthChallengeOptions, SandboxForceFailureOptions, SandboxServer, SandboxSubscriptionsServer, ServerConfig, ServerDestinationsQuery, SetPaymentMethodInput, SetPaymentMethodResult, SmsVerifyResult, SteamFinalizeInput, SteamFinalizeResult, SteamFinalizeSubscriptionResult, SteamInitPurchaseInput, SteamInitPurchaseResult, SteamInitResult, SteamPacksQuery, SteamPacksResult, SteamSubscriptionInitInput, type SubscriptionAuthenticationRequiredData, type SubscriptionCanceledData, type SubscriptionEventCommon, type SubscriptionExpiredData, SubscriptionListResult, type SubscriptionPastDueData, type SubscriptionPaymentFailedData, type SubscriptionRefundApprovedData, type SubscriptionRefundDetail, type SubscriptionRefundRejectedData, type SubscriptionRefundRequestData, type SubscriptionRefundedData, type SubscriptionRenewalFunding, type SubscriptionRenewalSplit, type SubscriptionRenewedData, SubscriptionResult, type SubscriptionRevenueShareAttribution, type SubscriptionTrialEventFields, SubscriptionsServer, TransactionStatusResult, type TransferEventData, UpdatePlayerPhoneInput, UpdatePlayerPhoneResult, type VerifyWebhookOptions, type WebhookHandlerOptions, createWebhookHandler, verifyWebhook, verifyWebhookAsync };
|
|
2109
|
+
export { ApproveWithDeviceCodeInput, BeginDeviceApprovalInput, CallOptions, CancelResult, CancelSubscriptionOptions, CardSetupConfirmInput, CardSetupConfirmResult, CardSetupInput, CardSetupResult, CardSetupSessionInput, CardSetupSessionResult, CardsServer, ChangeAmountResult, ClaimCurrencyInput, ClaimResult, ClaimTransferInput, CompleteDeviceApprovalInput, CompleteDeviceApprovalResult, ConfirmDeviceEnrollmentInput, ConfirmDeviceEnrollmentResult, ConfirmPaymentResult, CreateCheckoutInput, CreateCheckoutResult, CreateSubscriptionInput, CurrencyPurchaseQuote, CurrencyPurchaseQuoteInput, DestinationsResult, DeviceApprovalGrant, DeviceApprovalPollResult, DeviceApprovalSettleResult, GetSubscriptionOptions, GetSubscriptionResult, GuardianApprovalStatusResult, type IdentityPasskeyResetData, InboundPendingQuery, InboundPendingResult, InitiateResult, InitiateSendInput, InitiateTransferInput, InvoError, InvoServer, type InvoWebhookEvent, ItemHistoryQuery, ItemHistoryResult, ItemOrderQuery, type ItemPurchasedData, LinkedIdentitiesQuery, LinkedIdentitiesResult, type ListPayeesQuery, type ListPayeesResult, type ListPayoutsQuery, type ListPayoutsResult, ListSubscriptionsOptions, LoyaltyCardsResult, MintPlayerTokenInput, OrderDetailsResult, type Payee, type PayeeInvite, type PayeeStatus, type PayeeStatusChangedData, type Payout, type PayoutStatus, type PayoutStatusChangedData, PayoutsServer, PhoneChangeRequest, PhoneShareApproveInput, PhoneShareApproveResult, PhoneShareContact, PhoneShareInitiateResult, PhoneShareStatusResult, type PlatformCommercePurchasedData, type PlatformCommerceRefundedData, PlatformCommerceServer, PlatformOrderStatusResult, PlatformPurchaseHistoryQuery, PlatformPurchaseHistoryResult, PlatformPurchaseInput, PlatformPurchaseResult, PlatformRefundInput, PlatformRefundResult, PlayerActivityEntry, PlayerActivityQuery, PlayerActivityResult, PlayerBalanceQuery, PlayerBalanceResult, PlayerCardsResult, type PlayerPhoneChangedData, PlayerToken, PollDeviceApprovalInput, type PurchaseCompletedData, type PurchaseEventData, PurchaseInput, PurchaseItemInput, PurchaseItemResult, PurchaseResult, RefundResult, RefundSubscriptionInput, type RegisterPayeeInput, type RegisterPayeeResult, RegisterPlayerInput, RegisterPlayerResult, type RequestPayoutInput, type RequestPayoutResult, RequestPhoneChangeInput, RequestPhoneChangeResult, type ReturnReasonCode, SDK_VERSION, SandboxClockResult, SandboxFailureOutcome, SandboxForceAuthChallengeOptions, SandboxForceFailureOptions, SandboxServer, SandboxSubscriptionsServer, ServerConfig, ServerDestinationsQuery, SetPaymentMethodInput, SetPaymentMethodResult, SmsVerifyResult, SteamFinalizeInput, SteamFinalizeResult, SteamFinalizeSubscriptionResult, SteamInitPurchaseInput, SteamInitPurchaseResult, SteamInitResult, SteamPacksQuery, SteamPacksResult, SteamSubscriptionInitInput, type SubscriptionAuthenticationRequiredData, type SubscriptionCanceledData, type SubscriptionEventCommon, type SubscriptionExpiredData, SubscriptionListResult, type SubscriptionPastDueData, type SubscriptionPaymentFailedData, type SubscriptionRefundApprovedData, type SubscriptionRefundDetail, type SubscriptionRefundRejectedData, type SubscriptionRefundRequestData, type SubscriptionRefundedData, type SubscriptionRenewalFunding, type SubscriptionRenewalSplit, type SubscriptionRenewedData, SubscriptionResult, type SubscriptionRevenueShareAttribution, type SubscriptionTrialEventFields, SubscriptionsServer, TransactionStatusResult, type TransferEventData, UpdatePlayerPhoneInput, UpdatePlayerPhoneResult, type VerifyWebhookOptions, type WebhookHandlerOptions, createWebhookHandler, verifyWebhook, verifyWebhookAsync };
|