/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { array, lazy, object, optional, Schema, string } from '../schema.js'; import { LinkDescription, linkDescriptionSchema } from './linkDescription.js'; import { Money, moneySchema } from './money.js'; import { PayeeBase, payeeBaseSchema } from './payeeBase.js'; import { RefundStatus, refundStatusSchema } from './refundStatus.js'; import { RefundStatusDetails, refundStatusDetailsSchema, } from './refundStatusDetails.js'; import { SellerPayableBreakdown, sellerPayableBreakdownSchema, } from './sellerPayableBreakdown.js'; /** The refund information. */ export interface Refund { /** The status of the refund. */ status?: RefundStatus; /** The details of the refund status. */ statusDetails?: RefundStatusDetails; /** The PayPal-generated ID for the refund. */ id?: string; /** The currency and amount for a financial transaction, such as a balance or payment due. */ amount?: Money; /** The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives. */ invoiceId?: string; /** The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. */ customId?: string; /** Reference ID issued for the card transaction. This ID can be used to track the transaction across processors, card brands and issuing banks. */ acquirerReferenceNumber?: string; /** The reason for the refund. Appears in both the payer's transaction history and the emails that the payer receives. */ noteToPayer?: string; /** The breakdown of the refund. */ sellerPayableBreakdown?: SellerPayableBreakdown; /** The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee. */ payer?: PayeeBase; /** An array of related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links). */ links?: LinkDescription[]; /** The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates. */ createTime?: string; /** The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates. */ updateTime?: string; } export const refundSchema: Schema = lazy(() => object({ status: ['status', optional(refundStatusSchema)], statusDetails: ['status_details', optional(refundStatusDetailsSchema)], id: ['id', optional(string())], amount: ['amount', optional(moneySchema)], invoiceId: ['invoice_id', optional(string())], customId: ['custom_id', optional(string())], acquirerReferenceNumber: ['acquirer_reference_number', optional(string())], noteToPayer: ['note_to_payer', optional(string())], sellerPayableBreakdown: [ 'seller_payable_breakdown', optional(sellerPayableBreakdownSchema), ], payer: ['payer', optional(payeeBaseSchema)], links: ['links', optional(array(linkDescriptionSchema))], createTime: ['create_time', optional(string())], updateTime: ['update_time', optional(string())], }) );