/** * 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 { CheckoutOption, checkoutOptionSchema } from './checkoutOption.js'; import { Money, moneySchema } from './money.js'; import { TaxAmount, taxAmountSchema } from './taxAmount.js'; /** The item details. */ export interface ItemDetails { /** An item code that identifies a merchant's goods or service. */ itemCode?: string; /** The item name. */ itemName?: string; /** The item description. */ itemDescription?: string; /** The item options. Describes option choices on the purchase of the item in some detail. */ itemOptions?: string; /** The number of purchased units of goods or a service. */ itemQuantity?: string; /** The currency and amount for a financial transaction, such as a balance or payment due. */ itemUnitPrice?: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ itemAmount?: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ discountAmount?: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ adjustmentAmount?: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ giftWrapAmount?: Money; /** The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`. */ taxPercentage?: string; /** An array of tax amounts levied by a government on the purchase of goods or services. */ taxAmounts?: TaxAmount[]; /** The currency and amount for a financial transaction, such as a balance or payment due. */ basicShippingAmount?: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ extraShippingAmount?: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ handlingAmount?: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ insuranceAmount?: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ totalItemAmount?: Money; /** The invoice number. An alphanumeric string that identifies a billing for a merchant. */ invoiceNumber?: string; /** An array of checkout options. Each option has a name and value. */ checkoutOptions?: CheckoutOption[]; } export const itemDetailsSchema: Schema = lazy(() => object({ itemCode: ['item_code', optional(string())], itemName: ['item_name', optional(string())], itemDescription: ['item_description', optional(string())], itemOptions: ['item_options', optional(string())], itemQuantity: ['item_quantity', optional(string())], itemUnitPrice: ['item_unit_price', optional(moneySchema)], itemAmount: ['item_amount', optional(moneySchema)], discountAmount: ['discount_amount', optional(moneySchema)], adjustmentAmount: ['adjustment_amount', optional(moneySchema)], giftWrapAmount: ['gift_wrap_amount', optional(moneySchema)], taxPercentage: ['tax_percentage', optional(string())], taxAmounts: ['tax_amounts', optional(array(taxAmountSchema))], basicShippingAmount: ['basic_shipping_amount', optional(moneySchema)], extraShippingAmount: ['extra_shipping_amount', optional(moneySchema)], handlingAmount: ['handling_amount', optional(moneySchema)], insuranceAmount: ['insurance_amount', optional(moneySchema)], totalItemAmount: ['total_item_amount', optional(moneySchema)], invoiceNumber: ['invoice_number', optional(string())], checkoutOptions: [ 'checkout_options', optional(array(checkoutOptionSchema)), ], }) );