> ## 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.

# Cancel return label

Cancels a return label created by [Create return shipment](/api-reference/returnshipment/create-return-shipment). Pass the `labelId` from the create response or from the [`labelGenerated`](/webhooks#label-result) webhook.

## When a label can be cancelled

Every condition below must hold. If one fails, the call returns a validation soft error — HTTP 200 with `meta.status: 400` and `meta.errorCode: VALIDATION_FAILED` — with the message in `meta.error.labelId`. See [Error codes](/reference/error-codes).

| Condition | `meta.error.labelId` when it fails |
| - | - |
| The label belongs to your account | `Label:{labelId} not found` |
| The label was generated (`labelRequestStatusCode` is `success`) | `Cancel label only when label status is success` |
| The current time is before the label's `cancelCutoffTime` | `The cancellation cutoff Time {cancelCutoffTime} has already passed.` |
| The warehouse has not received the parcel | `Cancel label only when shipment status is lb-printed` |

`cancelCutoffTime` is delivered with the label in the `labelGenerated` webhook and returned by [Get return shipment details](/api-reference/returnshipment/get-return-request).

## After a successful cancel

[Get return shipment details](/api-reference/returnshipment/get-return-request) returns:

| Field | Value |
| - | - |
| `returnStatusCode` | `label-canceled` |
| `shipments[].shipmentStatusCode` | `lb-canceled` |
| `shipments[].labelId` | `0` |
| `shipments[].label` | `null` |

The cancelled label is no longer returned. Keep its `labelId` on your side if you need it later.

## Correcting a shipment

A cancelled return request cannot get a new label. To correct a shipment, cancel its label, then call [Create return shipment](/api-reference/returnshipment/create-return-shipment) again with the corrected details. The new call returns a new `returnRequestId`, `shipmentId`, and `labelId`. The cancelled return request stays at `label-canceled`.

## Idempotency

The `x-returnhelper-idempotency-key` header is optional. A call without it runs normally, with no protection against duplicates. See [Idempotency](/introduction#idempotency).

## Related

* [Create return shipment](/api-reference/returnshipment/create-return-shipment) — create the replacement shipment.
* [Get return shipment details](/api-reference/returnshipment/get-return-request) — read `cancelCutoffTime` and the current status.
* [Webhooks](/webhooks#label-result) — `labelGenerated` carries `labelId` and `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.