BrickLink
Use scripts/bricklink.py.
Setup
See SETUP.md for prerequisites and setup instructions.
Commands
Read-only
- -
bricklink.py get-orders [--direction in|out] [--status ...] [--include-status ...] [--exclude-status ...] [--filed true|false] - Lists orders you received or placed. - INLINECODE2 - Fetches details for a specific order.
- INLINECODE3 - Fetches the item batches for a specific order.
- INLINECODE4 - Fetches messages associated with a specific order.
- INLINECODE5 - Fetches feedback associated with a specific order.
- -
bricklink.py get-feedback [--direction in|out] - Lists feedback you received (in) or posted (out). - INLINECODE9 - Fetches a single feedback entry by id.
- -
bricklink.py get-notifications - Lists unread push notifications (/notifications).
- -
bricklink.py get-categories - Lists all catalog categories. - INLINECODE13 - Fetches a single category by id.
- -
bricklink.py get-colors - Lists all catalog colors. - INLINECODE15 - Fetches a single color by id.
- -
bricklink.py get-inventories [--item-type ...] [--status ...] [--category-id ...] [--color-id ...] - Lists your store inventory lots (supports include/exclude filters). - INLINECODE17 - Fetches a single inventory lot by id.
- -
bricklink.py get-item <type> <no> - Fetches a catalog item (PART/SET/MINIFIG/…). - INLINECODE19 - Lists items that contain the specified item.
- INLINECODE20 - Parts out an item into its included items.
- INLINECODE21 - Fetches price guide statistics.
- INLINECODE22 - Lists known colors for a catalog item.
Mutating
Note: Order mutations (update-order, update-order-status, update-payment-status) only work for store orders (direction=out, where you are the seller). Purchases (direction=in) return 404 — the BrickLink API does not allow buyers to modify order status or file/archive incoming orders. Use the BrickLink website for those.
- -
bricklink.py update-order <order_id> [--remarks ...] [--is-filed true|false] [--shipping-...] [--cost-...] — Updates allowed order fields (tracking, remarks, shipping/cost fields). Store orders only. - INLINECODE24 — Updates the status of an order. Store orders only.
- INLINECODE25 — Updates the payment status of an order. Store orders only.
- INLINECODE26 — Sends a "Drive Thru" email for an order.
- -
bricklink.py post-feedback --order-id N --rating 0|1|2 [--comment ...] - Posts new feedback for an order. - INLINECODE28 - Replies to feedback you received.
- -
bricklink.py create-inventory [--item-type ... --item-no ... --color-id N --quantity N --unit-price ... --new-or-used N|U ...] - Creates a single inventory lot from flags. - INLINECODE30 - Creates multiple inventory lots from a validated JSON file (workspace or /tmp only).
- INLINECODE31 - Updates an inventory lot.
- INLINECODE32 - Deletes an inventory lot.
Utilities
- -
bricklink.py order-detail-html <order_id> [--out path] [--inline-images] - Fetches order+items and renders a compact HTML view (similar to BrickLink orderDetail.asp).
BrickLink
使用 scripts/bricklink.py。
设置
请参阅 SETUP.md 了解前提条件和设置说明。
命令
只读
- - bricklink.py get-orders [--direction in|out] [--status ...] [--include-status ...] [--exclude-status ...] [--filed true|false] - 列出您收到或下达的订单。
- bricklink.py get-order id> - 获取特定订单的详细信息。
- bricklink.py get-order-items id> - 获取特定订单的物品批次。
- bricklink.py get-order-messages id> - 获取与特定订单相关的消息。
- bricklink.py get-order-feedback id> - 获取与特定订单相关的反馈。
- - bricklink.py get-feedback [--direction in|out] - 列出您收到的(in)或发布的(out)反馈。
- bricklink.py get-feedback-item - 按ID获取单条反馈记录。
- - bricklink.py get-notifications - 列出未读的推送通知(/notifications)。
- - bricklink.py get-categories - 列出所有目录分类。
- bricklink.py get-category - 按ID获取单个分类。
- - bricklink.py get-colors - 列出所有目录颜色。
- bricklink.py get-color - 按ID获取单个颜色。
- - bricklink.py get-inventories [--item-type ...] [--status ...] [--category-id ...] [--color-id ...] - 列出您店铺的库存批次(支持包含/排除筛选)。
- bricklink.py get-inventory - 按ID获取单个库存批次。
- - bricklink.py get-item - 获取目录物品(PART/SET/MINIFIG/…)。
- bricklink.py get-supersets [--color-id N] - 列出包含指定物品的物品。
- bricklink.py get-subsets [--color-id N] [--box true|false] [--instruction true|false] [--break-minifigs true|false] [--break-subsets true|false] - 将一个物品拆分为其包含的子物品。
- bricklink.py get-price-guide [--color-id N] [--guide-type stock|sold] [--new-or-used N|U] [--country-code XX] [--region ...] [--currency-code XXX] [--vat N|Y|O] - 获取价格指南统计数据。
- bricklink.py get-known-colors - 列出目录物品的已知颜色。
修改
注意: 订单修改(update-order、update-order-status、update-payment-status)仅适用于店铺订单(direction=out,即您作为卖家)。购买订单(direction=in)会返回404错误——BrickLink API不允许买家修改订单状态或归档/存档收到的订单。这些操作请使用BrickLink网站。
- - bricklink.py update-order id> [--remarks ...] [--is-filed true|false] [--shipping-...] [--cost-...] — 更新允许的订单字段(追踪信息、备注、运费/费用字段)。仅限店铺订单。
- bricklink.py update-order-status id> — 更新订单状态。仅限店铺订单。
- bricklink.py update-payment-status id> status> — 更新订单的付款状态。仅限店铺订单。
- bricklink.py send-drive-thru [--mail-me] — 为订单发送免下车电子邮件。
- - bricklink.py post-feedback --order-id N --rating 0|1|2 [--comment ...] - 为订单发布新的反馈。
- bricklink.py reply-feedback --reply ... - 回复您收到的反馈。
- - bricklink.py create-inventory [--item-type ... --item-no ... --color-id N --quantity N --unit-price ... --new-or-used N|U ...] - 通过参数创建单个库存批次。
- bricklink.py create-inventory --file batch.json - 通过已验证的JSON文件创建多个库存批次(仅限工作区或/tmp目录)。
- bricklink.py update-inventory id> [--quantity N --unit-price ... --new-or-used N|U --remarks ...] - 更新库存批次。
- bricklink.py delete-inventory id> - 删除库存批次。
工具
- - bricklink.py order-detail-html [--out path] [--inline-images] - 获取订单及物品信息,并生成紧凑的HTML视图(类似于BrickLink的orderDetail.asp)。