sanmar_sdk.orders

Purchase orders for SanMar’s own order channels.

A 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

PONumber

A purchase order number as SanMar takes it, up to 28 characters of printable ASCII without commas.

Classes

OrderLine

One item on a purchase order.

PurchaseOrder

A purchase order for SanMar's standard order service or SFTP order files.

Module Contents

type sanmar_sdk.orders.PONumber = Annotated[str, Field(min_length=1, max_length=28), ORDER_TEXT][source]

A purchase order number as SanMar takes it, up to 28 characters of printable ASCII without commas.

class sanmar_sdk.orders.OrderLine(/, **data: Any)[source]

Bases: sanmar_sdk.base.Model

One item on a purchase order.

Name the item by SkuKey where you can. SanMar recommends it, and the SFTP order files accept nothing else. By StyleColorSize, the color must be the catalog color.

item: sanmar_sdk.common.SkuKey | sanmar_sdk.common.StyleColorSize[source]
quantity: int = None[source]

How many pieces. The SFTP order files allow up to five digits.

warehouse: sanmar_sdk.common.Warehouse | None = None[source]

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.

class sanmar_sdk.orders.PurchaseOrder(/, **data: Any)[source]

Bases: sanmar_sdk.base.Model

A purchase order for SanMar’s standard order service or SFTP order files.

po_number: PONumber[source]
ship_to: sanmar_sdk.common.ShipTo[source]
ship_method: sanmar_sdk.common.ShipMethod | sanmar_sdk.common.WillCall[source]
lines: Annotated[collections.abc.Sequence[OrderLine], Field(min_length=1), sanmar_sdk.base.FROZEN][source]
merged_lines() → list[OrderLine][source]

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.