Pricing¶
SanMar updates list and case prices once or twice a year, and sale prices every Monday and
Wednesday. For the whole catalog, read sanmar_dip.txt (piece, case and sale prices,
hourly) or ask SanMar to set up the daily customer pricing files; use the services for
individual styles.
SanMar’s pricing service¶
get() prices a style, narrowed by catalog color,
size, or both. Each PriceQuote carries SanMar’s piece, case
and sale prices, and my_price, this account’s own price:
for quote in sanmar.pricing.get("K500", catalog_color="Black"):
print(quote.size, quote.piece_price, quote.case_price, quote.my_price)
Price one item by its key with get_by_key(), or
several lookups at once with get_many().
Prices are Decimal. Where SanMar has no price it writes NA or
NLA; the SDK reads those as None.
PromoStandards Pricing and Configuration¶
get() prices every part of a style, or one
part, at the price type you ask for:
from sanmar_sdk.promostandards import PriceType
for part in sanmar.promostandards.pricing.get("K500", price_type=PriceType.NET):
for price in part.prices:
print(part.part_id, price.min_quantity, price.price, price.uom)
NETis this account’s cost.LISTis SanMar’s suggested retail price.CUSTOMERis special pricing SanMar has set up for the account.
PromoStandards prices by FOB point, which for SanMar is a warehouse. SanMar’s prices do
not vary by warehouse, so the SDK sends Seattle unless told otherwise.
fob_points() lists the warehouses; SanMar
asks that it be called no more than once a week.
Customer pricing files¶
On request, SanMar writes customer pricing files to the account’s outbound SFTP folder
every night after 2 AM Pacific. Read them with read_customer_prices()
and read_price_changes():
File |
What |
|---|---|
|
The lowest price available to the account, for the whole catalog. |
|
Special program pricing, for the whole catalog, or 0 where there is none. |
|
The lowest price, for only what changed since the day before. The first file has everything. |
Where the outbound folder is depends on how SanMar sets the account up;
list_folder() shows what is there. Then:
from sanmar_sdk.ftp import read_price_changes
with ftp.stream("sanmar_dpc.csv", read_price_changes) as changes:
for change in changes:
print(change.unique_key, change.my_price)