Update a variation axis

PATCH/v2/experiences/{experienceId}/retail-attributes/{attributeId}

Requires your API key in the X-API-Key header.

Updates the axis. Organizer only (403 otherwise). When values is sent it replaces the whole set: entries with an id are updated, entries without one are created, and values left out are removed. An id from another axis returns 400 (RETAIL_ATTRIBUTE_VALUE_SCOPE_INVALID). Omit values to leave them as they are. Call the generate endpoint afterwards to update the SKUs.

Requestbash
curl -X PATCH "https://api.turneo.co/v2/experiences/8e7d6c5b-4a39-4281-90ef-1a2b3c4d5e6f/retail-attributes/2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": {
      "en": "Colour"
    }
  }'

Path parameters

  • experienceIdstring (uuid)required

    UUID of the retail product.

    Example:
    8e7d6c5b-4a39-4281-90ef-1a2b3c4d5e6f
  • attributeIdstring (uuid)required

    UUID of the variation axis.

    Example:
    2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e

Request bodyapplication/json, required

  • namestring or map of string

    Multilingual text field. Stored as an object keyed by language code (en, de, it, es, fr, hr, sl, pt, zh, zh-hant, ja, ko, ru; machine translations are stored under <lang>_auto keys internally). On read it is returned as a single string resolved for the requested language (falling back to English when the object is not consistently translated), or as the full per-language object when showTranslations=true is passed. On write, either a plain string (stored as English) or a partial per-language object is accepted.

    Accepted shapes
    • Either string

    • Or map of string

  • sortOrderinteger

    Position of the axis among the product's axes. Defaults to 0.

    Example:
    0
  • valuesobject[]

    The axis's values.

    Child fields
    • idstring (uuid)

      UUID of an existing value of this axis (or of one removed earlier, which brings it back). Omit to create a new value.

      Example:
      9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d
    • labelstring or map of string

      Multilingual text field. Stored as an object keyed by language code (en, de, it, es, fr, hr, sl, pt, zh, zh-hant, ja, ko, ru; machine translations are stored under <lang>_auto keys internally). On read it is returned as a single string resolved for the requested language (falling back to English when the object is not consistently translated), or as the full per-language object when showTranslations=true is passed. On write, either a plain string (stored as English) or a partial per-language object is accepted.

      Accepted shapes
      • Either string

      • Or map of string

    • sortOrderinteger

      Position of the value within the axis. Defaults to 0.

      Example:
      0
Example: Rename the axis only
Rename the axis onlyjson
{
  "name": {
    "en": "Colour"
  }
}
Example: Keep one value, add another, drop the rest
Keep one value, add another, drop the restjson
{
  "values": [
    {
      "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d",
      "label": {
        "en": "Red"
      }
    },
    {
      "label": {
        "en": "Green"
      }
    }
  ]
}

Responses

200object

The updated axis.

  • idstring (uuid)

    Axis UUID.

    Example:
    2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e
  • namestring or map of string

    Multilingual text field. Stored as an object keyed by language code (en, de, it, es, fr, hr, sl, pt, zh, zh-hant, ja, ko, ru; machine translations are stored under <lang>_auto keys internally). On read it is returned as a single string resolved for the requested language (falling back to English when the object is not consistently translated), or as the full per-language object when showTranslations=true is passed. On write, either a plain string (stored as English) or a partial per-language object is accepted.

    Accepted shapes
    • Either string

    • Or map of string

  • sortOrderinteger

    Position of the axis among the product's axes.

    Example:
    0
  • valuesobject[]

    The axis's values, in sortOrder.

    Child fields
    • idstring (uuid)

      Value UUID. SKUs list the values they are made of in attributeValueIds.

      Example:
      9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d
    • labelstring or map of string

      Multilingual text field. Stored as an object keyed by language code (en, de, it, es, fr, hr, sl, pt, zh, zh-hant, ja, ko, ru; machine translations are stored under <lang>_auto keys internally). On read it is returned as a single string resolved for the requested language (falling back to English when the object is not consistently translated), or as the full per-language object when showTranslations=true is passed. On write, either a plain string (stored as English) or a partial per-language object is accepted.

      Accepted shapes
      • Either string

      • Or map of string

    • sortOrderinteger

      Position of the value within its axis.

      Example:
      0
Response 200json
{
  "id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
  "name": "Sunset Kayak Tour",
  "sortOrder": 0,
  "values": [
    {
      "id": "9a8b7c6d-5e4f-4a3b-8c1d-0e9f8a7b6c5d",
      "label": "Sunset Kayak Tour",
      "sortOrder": 0
    }
  ]
}

Errors

400

Validation failed. Inspect errors[].field and errors[].code.

401

Missing or invalid X-API-Key header.

403

The API key is valid but not allowed to perform this action on this resource.

404

The resource does not exist or belongs to another partner (existence is not leaked across partners).

Error body
  • typestring

    Error class.

    Allowed values:
    validation_errorclient_errorserver_error
    Example:
    validation_error
  • errorsobject[]
    Child fields
    • codestring

      Machine-readable error code.

      Example:
      required
    • fieldstringnullable

      Offending field, or null/'general' for non-field errors.

      Example:
      startTime
    • messagestring

      Human-readable message.

      Example:
      This field is required.
Response 400json
{
  "type": "validation_error",
  "errors": [
    {
      "code": "required",
      "field": "startTime",
      "message": "This field is required."
    }
  ]
}