# Tiktok Returns

> TikTok Shop Returns — Browser Skill

- Skill: `martin-pv/tiktok-returns` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add martin-pv/tiktok-returns`
- Raw SKILL.md: https://api.skillmd.com/api/skills/martin-pv/tiktok-returns/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: martin-pv (https://skillmd.com/u/martin-pv)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/martin-pv/tiktok-returns

---


# 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]` + native `zbar` (brew)
- Printer: `DYMO_LabelWriter_4XL`
- Cookies: `/Users/martinp/Martin Secoond Brain/Amazon skills/tiktok-cookies.json`
  Refresh: `node "/Users/martinp/Martin Secoond Brain/Amazon skills/scripts/bootstrap-tiktok-session.mjs"`

## Workflow A: Download All Existing Return Labels

### Step 1 — Inject auth
```bash
cd "/Users/martinp/Martin Secoond Brain/Amazon skills"
node scripts/inject-cookies.mjs --platform tiktok
```

### Step 2 — Run autobrowse loop
```bash
node ~/.claude/skills/autobrowse/scripts/evaluate.mjs \
  --task tiktok-return-labels-download \
  --workspace autobrowse \
  --env remote
```

### Step 3 — Process and print each label
```bash
.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
```bash
node "/Users/martinp/Martin Secoond Brain/Amazon skills/scripts/inject-cookies.mjs" --platform tiktok
```

### Step 3 — Run autobrowse
```bash
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
```bash
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 3000` after 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:
1. Re-run bootstrap: `node scripts/bootstrap-tiktok-session.mjs`
2. Re-run inject: `node scripts/inject-cookies.mjs --platform tiktok`

## Expected Output (Workflow B)
```json
{
  "success": true,
  "order_id": "TIKTOK-XXXXXXXX",
  "item_name": "Matched item from order",
  "screenshot_path": "screenshots/tiktok-return-1234567890.png",
  "label_type": "qr_code"
}
```

