import { CreateRefundRequest as CreateRefundRequest$1, CreateRefundResponse as CreateRefundResponse$1, GetRefundRequest as GetRefundRequest$1, GetRefundResponse as GetRefundResponse$1, QueryRefundsRequest as QueryRefundsRequest$1, QueryRefundsResponse as QueryRefundsResponse$1 } from './index.typings.js'; import '@wix/sdk-types'; /** The refund object. A refund object is the record of an attempt to return charged funds. */ interface Refund { /** * Refund ID. * @readonly * @immutable * @format GUID */ id?: string | null; /** * Revision number, which increments by 1 each time the refund is updated. * * Ignored when creating a refund. * @readonly */ revision?: string | null; /** * Date and time the refund was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. For example, "2024-01-30T13:30:00". * @readonly * @immutable */ createdDate?: Date | null; /** * Date and time the refund was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format. For example, "2024-01-30T13:30:00". * @readonly */ updatedDate?: Date | null; /** * Custom field data for the refund object. * * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls. */ extendedFields?: ExtendedFields; /** * ID of the charge to refund. * @immutable * @format GUID */ chargeId?: string | null; /** * Refund currency. Should be the same as the charge currency. * @immutable * @format CURRENCY */ currencyCode?: string | null; /** * Amount being returned to the buyer in the refund currency's main units (such as dollars or euros). * For example, `"12.95"`. * @immutable * @decimalValue options { gt:0, maxScale:8 } */ amount?: string | null; /** * Application fee returned to the merchant from Wix in the refund currency's main units (such as dollars or euros). For example, `"12.95"`. * * Only included if an application fee was returned. * @readonly * @immutable * @decimalValue options { gt:0, maxScale:8 } */ returnedApplicationFee?: string | null; /** * Processing fee returned to the merchant from the payment service provider in the refund currency's main units (such as dollars or euros). For example, `"12.95"`. * * This field is empty when the processing fee is unknown. * @readonly * @immutable * @decimalValue options { gt:0, maxScale:8 } */ returnedProcessingFee?: string | null; /** * Whether the refund is for the entire amount of the charge. * @readonly * @immutable */ full?: boolean | null; /** * Status of the refund. * * Learn more about the [refund lifecycle](https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#lifecycle-of-a-refund>). * @readonly */ status?: StatusWithLiterals; /** * Payment service provider's ID for the refund. * @readonly * @immutable * @minLength 1 * @maxLength 100 */ providerRefundId?: string | null; /** * Reason this refund was issued. * @minLength 1 * @maxLength 1000 */ reason?: string | null; /** * Details about the refund status. * Used to provide additional information about why a refund was given its status. * @readonly */ statusInfo?: StatusInfo; /** * Unique number assigned to a refund. This number is shared across all parties involved in processing the refund. It allows the merchant to track the refund with their bank. * @readonly * @immutable * @minLength 1 * @maxLength 30 */ acquirerReferenceNumber?: string | null; /** * Note providing additional information about this refund. * @immutable * @minLength 1 * @maxLength 200 */ note?: string | null; } interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } declare enum Status { /** Refund is in progress. */ PENDING = "PENDING", /** Refund succeeded. */ SUCCEEDED = "SUCCEEDED", /** Refund failed. */ FAILED = "FAILED", /** Refund had succeeded, but has since been reversed. */ REVERSED = "REVERSED" } /** @enumType */ type StatusWithLiterals = Status | 'PENDING' | 'SUCCEEDED' | 'FAILED' | 'REVERSED'; declare enum Initiator { WIX = "WIX", API = "API", PROVIDER = "PROVIDER" } /** @enumType */ type InitiatorWithLiterals = Initiator | 'WIX' | 'API' | 'PROVIDER'; interface StatusInfo { /** * Reason code with detailed information about the refund status. * See the full list of [reason codes](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes#refund-declined). * @minLength 1 * @maxLength 10 */ code?: string; /** * Description of the status. * @minLength 1 * @maxLength 1000 */ description?: string | null; } interface CreateRefundRequest { /** Refund to be created. */ refund: Refund; /** * Amount of the charge that was previously refunded. * * Specify this to compare your records of previously refunded amounts against those on the server. If they don't match, this method will return an error with the code `PREVIOUSLY_REFUNDED_AMOUNT_MISMATCH`. * * Learn more about [preventing unintended refunds](https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#preventing-unintended-refunds). * @decimalValue options { gte:0, maxScale:8 } */ previouslyRefundedAmount?: string | null; } interface CreateRefundResponse { /** The created refund. */ refund?: Refund; } interface GetRefundRequest { /** * ID of the refund to retrieve. * @format GUID */ refundId: string; } interface GetRefundResponse { /** The requested refund. */ refund?: Refund; } interface QueryRefundsRequest { /** Query options. */ query?: CursorQuery; } interface CursorQuery extends CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` * @maxSize 4 */ sort?: Sorting[]; } /** @oneof */ interface CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } interface Sorting { /** * Name of the field to sort by. * @maxLength 64 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface CursorPaging { /** * Number of items to load. * @max 100 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get the relevant cursor token * from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 16000 */ cursor?: string | null; } interface QueryRefundsResponse { /** List of refunds. */ refunds?: Refund[]; /** Metadata for the paginated results. */ pagingMetadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ cursors?: Cursors; /** * Indicates if there are more results after the current page. * If `true`, another page of results can be retrieved. * If `false`, this is the last page. */ hasNext?: boolean | null; } interface Cursors { /** * Cursor pointing to next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface UpdateExtendedFieldsRequest { /** ID of the entity to update. */ id?: string; /** Identifier for the app whose extended fields are being updated. */ namespace?: string; /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */ namespaceData?: Record | null; } interface UpdateExtendedFieldsResponse { /** Updated refund. */ refund?: Refund; } interface GetRefundabilityRequest { /** * ID of the charge to calculate refundability for. * @format GUID */ chargeId?: string; } interface GetRefundabilityResponse { /** Refundability of the charge. */ refundability?: Refundability; } /** * Internal notes: * * Instead of separate Refundability and PartialRefundability, we provide min and max refund amount. * If only full refund is possible, min_refund_amount = max_refund_amount = charge amount. */ interface Refundability extends RefundabilityDetailsOneOf { /** When the charge is refundable, specifies the allowed range for the refund amount. */ refundDetails?: RefundDetails; /** When charge is not refundable, specifies why the refund is not allowed. */ rejectionDetails?: RejectionDetails; /** Whether you can refund the charge. This depends on your app's permissions, and the permissions of the user checking the refundability. */ refundable?: boolean; /** * Charge currency. * @format CURRENCY */ currencyCode?: string | null; /** * Sum of amounts of previous refunds for this charge with the `SUCCEEDED` status in the charge currency's main units (such as dollars or euros). For example, `"6.47"`. * Used to [prevent unintended refunds](https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#preventing-unintended-refunds). * @decimalValue options { gte:0, maxScale:8 } */ previouslyRefundedAmount?: string | null; } /** @oneof */ interface RefundabilityDetailsOneOf { /** When the charge is refundable, specifies the allowed range for the refund amount. */ refundDetails?: RefundDetails; /** When charge is not refundable, specifies why the refund is not allowed. */ rejectionDetails?: RejectionDetails; } interface RefundDetails { /** * Minimum allowed refund amount in the refund currency's main units (such as dollars or euros). For example, `"0.50"`. * @decimalValue options { gte:0, maxScale:8 } */ minRefundAmount?: string | null; /** * Maximum allowed refund amount in the refund currency's main units (such as dollars or euros). For example, `"12.95"`. * @decimalValue options { gt:0, maxScale:8 } */ maxRefundAmount?: string | null; } interface RejectionDetails { /** Reason the refund was rejected. */ reason?: RejectionReasonWithLiterals; } declare enum RejectionReason { /** Charge was fully refunded. */ CHARGE_REFUNDED = "CHARGE_REFUNDED", /** Another refund was initiated for this charge and is waiting for confirmation from the provider. */ CHARGE_REFUND_IN_PROGRESS = "CHARGE_REFUND_IN_PROGRESS", /** Charge was disputed. */ CHARGE_DISPUTED = "CHARGE_DISPUTED", /** Charge is too old to be refunded. */ CHARGE_REFUND_PERIOD_ENDED = "CHARGE_REFUND_PERIOD_ENDED", /** Charge is unpaid. */ CHARGE_UNPAID = "CHARGE_UNPAID", /** PSP is temporarily unavailable. */ PROVIDER_DOWN = "PROVIDER_DOWN", /** * PSP doesn't support the refund for one of the following reasons: * - The PSP doesn't currently support refunds. * - The charge is in an invalid state. * - The PSP does not have the required information for this transaction. */ PROVIDER_NOT_SUPPORTED = "PROVIDER_NOT_SUPPORTED", /** Payment method used for the charge doesn't support refunds. */ PAYMENT_METHOD_NOT_SUPPORTED = "PAYMENT_METHOD_NOT_SUPPORTED", /** Merchant doesn't have enough balance to issue a refund for the charge. */ MERCHANT_BALANCE_INSUFFICIENT = "MERCHANT_BALANCE_INSUFFICIENT", /** Charges done via POS terminal and should be refunded on that POS terminal. */ ONLINE_REFUND_NOT_SUPPORTED = "ONLINE_REFUND_NOT_SUPPORTED", /** The identity requesting the refund doesn't have the required permissions. This can occur if a site collaborator attempts to create a refund on behalf of the merchant. */ NOT_AUTHORIZED = "NOT_AUTHORIZED" } /** @enumType */ type RejectionReasonWithLiterals = RejectionReason | 'CHARGE_REFUNDED' | 'CHARGE_REFUND_IN_PROGRESS' | 'CHARGE_DISPUTED' | 'CHARGE_REFUND_PERIOD_ENDED' | 'CHARGE_UNPAID' | 'PROVIDER_DOWN' | 'PROVIDER_NOT_SUPPORTED' | 'PAYMENT_METHOD_NOT_SUPPORTED' | 'MERCHANT_BALANCE_INSUFFICIENT' | 'ONLINE_REFUND_NOT_SUPPORTED' | 'NOT_AUTHORIZED'; interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * 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. * 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. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntityAsJson?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntityAsJson?: string | null; } interface ActionEvent { bodyAsJson?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } interface SyncRefundRequest { /** * Refund ID. * @format GUID */ refundId?: string | null; /** * ID of the refund on the PSP side. * @minLength 1 * @maxLength 100 */ providerRefundId?: string | null; /** * ID of charge for which the funds are returned by this refund. * @format GUID */ chargeId?: string | null; /** * Status of the refund. * Read more about statuses in this [article](). */ status?: StatusWithLiterals; /** * Status code. * [Read more about reason codes.](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/reason-codes) * @minLength 1 * @maxLength 10 */ statusCode?: string | null; /** * Currency of refund, should be the same as currency of charge. * @format CURRENCY */ currencyCode?: string | null; /** * Amount of refund in base units, what's returned to the buyer. * E.g. "12.95". * @decimalValue options { gt:0, maxScale:8 } */ amount?: string | null; /** * Application fee returned to merchant from Wix. * Having this as a separate field since Refund.returned_application_fee is readOnly. * @decimalValue options { gt:0, maxScale:8 } */ returnedApplicationFee?: string | null; /** * Reason why this refund was issued. * @minLength 1 * @maxLength 1000 */ reason?: string | null; /** * Optional free-text note about this refund. * @minLength 1 * @maxLength 200 */ note?: string | null; /** * Processing fee returned to merchant from Wix. * Having this as a separate field since Refund.returned_processing_fee is readOnly. * @decimalValue options { gt:0, maxScale:8 } */ returnedProcessingFee?: string | null; /** * Unique number assigned to a refund. This number is shared across all parties involved in processing the refund. It allows the merchant to track the refund with their bank. * @minLength 1 * @maxLength 30 */ acquirerReferenceNumber?: string | null; /** Who initiated this refund. */ initiator?: InitiatorWithLiterals; } interface SyncRefundResponse { /** Created/updated refund. */ refund?: Refund; } /** @docsIgnore */ type CreateRefundApplicationErrors = { code?: 'CHARGE_REFUNDED'; description?: string; data?: Record; } | { code?: 'CHARGE_REFUND_IN_PROGRESS'; description?: string; data?: Record; } | { code?: 'CHARGE_DISPUTED'; description?: string; data?: Record; } | { code?: 'CHARGE_REFUND_PERIOD_ENDED'; description?: string; data?: Record; } | { code?: 'CHARGE_UNPAID'; description?: string; data?: Record; } | { code?: 'PROVIDER_DOWN'; description?: string; data?: Record; } | { code?: 'PROVIDER_NOT_SUPPORTED'; description?: string; data?: Record; } | { code?: 'PAYMENT_METHOD_NOT_SUPPORTED'; description?: string; data?: Record; } | { code?: 'MERCHANT_BALANCE_INSUFFICIENT'; description?: string; data?: Record; } | { code?: 'ONLINE_REFUND_NOT_SUPPORTED'; description?: string; data?: Record; } | { code?: 'PARTIAL_REFUND_NOT_SUPPORTED'; description?: string; data?: Record; } | { code?: 'REFUND_AMOUNT_OUT_OF_BOUNDS'; description?: string; data?: Record; } | { code?: 'REFUND_CURRENCY_MISSING'; description?: string; data?: Record; } | { code?: 'REFUND_CURRENCY_MISMATCH'; description?: string; data?: Record; } | { code?: 'PREVIOUSLY_REFUNDED_AMOUNT_MISMATCH'; description?: string; data?: Record; }; type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function createRefund(): __PublicMethodMetaInfo<'POST', {}, CreateRefundRequest$1, CreateRefundRequest, CreateRefundResponse$1, CreateRefundResponse>; declare function getRefund(): __PublicMethodMetaInfo<'GET', { refundId: string; }, GetRefundRequest$1, GetRefundRequest, GetRefundResponse$1, GetRefundResponse>; declare function queryRefunds(): __PublicMethodMetaInfo<'POST', {}, QueryRefundsRequest$1, QueryRefundsRequest, QueryRefundsResponse$1, QueryRefundsResponse>; export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type CreateRefundApplicationErrors as CreateRefundApplicationErrorsOriginal, type CreateRefundRequest as CreateRefundRequestOriginal, type CreateRefundResponse as CreateRefundResponseOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type CursorQuery as CursorQueryOriginal, type CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOfOriginal, type Cursors as CursorsOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type ExtendedFields as ExtendedFieldsOriginal, type GetRefundRequest as GetRefundRequestOriginal, type GetRefundResponse as GetRefundResponseOriginal, type GetRefundabilityRequest as GetRefundabilityRequestOriginal, type GetRefundabilityResponse as GetRefundabilityResponseOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, Initiator as InitiatorOriginal, type InitiatorWithLiterals as InitiatorWithLiteralsOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type QueryRefundsRequest as QueryRefundsRequestOriginal, type QueryRefundsResponse as QueryRefundsResponseOriginal, type RefundDetails as RefundDetailsOriginal, type Refund as RefundOriginal, type RefundabilityDetailsOneOf as RefundabilityDetailsOneOfOriginal, type Refundability as RefundabilityOriginal, type RejectionDetails as RejectionDetailsOriginal, RejectionReason as RejectionReasonOriginal, type RejectionReasonWithLiterals as RejectionReasonWithLiteralsOriginal, type RestoreInfo as RestoreInfoOriginal, SortOrder as SortOrderOriginal, type SortOrderWithLiterals as SortOrderWithLiteralsOriginal, type Sorting as SortingOriginal, type StatusInfo as StatusInfoOriginal, Status as StatusOriginal, type StatusWithLiterals as StatusWithLiteralsOriginal, type SyncRefundRequest as SyncRefundRequestOriginal, type SyncRefundResponse as SyncRefundResponseOriginal, type UpdateExtendedFieldsRequest as UpdateExtendedFieldsRequestOriginal, type UpdateExtendedFieldsResponse as UpdateExtendedFieldsResponseOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, createRefund, getRefund, queryRefunds };