// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import * as MiscAPI from '../misc'; import * as BreakupAPI from './breakup/breakup'; import { Breakup, BreakupRetrieveResponse } from './breakup/breakup'; import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams, PagePromise, } from '../../core/pagination'; import { RequestOptions } from '../../internal/request-options'; export class Payouts extends APIResource { breakup: BreakupAPI.Breakup = new BreakupAPI.Breakup(this._client); /** * @example * ```ts * // Automatically fetches more pages as needed. * for await (const payoutListResponse of client.payouts.list()) { * // ... * } * ``` */ list( query: PayoutListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/payouts', DefaultPageNumberPagination, { query, ...options, }); } } export type PayoutListResponsesDefaultPageNumberPagination = DefaultPageNumberPagination; export interface PayoutListResponse { /** * The total amount of the payout. */ amount: number; /** * The unique identifier of the business associated with the payout. */ business_id: string; /** * @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a * future release. */ chargebacks: number; /** * The timestamp when the payout was created, in UTC. */ created_at: string; /** * The currency of the payout, represented as an ISO 4217 currency code. */ currency: MiscAPI.Currency; /** * The fee charged for processing the payout. */ fee: number; /** * The payment method used for the payout (e.g., bank transfer, card, etc.). */ payment_method: string; /** * The unique identifier of the payout. */ payout_id: string; /** * @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a * future release. */ refunds: number; /** * The current status of the payout. */ status: 'not_initiated' | 'in_progress' | 'on_hold' | 'failed' | 'success'; /** * @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a * future release. */ tax: number; /** * The timestamp when the payout was last updated, in UTC. */ updated_at: string; /** * The name of the payout recipient or purpose. */ name?: string | null; /** * The URL of the document associated with the payout. */ payout_document_url?: string | null; /** * Any additional remarks or notes associated with the payout. */ remarks?: string | null; } export interface PayoutListParams extends DefaultPageNumberPaginationParams { /** * Get payouts created after this time (inclusive) */ created_at_gte?: string; /** * Get payouts created before this time (inclusive) */ created_at_lte?: string; } Payouts.Breakup = Breakup; export declare namespace Payouts { export { type PayoutListResponse as PayoutListResponse, type PayoutListResponsesDefaultPageNumberPagination as PayoutListResponsesDefaultPageNumberPagination, type PayoutListParams as PayoutListParams, }; export { Breakup as Breakup, type BreakupRetrieveResponse as BreakupRetrieveResponse }; }