@wix/auto_sdk_payments_payouts 1.0.0 → 1.0.2

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/payments-payouts-v4-payout-payouts.universal.ts","../../src/payments-payouts-v4-payout-payouts.http.ts"],"sourcesContent":["export * from './src/payments-payouts-v4-payout-payouts.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPayoutsV4Payout from './payments-payouts-v4-payout-payouts.http.js';\n\n/**\n * A payout is one outgoing transfer of funds from a Wix Payments merchant account\n * to the merchant's bank account. The entity carries the amount, lifecycle status,\n * estimated arrival date, and (when applicable) failure information.\n */\nexport interface Payout {\n /**\n * Unique identifier of the payout. Immutable.\n * @format GUID\n */\n _id?: string;\n /**\n * ID of the Wix Payments account that owns this payout.\n * @format GUID\n */\n accountId?: string;\n /**\n * ID of the Wix Payments account profile this payout belongs to.\n * A Wix Payments account has one or more profiles; each profile has its own\n * balance and its own payouts. Most merchants have a single profile.\n * @format GUID\n */\n accountProfileId?: string;\n /**\n * Date the payout was created, in advance of the underlying transfer being\n * initiated at the bank rail. Once initiated, the funds typically reach the\n * merchant's bank account within 3-5 business days, depending on the receiving bank.\n */\n _createdDate?: Date | null;\n /** Amount of funds transferred to the merchant's bank account. */\n amount?: Money;\n /**\n * Lifecycle status of the payout. `SENT` means the bank rail accepted the transfer\n * for delivery; `FAILED` means the receiving bank rejected the transfer. The rail\n * does not provide a delivery acknowledgement, so `SENT` is not the same as\n * \"delivered to the merchant\" — see the per-value documentation on `PayoutStatus`.\n */\n status?: PayoutStatusWithLiterals;\n /**\n * Estimated date for when the funds should arrive at the merchant's bank, returned\n * by the underlying bank rail when available. This is a prediction, not a guarantee —\n * actual arrival depends on the receiving bank's processing and may be later.\n * @format LOCAL_DATE\n */\n estimatedArrivalDateV2?: string | null;\n /**\n * Set only when `status` is `FAILED`. Indicates why the bank rail rejected the transfer.\n * The codes are a Wix Payments unified set; the original provider-specific reason is not exposed.\n */\n failureReason?: PayoutFailureReason;\n /**\n * Reference returned by the bank rail (e.g. ACH trace number, SEPA reference) once\n * the transfer is initiated. Use it for reconciliation against the merchant's bank\n * statement. Empty when the rail has not yet returned a reference.\n * @maxLength 500\n */\n bankTransferReference?: string | null;\n /**\n * `true` if the payout's `amount` includes funds that originate from a Wix Capital\n * advance the merchant has taken out. `false` if the amount is composed only of\n * regular sales proceeds.\n */\n cashAdvanceIncluded?: boolean;\n}\n\n/**\n * Money.\n * Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.\n */\nexport interface Money {\n /**\n * Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.\n * @format DECIMAL_VALUE\n */\n value?: string;\n /**\n * Currency code. Must be valid ISO 4217 currency code (e.g., USD).\n * @format CURRENCY\n */\n currency?: string;\n /** Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. */\n formattedValue?: string | null;\n}\n\n/** Lifecycle status of a payout. */\nexport enum PayoutStatus {\n /** Default value. Not returned by the API. */\n UNKNOWN = 'UNKNOWN',\n /**\n * The bank rail accepted the transfer. Funds are en route to the merchant's bank,\n * but acceptance is not the same as delivery — a `SENT` payout can still flip to\n * `FAILED` if the receiving bank rejects the transfer (the rail's return window\n * is up to 60 days for ACH and up to 13 months for SEPA).\n */\n SENT = 'SENT',\n /**\n * The transfer was rejected by the receiving bank. See `failure_reason` for the cause;\n * the funds remain in the merchant's Wix Payments balance.\n */\n FAILED = 'FAILED',\n}\n\n/** @enumType */\nexport type PayoutStatusWithLiterals =\n | PayoutStatus\n | 'UNKNOWN'\n | 'SENT'\n | 'FAILED';\n\n/**\n * Carries the reason a payout failed. Wraps the `PayoutFailureCode` enum to leave room\n * for future fields (e.g. a human-readable message); new clients should still read\n * `failure_reason.code` for the enum value.\n */\nexport interface PayoutFailureReason {\n /** Why the bank rail rejected the transfer. */\n code?: PayoutFailureCodeWithLiterals;\n}\n\n/**\n * Reasons a payout can fail. Values describe real-world bank-rail conditions and\n * are mapped from the underlying provider into a Wix Payments unified vocabulary.\n */\nexport enum PayoutFailureCode {\n /**\n * Generic failure with no more specific reason available from the bank rail.\n * Note: this value is also returned when no failure reason is known — clients\n * cannot distinguish \"unknown\" from \"generic\" using this code alone.\n */\n GENERIC_PAYOUT_FAILURE = 'GENERIC_PAYOUT_FAILURE',\n /**\n * The merchant's bank account is closed. The merchant must provide new bank\n * account details before further payouts can succeed.\n */\n ACCOUNT_CLOSED = 'ACCOUNT_CLOSED',\n /**\n * The merchant's bank account is frozen (e.g. due to a hold placed by the bank).\n * The merchant must resolve the hold with their bank before further payouts can succeed.\n */\n ACCOUNT_FROZEN = 'ACCOUNT_FROZEN',\n /**\n * The merchant's bank account is restricted from receiving the transfer\n * (e.g. account type or status does not permit incoming credits).\n */\n BANK_ACCOUNT_RESTRICTED = 'BANK_ACCOUNT_RESTRICTED',\n /**\n * Ownership of the merchant's bank account changed and the rail no longer\n * recognises the previously-recorded owner. New bank details are required.\n */\n BANK_OWNERSHIP_CHANGED = 'BANK_OWNERSHIP_CHANGED',\n /**\n * The receiving bank could not process the transfer for an unspecified reason.\n * A subsequent payout attempt may succeed.\n */\n COULD_NOT_PROCESS = 'COULD_NOT_PROCESS',\n /**\n * The merchant's bank declined the debit authorisation associated with the transfer.\n * The merchant must contact their bank to authorise Wix Payments payouts.\n */\n DEBIT_NOT_AUTHORIZED = 'DEBIT_NOT_AUTHORIZED',\n /**\n * The account holder name on file does not match what the receiving bank has on record.\n * The merchant must correct the account holder name.\n */\n INCORRECT_ACCOUNT_HOLDER_NAME = 'INCORRECT_ACCOUNT_HOLDER_NAME',\n /** The city in the bank account details is invalid for the receiving bank. */\n INVALID_ACCOUNT_DETAILS_CITY = 'INVALID_ACCOUNT_DETAILS_CITY',\n /** The bank account number is invalid (wrong format or does not exist). */\n INVALID_ACCOUNT_NUMBER = 'INVALID_ACCOUNT_NUMBER',\n /** The payout currency is not supported by the receiving bank account. */\n INVALID_CURRENCY = 'INVALID_CURRENCY',\n /** The routing number (US) is invalid or does not match the receiving bank. */\n INVALID_ROUTING_NUMBER = 'INVALID_ROUTING_NUMBER',\n /** The sort code (UK) is invalid or does not match the receiving bank. */\n INVALID_SORT_CODE = 'INVALID_SORT_CODE',\n /**\n * No bank account is on file for the merchant.\n * The merchant must add bank details before payouts can succeed.\n */\n NO_ACCOUNT = 'NO_ACCOUNT',\n /**\n * A technical error at the bank rail prevented the transfer.\n * A subsequent payout attempt may succeed.\n */\n TECHNICAL_ERROR = 'TECHNICAL_ERROR',\n}\n\n/** @enumType */\nexport type PayoutFailureCodeWithLiterals =\n | PayoutFailureCode\n | 'GENERIC_PAYOUT_FAILURE'\n | 'ACCOUNT_CLOSED'\n | 'ACCOUNT_FROZEN'\n | 'BANK_ACCOUNT_RESTRICTED'\n | 'BANK_OWNERSHIP_CHANGED'\n | 'COULD_NOT_PROCESS'\n | 'DEBIT_NOT_AUTHORIZED'\n | 'INCORRECT_ACCOUNT_HOLDER_NAME'\n | 'INVALID_ACCOUNT_DETAILS_CITY'\n | 'INVALID_ACCOUNT_NUMBER'\n | 'INVALID_CURRENCY'\n | 'INVALID_ROUTING_NUMBER'\n | 'INVALID_SORT_CODE'\n | 'NO_ACCOUNT'\n | 'TECHNICAL_ERROR';\n\nexport interface ListPayoutsRequest {\n /**\n * ID of the Wix Payments account whose payouts to list.\n * @format GUID\n */\n accountId: string;\n /**\n * Optional. When omitted, payouts across all profiles of the account are returned.\n * When set, only payouts belonging to the specified account profile are returned.\n * @format GUID\n */\n accountProfileId?: string | null;\n /** Optional. Returns only payouts created before this timestamp. */\n createdBefore?: Date | null;\n /** Optional. Returns only payouts created after this timestamp. */\n createdAfter?: Date | null;\n /** Optional. Sorting. Only `created_date` is supported; requests sorting by any other field are rejected with INVALID_ARGUMENT. */\n sort?: Sorting;\n /** Optional paging. Offset-based. */\n paging?: Paging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface Paging {\n /** Number of items to load. */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\nexport interface ListPayoutsResponse {\n /** List of payouts. */\n payouts?: Payout[];\n /** Paging metadata. */\n metadata?: PagingMetadata;\n}\n\nexport interface PagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n}\n\nexport interface CreatePayoutRequest {\n /** Payout. */\n payout?: Payout;\n}\n\nexport interface CreatePayoutResponse {\n /** Payout. */\n payout?: Payout;\n}\n\nexport interface GetPayoutRequest {\n /**\n * ID of the Wix Payments account the payout belongs to.\n * @format GUID\n */\n accountId: string;\n /**\n * ID of the payout to retrieve.\n * @format GUID\n */\n payoutId: string;\n}\n\nexport interface GetPayoutResponse {\n /** Payout. */\n payout?: Payout;\n}\n\nexport interface ListPayoutGroupsRequest {\n /**\n * Wix Payments account identifier.\n * @format GUID\n */\n accountId?: string;\n /**\n * Optional filter by payout date. Use it to return payouts before specific date.\n * @format LOCAL_DATE\n */\n payoutDateBefore?: string | null;\n /**\n * Optional filter by payout date. Use it to return payouts after specific date.\n * @format LOCAL_DATE\n */\n payoutDateAfter?: string | null;\n /** Optional sorting. Supported fields: \"payout_date\". */\n sort?: Sorting;\n /** Optional paging. */\n paging?: Paging;\n}\n\nexport interface ListPayoutGroupsResponse {\n /** List of payout groups. */\n groups?: PayoutGroup[];\n /** Paging metadata. */\n metadata?: PagingMetadata;\n}\n\n/** Payout group */\nexport interface PayoutGroup {\n /**\n * Payout date.\n * @format LOCAL_DATE\n */\n payoutDate?: string;\n /**\n * Payout number within the same date, is absent if there's only one group\n * @min 1\n * @max 99\n */\n payoutNumber?: number | null;\n /** Payout group amount */\n amount?: Money;\n /**\n * Payouts associated with the group\n * @maxSize 10\n */\n payouts?: Payout[];\n}\n\nexport interface GetPayoutGroupRequest {\n /**\n * Wix Payments account identifier.\n * @format GUID\n */\n accountId?: string;\n /**\n * Payout date.\n * @format LOCAL_DATE\n */\n payoutDate?: string;\n /**\n * Optional payout number within the same date\n * @min 1\n * @max 99\n */\n payoutNumber?: number | null;\n}\n\nexport interface GetPayoutGroupResponse {\n /** Payout group. */\n group?: PayoutGroup;\n}\n\nexport interface GetPayoutGroupByPayoutIdRequest {\n /**\n * Wix Payments account identifier.\n * @format GUID\n */\n accountId?: string;\n /**\n * Payout identifier.\n * @format GUID\n */\n payoutId?: string;\n}\n\nexport interface GetPayoutGroupByPayoutIdResponse {\n /** Payout group. */\n group?: PayoutGroup;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface PayoutCreatedEnvelope {\n entity: Payout;\n metadata: EventMetadata;\n}\n\n/**\n * Emitted once when the payout is first persisted, before the underlying transfer\n * is initiated at the bank. At this point `status` is SENT and `estimated_arrival_date`\n * is set if the bank rail returned one; `failure_reason` and `bank_transfer_reference`\n * are not yet populated.\n * @permissionId PAYMENTS.PAYOUT_READ\n * @webhook\n * @eventType wix.payments.payouts.v4.payout_created\n * @serviceIdentifier wix.payments.v4.payouts.PayoutsService\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onPayoutCreated(\n handler: (event: PayoutCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface PayoutUpdatedEnvelope {\n entity: Payout;\n metadata: EventMetadata;\n}\n\n/**\n * Emitted on every change to a persisted payout. Typical transitions include:\n * status moving from SENT to FAILED (and the corresponding `failure_reason` being set),\n * `estimated_arrival_date` being updated by the bank rail, and `bank_transfer_reference`\n * being populated once the rail returns it.\n * @permissionId PAYMENTS.PAYOUT_READ\n * @webhook\n * @eventType wix.payments.payouts.v4.payout_updated\n * @serviceIdentifier wix.payments.v4.payouts.PayoutsService\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onPayoutUpdated(\n handler: (event: PayoutUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves a paginated list of payouts for the specified Wix Payments account,\n * with optional filters by profile and creation date.\n * @param accountId - ID of the Wix Payments account whose payouts to list.\n * @public\n * @documentationMaturity preview\n * @requiredField accountId\n * @permissionId PAYMENTS.PAYOUT_READ\n * @fqn wix.payments.v4.payouts.PayoutsService.ListPayouts\n */\nexport async function listPayouts(\n accountId: string,\n options?: ListPayoutsOptions\n): Promise<\n NonNullablePaths<\n ListPayoutsResponse,\n | `payouts`\n | `payouts.${number}._id`\n | `payouts.${number}.accountId`\n | `payouts.${number}.accountProfileId`\n | `payouts.${number}.amount.value`\n | `payouts.${number}.amount.currency`\n | `payouts.${number}.status`\n | `payouts.${number}.failureReason.code`\n | `payouts.${number}.cashAdvanceIncluded`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n accountId: accountId,\n accountProfileId: options?.accountProfileId,\n createdBefore: options?.createdBefore,\n createdAfter: options?.createdAfter,\n sort: options?.sort,\n paging: options?.paging,\n });\n\n const reqOpts = ambassadorWixPaymentsPayoutsV4Payout.listPayouts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n accountId: '$[0]',\n accountProfileId: '$[1].accountProfileId',\n createdBefore: '$[1].createdBefore',\n createdAfter: '$[1].createdAfter',\n sort: '$[1].sort',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['accountId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListPayoutsOptions {\n /**\n * Optional. When omitted, payouts across all profiles of the account are returned.\n * When set, only payouts belonging to the specified account profile are returned.\n * @format GUID\n */\n accountProfileId?: string | null;\n /** Optional. Returns only payouts created before this timestamp. */\n createdBefore?: Date | null;\n /** Optional. Returns only payouts created after this timestamp. */\n createdAfter?: Date | null;\n /** Optional. Sorting. Only `created_date` is supported; requests sorting by any other field are rejected with INVALID_ARGUMENT. */\n sort?: Sorting;\n /** Optional paging. Offset-based. */\n paging?: Paging;\n}\n\n/**\n * Retrieves a single payout by id.\n * @param payoutId - ID of the payout to retrieve.\n * @param accountId - ID of the Wix Payments account the payout belongs to.\n * @public\n * @documentationMaturity preview\n * @requiredField accountId\n * @requiredField payoutId\n * @permissionId PAYMENTS.PAYOUT_READ\n * @returns Payout.\n * @fqn wix.payments.v4.payouts.PayoutsService.GetPayout\n */\nexport async function getPayout(\n payoutId: string,\n accountId: string\n): Promise<\n NonNullablePaths<\n Payout,\n | `_id`\n | `accountId`\n | `accountProfileId`\n | `amount.value`\n | `amount.currency`\n | `status`\n | `failureReason.code`\n | `cashAdvanceIncluded`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n payoutId: payoutId,\n accountId: accountId,\n });\n\n const reqOpts = ambassadorWixPaymentsPayoutsV4Payout.getPayout(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.payout!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { payoutId: '$[0]', accountId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['payoutId', 'accountId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsV4PayoutsPayoutsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wixpay-payout',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wixpay-payout/v4/payout-groups',\n destPath: '/v4/payout-groups',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/payouts',\n destPath: '/v4/payouts',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/_api/wixpay-payout/v4/payouts',\n destPath: '/v4/payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/payout-groups',\n destPath: '/v4/payout-groups',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payouts',\n destPath: '/v4/bo-payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payout-policies',\n destPath: '/v4/bo-payout-policies',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/wixpay-payout/v4/payouts',\n destPath: '/v4/payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/payout-groups',\n destPath: '/v4/payout-groups',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payouts',\n destPath: '/v4/bo-payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payout-policies',\n destPath: '/v4/bo-payout-policies',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_api/wixpay-payout/v4/payouts',\n destPath: '/v4/payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/payout-groups',\n destPath: '/v4/payout-groups',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payouts',\n destPath: '/v4/bo-payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payout-policies',\n destPath: '/v4/bo-payout-policies',\n },\n ],\n 'payment-webhooks.wixapps.net': [\n {\n srcPath: '/wix-payments/payout-callbacks/stripe',\n destPath: '/payout-callbacks/stripe',\n },\n {\n srcPath: '/wix-payments/payout-callbacks/adyen',\n destPath: '/payout-callbacks/adyen',\n },\n {\n srcPath: '/wix-payments/payout-callbacks/stone',\n destPath: '/payout-callbacks/stone',\n },\n {\n srcPath: '/wix-payments/payout-callbacks/paypal',\n destPath: '/payout-callbacks/paypal',\n },\n ],\n 'cronulla-jobs._base_domain_': [\n {\n srcPath: '/wix-payments/wixpay-payout/internal-api/jobs',\n destPath: '/internal-api/jobs',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/wixpay-payout',\n destPath: '',\n },\n ],\n 'payments.base44.com': [\n {\n srcPath: '/_api/wixpay-payout',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/wixpay-payouts/v4/payouts',\n destPath: '/v4/payouts',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_payouts';\n\n/**\n * Retrieves a paginated list of payouts for the specified Wix Payments account,\n * with optional filters by profile and creation date.\n */\nexport function listPayouts(payload: object): RequestOptionsFactory<any> {\n function __listPayouts({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'createdBefore' }, { path: 'createdAfter' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.payments.payouts.v4.payout',\n method: 'GET' as any,\n methodFqn: 'wix.payments.v4.payouts.PayoutsService.ListPayouts',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsV4PayoutsPayoutsServiceUrl({\n protoPath: '/v4/payouts',\n data: serializedData,\n host,\n }),\n params: toURLSearchParams(serializedData, true),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'payouts.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listPayouts;\n}\n\n/** Retrieves a single payout by id. */\nexport function getPayout(payload: object): RequestOptionsFactory<any> {\n function __getPayout({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.payouts.v4.payout',\n method: 'GET' as any,\n methodFqn: 'wix.payments.v4.payouts.PayoutsService.GetPayout',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsV4PayoutsPayoutsServiceUrl({\n protoPath: '/v4/payouts/{payoutId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'payout.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getPayout;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAAA;AAAA,EAAA,mBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB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M;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,UAAU,QAAQ,WAAW,OAAO;AAAA,QAChE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,YAAY,WAAW;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getPayout","listPayouts","import_timestamp","import_rest_modules","payload","PayoutStatus","PayoutFailureCode","SortOrder","WebhookIdentityType","listPayouts","sdkTransformError","getPayout"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/payments-payouts-v4-payout-payouts.universal.ts","../../src/payments-payouts-v4-payout-payouts.http.ts"],"sourcesContent":["export * from './src/payments-payouts-v4-payout-payouts.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPayoutsV4Payout from './payments-payouts-v4-payout-payouts.http.js';\n\n/**\n * A payout is an outgoing transfer of funds from a Wix Payments account to the\n * merchant's bank account. Each payout has an amount, a lifecycle status, an\n * estimated arrival date, and (when applicable) a failure reason.\n */\nexport interface Payout {\n /**\n * Payout ID.\n * @format GUID\n */\n _id?: string;\n /**\n * ID of the Wix Payments account that owns the payout. Retrieve account IDs\n * from the Accounts API.\n * @format GUID\n */\n accountId?: string;\n /**\n * ID of the Wix Payments account profile that owns the payout.\n *\n * A Wix Payments account has 1 or more profiles. Each profile has its own\n * balance and its own payouts. Most merchants have 1 profile. Retrieve\n * profile IDs from the Accounts API.\n * @format GUID\n */\n accountProfileId?: string;\n /**\n * Date and time the payout was created.\n *\n * The payout is created before the underlying transfer is initiated at the\n * bank. Once initiated, the funds typically reach the merchant's bank account\n * within 3 to 5 business days, depending on the receiving bank.\n */\n _createdDate?: Date | null;\n /** Amount of the transfer to the merchant's bank account. */\n amount?: Money;\n /**\n * Lifecycle status of the payout.\n *\n * `SENT` means the bank rail accepted the transfer for delivery. `FAILED` means\n * the receiving bank rejected the transfer.\n *\n * A `SENT` status doesn't guarantee that the funds were delivered to the\n * merchant. The bank rail doesn't provide a delivery acknowledgement, and a\n * payout in `SENT` can later transition to `FAILED` if the receiving bank\n * rejects the transfer. See the per-value documentation on `PayoutStatus` for\n * details.\n */\n status?: PayoutStatusWithLiterals;\n /**\n * Estimated date for when the funds should arrive at the merchant's bank\n * account, in `YYYY-MM-DD` format.\n *\n * The estimated arrival date is a prediction, not a guarantee. Actual arrival\n * depends on the receiving bank's processing and may be later.\n * @format LOCAL_DATE\n */\n estimatedArrivalDateV2?: string | null;\n /**\n * Reason the bank rail rejected the transfer.\n *\n * Returned only when `status` is `FAILED`.\n */\n failureReason?: PayoutFailureReason;\n /**\n * Reference returned by the bank rail once the transfer is initiated. For\n * example, an ACH trace number or a SEPA reference. Use this value to\n * reconcile against the merchant's bank statement.\n *\n * Empty until the bank rail returns a reference.\n * @maxLength 500\n */\n bankTransferReference?: string | null;\n /**\n * Whether the payout `amount` includes funds from a Wix Capital cash advance\n * taken out by the merchant. If `false`, the amount comes only from the\n * merchant's sales proceeds.\n */\n cashAdvanceIncluded?: boolean;\n}\n\n/**\n * Money.\n * Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.\n */\nexport interface Money {\n /**\n * Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.\n * @format DECIMAL_VALUE\n */\n value?: string;\n /**\n * Currency code. Must be valid ISO 4217 currency code (e.g., USD).\n * @format CURRENCY\n */\n currency?: string;\n /** Monetary amount. Decimal string in local format (e.g., 1 000,30). Optionally, a single (-), to indicate that the amount is negative. */\n formattedValue?: string | null;\n}\n\n/** Lifecycle status of a payout. */\nexport enum PayoutStatus {\n /** Unknown payout status. Not returned by the API. */\n UNKNOWN = 'UNKNOWN',\n /**\n * The bank rail accepted the transfer. Funds are en route to the merchant's\n * bank account.\n *\n * Acceptance isn't the same as delivery. A `SENT` payout can still\n * transition to `FAILED` if the receiving bank rejects the transfer. The\n * bank rail's return window is up to 60 days for ACH and up to 13 months\n * for SEPA.\n */\n SENT = 'SENT',\n /**\n * The bank rail rejected the transfer. See `failureReason` for the cause.\n * The funds remain in the merchant's Wix Payments balance.\n */\n FAILED = 'FAILED',\n}\n\n/** @enumType */\nexport type PayoutStatusWithLiterals =\n | PayoutStatus\n | 'UNKNOWN'\n | 'SENT'\n | 'FAILED';\n\n/** Reason a payout failed. */\nexport interface PayoutFailureReason {\n /** Why the bank rail rejected the transfer. */\n code?: PayoutFailureCodeWithLiterals;\n}\n\n/**\n * Possible reasons for a payout failure. Each value describes a real-world\n * bank-rail condition.\n */\nexport enum PayoutFailureCode {\n /**\n * Generic failure with no more specific reason available from the bank\n * rail. This value is also returned when no failure reason is known.\n * Clients can't distinguish \"unknown\" from \"generic\" using this code alone.\n */\n GENERIC_PAYOUT_FAILURE = 'GENERIC_PAYOUT_FAILURE',\n /**\n * The merchant's bank account is closed. The merchant must provide new\n * bank account details before further payouts can succeed.\n */\n ACCOUNT_CLOSED = 'ACCOUNT_CLOSED',\n /**\n * The merchant's bank account is frozen, for example due to a hold placed\n * by the bank. The merchant must resolve the hold with their bank before\n * further payouts can succeed.\n */\n ACCOUNT_FROZEN = 'ACCOUNT_FROZEN',\n /**\n * The merchant's bank account is restricted from receiving the transfer.\n * For example, the account type or status doesn't permit incoming credits.\n */\n BANK_ACCOUNT_RESTRICTED = 'BANK_ACCOUNT_RESTRICTED',\n /**\n * Ownership of the merchant's bank account changed and the rail no longer\n * recognises the previously-recorded owner. New bank details are required.\n */\n BANK_OWNERSHIP_CHANGED = 'BANK_OWNERSHIP_CHANGED',\n /**\n * The receiving bank couldn't process the transfer for an unspecified\n * reason. A subsequent payout attempt may succeed.\n */\n COULD_NOT_PROCESS = 'COULD_NOT_PROCESS',\n /**\n * The merchant's bank declined the debit authorisation associated with the\n * transfer. The merchant must contact their bank to authorise Wix Payments\n * payouts.\n */\n DEBIT_NOT_AUTHORIZED = 'DEBIT_NOT_AUTHORIZED',\n /**\n * The account holder name on file doesn't match the name the receiving\n * bank has on record. The merchant must correct the account holder name.\n */\n INCORRECT_ACCOUNT_HOLDER_NAME = 'INCORRECT_ACCOUNT_HOLDER_NAME',\n /** The city in the bank account details is invalid for the receiving bank. */\n INVALID_ACCOUNT_DETAILS_CITY = 'INVALID_ACCOUNT_DETAILS_CITY',\n /**\n * The bank account number is invalid. The format is wrong or the account\n * doesn't exist.\n */\n INVALID_ACCOUNT_NUMBER = 'INVALID_ACCOUNT_NUMBER',\n /** The payout currency isn't supported by the receiving bank account. */\n INVALID_CURRENCY = 'INVALID_CURRENCY',\n /** The routing number (US) is invalid or doesn't match the receiving bank. */\n INVALID_ROUTING_NUMBER = 'INVALID_ROUTING_NUMBER',\n /** The sort code (UK) is invalid or doesn't match the receiving bank. */\n INVALID_SORT_CODE = 'INVALID_SORT_CODE',\n /**\n * No bank account is on file for the merchant. The merchant must add bank\n * details before payouts can succeed.\n */\n NO_ACCOUNT = 'NO_ACCOUNT',\n /**\n * A technical error at the bank rail prevented the transfer. A subsequent\n * payout attempt may succeed.\n */\n TECHNICAL_ERROR = 'TECHNICAL_ERROR',\n}\n\n/** @enumType */\nexport type PayoutFailureCodeWithLiterals =\n | PayoutFailureCode\n | 'GENERIC_PAYOUT_FAILURE'\n | 'ACCOUNT_CLOSED'\n | 'ACCOUNT_FROZEN'\n | 'BANK_ACCOUNT_RESTRICTED'\n | 'BANK_OWNERSHIP_CHANGED'\n | 'COULD_NOT_PROCESS'\n | 'DEBIT_NOT_AUTHORIZED'\n | 'INCORRECT_ACCOUNT_HOLDER_NAME'\n | 'INVALID_ACCOUNT_DETAILS_CITY'\n | 'INVALID_ACCOUNT_NUMBER'\n | 'INVALID_CURRENCY'\n | 'INVALID_ROUTING_NUMBER'\n | 'INVALID_SORT_CODE'\n | 'NO_ACCOUNT'\n | 'TECHNICAL_ERROR';\n\nexport interface ListPayoutsRequest {\n /**\n * ID of the Wix Payments account whose payouts to list. Retrieve account\n * IDs from the Accounts API.\n * @format GUID\n */\n accountId: string;\n /**\n * ID of the Wix Payments account profile to filter by.\n *\n * When omitted, payouts across all profiles of the account are returned.\n * Retrieve profile IDs from the Accounts API.\n * @format GUID\n */\n accountProfileId?: string | null;\n /** Returns only payouts created before this date and time. */\n createdBefore?: Date | null;\n /** Returns only payouts created after this date and time. */\n createdAfter?: Date | null;\n /**\n * Sort order for the result list.\n *\n * Supported `fieldName` values: `created_date` (snake_case, not auto-converted). At most 1 sort field is allowed.\n */\n sort?: Sorting;\n /** Offset-based paging. */\n paging?: Paging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface Paging {\n /** Number of items to load. */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\nexport interface ListPayoutsResponse {\n /** List of retrieved payouts. */\n payouts?: Payout[];\n /** Paging metadata. */\n metadata?: PagingMetadata;\n}\n\nexport interface PagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n}\n\nexport interface CreatePayoutRequest {\n /** Payout to create. */\n payout?: Payout;\n}\n\nexport interface CreatePayoutResponse {\n /** Created payout. */\n payout?: Payout;\n}\n\nexport interface GetPayoutRequest {\n /**\n * ID of the Wix Payments account that owns the payout. The payout must\n * belong to this account. Retrieve account IDs from the Accounts API.\n * @format GUID\n */\n accountId: string;\n /**\n * ID of the payout to retrieve.\n * @format GUID\n */\n payoutId: string;\n}\n\nexport interface GetPayoutResponse {\n /** Retrieved payout. */\n payout?: Payout;\n}\n\nexport interface ListPayoutGroupsRequest {\n /**\n * ID of the Wix Payments account whose payout groups to list. Retrieve\n * account IDs from the Accounts API.\n * @format GUID\n */\n accountId?: string;\n /**\n * Optional filter by payout date. Use it to return payouts before specific date.\n * @format LOCAL_DATE\n */\n payoutDateBefore?: string | null;\n /**\n * Optional filter by payout date. Use it to return payouts after specific date.\n * @format LOCAL_DATE\n */\n payoutDateAfter?: string | null;\n /** Optional sorting. Supported fields: \"payout_date\". */\n sort?: Sorting;\n /** Optional paging. */\n paging?: Paging;\n}\n\nexport interface ListPayoutGroupsResponse {\n /** List of payout groups. */\n groups?: PayoutGroup[];\n /** Paging metadata. */\n metadata?: PagingMetadata;\n}\n\n/** Payout group */\nexport interface PayoutGroup {\n /**\n * Payout date.\n * @format LOCAL_DATE\n */\n payoutDate?: string;\n /**\n * Payout number within the same date, is absent if there's only one group\n * @min 1\n * @max 99\n */\n payoutNumber?: number | null;\n /** Payout group amount */\n amount?: Money;\n /**\n * Payouts associated with the group\n * @maxSize 10\n */\n payouts?: Payout[];\n}\n\nexport interface GetPayoutGroupRequest {\n /**\n * ID of the Wix Payments account that owns the payout group. Retrieve\n * account IDs from the Accounts API.\n * @format GUID\n */\n accountId?: string;\n /**\n * Payout date.\n * @format LOCAL_DATE\n */\n payoutDate?: string;\n /**\n * Optional payout number within the same date\n * @min 1\n * @max 99\n */\n payoutNumber?: number | null;\n}\n\nexport interface GetPayoutGroupResponse {\n /** Payout group. */\n group?: PayoutGroup;\n}\n\nexport interface GetPayoutGroupByPayoutIdRequest {\n /**\n * ID of the Wix Payments account that owns the payout. Retrieve account IDs\n * from the Accounts API.\n * @format GUID\n */\n accountId?: string;\n /**\n * ID of the payout whose group to retrieve.\n * @format GUID\n */\n payoutId?: string;\n}\n\nexport interface GetPayoutGroupByPayoutIdResponse {\n /** Payout group. */\n group?: PayoutGroup;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface PayoutCreatedEnvelope {\n entity: Payout;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a payout is created.\n *\n * The payout is created before the underlying transfer is initiated at the\n * bank. At this point `status` is `SENT` and `estimatedArrivalDateV2` is set\n * if the bank rail returned one. `failureReason` and `bankTransferReference`\n * are not yet populated.\n * @permissionScope View settlement reports and payouts\n * @permissionScopeId SCOPE.PAYMENTS.PAYOUTS-VIEW-FOR-SITE\n * @permissionId PAYMENTS.PAYOUT_READ\n * @webhook\n * @eventType wix.payments.payouts.v4.payout_created\n * @serviceIdentifier wix.payments.v4.payouts.PayoutsService\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onPayoutCreated(\n handler: (event: PayoutCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface PayoutUpdatedEnvelope {\n entity: Payout;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a payout is updated.\n *\n * Typical updates include `status` transitioning from `SENT` to `FAILED`\n * (with `failureReason` being set), `estimatedArrivalDateV2` being refined by\n * the bank rail, and `bankTransferReference` being populated once the rail\n * returns it.\n * @permissionScope View settlement reports and payouts\n * @permissionScopeId SCOPE.PAYMENTS.PAYOUTS-VIEW-FOR-SITE\n * @permissionId PAYMENTS.PAYOUT_READ\n * @webhook\n * @eventType wix.payments.payouts.v4.payout_updated\n * @serviceIdentifier wix.payments.v4.payouts.PayoutsService\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onPayoutUpdated(\n handler: (event: PayoutUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves a paginated list of payouts for the specified Wix Payments account.\n *\n * Supports optional filters by account profile and by creation date range.\n * @param accountId - ID of the Wix Payments account whose payouts to list. Retrieve account\n * IDs from the Accounts API.\n * @public\n * @documentationMaturity preview\n * @requiredField accountId\n * @permissionId PAYMENTS.PAYOUT_READ\n * @applicableIdentity APP\n * @fqn wix.payments.v4.payouts.PayoutsService.ListPayouts\n */\nexport async function listPayouts(\n accountId: string,\n options?: ListPayoutsOptions\n): Promise<\n NonNullablePaths<\n ListPayoutsResponse,\n | `payouts`\n | `payouts.${number}._id`\n | `payouts.${number}.accountId`\n | `payouts.${number}.accountProfileId`\n | `payouts.${number}.amount.value`\n | `payouts.${number}.amount.currency`\n | `payouts.${number}.status`\n | `payouts.${number}.failureReason.code`\n | `payouts.${number}.cashAdvanceIncluded`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n accountId: accountId,\n accountProfileId: options?.accountProfileId,\n createdBefore: options?.createdBefore,\n createdAfter: options?.createdAfter,\n sort: options?.sort,\n paging: options?.paging,\n });\n\n const reqOpts = ambassadorWixPaymentsPayoutsV4Payout.listPayouts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n accountId: '$[0]',\n accountProfileId: '$[1].accountProfileId',\n createdBefore: '$[1].createdBefore',\n createdAfter: '$[1].createdAfter',\n sort: '$[1].sort',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['accountId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListPayoutsOptions {\n /**\n * ID of the Wix Payments account profile to filter by.\n *\n * When omitted, payouts across all profiles of the account are returned.\n * Retrieve profile IDs from the Accounts API.\n * @format GUID\n */\n accountProfileId?: string | null;\n /** Returns only payouts created before this date and time. */\n createdBefore?: Date | null;\n /** Returns only payouts created after this date and time. */\n createdAfter?: Date | null;\n /**\n * Sort order for the result list.\n *\n * Supported `fieldName` values: `created_date` (snake_case, not auto-converted). At most 1 sort field is allowed.\n */\n sort?: Sorting;\n /** Offset-based paging. */\n paging?: Paging;\n}\n\n/**\n * Retrieves a single payout by ID.\n * @param payoutId - ID of the payout to retrieve.\n * @param accountId - ID of the Wix Payments account that owns the payout. The payout must\n * belong to this account. Retrieve account IDs from the Accounts API.\n * @public\n * @documentationMaturity preview\n * @requiredField accountId\n * @requiredField payoutId\n * @permissionId PAYMENTS.PAYOUT_READ\n * @applicableIdentity APP\n * @returns Retrieved payout.\n * @fqn wix.payments.v4.payouts.PayoutsService.GetPayout\n */\nexport async function getPayout(\n payoutId: string,\n accountId: string\n): Promise<\n NonNullablePaths<\n Payout,\n | `_id`\n | `accountId`\n | `accountProfileId`\n | `amount.value`\n | `amount.currency`\n | `status`\n | `failureReason.code`\n | `cashAdvanceIncluded`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n payoutId: payoutId,\n accountId: accountId,\n });\n\n const reqOpts = ambassadorWixPaymentsPayoutsV4Payout.getPayout(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.payout!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { payoutId: '$[0]', accountId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['payoutId', 'accountId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsV4PayoutsPayoutsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wixpay-payout',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/wixpay-payout/v4/payout-groups',\n destPath: '/v4/payout-groups',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/payouts',\n destPath: '/v4/payouts',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/_api/wixpay-payout/v4/payouts',\n destPath: '/v4/payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/payout-groups',\n destPath: '/v4/payout-groups',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payouts',\n destPath: '/v4/bo-payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payout-policies',\n destPath: '/v4/bo-payout-policies',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/wixpay-payout/v4/payouts',\n destPath: '/v4/payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/payout-groups',\n destPath: '/v4/payout-groups',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payouts',\n destPath: '/v4/bo-payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payout-policies',\n destPath: '/v4/bo-payout-policies',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_api/wixpay-payout/v4/payouts',\n destPath: '/v4/payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/payout-groups',\n destPath: '/v4/payout-groups',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payouts',\n destPath: '/v4/bo-payouts',\n },\n {\n srcPath: '/_api/wixpay-payout/v4/bo-payout-policies',\n destPath: '/v4/bo-payout-policies',\n },\n ],\n 'payment-webhooks.wixapps.net': [\n {\n srcPath: '/wix-payments/payout-callbacks/stripe',\n destPath: '/payout-callbacks/stripe',\n },\n {\n srcPath: '/wix-payments/payout-callbacks/adyen',\n destPath: '/payout-callbacks/adyen',\n },\n {\n srcPath: '/wix-payments/payout-callbacks/stone',\n destPath: '/payout-callbacks/stone',\n },\n {\n srcPath: '/wix-payments/payout-callbacks/paypal',\n destPath: '/payout-callbacks/paypal',\n },\n ],\n 'cronulla-jobs._base_domain_': [\n {\n srcPath: '/wix-payments/wixpay-payout/internal-api/jobs',\n destPath: '/internal-api/jobs',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/wixpay-payout',\n destPath: '',\n },\n ],\n 'payments.base44.com': [\n {\n srcPath: '/_api/wixpay-payout',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/wixpay-payouts/v4/payouts',\n destPath: '/v4/payouts',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_payouts';\n\n/**\n * Retrieves a paginated list of payouts for the specified Wix Payments account.\n *\n * Supports optional filters by account profile and by creation date range.\n */\nexport function listPayouts(payload: object): RequestOptionsFactory<any> {\n function __listPayouts({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'createdBefore' }, { path: 'createdAfter' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.payments.payouts.v4.payout',\n method: 'GET' as any,\n methodFqn: 'wix.payments.v4.payouts.PayoutsService.ListPayouts',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsV4PayoutsPayoutsServiceUrl({\n protoPath: '/v4/payouts',\n data: serializedData,\n host,\n }),\n params: toURLSearchParams(serializedData, true),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'payouts.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listPayouts;\n}\n\n/** Retrieves a single payout by ID. */\nexport function getPayout(payload: object): RequestOptionsFactory<any> {\n function __getPayout({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.payouts.v4.payout',\n method: 'GET' as any,\n methodFqn: 'wix.payments.v4.payouts.PayoutsService.GetPayout',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsV4PayoutsPayoutsServiceUrl({\n protoPath: '/v4/payouts/{payoutId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'payout.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getPayout;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAAA;AAAA,EAAA,mBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AA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ayoutStatus","PayoutFailureCode","SortOrder","WebhookIdentityType","listPayouts","sdkTransformError","getPayout"]}
@@ -2,66 +2,82 @@ import { ListPayoutsRequest as ListPayoutsRequest$1, ListPayoutsResponse as List
2
2
  import '@wix/sdk-types';
3
3
 
4
4
  /**
5
- * A payout is one outgoing transfer of funds from a Wix Payments merchant account
6
- * to the merchant's bank account. The entity carries the amount, lifecycle status,
7
- * estimated arrival date, and (when applicable) failure information.
5
+ * A payout is an outgoing transfer of funds from a Wix Payments account to the
6
+ * merchant's bank account. Each payout has an amount, a lifecycle status, an
7
+ * estimated arrival date, and (when applicable) a failure reason.
8
8
  */
9
9
  interface Payout {
10
10
  /**
11
- * Unique identifier of the payout. Immutable.
11
+ * Payout ID.
12
12
  * @format GUID
13
13
  */
14
14
  id?: string;
15
15
  /**
16
- * ID of the Wix Payments account that owns this payout.
16
+ * ID of the Wix Payments account that owns the payout. Retrieve account IDs
17
+ * from the Accounts API.
17
18
  * @format GUID
18
19
  */
19
20
  accountId?: string;
20
21
  /**
21
- * ID of the Wix Payments account profile this payout belongs to.
22
- * A Wix Payments account has one or more profiles; each profile has its own
23
- * balance and its own payouts. Most merchants have a single profile.
22
+ * ID of the Wix Payments account profile that owns the payout.
23
+ *
24
+ * A Wix Payments account has 1 or more profiles. Each profile has its own
25
+ * balance and its own payouts. Most merchants have 1 profile. Retrieve
26
+ * profile IDs from the Accounts API.
24
27
  * @format GUID
25
28
  */
26
29
  accountProfileId?: string;
27
30
  /**
28
- * Date the payout was created, in advance of the underlying transfer being
29
- * initiated at the bank rail. Once initiated, the funds typically reach the
30
- * merchant's bank account within 3-5 business days, depending on the receiving bank.
31
+ * Date and time the payout was created.
32
+ *
33
+ * The payout is created before the underlying transfer is initiated at the
34
+ * bank. Once initiated, the funds typically reach the merchant's bank account
35
+ * within 3 to 5 business days, depending on the receiving bank.
31
36
  */
32
37
  createdDate?: Date | null;
33
- /** Amount of funds transferred to the merchant's bank account. */
38
+ /** Amount of the transfer to the merchant's bank account. */
34
39
  amount?: Money;
35
40
  /**
36
- * Lifecycle status of the payout. `SENT` means the bank rail accepted the transfer
37
- * for delivery; `FAILED` means the receiving bank rejected the transfer. The rail
38
- * does not provide a delivery acknowledgement, so `SENT` is not the same as
39
- * "delivered to the merchant" see the per-value documentation on `PayoutStatus`.
41
+ * Lifecycle status of the payout.
42
+ *
43
+ * `SENT` means the bank rail accepted the transfer for delivery. `FAILED` means
44
+ * the receiving bank rejected the transfer.
45
+ *
46
+ * A `SENT` status doesn't guarantee that the funds were delivered to the
47
+ * merchant. The bank rail doesn't provide a delivery acknowledgement, and a
48
+ * payout in `SENT` can later transition to `FAILED` if the receiving bank
49
+ * rejects the transfer. See the per-value documentation on `PayoutStatus` for
50
+ * details.
40
51
  */
41
52
  status?: PayoutStatusWithLiterals;
42
53
  /**
43
- * Estimated date for when the funds should arrive at the merchant's bank, returned
44
- * by the underlying bank rail when available. This is a prediction, not a guarantee —
45
- * actual arrival depends on the receiving bank's processing and may be later.
54
+ * Estimated date for when the funds should arrive at the merchant's bank
55
+ * account, in `YYYY-MM-DD` format.
56
+ *
57
+ * The estimated arrival date is a prediction, not a guarantee. Actual arrival
58
+ * depends on the receiving bank's processing and may be later.
46
59
  * @format LOCAL_DATE
47
60
  */
48
61
  estimatedArrivalDateV2?: string | null;
49
62
  /**
50
- * Set only when `status` is `FAILED`. Indicates why the bank rail rejected the transfer.
51
- * The codes are a Wix Payments unified set; the original provider-specific reason is not exposed.
63
+ * Reason the bank rail rejected the transfer.
64
+ *
65
+ * Returned only when `status` is `FAILED`.
52
66
  */
53
67
  failureReason?: PayoutFailureReason;
54
68
  /**
55
- * Reference returned by the bank rail (e.g. ACH trace number, SEPA reference) once
56
- * the transfer is initiated. Use it for reconciliation against the merchant's bank
57
- * statement. Empty when the rail has not yet returned a reference.
69
+ * Reference returned by the bank rail once the transfer is initiated. For
70
+ * example, an ACH trace number or a SEPA reference. Use this value to
71
+ * reconcile against the merchant's bank statement.
72
+ *
73
+ * Empty until the bank rail returns a reference.
58
74
  * @maxLength 500
59
75
  */
60
76
  bankTransferReference?: string | null;
61
77
  /**
62
- * `true` if the payout's `amount` includes funds that originate from a Wix Capital
63
- * advance the merchant has taken out. `false` if the amount is composed only of
64
- * regular sales proceeds.
78
+ * Whether the payout `amount` includes funds from a Wix Capital cash advance
79
+ * taken out by the merchant. If `false`, the amount comes only from the
80
+ * merchant's sales proceeds.
65
81
  */
66
82
  cashAdvanceIncluded?: boolean;
67
83
  }
@@ -85,56 +101,56 @@ interface Money {
85
101
  }
86
102
  /** Lifecycle status of a payout. */
87
103
  declare enum PayoutStatus {
88
- /** Default value. Not returned by the API. */
104
+ /** Unknown payout status. Not returned by the API. */
89
105
  UNKNOWN = "UNKNOWN",
90
106
  /**
91
- * The bank rail accepted the transfer. Funds are en route to the merchant's bank,
92
- * but acceptance is not the same as delivery — a `SENT` payout can still flip to
93
- * `FAILED` if the receiving bank rejects the transfer (the rail's return window
94
- * is up to 60 days for ACH and up to 13 months for SEPA).
107
+ * The bank rail accepted the transfer. Funds are en route to the merchant's
108
+ * bank account.
109
+ *
110
+ * Acceptance isn't the same as delivery. A `SENT` payout can still
111
+ * transition to `FAILED` if the receiving bank rejects the transfer. The
112
+ * bank rail's return window is up to 60 days for ACH and up to 13 months
113
+ * for SEPA.
95
114
  */
96
115
  SENT = "SENT",
97
116
  /**
98
- * The transfer was rejected by the receiving bank. See `failure_reason` for the cause;
99
- * the funds remain in the merchant's Wix Payments balance.
117
+ * The bank rail rejected the transfer. See `failureReason` for the cause.
118
+ * The funds remain in the merchant's Wix Payments balance.
100
119
  */
101
120
  FAILED = "FAILED"
102
121
  }
103
122
  /** @enumType */
104
123
  type PayoutStatusWithLiterals = PayoutStatus | 'UNKNOWN' | 'SENT' | 'FAILED';
105
- /**
106
- * Carries the reason a payout failed. Wraps the `PayoutFailureCode` enum to leave room
107
- * for future fields (e.g. a human-readable message); new clients should still read
108
- * `failure_reason.code` for the enum value.
109
- */
124
+ /** Reason a payout failed. */
110
125
  interface PayoutFailureReason {
111
126
  /** Why the bank rail rejected the transfer. */
112
127
  code?: PayoutFailureCodeWithLiterals;
113
128
  }
114
129
  /**
115
- * Reasons a payout can fail. Values describe real-world bank-rail conditions and
116
- * are mapped from the underlying provider into a Wix Payments unified vocabulary.
130
+ * Possible reasons for a payout failure. Each value describes a real-world
131
+ * bank-rail condition.
117
132
  */
118
133
  declare enum PayoutFailureCode {
119
134
  /**
120
- * Generic failure with no more specific reason available from the bank rail.
121
- * Note: this value is also returned when no failure reason is known — clients
122
- * cannot distinguish "unknown" from "generic" using this code alone.
135
+ * Generic failure with no more specific reason available from the bank
136
+ * rail. This value is also returned when no failure reason is known.
137
+ * Clients can't distinguish "unknown" from "generic" using this code alone.
123
138
  */
124
139
  GENERIC_PAYOUT_FAILURE = "GENERIC_PAYOUT_FAILURE",
125
140
  /**
126
- * The merchant's bank account is closed. The merchant must provide new bank
127
- * account details before further payouts can succeed.
141
+ * The merchant's bank account is closed. The merchant must provide new
142
+ * bank account details before further payouts can succeed.
128
143
  */
129
144
  ACCOUNT_CLOSED = "ACCOUNT_CLOSED",
130
145
  /**
131
- * The merchant's bank account is frozen (e.g. due to a hold placed by the bank).
132
- * The merchant must resolve the hold with their bank before further payouts can succeed.
146
+ * The merchant's bank account is frozen, for example due to a hold placed
147
+ * by the bank. The merchant must resolve the hold with their bank before
148
+ * further payouts can succeed.
133
149
  */
134
150
  ACCOUNT_FROZEN = "ACCOUNT_FROZEN",
135
151
  /**
136
- * The merchant's bank account is restricted from receiving the transfer
137
- * (e.g. account type or status does not permit incoming credits).
152
+ * The merchant's bank account is restricted from receiving the transfer.
153
+ * For example, the account type or status doesn't permit incoming credits.
138
154
  */
139
155
  BANK_ACCOUNT_RESTRICTED = "BANK_ACCOUNT_RESTRICTED",
140
156
  /**
@@ -143,38 +159,42 @@ declare enum PayoutFailureCode {
143
159
  */
144
160
  BANK_OWNERSHIP_CHANGED = "BANK_OWNERSHIP_CHANGED",
145
161
  /**
146
- * The receiving bank could not process the transfer for an unspecified reason.
147
- * A subsequent payout attempt may succeed.
162
+ * The receiving bank couldn't process the transfer for an unspecified
163
+ * reason. A subsequent payout attempt may succeed.
148
164
  */
149
165
  COULD_NOT_PROCESS = "COULD_NOT_PROCESS",
150
166
  /**
151
- * The merchant's bank declined the debit authorisation associated with the transfer.
152
- * The merchant must contact their bank to authorise Wix Payments payouts.
167
+ * The merchant's bank declined the debit authorisation associated with the
168
+ * transfer. The merchant must contact their bank to authorise Wix Payments
169
+ * payouts.
153
170
  */
154
171
  DEBIT_NOT_AUTHORIZED = "DEBIT_NOT_AUTHORIZED",
155
172
  /**
156
- * The account holder name on file does not match what the receiving bank has on record.
157
- * The merchant must correct the account holder name.
173
+ * The account holder name on file doesn't match the name the receiving
174
+ * bank has on record. The merchant must correct the account holder name.
158
175
  */
159
176
  INCORRECT_ACCOUNT_HOLDER_NAME = "INCORRECT_ACCOUNT_HOLDER_NAME",
160
177
  /** The city in the bank account details is invalid for the receiving bank. */
161
178
  INVALID_ACCOUNT_DETAILS_CITY = "INVALID_ACCOUNT_DETAILS_CITY",
162
- /** The bank account number is invalid (wrong format or does not exist). */
179
+ /**
180
+ * The bank account number is invalid. The format is wrong or the account
181
+ * doesn't exist.
182
+ */
163
183
  INVALID_ACCOUNT_NUMBER = "INVALID_ACCOUNT_NUMBER",
164
- /** The payout currency is not supported by the receiving bank account. */
184
+ /** The payout currency isn't supported by the receiving bank account. */
165
185
  INVALID_CURRENCY = "INVALID_CURRENCY",
166
- /** The routing number (US) is invalid or does not match the receiving bank. */
186
+ /** The routing number (US) is invalid or doesn't match the receiving bank. */
167
187
  INVALID_ROUTING_NUMBER = "INVALID_ROUTING_NUMBER",
168
- /** The sort code (UK) is invalid or does not match the receiving bank. */
188
+ /** The sort code (UK) is invalid or doesn't match the receiving bank. */
169
189
  INVALID_SORT_CODE = "INVALID_SORT_CODE",
170
190
  /**
171
- * No bank account is on file for the merchant.
172
- * The merchant must add bank details before payouts can succeed.
191
+ * No bank account is on file for the merchant. The merchant must add bank
192
+ * details before payouts can succeed.
173
193
  */
174
194
  NO_ACCOUNT = "NO_ACCOUNT",
175
195
  /**
176
- * A technical error at the bank rail prevented the transfer.
177
- * A subsequent payout attempt may succeed.
196
+ * A technical error at the bank rail prevented the transfer. A subsequent
197
+ * payout attempt may succeed.
178
198
  */
179
199
  TECHNICAL_ERROR = "TECHNICAL_ERROR"
180
200
  }
@@ -182,23 +202,30 @@ declare enum PayoutFailureCode {
182
202
  type PayoutFailureCodeWithLiterals = PayoutFailureCode | 'GENERIC_PAYOUT_FAILURE' | 'ACCOUNT_CLOSED' | 'ACCOUNT_FROZEN' | 'BANK_ACCOUNT_RESTRICTED' | 'BANK_OWNERSHIP_CHANGED' | 'COULD_NOT_PROCESS' | 'DEBIT_NOT_AUTHORIZED' | 'INCORRECT_ACCOUNT_HOLDER_NAME' | 'INVALID_ACCOUNT_DETAILS_CITY' | 'INVALID_ACCOUNT_NUMBER' | 'INVALID_CURRENCY' | 'INVALID_ROUTING_NUMBER' | 'INVALID_SORT_CODE' | 'NO_ACCOUNT' | 'TECHNICAL_ERROR';
183
203
  interface ListPayoutsRequest {
184
204
  /**
185
- * ID of the Wix Payments account whose payouts to list.
205
+ * ID of the Wix Payments account whose payouts to list. Retrieve account
206
+ * IDs from the Accounts API.
186
207
  * @format GUID
187
208
  */
188
209
  accountId: string;
189
210
  /**
190
- * Optional. When omitted, payouts across all profiles of the account are returned.
191
- * When set, only payouts belonging to the specified account profile are returned.
211
+ * ID of the Wix Payments account profile to filter by.
212
+ *
213
+ * When omitted, payouts across all profiles of the account are returned.
214
+ * Retrieve profile IDs from the Accounts API.
192
215
  * @format GUID
193
216
  */
194
217
  accountProfileId?: string | null;
195
- /** Optional. Returns only payouts created before this timestamp. */
218
+ /** Returns only payouts created before this date and time. */
196
219
  createdBefore?: Date | null;
197
- /** Optional. Returns only payouts created after this timestamp. */
220
+ /** Returns only payouts created after this date and time. */
198
221
  createdAfter?: Date | null;
199
- /** Optional. Sorting. Only `created_date` is supported; requests sorting by any other field are rejected with INVALID_ARGUMENT. */
222
+ /**
223
+ * Sort order for the result list.
224
+ *
225
+ * Supported `fieldName` values: `created_date` (snake_case, not auto-converted). At most 1 sort field is allowed.
226
+ */
200
227
  sort?: Sorting;
201
- /** Optional paging. Offset-based. */
228
+ /** Offset-based paging. */
202
229
  paging?: Paging;
203
230
  }
204
231
  interface Sorting {
@@ -223,7 +250,7 @@ interface Paging {
223
250
  offset?: number | null;
224
251
  }
225
252
  interface ListPayoutsResponse {
226
- /** List of payouts. */
253
+ /** List of retrieved payouts. */
227
254
  payouts?: Payout[];
228
255
  /** Paging metadata. */
229
256
  metadata?: PagingMetadata;
@@ -239,16 +266,17 @@ interface PagingMetadata {
239
266
  tooManyToCount?: boolean | null;
240
267
  }
241
268
  interface CreatePayoutRequest {
242
- /** Payout. */
269
+ /** Payout to create. */
243
270
  payout?: Payout;
244
271
  }
245
272
  interface CreatePayoutResponse {
246
- /** Payout. */
273
+ /** Created payout. */
247
274
  payout?: Payout;
248
275
  }
249
276
  interface GetPayoutRequest {
250
277
  /**
251
- * ID of the Wix Payments account the payout belongs to.
278
+ * ID of the Wix Payments account that owns the payout. The payout must
279
+ * belong to this account. Retrieve account IDs from the Accounts API.
252
280
  * @format GUID
253
281
  */
254
282
  accountId: string;
@@ -259,12 +287,13 @@ interface GetPayoutRequest {
259
287
  payoutId: string;
260
288
  }
261
289
  interface GetPayoutResponse {
262
- /** Payout. */
290
+ /** Retrieved payout. */
263
291
  payout?: Payout;
264
292
  }
265
293
  interface ListPayoutGroupsRequest {
266
294
  /**
267
- * Wix Payments account identifier.
295
+ * ID of the Wix Payments account whose payout groups to list. Retrieve
296
+ * account IDs from the Accounts API.
268
297
  * @format GUID
269
298
  */
270
299
  accountId?: string;
@@ -312,7 +341,8 @@ interface PayoutGroup {
312
341
  }
313
342
  interface GetPayoutGroupRequest {
314
343
  /**
315
- * Wix Payments account identifier.
344
+ * ID of the Wix Payments account that owns the payout group. Retrieve
345
+ * account IDs from the Accounts API.
316
346
  * @format GUID
317
347
  */
318
348
  accountId?: string;
@@ -334,12 +364,13 @@ interface GetPayoutGroupResponse {
334
364
  }
335
365
  interface GetPayoutGroupByPayoutIdRequest {
336
366
  /**
337
- * Wix Payments account identifier.
367
+ * ID of the Wix Payments account that owns the payout. Retrieve account IDs
368
+ * from the Accounts API.
338
369
  * @format GUID
339
370
  */
340
371
  accountId?: string;
341
372
  /**
342
- * Payout identifier.
373
+ * ID of the payout whose group to retrieve.
343
374
  * @format GUID
344
375
  */
345
376
  payoutId?: string;