/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { lazy, object, optional, Schema, string } from '../schema.js'; import { ItemCategory, itemCategorySchema } from './itemCategory.js'; import { Money, moneySchema } from './money.js'; import { OrderBillingPlan, orderBillingPlanSchema, } from './orderBillingPlan.js'; import { UniversalProductCode, universalProductCodeSchema, } from './universalProductCode.js'; /** The details for the items to be purchased. */ export interface Item { /** The item name or title. */ name: string; /** The currency and amount for a financial transaction, such as a balance or payment due. */ unitAmount: Money; /** The currency and amount for a financial transaction, such as a balance or payment due. */ tax?: Money; /** The item quantity. Must be a whole number. */ quantity: string; /** The detailed item description. */ description?: string; /** The stock keeping unit (SKU) for the item. */ sku?: string; /** The URL to the item being purchased. Visible to buyer and used in buyer experiences. */ url?: string; /** The item category type. */ category?: ItemCategory; /** The URL of the item's image. File type and size restrictions apply. An image that violates these restrictions will not be honored. */ imageUrl?: string; /** The Universal Product Code of the item. */ upc?: UniversalProductCode; /** Metadata for merchant-managed recurring billing plans. Valid only during the saved payment method token or billing agreement creation. */ billingPlan?: OrderBillingPlan; } export const itemSchema: Schema = lazy(() => object({ name: ['name', string()], unitAmount: ['unit_amount', moneySchema], tax: ['tax', optional(moneySchema)], quantity: ['quantity', string()], description: ['description', optional(string())], sku: ['sku', optional(string())], url: ['url', optional(string())], category: ['category', optional(itemCategorySchema)], imageUrl: ['image_url', optional(string())], upc: ['upc', optional(universalProductCodeSchema)], billingPlan: ['billing_plan', optional(orderBillingPlanSchema)], }) );