sanmar_sdk.standard =================== .. py:module:: sanmar_sdk.standard .. autoapi-nested-parse:: SanMar's own web services, as opposed to its PromoStandards ones. Each is reached through an attribute of :class:`~sanmar_sdk.client.SanMar`, such as ``sanmar.products`` or ``sanmar.purchase_orders``. They take the SanMar customer number as well as the SanMar.com login. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/sanmar_sdk/standard/inventory/index /autoapi/sanmar_sdk/standard/invoices/index /autoapi/sanmar_sdk/standard/packing_slips/index /autoapi/sanmar_sdk/standard/pricing/index /autoapi/sanmar_sdk/standard/products/index /autoapi/sanmar_sdk/standard/purchase_orders/index Classes ------- .. autoapisummary:: sanmar_sdk.standard.InventoryService sanmar_sdk.standard.SkuStock sanmar_sdk.standard.WarehouseStock sanmar_sdk.standard.Address sanmar_sdk.standard.Invoice sanmar_sdk.standard.InvoiceHeader sanmar_sdk.standard.InvoiceLine sanmar_sdk.standard.InvoiceService sanmar_sdk.standard.Party sanmar_sdk.standard.PackingSlip sanmar_sdk.standard.PackingSlipAddress sanmar_sdk.standard.PackingSlipItem sanmar_sdk.standard.PackingSlipParty sanmar_sdk.standard.PackingSlipService sanmar_sdk.standard.PriceQuote sanmar_sdk.standard.PricingService sanmar_sdk.standard.FileRequest sanmar_sdk.standard.ProductImages sanmar_sdk.standard.ProductInfo sanmar_sdk.standard.ProductInfoService sanmar_sdk.standard.ProductPrices sanmar_sdk.standard.LineAvailability sanmar_sdk.standard.OrderCheck sanmar_sdk.standard.PurchaseOrderService Package Contents ---------------- .. py:class:: InventoryService(soap: SoapClient, credentials: Credentials) Bases: :py:obj:`sanmar_sdk._soap.Service` SanMar's own inventory service. .. py:method:: get(style: str, *, catalog_color: str | None = None, size: str | None = None) -> list[SkuStock] Look up stock by warehouse for a style, one catalog color, one size, or both. The color must be the catalog (mainframe) color, not the display name. .. py:method:: get_quantity(style: str, catalog_color: str, size: str, warehouse: sanmar_sdk.common.Warehouse | int) -> int Look up the stock of one style, catalog color and size at one warehouse. .. py:class:: SkuStock(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` Stock of one style, color and size, warehouse by warehouse. .. py:attribute:: style :type: str .. py:attribute:: catalog_color :type: str :value: None The catalog (mainframe) color, which web services and orders expect. .. py:attribute:: size :type: str .. py:attribute:: warehouses :type: sanmar_sdk.base.OneOrMany[WarehouseStock] :value: None .. py:property:: total :type: int Stock across every warehouse. .. py:class:: WarehouseStock(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` Stock of one style, color and size at one warehouse. .. py:attribute:: warehouse :type: sanmar_sdk.common.WarehouseNumber :value: None .. py:attribute:: quantity :type: int :value: None Stock at this warehouse, capped by SanMar. .. py:attribute:: name :type: str | None :value: None .. py:class:: Address(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` A postal address on an invoice. .. py:attribute:: address1 :type: str | None :value: None .. py:attribute:: address2 :type: str | None :value: None .. py:attribute:: address3 :type: str | None :value: None .. py:attribute:: city :type: str | None :value: None .. py:attribute:: state :type: str | None :value: None .. py:attribute:: postal_code :type: str | None :value: None .. py:attribute:: country :type: str | None :value: None .. py:class:: Invoice(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` One SanMar invoice, with its lines. .. py:attribute:: header :type: InvoiceHeader :value: None .. py:attribute:: lines :type: sanmar_sdk.base.OneOrMany[InvoiceLine] :value: None .. py:class:: InvoiceHeader(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` The header of one SanMar invoice. .. py:attribute:: invoice_number :type: int :value: None .. py:attribute:: invoice_date :type: sanmar_sdk.base.SanMarDate :value: None .. py:attribute:: sales_order_number :type: int | None :value: None .. py:attribute:: status :type: str | None :value: None ``Paid`` or ``Unpaid``. .. py:attribute:: is_credit_memo :type: bool :value: None .. py:attribute:: customer_number :type: int | None :value: None .. py:attribute:: po_number :type: str | None :value: None .. py:attribute:: order_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: due_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: sold_to :type: Party | None :value: None .. py:attribute:: ship_to :type: Party | None :value: None .. py:attribute:: remit_to :type: Party | None :value: None .. py:attribute:: ship_via :type: str | None :value: None .. py:attribute:: fob :type: str | None :value: None The shipping point, such as ``SPARKS NV``. .. py:attribute:: terms :type: str | None :value: None .. py:attribute:: department :type: str | None :value: None .. py:attribute:: total_cases :type: int | None :value: None .. py:attribute:: total_weight :type: int | None :value: None .. py:attribute:: subtotal :type: decimal.Decimal | None :value: None .. py:attribute:: sales_tax :type: decimal.Decimal | None :value: None .. py:attribute:: shipping_and_handling :type: decimal.Decimal | None :value: None .. py:attribute:: total :type: decimal.Decimal | None :value: None .. py:attribute:: freight_savings :type: decimal.Decimal | None :value: None .. py:class:: InvoiceLine(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` One line of a SanMar invoice. .. py:attribute:: style :type: str | None :value: None .. py:attribute:: catalog_color :type: str | None :value: None The color as SanMar's order system records it, which is the catalog (mainframe) color. .. py:attribute:: size :type: str | None :value: None .. py:attribute:: description :type: str | None :value: None .. py:attribute:: quantity :type: int :value: None .. py:attribute:: unit_price :type: decimal.Decimal | None :value: None .. py:attribute:: amount :type: decimal.Decimal | None :value: None .. py:attribute:: unique_key :type: str | None :value: None .. py:class:: InvoiceService(soap: SoapClient, credentials: Credentials) Bases: :py:obj:`sanmar_sdk._soap.Service` SanMar's own invoicing service. .. py:method:: get(invoice_number: int) -> Invoice Fetch one invoice by its number. :raises ~sanmar_sdk.exceptions.NotFoundError: If SanMar has no invoice with that number. .. py:method:: by_purchase_order(po_number: str) -> list[Invoice] Fetch the invoices for one purchase order. SanMar matches at most the first 13 characters of a PO number here. .. py:method:: by_invoice_date(start: datetime.date, end: datetime.date) -> list[Invoice] Fetch the invoices dated between two days, inclusive, up to three months apart. .. py:method:: by_order_date(order_date: datetime.date) -> list[Invoice] Fetch the invoices for orders placed on one day. .. py:method:: unpaid() -> list[Invoice] Fetch every unpaid invoice. .. py:method:: since_last_call() -> list[Invoice] 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. .. py:method:: headers_by_purchase_order(po_number: str) -> list[InvoiceHeader] Fetch the invoice headers for one purchase order. .. py:method:: headers_by_invoice_date(start: datetime.date, end: datetime.date) -> list[InvoiceHeader] Fetch the invoice headers dated between two days, inclusive, up to a year apart. .. py:method:: headers_by_order_date(order_date: datetime.date) -> list[InvoiceHeader] Fetch the invoice headers for orders placed on one day. .. py:method:: unpaid_headers() -> list[InvoiceHeader] Fetch the headers of every unpaid invoice. .. py:class:: Party(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` Who an invoice is sold to, shipped to, or paid to. .. py:attribute:: name :type: str | None :value: None .. py:attribute:: address :type: Address :value: None .. py:class:: PackingSlip(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` What is in one box SanMar shipped. .. py:attribute:: license_plate :type: str :value: None .. py:attribute:: ship_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: box_number :type: int | None :value: None Which box of the shipment this is. .. py:attribute:: box_count :type: int | None :value: None How many boxes the shipment has. .. py:attribute:: order_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: order_number :type: int | None :value: None SanMar's sales order number. .. py:attribute:: invoice_number :type: int | None :value: None .. py:attribute:: po_number :type: str | None :value: None .. py:attribute:: ship_from :type: PackingSlipParty | None :value: None .. py:attribute:: ship_to :type: PackingSlipParty | None :value: None .. py:attribute:: bill_to :type: PackingSlipParty | None :value: None .. py:attribute:: weight :type: float | None :value: None .. py:attribute:: weight_unit :type: str | None :value: None .. py:attribute:: carrier :type: str | None :value: None .. py:attribute:: shipping_method :type: str | None :value: None .. py:attribute:: tracking_number :type: str | None :value: None .. py:attribute:: items :type: sanmar_sdk.base.OneOrMany[PackingSlipItem] :value: None .. py:class:: PackingSlipAddress(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` A postal address on a packing slip. .. py:attribute:: line1 :type: str | None :value: None .. py:attribute:: line2 :type: str | None :value: None .. py:attribute:: line3 :type: str | None :value: None .. py:attribute:: city :type: str | None :value: None .. py:attribute:: state :type: str | None :value: None .. py:attribute:: postal_code :type: str | None :value: None .. py:attribute:: country :type: str | None :value: None .. py:attribute:: residential :type: bool | None :value: None .. py:class:: PackingSlipItem(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` One item in a box. .. py:attribute:: unique_key :type: str | None :value: None SanMar's identifier for this style, color and size. .. py:attribute:: style :type: str | None :value: None .. py:attribute:: catalog_color :type: str | None :value: None The color as SanMar's warehouse records it, which is the catalog (mainframe) color. .. py:attribute:: size :type: str | None :value: None .. py:attribute:: description :type: str | None :value: None .. py:attribute:: quantity :type: int :value: None .. py:attribute:: gtin :type: str | None :value: None .. py:class:: PackingSlipParty(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` Who a box ships from, ships to, or is billed to. .. py:attribute:: name :type: str | None :value: None .. py:attribute:: address :type: PackingSlipAddress :value: None .. py:attribute:: contact_name :type: str | None :value: None .. py:class:: PackingSlipService(soap: SoapClient, credentials: Credentials) Bases: :py:obj:`sanmar_sdk._soap.Service` SanMar's packing slip service. .. py:method:: get(license_plate: str) -> PackingSlip 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 ~sanmar_sdk.exceptions.NotFoundError: If SanMar has no box with that number, or the box was shipped to someone else. .. py:class:: PriceQuote(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` The prices of one style, color and size. .. py:attribute:: style :type: str .. py:attribute:: catalog_color :type: str :value: None The catalog (mainframe) color, which web services and orders expect. .. py:attribute:: size :type: str .. py:attribute:: inventory_key :type: int :value: None .. py:attribute:: size_index :type: int :value: None .. py:attribute:: piece_price :type: sanmar_sdk.base.Price :value: None The price per piece for five pieces or fewer of one style and color. .. py:attribute:: case_price :type: sanmar_sdk.base.Price :value: None The price per piece when buying by the case. .. py:attribute:: sale_price :type: sanmar_sdk.base.Price :value: None .. py:attribute:: sale_start_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: sale_end_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: my_price :type: sanmar_sdk.base.Price :value: None This account's price. .. py:attribute:: incentive_price :type: sanmar_sdk.base.Price :value: None .. py:class:: PricingService(soap: SoapClient, credentials: Credentials) Bases: :py:obj:`sanmar_sdk._soap.Service` SanMar's own pricing service. .. py:method:: get(style: str, *, catalog_color: str | None = None, size: str | None = None) -> list[PriceQuote] Price a style, optionally narrowed to one catalog color, one size, or both. .. py:method:: get_by_key(key: sanmar_sdk.common.SkuKey) -> list[PriceQuote] Price one style, color and size by its inventory key and size index. .. py:method:: get_many(queries: collections.abc.Sequence[sanmar_sdk.common.StyleQuery | sanmar_sdk.common.SkuKey]) -> list[PriceQuote] Price several lookups in one call. .. py:class:: FileRequest(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` SanMar'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 :meth:`sanmar_sdk.ftp.SanMarFTP.find` and :meth:`~sanmar_sdk.ftp.SanMarFTP.product_information`. .. py:attribute:: folder :type: str .. py:attribute:: file_pattern :type: str The file's name, or a shell-style pattern where SanMar dates it. .. py:attribute:: message :type: str | None :value: None .. py:class:: ProductImages(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` Links to a product's images and documents. .. py:attribute:: product :type: str | None :value: None .. py:attribute:: thumbnail :type: str | None :value: None .. py:attribute:: color_product :type: str | None :value: None .. py:attribute:: color_product_thumbnail :type: str | None :value: None .. py:attribute:: color_square :type: str | None :value: None .. py:attribute:: color_swatch :type: str | None :value: None .. py:attribute:: brand_logo :type: str | None :value: None .. py:attribute:: front_model :type: str | None :value: None .. py:attribute:: back_model :type: str | None :value: None .. py:attribute:: side_model :type: str | None :value: None .. py:attribute:: three_quarter_model :type: str | None :value: None .. py:attribute:: front_flat :type: str | None :value: None .. py:attribute:: back_flat :type: str | None :value: None .. py:attribute:: spec_sheet :type: str | None :value: None .. py:class:: ProductInfo(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` One style, color and size, as SanMar's product information service describes it. .. py:attribute:: style :type: str :value: None .. py:attribute:: catalog_color :type: str :value: None The catalog (mainframe) color, which web services and orders expect. .. py:attribute:: size :type: str :value: None .. py:attribute:: unique_key :type: str :value: None SanMar's identifier for this style, color and size, and the PromoStandards part id. .. py:attribute:: inventory_key :type: int :value: None .. py:attribute:: size_index :type: int :value: None .. py:attribute:: color_name :type: str | None :value: None The full color name, for display only. .. py:attribute:: title :type: str | None :value: None .. py:attribute:: description :type: str | None :value: None .. py:attribute:: brand :type: str | None :value: None .. py:attribute:: category :type: str | None :value: None .. py:attribute:: status :type: str | None :value: None Coming Soon, New, Active, Regular, or Discontinued. .. py:attribute:: available_sizes :type: str | None :value: None .. py:attribute:: keywords :type: sanmar_sdk.base.CommaSeparated :value: None .. py:attribute:: case_size :type: int | None :value: None .. py:attribute:: piece_weight :type: decimal.Decimal | None :value: None Approximate weight per piece in pounds. .. py:attribute:: images :type: ProductImages :value: None .. py:attribute:: prices :type: ProductPrices :value: None .. py:class:: ProductInfoService(soap: SoapClient, credentials: Credentials) Bases: :py:obj:`sanmar_sdk._soap.Service` SanMar's own product information service. .. py:method:: get(style: str, *, catalog_color: str | None = None, size: str | None = None) -> list[ProductInfo] 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. .. py:method:: get_many(queries: collections.abc.Sequence[sanmar_sdk.common.StyleQuery]) -> list[ProductInfo] Look up several styles in one call. .. py:method:: request_bulk_file() -> FileRequest Ask SanMar to write a file of its whole catalog. SanMar allows this once a month. .. py:method:: request_delta_file() -> FileRequest 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. .. py:method:: request_brand_file(brand: str) -> FileRequest Ask SanMar to write a file of one brand's products, such as ``OGIO``. .. py:method:: request_category_file(category: str) -> FileRequest Ask SanMar to write a file of one category's products, such as ``Caps``. .. py:class:: ProductPrices(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` A product's list and sale prices. .. py:attribute:: piece_price :type: sanmar_sdk.base.Price :value: None The price per piece for five pieces or fewer of one style and color. .. py:attribute:: case_price :type: sanmar_sdk.base.Price :value: None The price per piece when buying by the case. .. py:attribute:: piece_sale_price :type: sanmar_sdk.base.Price :value: None .. py:attribute:: case_sale_price :type: sanmar_sdk.base.Price :value: None .. py:attribute:: sale_start_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: sale_end_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: map_price :type: sanmar_sdk.base.Price :value: None The minimum advertised price. .. py:attribute:: price_code :type: str | None :value: None The suggested retail pricing code. A/P is 50%, B/Q 45%, C/R 40%, D/S 35%, E/T 30%. .. py:attribute:: price_text :type: str | None :value: None Which sizes the price applies to. .. py:class:: LineAvailability(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` Whether one line of an order could ship, and from where. .. py:attribute:: style :type: str | None :value: None .. py:attribute:: catalog_color :type: str | None :value: None .. py:attribute:: size :type: str | None :value: None .. py:attribute:: inventory_key :type: int | None :value: None .. py:attribute:: size_index :type: int | None :value: None .. py:attribute:: quantity :type: int .. py:attribute:: warehouse :type: sanmar_sdk.common.WarehouseNumber | None :value: None The warehouse SanMar would ship this line from. .. py:attribute:: error :type: bool :value: None .. py:attribute:: message :type: str | None :value: None SanMar's explanation, such as which warehouse has the stock. .. py:property:: available :type: bool Whether the requested quantity is in stock. .. py:method:: matches(item: sanmar_sdk.common.SkuKey | sanmar_sdk.common.StyleColorSize) -> bool Whether this line is for the given item. .. py:class:: OrderCheck(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` SanMar's answer to whether an order could ship as it stands. .. py:attribute:: available :type: bool Whether every line is in stock. .. py:attribute:: message :type: str | None :value: None .. py:attribute:: lines :type: sanmar_sdk.base.OneOrMany[LineAvailability] :value: None .. py:method:: line_for(item: sanmar_sdk.common.SkuKey | sanmar_sdk.common.StyleColorSize) -> LineAvailability | None Find the line for an item, or ``None`` if the order has no line for it. .. py:class:: PurchaseOrderService(soap: SoapClient, credentials: Credentials) Bases: :py:obj:`sanmar_sdk._soap.Service` SanMar's own purchase order service. .. py:method:: check(order: sanmar_sdk.orders.PurchaseOrder) -> OrderCheck Ask whether an order could ship, and from where, without placing it. Being out of stock is an answer, not an error: see :attr:`OrderCheck.available` and each line's message. .. py:method:: submit(order: sanmar_sdk.orders.PurchaseOrder) -> str 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 :meth:`check` if the account splits orders across warehouses.