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

# Upsert Return Tag

> Create a new return tag, update an existing tag's color, or rename a tag. When `newName` is set and differs from the path `name`, the rename cascades to returns and saved view filters.

Possible 400 problem types:
- `com.getredo.api:return-tag/rename-precondition-failed` — the source
  tag does not exist, or the target name is already in use.

- `com.getredo.api:return-tag/invalid-request` — the path `name` is
  missing or the request body is invalid.

Requires the [`returns_write`](/docs/api-reference/scopes) scope.



## OpenAPI

````yaml /api-schema/openapi.yaml put /stores/{storeId}/return-tags/{name}
openapi: 3.1.0
info:
  contact:
    email: engineering-admin@getredo.com
    name: Redo Engineering
  description: |
    ## Endpoints

    Endpoints are authenticated using the Bearer authorization scheme, using the
    REDO_API_SECRET.

    ```txt
    GET /v2.2/resource HTTP/1.1
    Authorization: Bearer 77bb7598b7a972475cc7c7e171ec33af
    Host: api.getredo.com
    ```

    ## Webhooks

    Webhooks are authenticated using the Bearer authorization scheme, using
    a secret supplied by the subscriber.

    ```txt
    POST /events HTTP/1.1
    Authorization: Bearer subscriberauth123
    Host: subscriber.example.com
    ```

    Webhook events are delivered in order for each individual subject (e.g.
    return).

    If the response is not a 2xx status code, the event will be retried multiple
    times before discarding it.
  title: Redo API
  version: 2.2.1
servers:
  - url: https://api.getredo.com/v2.2
security: []
tags:
  - name: Checkout Buttons
  - name: Coverage Info
  - name: Coverage Products
  - name: Custom Events
  - name: Customer Portal
  - name: Customer Subscriptions
  - name: Customers
  - name: Inbound Shipments
  - name: Inventory Items
  - name: Inventory Levels
  - name: Invoices
  - name: Merchant Admin
  - name: Orders
  - name: Products
  - name: Returns
  - name: Storefront
  - name: Webhooks
paths:
  /stores/{storeId}/return-tags/{name}:
    summary: Return Tag
    description: Return tag.
    parameters:
      - $ref: '#/components/parameters/store-id.param'
      - $ref: '#/components/parameters/return-tag-name.param'
    put:
      tags:
        - Returns
      summary: Upsert Return Tag
      description: >-
        Create a new return tag, update an existing tag's color, or rename a
        tag. When `newName` is set and differs from the path `name`, the rename
        cascades to returns and saved view filters.


        Possible 400 problem types:

        - `com.getredo.api:return-tag/rename-precondition-failed` — the source
          tag does not exist, or the target name is already in use.

        - `com.getredo.api:return-tag/invalid-request` — the path `name` is
          missing or the request body is invalid.

        Requires the [`returns_write`](/docs/api-reference/scopes) scope.
      operationId: Return tag upsert
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/return-tag-upsert-request.schema'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  tag:
                    $ref: '#/components/schemas/return-tag.schema'
                required:
                  - tag
                type: object
          description: Success
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/error.schema'
          description: Rename precondition failed or invalid request
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/error.schema'
          description: Error
      security:
        - Bearer: []
components:
  parameters:
    store-id.param:
      description: Store ID
      in: path
      name: storeId
      required: true
      schema:
        example: 64e5a8a1af49a89df37e4ee7
        type: string
    return-tag-name.param:
      description: Return tag name. Case-sensitive and URL-encoded.
      in: path
      name: name
      required: true
      schema:
        example: Damaged
        type: string
  schemas:
    return-tag-upsert-request.schema:
      description: Request body for creating, recoloring, or renaming a return tag.
      properties:
        pillTheme:
          $ref: '#/components/schemas/pill-theme.schema'
        newName:
          description: >-
            New name for the tag. When set and different from the path `name`,
            the tag is renamed and the change cascades to returns and saved view
            filters.
          type: string
      required:
        - pillTheme
      title: Return tag upsert request
      type: object
    return-tag.schema:
      description: A return tag defined for a store.
      properties:
        name:
          description: The tag's display name. Case-sensitive.
          type: string
        kind:
          const: return
          type: string
        pillTheme:
          $ref: '#/components/schemas/pill-theme.schema'
        source:
          description: Where the tag originated.
          enum:
            - merchant
            - redo
            - flow
          type: string
        numericId:
          description: Stable numeric identifier, if one has been assigned.
          type:
            - number
            - 'null'
      required:
        - name
        - kind
        - pillTheme
        - source
        - numericId
      title: Return tag
      type: object
    error.schema:
      description: >-
        Problem details. See [RFC 7807 Section
        3](https://datatracker.ietf.org/doc/html/rfc7807#section-3).
      properties:
        detail:
          description: Human-readable description of the problem.
          title: Detail
          type: string
        instance:
          description: A URI reference that identifies this problem.
          format: uri-reference
          type: string
        title:
          description: Human-readable summary of the problem type.
          title: Title
          type: string
        type:
          default: about:blank
          description: A URI reference that identifies the problem type.
          format: uri-reference
          type: string
      title: Problem details
      type: object
    pill-theme.schema:
      description: Color theme used to render a tag pill in the UI.
      enum:
        - NORMAL
        - PRIMARY_LIGHT
        - LIGHT_PINK
        - DANGER
        - NEUTRAL_YELLOW
        - SUCCESS
        - NEUTRAL_BLUE
        - PRIMARY
        - SOLID_WHITE
        - SOLID_PINK
        - SOLID_RED
        - SOLID_ORANGE
        - SOLID_YELLOW
        - SOLID_GREEN
        - SOLID_LIGHT_BLUE
        - SOLID_NAVY
        - SOLID_BLACK
        - BRAND
        - GRAY_BLUE
        - WHITE_SUCCESS
        - GRAY_ALTERNATE
        - BRAND_ALTERNATE
        - ERROR_ALTERNATE
        - WARNING_ALTERNATE
        - SUCCESS_ALTERNATE
        - GRAY_BLUE_ALTERNATE
        - BLUE_LIGHT_ALTERNATE
        - BLUE_ALTERNATE
        - INDIGO_ALTERNATE
        - PURPLE_ALTERNATE
        - PINK_ALTERNATE
        - ORANGE_ALTERNATE
        - BLACK_ALTERNATE
        - WHITE_ALTERNATE
        - WHITE_SUCCESS_ALTERNATE
      title: Pill theme
      type: string
  securitySchemes:
    Bearer:
      scheme: bearer
      type: http

````