import { GenericFields, Pageable, Response } from "../../types/generic"; import RestClient from "../../utils/RestClient"; export interface PayoutLinkContact { name: string; contact: string; email: string; type?: "vendor" | "customer" | "employee" | "self"; } export interface PayoutLink extends GenericFields { entity: "payout_link"; fund_account_id: string; payout_id: string; contact_id: string; contact?: PayoutLinkContact; purpose: "refund" | string; status: "pending" | "issued" | "processing" | "processed" | "cancelled" | "rejected"; amount: number; currency: "INR"; description?: string; receipt?: string; attempt_count?: number; notes?: Record; short_url?: string; send_sms: boolean; send_email: boolean; cancelled_at: number; expire_by?: number; expired_at?: number; } declare class RPXPayoutLink { client: RestClient; constructor(client: RestClient); /** * Creates a payout link for the given details * @link https://razorpay.com/docs/api/x/payout-links#create-a-payout-link */ create(payoutLinkInfo: { account_number: string; contact: { id: string; } | PayoutLinkContact; } & Pick): Promise; /** * Fetches all payout links * @link https://razorpay.com/docs/api/x/payout-links#fetch-all-payout-links */ getAll(filter?: Pageable & { contact_phone_number?: PayoutLinkContact["contact"]; contact_email?: PayoutLinkContact["email"]; } & Partial>): Promise>; /** * Fetch details of a payout link * @link https://razorpay.com/docs/api/x/payout-links#fetch-payout-link-by */ get(payoutLinkId: PayoutLink["id"]): Promise; /** * Cancels the payout link for given payoutLinkId * @link https://razorpay.com/docs/api/x/payout-links#cancel-a-payout-link */ cancel(payoutLinkId: PayoutLink["id"]): Promise; } export default RPXPayoutLink;