sanmar_sdk.ftp.orders¶
Ordering through order files on SanMar’s SFTP server, and the files SanMar writes back.
An SFTP order is three comma-delimited ASCII files that share a batch name:
<batch>CustInfo.txtships each purchase order somewhere,<batch>Details.txtlists what each purchase order is for, by inventory key and size index only, and<batch>Release<n>.txtreleases some or all of the batch’s purchase orders for processing, any time up to two weeks after the other two were uploaded.
Within about 15 minutes SanMar acknowledges an uploaded batch with a Holding file that says, line by line, which warehouse will ship it and whether the stock is there. Orders shipped each day are listed in a tab-delimited daily status file, where SanMar has set one up.
SFTP orders go straight to SanMar’s production system; there is no test environment.
Attributes¶
The order files allow six digits for an inventory key. |
|
A Holding file, per the example in the Purchase Order Integration Guide v24.5. |
|
The daily shipment status file, per the FTP Integration Guide v23.6. |
Classes¶
The two files that place a batch of orders: names and contents. |
|
One line of SanMar's acknowledgement of an SFTP order. |
|
One line of one box in SanMar's daily shipment status file. |
Functions¶
|
Build the |
|
Build the file that releases some or all of a batch's orders, as |
|
Stream a Holding file, one order line at a time. |
|
Stream a daily shipment status file, one line of one box at a time. |
Module Contents¶
- sanmar_sdk.ftp.orders.MAX_INVENTORY_KEY = 999999[source]¶
The order files allow six digits for an inventory key.
- sanmar_sdk.ftp.orders.HOLDING_COLUMNS = ('ponum', 'style', 'color', 'size', 'qty', 'whse_no', 'availability')[source]¶
A Holding file, per the example in the Purchase Order Integration Guide v24.5.
The guide’s field table omits the size its example includes.
- sanmar_sdk.ftp.orders.SHIPMENT_STATUS_COLUMNS = ('customer_po', 'salesorder#', 'ship_from', 'ship_date', 'ship_to_name', 'attention',...[source]¶
The daily shipment status file, per the FTP Integration Guide v23.6.
- class sanmar_sdk.ftp.orders.OrderFiles[source]¶
The two files that place a batch of orders: names and contents.
- sanmar_sdk.ftp.orders.render_order_files(batch: str, orders: collections.abc.Sequence[sanmar_sdk.orders.PurchaseOrder]) OrderFiles[source]¶
Build the
CustInfo.txtandDetails.txtfiles for a batch of orders.- Parameters:
batch – The batch name, unique for every batch ever sent. SanMar suggests the date and a running number for the day, such as
06-07-2022-1.orders – The purchase orders in the batch. Items must be named by
SkuKey, and each order needs a ship-to email.
- sanmar_sdk.ftp.orders.render_release_file(batch: str, po_numbers: collections.abc.Sequence[str], release_number: int = 1) tuple[str, str][source]¶
Build the file that releases some or all of a batch’s orders, as
(name, contents).Each release of a batch gets the next
release_number, starting at 1. PO numbers are checked as aPurchaseOrderchecks its own.
- class sanmar_sdk.ftp.orders.HoldingLine(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordOne line of SanMar’s acknowledgement of an SFTP order.
- warehouse: sanmar_sdk.common.WarehouseNumber = None[source]¶
The warehouse SanMar will ship this line from.
- class sanmar_sdk.ftp.orders.ShipmentStatus(/, **data: Any)[source]¶
Bases:
sanmar_sdk.base.RecordOne line of one box in SanMar’s daily shipment status file.
- ship_date: sanmar_sdk.base.SanMarDate[source]¶
- sub_total: sanmar_sdk.base.Price = None[source]¶
- freight: sanmar_sdk.base.Price = None[source]¶
- handling_fee: sanmar_sdk.base.Price = None[source]¶
- invoice_total: sanmar_sdk.base.Price = None[source]¶
- sanmar_sdk.ftp.orders.read_holding(source: sanmar_sdk.ftp.readers.Source, *, encoding: str = 'utf-8-sig') collections.abc.Iterator[HoldingLine][source]¶
Stream a Holding file, one order line at a time.
- sanmar_sdk.ftp.orders.read_shipment_status(source: sanmar_sdk.ftp.readers.Source, *, encoding: str = 'utf-8-sig') collections.abc.Iterator[ShipmentStatus][source]¶
Stream a daily shipment status file, one line of one box at a time.