sanmar_sdk.standard.purchase_orders =================================== .. py:module:: sanmar_sdk.standard.purchase_orders .. autoapi-nested-parse:: SanMar's own purchase order service. :meth:`PurchaseOrderService.check` asks SanMar whether an order could ship, and from which warehouses, without placing it. :meth:`PurchaseOrderService.submit` places it. Both take the :class:`~sanmar_sdk.orders.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 ------- .. autoapisummary:: sanmar_sdk.standard.purchase_orders.LineAvailability sanmar_sdk.standard.purchase_orders.OrderCheck sanmar_sdk.standard.purchase_orders.PurchaseOrderService Module Contents --------------- .. 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.