sanmar_sdk.orders ================= .. py:module:: sanmar_sdk.orders .. autoapi-nested-parse:: Purchase orders for SanMar's own order channels. A :class:`PurchaseOrder` is placed through SanMar's standard purchase order web service or uploaded as order files to SanMar's SFTP server; both take the same fields. PromoStandards orders carry a different set of fields and are modelled separately. Attributes ---------- .. autoapisummary:: sanmar_sdk.orders.PONumber Classes ------- .. autoapisummary:: sanmar_sdk.orders.OrderLine sanmar_sdk.orders.PurchaseOrder Module Contents --------------- .. py:type:: PONumber :canonical: Annotated[str, Field(min_length=1, max_length=28), ORDER_TEXT] A purchase order number as SanMar takes it, up to 28 characters of printable ASCII without commas. .. py:class:: OrderLine(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Model` One item on a purchase order. Name the item by :class:`~sanmar_sdk.common.SkuKey` where you can. SanMar recommends it, and the SFTP order files accept nothing else. By :class:`~sanmar_sdk.common.StyleColorSize`, the color must be the catalog color. .. py:attribute:: item :type: sanmar_sdk.common.SkuKey | sanmar_sdk.common.StyleColorSize .. py:attribute:: quantity :type: int :value: None How many pieces. The SFTP order files allow up to five digits. .. py:attribute:: warehouse :type: sanmar_sdk.common.Warehouse | None :value: None The warehouse to ship this line from. Leave it unset unless SanMar has set your account up for warehouse selection; otherwise SanMar picks warehouses according to the shipping option on your account. .. py:class:: PurchaseOrder(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Model` A purchase order for SanMar's standard order service or SFTP order files. .. py:attribute:: po_number :type: PONumber .. py:attribute:: ship_to :type: sanmar_sdk.common.ShipTo .. py:attribute:: ship_method :type: sanmar_sdk.common.ShipMethod | sanmar_sdk.common.WillCall .. py:attribute:: lines :type: Annotated[collections.abc.Sequence[OrderLine], Field(min_length=1), sanmar_sdk.base.FROZEN] .. py:method:: merged_lines() -> list[OrderLine] Return the lines with duplicates combined, as SanMar asks. SanMar checks inventory line by line, so two lines for the same item and warehouse can each pass on their own while their total is short. Lines are combined on item and warehouse, keeping the order each first appeared in.