print_packing_slip
Generate TCGplayer packing-slip PDFs for one or more order numbers and save them to a local folder for printing, with automatic format selection based on order total.
Instructions
Generate TCGplayer packing-slip PDF(s) for one or more order numbers by calling the Seller Portal's export API directly (bypasses the "Packing Slip" button, which stopped responding to automated clicks). Saves each PDF to a local packing-slips/ folder and returns its path — open or print that file yourself. If format is omitted, it's chosen automatically per order from tcgplayer_orders.order_total: orders below $20 print as "LeftWindowedEnvelope" (single #10 windowed envelope), orders at or above that print as "Default" (standard full-page). A mixed batch under auto mode is split into one export call per format, producing multiple PDFs. Pass format explicitly to force one format for every requested order instead. Requires TCGPLAYER_COOKIE in .env: a session cookie captured from a logged-in Seller Portal tab (DevTools → Network → any request → Copy as cURL → take the Cookie header value). That cookie expires/rotates periodically — a 401/403 here means it needs refreshing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Optional explicit override applied to every order in the request. "Default" is the standard full-page packing slip. "LeftWindowedEnvelope" is the Seller Portal's "Print #10 Left Window (Single)" option. Omit to auto-select per order by order_total (see tool description). | |
| order_numbers | Yes | One or more order_number values, e.g. ["F0DFDDC3-36957C-6C74A"]. |