import { FundAccount, FundAccountBankWithContact, FundAccountVPAWithContact } from "../FundAccount"; import { GenericFields, Pageable, Response } from "../../types/generic"; import RestClient from "../../utils/RestClient"; interface WithFundAccount { fund_account: FundAccountBankWithContact | FundAccountVPAWithContact; fund_account_id?: never; } interface WithFundAccountId { fund_account_id: string; fund_account?: never; } export type Payout = BasePayout & (WithFundAccount | WithFundAccountId); interface BasePayout extends Omit { entity: "payout"; account_number?: string; /** Amount in paise */ amount: number; currency: "INR"; notes?: Record; fees?: number; tax?: number; status: "queued" | "pending" | "rejected" | "processing" | "processed" | "cancelled" | "reversed"; utr: string; mode: "UPI" | "NEFT" | "RTGS" | "IMPS" | "card"; purpose?: "refund" | "cashback" | "payout" | "salary" | "utility bill" | "vendor bill" | string; reference_id?: string; narration?: string; status_details?: { source?: string; reason?: string; description?: string; }; } declare class RPXPayout { client: RestClient; constructor(client: RestClient); /** * Creates a payout for the given details * @link https://razorpay.com/docs/api/x/payouts/#create-a-payout */ create(payoutInfo: Pick & ({ fund_account: Pick & (FundAccountBankWithContact | FundAccountVPAWithContact); fund_account_id?: never; } | { fund_account_id: string; fund_account?: never; }) & { queue_if_low_balance?: boolean; }): Promise; /** * Fetches all payout * @link https://razorpay.com/docs/api/x/payouts/#fetch-all-payouts */ getAll(accountNumber: Payout["account_number"], filter?: Pageable & Partial> & { contact_id?: string; }): Promise>; /** * Fetch details of a payout * @link https://razorpay.com/docs/api/x/payouts/#fetch-a-payout-by-id */ get(payoutId: Payout["id"]): Promise; /** * Cancels the payout for given payoutId * @link https://razorpay.com/docs/api/x/payouts/#cancel-a-queued-payout */ cancel(payoutId: Payout["id"]): Promise; } export default RPXPayout;