> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 批量生成 GS1 序列号区间

> POST /bulk-operation/gs1/serial-range-generate/

在 **Management API** 主机（`api.scanova.io`）上根据起始序列号异步生成一段连续的 GS1 QR 码区间，使用您的原始 Management API 密钥进行身份验证。

```
POST https://api.scanova.io/bulk-operation/gs1/serial-range-generate/
Authorization: 401f7ac837da42b97f613d789819ff93537bee6a
```

<Note>
  无需上传文件——此端点根据 `start_serial` 和 `count` 以编程方式生成该区间。
</Note>

<ParamField body="name" type="string" required>
  此操作的标签。
</ParamField>

<ParamField body="start_serial" type="string" required>
  区间中的第一个序列号，仅限数字，最多 20 个字符。
</ParamField>

<ParamField body="count" type="integer" required>
  要生成的连续序列号数量，最少为 1。
</ParamField>

<ParamField body="sample_qrid" type="string">
  现有 GS1 QR 的 id，用于从中复制共享字段值。请提供此项**或** `shared_info`，二者不可都不提供。
</ParamField>

<ParamField body="shared_info" type="array">
  区间内每个序列号共享的 GS1 字段值，以 JSON 形式提供。请提供此项**或** `sample_qrid`，二者不可都不提供。
</ParamField>

<ParamField body="custom_domain" type="integer">
  用于生成的 QR 码短链接的自定义域名 id。
</ParamField>

<ParamField body="pattern_info" type="string">
  应用于所有生成的 QR 码的设计图案数据。
</ParamField>

<ParamField body="auto_deactivate" type="object">
  应用于所有生成的 QR 码的可选自动停用规则。
</ParamField>

<ParamField body="utm_parameters" type="object">
  应用于所有生成的 QR 码链接的 UTM 跟踪参数。
</ParamField>

<ParamField body="folder" type="integer">
  用于保存生成的 QR 码的文件夹 id。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.scanova.io/bulk-operation/gs1/serial-range-generate/" \
    -H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "GS1 batch 001-100",
      "start_serial": "00000001",
      "count": 100,
      "sample_qrid": "a1b2c3d4"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "operation_id": "bo-gs1-001",
    "message": ["Your GS1 serial range is being processed. We'll email you once it's ready."]
  }
  ```
</ResponseExample>

与[批量生成 QR 码](/zh/api-reference/management-api/bulk-operation/generate)相同的异步模式——轮询[列出批量操作](/zh/api-reference/management-api/bulk-operation/list)。在创建任何 QR 码之前，会对该区间中第一个组装好的 GS1 数据进行模式验证，因此格式错误的 `shared_info` 会快速失败。

如果区间中的序列号在任何位置超过 20 个字符、既未提供 `shared_info` 也未提供 `sample_qrid`，或配额（`BULK_OPERATION` 或 `TOTAL_QR_CODES`，按完整的 `count` 检查）超出，则返回 `400`。如果账户缺少 `BULK_OPERATION` 配额、套餐不活跃，或缺少 `BULK_OPERATION_CAN_GENERATE` 权限，则返回 `403`。

## 相关内容

* [批量生成 QR 码](/zh/api-reference/management-api/bulk-operation/generate)——适用于非 GS1 分类的基于文件的通用等效端点。
* [列出批量操作](/zh/api-reference/management-api/bulk-operation/list)——轮询完成状态。
* [Management API 概览](/zh/api-reference/management-api/overview)——适用于此端点的身份验证方案和配额规则。


## OpenAPI

````yaml api-reference/openapi/management-api.json POST /bulk-operation/gs1/serial-range-generate/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    api.scanova.io (QR codes, folders, tags, leads, forms, analytics, plans,
    shared users & roles), plus the token-creation and usage-stats endpoints
    used to authenticate against it. Every path and request/response shape below
    was verified live against a real API key and the actual running backend
    (Phase 7, 2026-08-16) — not guessed from reading urls.py alone.
  version: 2.0.0
servers:
  - url: https://api.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /bulk-operation/gs1/serial-range-generate/:
    post:
      summary: Bulk-generate a GS1 serial range
      description: >-
        Generates a contiguous range of GS1 QR codes from a starting serial and
        count, without a file upload. Requires either `shared_info` or
        `sample_qrid` to supply the shared GS1 field values applied to every
        serial in the range.
      operationId: generateGs1SerialRange
      requestBody:
        content:
          application/json:
            example:
              name: GS1 batch 001-100
              start_serial: '00000001'
              count: 100
              sample_qrid: a1b2c3d4
              custom_domain: null
              folder: null
      responses:
        '200':
          description: Generation started.
          content:
            application/json:
              example:
                operation_id: bo-gs1-001
                message:
                  - >-
                    Your GS1 serial range is being processed. We'll email you
                    once it's ready.
        '400':
          description: >-
            Serial range too long (>20 characters), neither shared_info nor
            sample_qrid provided, or quota exceeded.
        '403':
          description: >-
            Missing BULK_OPERATION quota, inactive plan, or missing
            BULK_OPERATION_CAN_GENERATE permission.
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Send your Management API key as the raw value of the Authorization
        header — no "Bearer " or "Token " prefix, and no other characters.
        Example: `Authorization: 401f7ac837da42b97f613d789819ff93537bee6a`. A
        header containing more than one space-separated part is rejected
        outright. Requests also require the request's Host header to be the
        management API host (e.g. api.scanova.io) — the same key sent to the
        regular API host will not authenticate.

````