sanmar_sdk.standard¶
SanMar’s own web services, as opposed to its PromoStandards ones.
Each is reached through an attribute of SanMar, such as
sanmar.products or sanmar.purchase_orders. They take the SanMar customer number as
well as the SanMar.com login.
Submodules¶
Classes¶
SanMar's own inventory service. |
|
Stock of one style, color and size, warehouse by warehouse. |
|
Stock of one style, color and size at one warehouse. |
|
A postal address on an invoice. |
|
One SanMar invoice, with its lines. |
|
The header of one SanMar invoice. |
|
One line of a SanMar invoice. |
|
SanMar's own invoicing service. |
|
Who an invoice is sold to, shipped to, or paid to. |
|
What is in one box SanMar shipped. |
|
A postal address on a packing slip. |
|
One item in a box. |
|
Who a box ships from, ships to, or is billed to. |
|
SanMar's packing slip service. |
|
The prices of one style, color and size. |
|
SanMar's own pricing service. |
|
SanMar's acknowledgement of a request for a product file. |
|
Links to a product's images and documents. |
|
One style, color and size, as SanMar's product information service describes it. |
|
SanMar's own product information service. |
|
A product's list and sale prices. |
|
Whether one line of an order could ship, and from where. |
|
SanMar's answer to whether an order could ship as it stands. |
|
SanMar's own purchase order service. |
Package Contents¶
- class sanmar_sdk.standard.InventoryService(soap: SoapClient, credentials: Credentials)[source]¶
Bases:
sanmar_sdk._soap.ServiceSanMar’s own inventory service.
- class sanmar_sdk.standard.SkuStock(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordStock of one style, color and size, warehouse by warehouse.
- catalog_color: str = None[source]¶
The catalog (mainframe) color, which web services and orders expect.
- warehouses: sanmar_sdk.base.OneOrMany[WarehouseStock] = None[source]¶
- class sanmar_sdk.standard.WarehouseStock(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordStock of one style, color and size at one warehouse.
- warehouse: sanmar_sdk.common.WarehouseNumber = None[source]¶
- class sanmar_sdk.standard.Address(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordA postal address on an invoice.
- class sanmar_sdk.standard.Invoice(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordOne SanMar invoice, with its lines.
- header: InvoiceHeader = None[source]¶
- lines: sanmar_sdk.base.OneOrMany[InvoiceLine] = None[source]¶
- class sanmar_sdk.standard.InvoiceHeader(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordThe header of one SanMar invoice.
- invoice_date: sanmar_sdk.base.SanMarDate = None[source]¶
- order_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- due_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- subtotal: decimal.Decimal | None = None[source]¶
- sales_tax: decimal.Decimal | None = None[source]¶
- shipping_and_handling: decimal.Decimal | None = None[source]¶
- total: decimal.Decimal | None = None[source]¶
- freight_savings: decimal.Decimal | None = None[source]¶
- class sanmar_sdk.standard.InvoiceLine(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordOne line of a SanMar invoice.
- catalog_color: str | None = None[source]¶
The color as SanMar’s order system records it, which is the catalog (mainframe) color.
- unit_price: decimal.Decimal | None = None[source]¶
- amount: decimal.Decimal | None = None[source]¶
- class sanmar_sdk.standard.InvoiceService(soap: SoapClient, credentials: Credentials)[source]¶
Bases:
sanmar_sdk._soap.ServiceSanMar’s own invoicing service.
- get(invoice_number: int) Invoice[source]¶
Fetch one invoice by its number.
- Raises:
NotFoundError – If SanMar has no invoice with that number.
- by_purchase_order(po_number: str) list[Invoice][source]¶
Fetch the invoices for one purchase order.
SanMar matches at most the first 13 characters of a PO number here.
- by_invoice_date(start: datetime.date, end: datetime.date) list[Invoice][source]¶
Fetch the invoices dated between two days, inclusive, up to three months apart.
- by_order_date(order_date: datetime.date) list[Invoice][source]¶
Fetch the invoices for orders placed on one day.
- since_last_call() list[Invoice][source]¶
Fetch the invoices added since this was last called.
The first call returns the last three months. Each call moves SanMar’s marker, so the invoices it returns are not returned again.
- headers_by_purchase_order(po_number: str) list[InvoiceHeader][source]¶
Fetch the invoice headers for one purchase order.
- headers_by_invoice_date(start: datetime.date, end: datetime.date) list[InvoiceHeader][source]¶
Fetch the invoice headers dated between two days, inclusive, up to a year apart.
- headers_by_order_date(order_date: datetime.date) list[InvoiceHeader][source]¶
Fetch the invoice headers for orders placed on one day.
- unpaid_headers() list[InvoiceHeader][source]¶
Fetch the headers of every unpaid invoice.
- class sanmar_sdk.standard.Party(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordWho an invoice is sold to, shipped to, or paid to.
- class sanmar_sdk.standard.PackingSlip(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordWhat is in one box SanMar shipped.
- ship_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- order_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- ship_from: PackingSlipParty | None = None[source]¶
- ship_to: PackingSlipParty | None = None[source]¶
- bill_to: PackingSlipParty | None = None[source]¶
- items: sanmar_sdk.base.OneOrMany[PackingSlipItem] = None[source]¶
- class sanmar_sdk.standard.PackingSlipAddress(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordA postal address on a packing slip.
- class sanmar_sdk.standard.PackingSlipItem(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordOne item in a box.
- class sanmar_sdk.standard.PackingSlipParty(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordWho a box ships from, ships to, or is billed to.
- address: PackingSlipAddress = None[source]¶
- class sanmar_sdk.standard.PackingSlipService(soap: SoapClient, credentials: Credentials)[source]¶
Bases:
sanmar_sdk._soap.ServiceSanMar’s packing slip service.
- get(license_plate: str) PackingSlip[source]¶
Look up what is in the box with the given license plate number.
License plate numbers start with LP, L, S or R, such as
LP000123456789.- Raises:
NotFoundError – If SanMar has no box with that number, or the box was shipped to someone else.
- class sanmar_sdk.standard.PriceQuote(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordThe prices of one style, color and size.
- catalog_color: str = None[source]¶
The catalog (mainframe) color, which web services and orders expect.
- piece_price: sanmar_sdk.base.Price = None[source]¶
The price per piece for five pieces or fewer of one style and color.
- case_price: sanmar_sdk.base.Price = None[source]¶
The price per piece when buying by the case.
- sale_price: sanmar_sdk.base.Price = None[source]¶
- sale_start_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- sale_end_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- my_price: sanmar_sdk.base.Price = None[source]¶
This account’s price.
- incentive_price: sanmar_sdk.base.Price = None[source]¶
- class sanmar_sdk.standard.PricingService(soap: SoapClient, credentials: Credentials)[source]¶
Bases:
sanmar_sdk._soap.ServiceSanMar’s own pricing service.
- get(style: str, *, catalog_color: str | None = None, size: str | None = None) list[PriceQuote][source]¶
Price a style, optionally narrowed to one catalog color, one size, or both.
- get_by_key(key: sanmar_sdk.common.SkuKey) list[PriceQuote][source]¶
Price one style, color and size by its inventory key and size index.
- get_many(queries: collections.abc.Sequence[sanmar_sdk.common.StyleQuery | sanmar_sdk.common.SkuKey]) list[PriceQuote][source]¶
Price several lookups in one call.
- class sanmar_sdk.standard.FileRequest(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordSanMar’s acknowledgement of a request for a product file.
SanMar writes the file to its SFTP server about 20 minutes later. Brand and category file names end with the date SanMar wrote them, so they are matched by pattern; read one with
sanmar_sdk.ftp.SanMarFTP.find()andproduct_information().
- class sanmar_sdk.standard.ProductImages(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordLinks to a product’s images and documents.
- class sanmar_sdk.standard.ProductInfo(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordOne style, color and size, as SanMar’s product information service describes it.
- catalog_color: str = None[source]¶
The catalog (mainframe) color, which web services and orders expect.
- unique_key: str = None[source]¶
SanMar’s identifier for this style, color and size, and the PromoStandards part id.
- keywords: sanmar_sdk.base.CommaSeparated = None[source]¶
- piece_weight: decimal.Decimal | None = None[source]¶
Approximate weight per piece in pounds.
- images: ProductImages = None[source]¶
- prices: ProductPrices = None[source]¶
- class sanmar_sdk.standard.ProductInfoService(soap: SoapClient, credentials: Credentials)[source]¶
Bases:
sanmar_sdk._soap.ServiceSanMar’s own product information service.
- get(style: str, *, catalog_color: str | None = None, size: str | None = None) list[ProductInfo][source]¶
Look up a style, optionally narrowed to one catalog color, one size, or both.
Returns one entry per matching style, color and size. The color must be the catalog (mainframe) color.
- get_many(queries: collections.abc.Sequence[sanmar_sdk.common.StyleQuery]) list[ProductInfo][source]¶
Look up several styles in one call.
- request_bulk_file() FileRequest[source]¶
Ask SanMar to write a file of its whole catalog. SanMar allows this once a month.
- request_delta_file() FileRequest[source]¶
Ask SanMar to write a file of what changed since the last bulk or delta file.
SanMar allows this once a day. The next delta starts from this one, so calling it consumes the changes it reports.
- request_brand_file(brand: str) FileRequest[source]¶
Ask SanMar to write a file of one brand’s products, such as
OGIO.
- request_category_file(category: str) FileRequest[source]¶
Ask SanMar to write a file of one category’s products, such as
Caps.
- class sanmar_sdk.standard.ProductPrices(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordA product’s list and sale prices.
- piece_price: sanmar_sdk.base.Price = None[source]¶
The price per piece for five pieces or fewer of one style and color.
- case_price: sanmar_sdk.base.Price = None[source]¶
The price per piece when buying by the case.
- piece_sale_price: sanmar_sdk.base.Price = None[source]¶
- case_sale_price: sanmar_sdk.base.Price = None[source]¶
- sale_start_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- sale_end_date: sanmar_sdk.base.SanMarDate | None = None[source]¶
- map_price: sanmar_sdk.base.Price = None[source]¶
The minimum advertised price.
- class sanmar_sdk.standard.LineAvailability(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordWhether one line of an order could ship, and from where.
- warehouse: sanmar_sdk.common.WarehouseNumber | None = None[source]¶
The warehouse SanMar would ship this line from.
- matches(item: sanmar_sdk.common.SkuKey | sanmar_sdk.common.StyleColorSize) bool[source]¶
Whether this line is for the given item.
- class sanmar_sdk.standard.OrderCheck(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordSanMar’s answer to whether an order could ship as it stands.
- 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
Noneif the order has no line for it.
- class sanmar_sdk.standard.PurchaseOrderService(soap: SoapClient, credentials: Credentials)[source]¶
Bases:
sanmar_sdk._soap.ServiceSanMar’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.availableand 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.