/** * Generated by orval v8.5.3 🍺 * Do not edit manually. * Space Invoices API * REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking. * OpenAPI spec version: 1.0.0 */ import type { CreateDocumentItemClassification } from './createDocumentItemClassification'; import type { CreateDocumentItemMetadata } from './createDocumentItemMetadata'; import type { CreateDocumentItemType } from './createDocumentItemType'; import type { DocumentItemTax } from './documentItemTax'; import type { LineDiscount } from './lineDiscount'; export interface CreateDocumentItem { /** * Item type. Omit or null for regular line item, 'separator' for a visual section header. Separator items only use name and description — all financial fields are ignored. * @nullable */ type?: CreateDocumentItemType; /** * Item name. Required unless `item_id` is provided. For separator items, this is the section title (always required). * @minLength 1 * @nullable */ name?: string | null; /** * @maxLength 2000 * @nullable */ description?: string | null; /** * Item classification used for Portugal SAF-T product typing. * @nullable */ classification?: CreateDocumentItemClassification; /** * Net price per unit (before tax). Provide either `price` OR `gross_price`, not both. Optional if `item_id` is provided. Ignored for separator items. * @nullable */ price?: number | null; /** * Gross price per unit (includes tax). If provided, net price is calculated. Provide either `price` OR `gross_price`, not both. Optional if `item_id` is provided. Ignored for separator items. * @nullable */ gross_price?: number | null; /** * Item quantity. Required for regular items. Ignored for separator items. * @minimum -140737488355328 * @maximum 140737488355327 * @nullable */ quantity?: number | null; /** * @maxLength 50 * @nullable */ unit?: string | null; /** Applied taxes (provide rate to create new tax, or tax_id to use existing tax) */ taxes?: DocumentItemTax[]; /** * Line discounts (max 5) in request order. In `b2b_standard`, percentage discounts are calculated from the original line subtotal and fixed amounts are summed before tax. In `b2c_gross_discount`, discounts are applied sequentially to the running gross subtotal. * @maxItems 5 */ discounts?: LineDiscount[]; /** * ID of a catalog item to prefill from. When provided, the item's name, description, price, and taxes are used as defaults. Any field you provide will override the catalog item's value. Not applicable for separator items. * @nullable */ item_id?: string | null; /** * Custom key-value data for your own use. Store any JSON object up to 50 properties. Values must be strings up to 250 characters. Useful for storing external IDs, tags, or integration data. * @nullable */ metadata?: CreateDocumentItemMetadata; /** * Whether to save this item to the catalog. When true without item_id, matches by exact name and reuses existing, or creates a new catalog item. Defaults to true (best-effort). When omitted, behaves like true but won't fail the request if persistence fails. * @nullable */ save_item?: boolean | null; } //# sourceMappingURL=createDocumentItem.d.ts.map