sanmar_sdk.common ================= .. py:module:: sanmar_sdk.common .. autoapi-nested-parse:: Types shared across SanMar's services and files. The identifiers here are the ones SanMar's services actually match on. SanMar has two color names for every product, and only one of them works in a request: - ``catalog_color`` is SanMar's *catalog* or *mainframe* color: the abbreviated name in the ``SANMAR_MAINFRAME_COLOR`` column of ``SanMar_SDL_N.csv`` (``CATALOG_COLOR`` in the SanMarPI files, ``colorName`` in PromoStandards). Every lookup and every order uses it. - ``color_name`` is the full display name (``COLOR_NAME``, ``standardColorName``). It is for showing to people, and SanMar rejects it in requests: "Athletic Hthr" works where "Athletic Heather" does not. The SDK never mixes the two: a field called ``catalog_color`` is always the catalog color. Attributes ---------- .. autoapisummary:: sanmar_sdk.common.WarehouseNumber Classes ------- .. autoapisummary:: sanmar_sdk.common.Environment sanmar_sdk.common.Warehouse sanmar_sdk.common.ShipMethod sanmar_sdk.common.WillCall sanmar_sdk.common.ShipTo sanmar_sdk.common.SkuKey sanmar_sdk.common.StyleColorSize sanmar_sdk.common.StyleQuery Module Contents --------------- .. py:class:: Environment Bases: :py:obj:`enum.StrEnum` Which of SanMar's two web service environments to call. .. py:attribute:: PRODUCTION :value: 'https://ws.sanmar.com:8080' .. py:attribute:: EDEV :value: 'https://edev-ws.sanmar.com:8080' SanMar's test environment. It needs its own credentials, requested from sanmarintegrations@sanmar.com, and its products, prices and inventory may not match production. .. py:class:: Warehouse Bases: :py:obj:`enum.IntEnum` A SanMar warehouse, numbered as SanMar numbers them. The number is also the warehouse's PromoStandards FOB id. .. py:attribute:: SEATTLE :value: 1 .. py:attribute:: CINCINNATI :value: 2 .. py:attribute:: DALLAS :value: 3 .. py:attribute:: RENO :value: 4 .. py:attribute:: ROBBINSVILLE :value: 5 .. py:attribute:: JACKSONVILLE :value: 6 .. py:attribute:: MINNEAPOLIS :value: 7 .. py:attribute:: PHOENIX :value: 12 .. py:attribute:: RICHMOND :value: 31 .. py:property:: code :type: str The warehouse's will-call code, which goes in the ship method field. .. py:property:: city :type: str The city the warehouse is in. .. py:property:: state :type: str The two-letter state the warehouse is in. .. py:data:: WarehouseNumber A warehouse number as SanMar reports it. A known warehouse parses to :class:`Warehouse`. A number SanMar has added since this SDK was released stays a plain ``int`` rather than failing the whole response. .. py:class:: ShipMethod Bases: :py:obj:`enum.StrEnum` How SanMar ships an order. The value is the ship method as SanMar's own order services and order files spell it. PromoStandards orders split it into a carrier and a service; see :meth:`promostandards_freight`. .. py:attribute:: UPS_GROUND :value: 'UPS' .. py:attribute:: UPS_2ND_DAY :value: 'UPS 2ND DAY' .. py:attribute:: UPS_2ND_DAY_AM :value: 'UPS 2ND DAY AM' .. py:attribute:: UPS_3RD_DAY :value: 'UPS 3RD DAY' .. py:attribute:: UPS_NEXT_DAY :value: 'UPS NEXT DAY' .. py:attribute:: UPS_NEXT_DAY_EARLY_AM :value: 'UPS NEXT DAY EA' .. py:attribute:: UPS_NEXT_DAY_SAVER :value: 'UPS NEXT DAY SV' .. py:attribute:: UPS_SATURDAY :value: 'UPS SATURDAY' .. py:attribute:: USPS_GROUND_ADVANTAGE :value: 'USPS PP' .. py:attribute:: USPS_PRIORITY_MAIL :value: 'USPS APP' .. py:attribute:: PSST :value: 'PSST' SanMar's Pack Separately, Ship Together program. The ship-to must exactly match the address SanMar has on file. .. py:attribute:: TRUCK :value: 'TRUCK' Truck freight, for orders over 500 pounds. Not available through PromoStandards. .. py:method:: promostandards_freight() -> tuple[str, str] Return the PromoStandards ``(carrier, service)`` pair for this ship method. :raises ValueError: If SanMar does not offer the ship method through PromoStandards. .. py:class:: WillCall(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Model` Pick an order up from a warehouse instead of having it shipped. Only SanMar's own order services and order files support will call, and only for accounts SanMar has set up for warehouse selection. .. py:attribute:: warehouse :type: Warehouse .. py:property:: ship_method :type: str The value SanMar expects in the ship method field. .. py:class:: ShipTo(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Model` Where an order ships. Field lengths are the tightest limits across SanMar's order services and order files. .. py:attribute:: address1 :type: Annotated[str, Field(min_length=1, max_length=35), sanmar_sdk.base.ORDER_TEXT] The street address. SanMar asks for the abbreviations ST, AVE, RD, DR and BLVD. .. py:attribute:: city :type: Annotated[str, Field(min_length=1, max_length=28), sanmar_sdk.base.ORDER_TEXT] .. py:attribute:: state :type: str :value: None The two-letter state abbreviation. .. py:attribute:: zip_code :type: str :value: None A five-digit ZIP code, or ZIP+4 with or without the dash. .. py:attribute:: company :type: Annotated[str, Field(min_length=1, max_length=28), sanmar_sdk.base.ORDER_TEXT] | None :value: None .. py:attribute:: attention :type: Annotated[str, Field(min_length=1, max_length=35), sanmar_sdk.base.ORDER_TEXT] | None :value: None The receiver's name, or the PO number. .. py:attribute:: address2 :type: Annotated[str, Field(min_length=1, max_length=35), sanmar_sdk.base.ORDER_TEXT] | None :value: None The suite or apartment number. .. py:attribute:: email :type: Annotated[str, Field(min_length=3, max_length=105), sanmar_sdk.base.ORDER_TEXT] | None :value: None Where SanMar sends the order confirmation and shipping notification. When omitted, SanMar uses the default email on the account. .. py:attribute:: phone :type: Annotated[str, Field(min_length=1, max_length=32), sanmar_sdk.base.ORDER_TEXT] | None :value: None The receiver's phone number. Only PromoStandards orders carry it. .. py:attribute:: residential :type: bool :value: False .. py:attribute:: country :type: str :value: None .. py:class:: SkuKey(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Model` SanMar's own key for one style, color and size. ``INVENTORY_KEY`` and ``SIZE_INDEX`` are in every SanMar product file. The inventory key is not the style number. SanMar recommends ordering by key rather than by style, color and size, because it cannot be misspelled. .. py:attribute:: inventory_key :type: int :value: None .. py:attribute:: size_index :type: int :value: None .. py:class:: StyleColorSize(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Model` One style, color and size, named the way SanMar's order services expect. .. py:attribute:: style :type: str :value: None The style number, as printed in SanMar's catalog (``K500``). .. py:attribute:: catalog_color :type: str :value: None The catalog (mainframe) color, not the display color name. .. py:attribute:: size :type: str :value: None .. py:class:: StyleQuery(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Model` A style to look up, optionally narrowed to one catalog color, one size, or both. .. py:attribute:: style :type: str :value: None The style number, as printed in SanMar's catalog (``K500``). .. py:attribute:: catalog_color :type: Annotated[str, Field(min_length=1, max_length=50)] | None :value: None The catalog (mainframe) color, not the display color name. .. py:attribute:: size :type: Annotated[str, Field(min_length=1, max_length=50)] | None :value: None