sanmar_sdk.standard.purchase_orders

SanMar’s own purchase order service.

PurchaseOrderService.check() asks SanMar whether an order could ship, and from which warehouses, without placing it. PurchaseOrderService.submit() places it. Both take the PurchaseOrder that SFTP ordering takes too.

SanMar needs an account set up for integrated ordering before it accepts orders here, and tests new integrations on EDEV first; see the Purchase Order Integration Guide.

Classes

LineAvailability

Whether one line of an order could ship, and from where.

OrderCheck

SanMar's answer to whether an order could ship as it stands.

PurchaseOrderService

SanMar's own purchase order service.

Module Contents

class sanmar_sdk.standard.purchase_orders.LineAvailability(/, **data: Any)[source]

Bases: sanmar_sdk.base.Record

Whether one line of an order could ship, and from where.

style: str | None = None[source]
catalog_color: str | None = None[source]
size: str | None = None[source]
inventory_key: int | None = None[source]
size_index: int | None = None[source]
quantity: int[source]
warehouse: sanmar_sdk.common.WarehouseNumber | None = None[source]

The warehouse SanMar would ship this line from.

error: bool = None[source]
message: str | None = None[source]

SanMar’s explanation, such as which warehouse has the stock.

property available: bool[source]

Whether the requested quantity is in stock.

matches(item: sanmar_sdk.common.SkuKey | sanmar_sdk.common.StyleColorSize) → bool[source]

Whether this line is for the given item.

class sanmar_sdk.standard.purchase_orders.OrderCheck(/, **data: Any)[source]

Bases: sanmar_sdk.base.Record

SanMar’s answer to whether an order could ship as it stands.

available: bool[source]

Whether every line is in stock.

message: str | None = None[source]
lines: sanmar_sdk.base.OneOrMany[LineAvailability] = None[source]
line_for(item: sanmar_sdk.common.SkuKey | sanmar_sdk.common.StyleColorSize) → LineAvailability | None[source]

Find the line for an item, or None if the order has no line for it.

class sanmar_sdk.standard.purchase_orders.PurchaseOrderService(soap: SoapClient, credentials: Credentials)[source]

Bases: sanmar_sdk._soap.Service

SanMar’s own purchase order service.

check(order: sanmar_sdk.orders.PurchaseOrder) → OrderCheck[source]

Ask whether an order could ship, and from where, without placing it.

Being out of stock is an answer, not an error: see OrderCheck.available and each line’s message.

submit(order: sanmar_sdk.orders.PurchaseOrder) → str[source]

Place an order. Returns SanMar’s confirmation message.

SanMar ships each line from the warehouses its shipping option for the account picks, unless a line names one. Check an order first with check() if the account splits orders across warehouses.