# Commerce photo publishing flow

The TikTok Shop commerce photo publishing flow with standard endpoints: creator selection with photo permission, products and schedule, 1–15 image upload, title and music settings, publishing tasks and records. Photo posts have no pre-check.

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

## Flow

```mermaid
flowchart TD
  A["Authorized creator with photo permission"] --> B["Select creators"]
  B --> C["Select products and schedule"]
  C --> D["Upload 1–15 ordered images"]
  D --> E{"presign isNew?"}
  E -- "yes" --> F["PUT + confirm"]
  E -- "no" --> G["Reuse fileIds"]
  F --> H["Commerce settings: title, music, AI label"]
  G --> H
  H --> I["Validate; no 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 with hasPhotoPermission=true, then confirm permissions contains PHOTO_SHOPPABLE_PERMISSION_PRODUCT or PHOTO_SHOPPABLE_PERMISSION_SHOP; 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 images: 1–15 images, each through presign → PUT → confirm; keep display order.
4. Step 4 · Commerce settings: product title, music and AI-generated label; no cover and no video pre-check.
5. Step 5 · Validate and create: check image count/order, product, title and schedule (5 minutes ahead); createPost with mediaType=PHOTO and postType=MULTI_PHOTO_ONE_ANCHOR.
6. After publishing: query records for platform post ID and failure reasons; submit, update or cancel when possible.

## Key branches

- **Photo permission required**: permissions must contain PHOTO_SHOPPABLE_PERMISSION_PRODUCT or PHOTO_SHOPPABLE_PERMISSION_SHOP; without either, no photo publishing permission.
- **1–15 images, order matters**: businessIds follow display order and cannot be reordered after publishing.
- **No pre-check**: validation happens before createPost; platform failures appear in records.
- **Scheduled or immediate**: scheduled tasks at least 5 minutes ahead.
- **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) |
| 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

- Authorization alone is not enough: photo posts need PHOTO_SHOPPABLE_PERMISSION_PRODUCT or PHOTO_SHOPPABLE_PERMISSION_SHOP in permissions.
- Keep the image order stable; businessIds are display order.
- businessIds use string file IDs, not numbers.
- scheduledAt is an absolute timestamp; scheduledTz is the IANA timezone.
