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

# 取消退货面单

> [!WARNING]
>
> 此页面由 AI 自动翻译。API 技术规格以英文呈现为标准。如有任何疑问，请参阅[英文版本](/api-reference/returnshipment/cancel-return-label)。

取消由[创建 Return Shipment](/zh-Hans/api-reference/returnshipment/create-return-shipment) 生成的退货面单。请传入创建回应或 [`labelGenerated`](/zh-Hans/webhooks#label-result) webhook 中的 `labelId`。

## 可取消面单的条件

必须同时满足以下所有条件。任一条件不满足时，调用会返回验证软错误——HTTP 200，`meta.status: 400`，`meta.errorCode: VALIDATION_FAILED`——错误信息位于 `meta.error.labelId`。详见[错误代码](/zh-Hans/reference/error-codes)。

| 条件 | 不满足时的 `meta.error.labelId` |
| - | - |
| 面单属于您的账户 | `Label:{labelId} not found` |
| 面单已生成（`labelRequestStatusCode` 为 `success`） | `Cancel label only when label status is success` |
| 当前时间早于面单的 `cancelCutoffTime` | `The cancellation cutoff Time {cancelCutoffTime} has already passed.` |
| 仓库尚未收到包裹 | `Cancel label only when shipment status is lb-printed` |

`cancelCutoffTime` 会随 `labelGenerated` webhook 中的面单一并推送，也会由[获取 Return Shipment 详情](/zh-Hans/api-reference/returnshipment/get-return-request)返回。

## 取消成功后

[获取 Return Shipment 详情](/zh-Hans/api-reference/returnshipment/get-return-request)会返回：

| 字段 | 值 |
| - | - |
| `returnStatusCode` | `label-canceled` |
| `shipments[].shipmentStatusCode` | `lb-canceled` |
| `shipments[].labelId` | `0` |
| `shipments[].label` | `null` |

已取消的面单不会再返回。如之后需要，请在您的系统中保存其 `labelId`。

## 修正运货单

已取消的 Return Request 无法再获取新面单。如需修正运货单，请先取消面单，再以修正后的资料重新调用[创建 Return Shipment](/zh-Hans/api-reference/returnshipment/create-return-shipment)。新的调用会返回新的 `returnRequestId`、`shipmentId` 与 `labelId`。已取消的 Return Request 会保持 `label-canceled`。

## 幂等性

`x-returnhelper-idempotency-key` 请求头为选填。不带该请求头的调用会正常执行，但不具备防重复的保护。请参阅[幂等性](/zh-Hans/introduction#idempotency)。

## 相关

* [创建 Return Shipment](/zh-Hans/api-reference/returnshipment/create-return-shipment) — 创建替代的运货单。
* [获取 Return Shipment 详情](/zh-Hans/api-reference/returnshipment/get-return-request) — 查看 `cancelCutoffTime` 与当前状态。
* [Webhooks](/zh-Hans/webhooks#label-result) — `labelGenerated` 包含 `labelId` 与 `cancelCutoffTime`。


## OpenAPI

````yaml post /api/Label/CancelLabel
openapi: 3.1.0
info:
  title: Return Helper API
  description: API documentation for Return Helper — covering User and Public endpoints.
  version: 1.0.0
servers:
  - url: https://api.returnshelper.com/uat/user
    description: Sandbox — User API
  - url: https://api.returnshelper.com/uat/public
    description: Sandbox — Public API
  - url: https://api.returnhelpercentre.com/v1/user
    description: Production — User API
  - url: https://api.returnhelpercentre.com/v1/public
    description: Production — Public API
  - url: https://api.returnhelperchina.com/user
    description: Production — User API (China)
security:
  - ApiKey: []
    ApiToken: []
paths:
  /api/Label/CancelLabel:
    post:
      tags:
        - ReturnShipment
      summary: Cancel return label
      operationId: ReturnUserApi_CancelLabel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelLabelRequest'
      responses:
        '200':
          description: >-
            Success — returns the standard response envelope with no additional
            payload fields. Inspect meta.status to confirm the label was
            cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: >-
            Authentication failed. Returned when the `x-rr-apikey` or
            `x-rr-apitoken` header is missing or invalid. The body uses the
            standard `ApiResponse` envelope with `meta.error.message` describing
            the auth failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      security:
        - ApiKey: []
          ApiToken: []
      servers:
        - url: https://api.returnshelper.com/uat/user
          description: Sandbox — User API
components:
  schemas:
    CancelLabelRequest:
      type: object
      properties:
        labelId:
          type: integer
          format: int64
          description: >-
            ID of the label to cancel, as returned by Create return shipment and
            the `labelGenerated` webhook
      required:
        - labelId
    ApiResponse:
      type: object
      description: >-
        Universal response envelope. Successful responses include the business
        payload as additional top-level fields alongside `correlationId` and
        `meta`. Failed responses (auth errors, validation errors) only populate
        `correlationId` and `meta`, with `meta.errorCode` and `meta.error`
        describing the failure.
      properties:
        correlationId:
          type:
            - string
            - 'null'
          description: >-
            Unique correlation ID for tracing the request through Return Helper
            systems.
        meta:
          $ref: '#/components/schemas/ApiResponseMeta'
    ApiResponseMeta:
      type: object
      description: >-
        Application-level metadata for every API response. Inspect `status` and
        `errorCode` to detect soft-error responses (validation failures arrive
        as HTTP 200 with `meta.status: 400`).
      properties:
        status:
          type: integer
          description: >-
            Application-level status code. For successful operations this
            mirrors the HTTP status (e.g. 200). For validation failures it
            reports the logical status (e.g. 400) even though the wire HTTP
            status is 200.
        data:
          type: object
          additionalProperties:
            type: string
          description: Reserved free-form metadata key/value pairs. Usually empty.
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Machine-readable error code (e.g. `VALIDATION_FAILED`). Non-null
            only when the operation failed.
        error:
          type: object
          additionalProperties: true
          description: >-
            Field-level or message-level error detail keyed by request property
            name. Empty object on success.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-rr-apikey
      description: Your API key
    ApiToken:
      type: apiKey
      in: header
      name: x-rr-apitoken
      description: Your API token — keep this private

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.