/** * 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 ItemRequest { /** 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; /** This field supports up to 4000 characters, but any content beyond 2048 characters (including spaces) will be truncated. The 2048 character limit is reflected in the response representation of this field. */ 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 itemRequestSchema: 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)], }) );