# Commerce video publishing flow

The TikTok Shop commerce video publishing flow with standard endpoints: creator selection, products and schedule, video upload, title/music/cover settings, optional pre-check, publishing tasks and records.

- Web document: [Commerce video publishing flow](/en/openapi/workflows/commerce-video)
- Markdown: [Markdown](/en/openapi/workflows/commerce-video.md)
- Operation index: [Operation index](/en/openapi/operations/index.json)

## Flow

```mermaid
flowchart TD
  A["Authorized creator"] --> B["Select creators"]
  B --> C["Select products and schedule"]
  C --> D["Upload one video"]
  D --> E{"presign isNew?"}
  E -- "yes" --> F["PUT + confirm"]
  E -- "no" --> G["Reuse fileId"]
  F --> H["Commerce settings: title, music, cover, AI label"]
  G --> H
  H --> I["Validate; optional video pre-check"]
  I --> J{"Scheduled?"}
  J -- "immediate" --> K["createPost scheduledAt=now"]
  J -- "scheduled" --> L["createPost planned time + scheduledTz"]
  K --> M["Publishing records"]
  L --> M
```

## Steps

1. Step 1 · Select creators: list commerce creators with authSource=TIKTOK_SHOP_CREATOR; permissions containing both LIVE_STREAM_PERMISSION and SELF_SALE_PERMISSION guarantees video commerce permission; use creatorId for tasks and the account id for products.
2. Step 2 · Products and schedule: choose shop or showcase products and set dates or publish immediately.
3. Step 3 · Upload the video: presign → PUT when isNew=true → confirm; businessId is the string file ID, businessType=FILE.
4. Step 4 · Commerce settings: product title, music, cover (frame or upload) and AI-generated label; custom cover needs returnCoverFileId=true.
5. Step 5 · Validate and create: pre-check is optional and only for videos; scheduled tasks must be 5 minutes ahead; call createPost with scheduledAt and scheduledTz.
6. After publishing: query records for pre-check results, platform post ID and failures; submit, update or cancel when possible.

## Key branches

- **Scheduled or immediate**: scheduled tasks at least 5 minutes ahead; immediate uses the current time.
- **New video or deduplicated**: only isNew=true needs PUT and confirm.
- **Pre-check is optional**: applies to videos only; timeout lets publishing continue.
- **Cover: frame or upload**: coverTimestampMs and coverUri/coverFileId are mutually exclusive.
- **Creation is not publishing**: final status comes from records.

## Endpoint sequence

| Step | Endpoints |
|---|---|
| 1 | [GET /v1/creatorAccount/pageList](/en/openapi/creators) |
| 2 | [GET /v1/creator/tiktokshop/product/listByShop](/en/openapi/shop-products) · [GET /v1/creator/tiktokshop/product/listByShowcase](/en/openapi/showcase-products) |
| 3 | [POST /v1/file/presign](/en/openapi/presign) · `PUT presigned URL` · [POST /v1/file/confirm](/en/openapi/confirm) |
| 4 | [GET /v1/creator/tiktokshop/searchMusic](/en/openapi/search-music) · [POST /v1/creator/tiktokshop/uploadPhoto](/en/openapi/upload-tiktok-cover) |
| 5 | [POST /v1/creator/post/create](/en/openapi/create-post) |
| 6 | [GET /v1/creator/post/pageList](/en/openapi/post-records) · [POST /v1/creator/post/submit](/en/openapi/submit-post) · [POST /v1/creator/post/update](/en/openapi/update-post) · [POST /v1/creator/post/cancel](/en/openapi/cancel-post) |

## Integration notes

- The creator must be authorized with TikTok Shop before publishing.
- Product title length and forbidden characters are validated before creating tasks.
- Custom covers need returnCoverFileId=true; pass photoFile.photoUri and coverFileId when publishing.
- scheduledAt is an absolute timestamp; scheduledTz is the IANA timezone.
