Add a variation axis

POST/v2/experiences/{experienceId}/retail-attributes

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

Adds a variation axis to your retail product, optionally with its values. Only the product's organizer can call it (403 otherwise); an experience that is not a retail product returns 400 (RETAIL_EXPERIENCE_REQUIRED). New values become SKUs only when you call POST /v2/experiences/{experienceId}/retail-skus/generate.

Requestbash
curl -X POST "https://api.turneo.co/v2/experiences/8e7d6c5b-4a39-4281-90ef-1a2b3c4d5e6f/retail-attributes" \
  -H "X-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": {
      "en": "Colour"
    },
    "sortOrder": 0,
    "values": [
      {
        "label": {
          "en": "Red"
        },
        "sortOrder": 0
      },
      {
        "label": {
          "en": "Blue"
        },
        "sortOrder": 1
      }
    ]
  }'

Path parameters

  • experienceIdstring (uuid)required

    UUID of the retail product (an experience with experienceType RETAIL or VOUCHER).

    Example:
    8e7d6c5b-4a39-4281-90ef-1a2b3c4d5e6f

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: Colour axis with two values
Colour axis with two valuesjson
{
  "name": {
    "en": "Colour"
  },
  "sortOrder": 0,
  "values": [
    {
      "label": {
        "en": "Red"
      },
      "sortOrder": 0
    },
    {
      "label": {
        "en": "Blue"
      },
      "sortOrder": 1
    }
  ]
}

Responses

201object

The new axis with its values.

  • 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 201json
{
  "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."
    }
  ]
}