**版本：202601**

# 保存高级卡片

**POST** `/openapi/2026-01/themes/page-builder/blocks`

基于高级卡片模板应用编辑操作（`ops`）并保存为新卡片，再把它放到编辑会话中的目标位置；`event_type` 不是 `theme` 时只保存卡片，不放到页面上。

## 请求

**application/json**

**请求体 | 示例**

**请求体 (required)**

- `event_type` string (required)

  卡片的事件类型。传 `theme` 时响应会带上 `type` 与 `block`；其它事件类型只保存卡片，不创建单页 block
- `origin_template_id` string (required)

  新卡片所基于的来源模板 ID。新卡片自己的 id 在响应里返回
- `title` object

  卡片标题，多语言 map，如 `{"en-US": "...", "zh-CN": "..."}`
- `action` string (required)

  保存方式：`save`、`save_as`、`update`
- `category` string

  分类，如 `image_with_text`
- `second_category` string

  二级分类，如 `Carousal`
- `image` string

  预览图文件名
- `origin` string

  基底模板来源范围：`custom` 或 `global`。留空则先查 `custom`、未命中再查 `global`
- `ops` object[]

  保存前应用到基底模板的操作列表。至少一条；传空数组会返回 400
- `oseid` string (required)

  要插入的编辑会话 ID
- `doc_id` string (required)

  插入会话用的文档（模板文件）ID
- `section_id` string (required)

  要替换成新卡片的目标 section ID
- `theme_id` string (required)

  插入会话渲染上下文 url 用的主题 ID
- `template_name` string

  插入会话用的模板名；默认取文件 location 去掉 `.liquid`
- `locale` string

  插入会话渲染语言；默认 en\_US

```json
{
  "event_type": "string",
  "origin_template_id": "string",
  "title": {},
  "action": "string",
  "category": "string",
  "second_category": "string",
  "image": "string",
  "origin": "string",
  "ops": [
    {}
  ],
  "oseid": "string",
  "doc_id": "string",
  "section_id": "string",
  "theme_id": "string",
  "template_name": "string",
  "locale": "string"
}
```

## 响应

**200**

OK

**application/json**

**数据结构 | 示例**

**数据结构**

- `code` string

  错误码
- `message` string

  错误信息
- `data` object

  - `id` string

    创建/更新的块 ID
  - `series_id` string

    系列 ID
  - `show_templates` int32

    保存后该系列的展示模板数
  - `type` string

    保存后卡片的完整 block type，形如 `shoplazza://apps/page-builder/blocks/custom-{id}/{hash}`。把卡片落位到页面时用它作为卡片的 type
  - `block` object

    用于作为新 section 插入的 single-block 内容（name/type/settings/source）

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "id": "string",
    "series_id": "string",
    "show_templates": 0,
    "type": "string",
    "block": {}
  }
}
```
