TikTok Shop Returns — Browser Skill
Purpose
Two workflows: (A) download and print all existing TikTok Shop return labels; (B) create a new return from a photo of the item.
Dependencies
- browse CLI:
npm install -g @browserbasehq/browse-cli - Browserbase remote mode required (TikTok bot detection)
- Python venv:
/Users/martinp/Martin Secoond Brain/Amazon skills/.venv/ - Packages:
Pillow pyzbar qrcode[pil]+ nativezbar(brew) - Printer:
DYMO_LabelWriter_4XL - Cookies:
/Users/martinp/Martin Secoond Brain/Amazon skills/tiktok-cookies.jsonRefresh:node "/Users/martinp/Martin Secoond Brain/Amazon skills/scripts/bootstrap-tiktok-session.mjs"
Workflow A: Download All Existing Return Labels
Step 1 — Inject auth
cd "/Users/martinp/Martin Secoond Brain/Amazon skills"
node scripts/inject-cookies.mjs --platform tiktok
Step 2 — Run autobrowse loop
node ~/.claude/skills/autobrowse/scripts/evaluate.mjs \
--task tiktok-return-labels-download \
--workspace autobrowse \
--env remote
Step 3 — Process and print each label
.venv/bin/python3 process-return-label.py "<screenshot_path>" "<item_name>"
Workflow B: Create New Return from Photo
Step 0 — Identify item (outer skill)
Claude vision on attached photo:
"Identify this item in 10 words or less: brand, model, key features." Store as ITEM_DESCRIPTION.
Step 1 — Write item description into task
Replace ITEM_DESCRIPTION_PLACEHOLDER in:
/Users/martinp/Martin Secoond Brain/Amazon skills/autobrowse/tasks/tiktok-create-return/task.md
Also save the photo path into ITEM_PHOTO_PLACEHOLDER — TikTok may require photo evidence.
Step 2 — Inject auth
node "/Users/martinp/Martin Secoond Brain/Amazon skills/scripts/inject-cookies.mjs" --platform tiktok
Step 3 — Run autobrowse
node ~/.claude/skills/autobrowse/scripts/evaluate.mjs \
--task tiktok-create-return \
--workspace "/Users/martinp/Martin Secoond Brain/Amazon skills/autobrowse" \
--env remote
Step 4 — Print label
cd "/Users/martinp/Martin Secoond Brain/Amazon skills"
.venv/bin/python3 process-return-label.py "<screenshot_path>" "$ITEM_DESCRIPTION"
TikTok Shop Gotchas
- TikTok Shop is at shop.tiktok.com — NOT tiktok.com
- Heavy JS rendering: use
browse wait timeout 3000after every navigation - Cookie/age consent banners appear on first load — dismiss before proceeding
- Returns may be labeled "Apply for Refund" or "Return & Refund"
- TikTok frequently requires a photo of the item as return evidence
- Label may not appear immediately — TikTok may email the label instead If so: screenshot the confirmation and note in output that label is coming via email
Auth / Cookie Refresh
If login redirect appears:
- Re-run bootstrap:
node scripts/bootstrap-tiktok-session.mjs - Re-run inject:
node scripts/inject-cookies.mjs --platform tiktok
Expected Output (Workflow B)
{
"success": true,
"order_id": "TIKTOK-XXXXXXXX",
"item_name": "Matched item from order",
"screenshot_path": "screenshots/tiktok-return-1234567890.png",
"label_type": "qr_code"
}