{
  "openapi": "3.0.1",
  "info": {
    "title": "Voucherify API - Metadata Schemas",
    "version": "v2018-08-01",
    "description": "Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details.",
    "contact": {
      "name": "Voucherify Team",
      "url": "https://www.voucherify.io/contact-support",
      "email": "support@voucherify.io"
    },
    "termsOfService": "https://www.voucherify.io/legal/subscription-agreement",
    "license": {
      "name": "MIT",
      "url": "https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE"
    }
  },
  "servers": [
    {
      "url": "https://{cluster}.voucherify.io",
      "description": "Base URL",
      "variables": {
        "cluster": {
          "default": "api",
          "enum": [
            "api",
            "us1.api",
            "as1.api",
            "download",
            "us1.download",
            "as1.download"
          ]
        }
      }
    }
  ],
  "paths": {
    "/v1/metadata-schemas": {
      "get": {
        "operationId": "list-metadata-schemas",
        "tags": [
          "Metadata Schemas"
        ],
        "summary": "List Metadata Schema Definitions",
        "description": "Retrieve metadata schema definitions.\n\n<Note>\n\n<Badge color=\"blue\">Management API</Badge>\n\nIf you have Management API enabled, you can also use the [List Metadata Schemas](/api-reference/management/list-metadata-schemas) endpoint to list all metadata schemas.\n\n</Note>",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "metadata-schemas"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns an array of metadata schema definitions. The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager while creating a campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataSchemasListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "schemas",
                      "schemas": [
                        {
                          "id": "ms_yqMHRHH6S1KYIHPmQHealNf4",
                          "related_object": "Payment",
                          "properties": {
                            "payment_tax": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "payment_method": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": true,
                          "created_at": "2022-03-07T11:01:01.747Z",
                          "updated_at": "2022-03-07T11:01:44.785Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_DwUjpX32sY3fJEoQELpS7bN3",
                          "related_object": "campaign",
                          "properties": {
                            "Store": {
                              "type": "string",
                              "array": false,
                              "deleted": true,
                              "optional": true,
                              "objectType": null
                            },
                            "locale": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "date_tag": {
                              "type": "date",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "store_names": {
                              "eq": [
                                "Store 1 - New York - Broadway",
                                "Store 2 - Florida - Miami",
                                "Store 3 - London - Heathrow",
                                "Store 4 - Berlin - Alexanderplatz"
                              ],
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "date_time_tag": {
                              "type": "datetime",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "favorite_brands": {
                              "type": "string",
                              "array": true,
                              "deleted": true,
                              "optional": true,
                              "objectType": null
                            },
                            "height_customer_number": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "location_country_string": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2021-12-03T13:33:44.556Z",
                          "updated_at": "2022-07-26T13:57:42.288Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_f0r4hm3ta6a4a5ch3ma",
                          "related_object": "customer",
                          "properties": {
                            "birth_date": {
                              "type": "datetime",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "CRM_created_date": {
                              "type": "datetime",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "customer_location": {
                              "type": "geopoint",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "acquisition_channel": {
                              "eq": [
                                "Facebook",
                                "Twitter",
                                "Website"
                              ],
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "customer_life_time_value": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2021-12-03T06:33:45.894Z",
                          "updated_at": "2022-07-14T15:15:34.928Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_7X7krsG84H6MeNuIaKkb4LXN",
                          "related_object": "earning_rule",
                          "properties": {
                            "Type": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "minLength": 6,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2022-07-27T08:54:07.980Z",
                          "updated_at": null,
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_OF36L2rk4EqhdxvZs56IW9iE",
                          "related_object": "loyalty_tier",
                          "properties": {
                            "has_funds": {
                              "type": "boolean",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2022-03-30T06:22:16.685Z",
                          "updated_at": "2022-07-27T08:55:01.628Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_f1r5Tm3ta6a4a5ch3ma",
                          "related_object": "order",
                          "properties": {
                            "Payment": {
                              "type": "object",
                              "array": false,
                              "deleted": true,
                              "optional": true,
                              "objectType": "Payment"
                            },
                            "day_of_week": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "location_id": {
                              "eq": [
                                "L1",
                                "L2",
                                "L3"
                              ],
                              "type": "string",
                              "array": true,
                              "optional": true,
                              "objectType": null
                            },
                            "payment_mean": {
                              "eq": [
                                "credit-card",
                                "wire-transfer",
                                "paypal"
                              ],
                              "type": "string",
                              "array": true,
                              "optional": true,
                              "objectType": null
                            },
                            "booking_end_date": {
                              "type": "datetime",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "booking_start_date": {
                              "type": "datetime",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "number_of_store_visits": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2021-12-03T06:33:45.798Z",
                          "updated_at": "2022-04-20T06:47:10.350Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN",
                          "related_object": "order_item",
                          "properties": {
                            "Size": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "Color": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "Thickness": {
                              "eq": [
                                "Thin",
                                "Medium",
                                "Thick"
                              ],
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2022-03-11T13:32:55.029Z",
                          "updated_at": "2022-05-23T13:46:01.463Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_s3c0N6m3ta6a4a5ch3ma",
                          "related_object": "product",
                          "properties": {
                            "color": {
                              "type": "string",
                              "array": true,
                              "optional": true,
                              "objectType": null
                            },
                            "origin": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "minLength": 1,
                              "objectType": null
                            },
                            "product_location": {
                              "type": "geopoint",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "metadata_attribute_name_with_date_property": {
                              "type": "date",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "metadata_attribute_name_with_number_property": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "metadata_attribute_name_with_boolean_property": {
                              "type": "boolean",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "metadata_attribute_name_with_datetime_property": {
                              "type": "datetime",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2021-12-03T06:33:45.880Z",
                          "updated_at": "2022-07-14T15:46:47.994Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_th8YHt9yFYY1yAA99XOasT5W",
                          "related_object": "promotion_tier",
                          "properties": {
                            "has_budget": {
                              "type": "boolean",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2022-01-24T07:22:21.523Z",
                          "updated_at": "2022-07-27T08:54:42.909Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_Z7niydc0OpGjDRL4yB40niXn",
                          "related_object": "publication",
                          "properties": {
                            "year": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2022-03-30T06:23:49.715Z",
                          "updated_at": "2022-04-19T10:28:24.568Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_t4ir0Dm3ta6a4a5ch3ma",
                          "related_object": "redemption",
                          "properties": {
                            "location_id": {
                              "eq": [
                                "L1",
                                "L2",
                                "L3"
                              ],
                              "type": "string",
                              "array": true,
                              "optional": true,
                              "objectType": null
                            },
                            "store_names": {
                              "eq": [
                                "Store 1 - New York - Broadway",
                                "Store 2 - Florida - Miami",
                                "Store 3 - London - Heathrow",
                                "Store 4 - Berlin - Alexanderplatz"
                              ],
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2021-12-03T06:33:45.890Z",
                          "updated_at": "2022-07-26T14:58:24.546Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg",
                          "related_object": "reward",
                          "properties": {
                            "Type": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null,
                              "exactLength": 4
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2022-07-27T08:53:32.257Z",
                          "updated_at": "2022-07-27T08:53:48.542Z",
                          "object": "metadata_schema"
                        },
                        {
                          "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4",
                          "related_object": "voucher",
                          "properties": {
                            "unit": {
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "Region": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "Season": {
                              "eq": [
                                "Spring",
                                "Summer",
                                "Fall",
                                "Winter"
                              ],
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "CATEGORY": {
                              "type": "string",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            },
                            "active_on_calendar_month": {
                              "eq": [
                                1,
                                2,
                                3,
                                5,
                                7,
                                9,
                                10,
                                11,
                                12
                              ],
                              "type": "number",
                              "array": false,
                              "optional": true,
                              "objectType": null
                            }
                          },
                          "allow_defined_only": false,
                          "created_at": "2022-01-24T07:22:01.281Z",
                          "updated_at": "2022-06-22T07:22:09.577Z",
                          "object": "metadata_schema"
                        }
                      ],
                      "total": 13
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/metadata-schemas/{resource}": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterString"
          },
          "name": "resource",
          "in": "path",
          "required": true,
          "description": "There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas."
        }
      ],
      "get": {
        "operationId": "get-metadata-schema",
        "tags": [
          "Metadata Schemas"
        ],
        "summary": "Get Metadata Schema",
        "description": "Retrieves a metadata schema per resource type.\n\n## Resource types\n\n### Standard\n\nYou can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.\n\n- `campaign`\n- `customer`\n- `earning_rule`\n- `loyalty_tier`\n- `order`\n- `order_item`\n- `product`\n- `promotion_tier`\n- `publication`\n- `redemption`\n- `reward`\n- `voucher`\n\n### Custom\n\nIf you have defined a [custom metadata schema](/prepare/metadata#add-metadata), provide its name in the `\"resource\"` field to retrieve its details.\n\n<Note>\n\n<Badge color=\"blue\">Management API</Badge>\n\nIf you have Management API enabled, you can also use the [Get Metadata Schemas](/api-reference/management/get-metadata-schema) endpoint to retrieve a metadata schema using its ID.\n\n</Note>",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "metadata-schemas"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataSchemasGetResponseBody"
                },
                "examples": {
                  "earning_rule": {
                    "value": {
                      "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn",
                      "related_object": "earning_rule",
                      "properties": {
                        "channel_id": {
                          "type": "string",
                          "array": true,
                          "optional": true,
                          "objectType": null,
                          "exactLength": 5
                        },
                        "channel_name": {
                          "eq": [
                            "instagram",
                            "facebook",
                            "google",
                            "twitter",
                            "linkedin",
                            "website"
                          ],
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2022-08-25T13:09:59.970Z",
                      "updated_at": "2022-08-25T13:11:15.704Z",
                      "object": "metadata_schema"
                    }
                  },
                  "campaign": {
                    "value": {
                      "id": "ms_psGSDpVl6JcPilPA7toZ83Kj",
                      "related_object": "campaign",
                      "properties": {
                        "region": {
                          "eq": [
                            "EMEA",
                            "AMER",
                            "APAC"
                          ],
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2022-08-25T13:12:58.447Z",
                      "updated_at": "2022-08-25T13:16:03.167Z",
                      "object": "metadata_schema"
                    }
                  },
                  "customer": {
                    "value": {
                      "id": "ms_f0r4hm3ta6a4a5ch3ma",
                      "related_object": "customer",
                      "properties": {
                        "age": {
                          "type": "number",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "city_id": {
                          "type": "number",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "location": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "favorite_brands": {
                          "type": "string",
                          "array": true,
                          "optional": true,
                          "objectType": null
                        },
                        "acquisition_channel": {
                          "eq": [
                            "Facebook",
                            "Twitter",
                            "Website"
                          ],
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "customer_life_time_value": {
                          "type": "number",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2021-12-01T08:00:48.889Z",
                      "updated_at": "2022-09-12T07:34:49.163Z",
                      "object": "metadata_schema"
                    }
                  },
                  "loyalty_tier": {
                    "value": {
                      "id": "ms_jHUoFlgepKVEftxK1pKPGZlO",
                      "related_object": "loyalty_tier",
                      "properties": {
                        "level_name": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "audience_restricted": {
                          "type": "boolean",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2022-08-25T13:14:54.954Z",
                      "updated_at": "2022-08-25T13:15:24.436Z",
                      "object": "metadata_schema"
                    }
                  },
                  "order": {
                    "value": {
                      "id": "ms_f1r5Tm3ta6a4a5ch3ma",
                      "related_object": "order",
                      "properties": {
                        "card": {
                          "eq": [
                            "Visa",
                            "MasterCard",
                            "Other"
                          ],
                          "type": "string",
                          "array": true,
                          "optional": true,
                          "objectType": null
                        },
                        "currency": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "location": {
                          "ne": [
                            1,
                            2,
                            18,
                            22
                          ],
                          "type": "number",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "store_city": {
                          "eq": [
                            "Hampden",
                            "San Francisco",
                            "Warsaw"
                          ],
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "location_id": {
                          "eq": [
                            "L1",
                            "L2",
                            "L3"
                          ],
                          "type": "string",
                          "array": true,
                          "optional": true,
                          "objectType": null
                        },
                        "payment_mean": {
                          "eq": [
                            "credit-card",
                            "wire-transfer",
                            "paypal"
                          ],
                          "type": "string",
                          "array": true,
                          "optional": true,
                          "objectType": null
                        },
                        "booking_end_date": {
                          "type": "datetime",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "booking_start_date": {
                          "type": "datetime",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2021-12-01T08:00:47.575Z",
                      "updated_at": "2022-10-25T10:05:18.978Z",
                      "object": "metadata_schema"
                    }
                  },
                  "order_item": {
                    "value": {
                      "id": "ms_7ux44AEnt82bqo8ww5V1SXzV",
                      "related_object": "order_item",
                      "properties": {
                        "manufacturer_id": {
                          "gte": 15,
                          "type": "number",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2022-08-25T13:16:03.167Z",
                      "updated_at": "2022-08-25T13:16:03.167Z",
                      "object": "metadata_schema"
                    }
                  },
                  "product": {
                    "value": {
                      "id": "ms_s3c0N6m3ta6a4a5ch3ma",
                      "related_object": "product",
                      "properties": {
                        "vendor": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "category": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "location": {
                          "type": "geopoint",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2021-12-01T08:00:48.298Z",
                      "updated_at": "2022-07-14T15:53:29.226Z",
                      "object": "metadata_schema"
                    }
                  },
                  "promotion_tier": {
                    "value": {
                      "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn",
                      "related_object": "promotion_tier",
                      "properties": {
                        "level": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2022-01-24T10:42:04.937Z",
                      "updated_at": "2022-09-23T08:51:46.266Z",
                      "object": "metadata_schema"
                    }
                  },
                  "publication": {
                    "value": {
                      "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG",
                      "related_object": "publication",
                      "properties": {
                        "file_uploaded": {
                          "type": "image_url",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "publication_method": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2022-08-25T13:16:35.534Z",
                      "updated_at": "2022-09-12T10:26:31.135Z",
                      "object": "metadata_schema"
                    }
                  },
                  "redemption": {
                    "value": {
                      "id": "ms_t4ir0Dm3ta6a4a5ch3ma",
                      "related_object": "redemption",
                      "properties": {
                        "location_id": {
                          "eq": [
                            "L1",
                            "L2",
                            "L3"
                          ],
                          "type": "string",
                          "array": true,
                          "optional": true,
                          "objectType": null
                        },
                        "redemption_location": {
                          "type": "object",
                          "array": false,
                          "optional": true,
                          "objectType": "Location"
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2021-12-01T08:00:48.794Z",
                      "updated_at": "2022-08-25T13:19:50.497Z",
                      "object": "metadata_schema"
                    }
                  },
                  "reward": {
                    "value": {
                      "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl",
                      "related_object": "reward",
                      "properties": {
                        "reward_type": {
                          "eq": [
                            "MATERIAL",
                            "PAY-WITH-POINTS",
                            "DISCOUNT-COUPON",
                            "GIFT-CARD-CREDITS",
                            "LOYALTY POINTS"
                          ],
                          "type": "string",
                          "array": false,
                          "optional": false,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": true,
                      "created_at": "2022-08-25T13:07:13.689Z",
                      "updated_at": "2022-08-25T13:08:26.696Z",
                      "object": "metadata_schema"
                    }
                  },
                  "voucher": {
                    "value": {
                      "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut",
                      "related_object": "voucher",
                      "properties": {
                        "lang": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "Season": {
                          "eq": [
                            "Spring",
                            "Summer",
                            "Fall",
                            "Winter"
                          ],
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "marketing_text": {
                          "type": "string",
                          "array": false,
                          "optional": true,
                          "objectType": null
                        },
                        "ProductionVoucherCodeMetaData": {
                          "type": "string",
                          "array": false,
                          "deleted": true,
                          "optional": true,
                          "objectType": null
                        }
                      },
                      "allow_defined_only": false,
                      "created_at": "2022-01-24T10:42:23.994Z",
                      "updated_at": "2022-09-19T14:13:30.590Z",
                      "object": "metadata_schema"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the resource provided in the path is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find metadata schema with id earning_rules",
                      "request_id": "v-0c1b9ce0098a391421",
                      "resource_id": "earning_rules",
                      "resource_type": "metadata schema"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MetadataSchemasListResponseBody": {
        "type": "object",
        "description": "Object containing a list of metadata schemas.",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "description": "The type of the object represented by JSON. This object stores information about the metadata schemas in a dictionary.",
            "enum": [
              "list"
            ]
          },
          "data_ref": {
            "type": "string",
            "default": "data",
            "description": "Identifies the name of the attribute that contains the array of metadata schema objects.",
            "enum": [
              "schemas"
            ]
          },
          "schemas": {
            "type": "array",
            "description": "Array of metadata schema objects. The metadata schemas are listed by related object properties.",
            "items": {
              "$ref": "#/components/schemas/MetadataSchemaDeprecated"
            }
          },
          "total": {
            "type": "integer",
            "description": "The total number of metadata schema objects."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "MetadataSchemasGetResponseBody": {
        "type": "object",
        "title": "Metadata Schemas Get Response Body",
        "description": "Response body schema for **GET** `/v1/metadata-schemas/{resource}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/MetadataSchemaDeprecated"
          }
        ]
      },
      "Error": {
        "title": "Error Object",
        "type": "object",
        "description": "Error details",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Error's HTTP status code."
          },
          "key": {
            "type": "string",
            "description": "Short string describing the kind of error which occurred."
          },
          "message": {
            "type": "string",
            "description": "A human-readable message providing a short description of the error."
          },
          "details": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          },
          "request_id": {
            "type": "string",
            "example": "v-0a885062c80375740f",
            "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team."
          },
          "resource_id": {
            "type": "string",
            "description": "Unique resource ID that can be used in another endpoint to get more details.",
            "example": "rf_0c5d710a87c8a31f86"
          },
          "resource_type": {
            "type": "string",
            "description": "The resource type.",
            "example": "voucher"
          },
          "error": {
            "type": "object",
            "description": "Includes additional information about the error.",
            "properties": {
              "message": {
                "type": "string",
                "description": "The message configured by the user in a validation rule."
              }
            }
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "ParameterString": {
        "type": "string"
      },
      "MetadataSchemaDeprecated": {
        "type": "object",
        "description": "Object representing a metadata schema.",
        "allOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the metadata schema."
              },
              "related_object": {
                "type": "string",
                "description": "The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`."
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "properties": {
                "type": "object",
                "description": "Contains metadata definitions.",
                "additionalProperties": {
                  "$ref": "#/components/schemas/MetadataSchemaDefinitionDeprecated"
                }
              }
            },
            "required": [
              "properties"
            ]
          },
          {
            "type": "object",
            "properties": {
              "allow_defined_only": {
                "type": "boolean",
                "nullable": true,
                "description": "Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values."
              },
              "created_at": {
                "type": "string",
                "example": "2021-12-03T13:33:44.556Z",
                "description": "Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format.",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "nullable": true,
                "example": "2022-08-11T08:05:30.695Z",
                "description": "Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format.",
                "format": "date-time"
              },
              "object": {
                "type": "string",
                "default": "metadata_schema",
                "description": "The type of the object represented by the JSON. This object stores information about the metadata schema."
              }
            }
          }
        ],
        "required": [
          "id",
          "related_object",
          "properties",
          "allow_defined_only",
          "created_at",
          "updated_at",
          "object"
        ]
      },
      "MetadataSchemaDefinitionDeprecated": {
        "type": "object",
        "title": "Metadata Definitions",
        "description": "Custom definition name. This is also shown in **Project Settings** > **Metadata Schema** in the Voucherify Dashboard.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "object",
              "date",
              "datetime",
              "geopoint",
              "boolean",
              "image_url"
            ]
          },
          "array": {
            "type": "boolean",
            "description": "Indicates whether the definition is an array."
          },
          "optional": {
            "type": "boolean",
            "description": "Indicates whether this definition is optional or not optional for the resource."
          },
          "objectType": {
            "type": "string",
            "nullable": true,
            "description": "Returns the name of the custom resource if the resource was previously defined in the Dashboard as a custom (non-standard) Nested object."
          },
          "eq": {
            "type": "array",
            "description": "Array of possible values when the setting for `is equal to any of` in the Dashboard is defined explicitly.",
            "items": {}
          },
          "ne": {
            "type": "array",
            "description": "Array of values that are not allowed when the setting for `is not equal to any of` in the Dashboard is defined explicitly.",
            "items": {}
          },
          "lt": {
            "type": "integer",
            "description": "A property of `number` type must have `less than` this value."
          },
          "lte": {
            "type": "integer",
            "description": "A property of `number` type must be `less than or equal` to this value."
          },
          "gt": {
            "type": "integer",
            "description": "A property of `number` type must be `greater than` this value."
          },
          "gte": {
            "type": "integer",
            "description": "A property of `number` type must be `greater than or equal` to this value."
          },
          "deleted": {
            "type": "boolean",
            "description": "Indicates whether the definition was deleted from the schema."
          },
          "maxLength": {
            "type": "integer",
            "description": "Value for maximum length when the setting for `has maximum length of` in the Dashboard is defined explicitly."
          },
          "minLength": {
            "type": "integer",
            "description": "Value indicating minimum length when the setting for `has minimum length of` in the Dashboard is defined explicitly."
          },
          "exactLength": {
            "type": "integer",
            "description": "Value indicating exact length when the setting for `has exact length of` in the Dashboard is defined explicitly."
          }
        },
        "required": [
          "type",
          "optional",
          "array"
        ]
      }
    },
    "securitySchemes": {
      "X-App-Id": {
        "type": "apiKey",
        "name": "X-App-Id",
        "in": "header"
      },
      "X-App-Token": {
        "type": "apiKey",
        "name": "X-App-Token",
        "in": "header"
      },
      "X-Voucherify-OAuth": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://api.voucherify.io/v1/oauth/token",
            "scopes": {
              "api": "Gives access to whole server-side API.",
              "vouchers": "Gives access to all endpoints and methods starting with `v1/vouchers`.",
              "client_api": "Gives access to whole client-side API.",
              "client_vouchers": "Gives access to all endpoints and methods starting with `/client/v1/vouchers`.",
              "promotions": "Gives access to all endpoints and methods starting with `/v1/promotions`.",
              "client_promotions": "Gives access to all endpoints and methods starting with `/client/v1/promotions`",
              "campaigns": "Gives access to all endpoints and methods starting with `v1/campaigns`.",
              "client_publish": "Gives access to all endpoints and methods starting with `/client/v1/publish`.",
              "exports": "Gives access to all endpoints and methods starting with `/v1/exports`.",
              "publications": "Gives access to all endpoints and methods starting with `/v1/publications`.",
              "client_validate": "Gives access to all endpoints and methods starting with `/client/v1/validate`.",
              "validations": "Gives access to all endpoints and methods starting with `/v1/validations`.",
              "client_validations": "Gives access to all endpoints and methods starting with `/client/v1/validations`.",
              "qualifications": "Gives access to all endpoints and methods starting with `/v1/qualifications`.",
              "client_qualifications": "Gives access to all endpoints and methods starting with `/client/v1/qualifications`.",
              "client_redeem": "Gives access to all endpoints and methods starting with `/client/v1/redeem",
              "redemptions": "Gives access to all endpoints and methods starting with `/v1/redemptions`.",
              "client_redemptions": "Gives access to all endpoints and methods starting with `/client/v1/redemptions`",
              "customers": "Gives access to all endpoints and methods starting with `/v1/customers`.",
              "client_customers": "Gives access to all endpoints and methods starting with `/client/v1/customers`.",
              "orders": "Gives access to all endpoints and methods starting with `/v1/orders`.",
              "products": "Gives access to all endpoints and methods starting with `/v1/products`.",
              "skus": "Gives access to all endpoints and methods starting with `/v1/SKUs`.",
              "validation-rules": "Gives access to all endpoints and methods starting with `/v1/validation-rules`.",
              "validation-rules-assignments": "Gives access to all endpoints and methods starting with `/v1/validation-rules-assignments",
              "segments": "Gives access to all endpoints and methods starting with `/v1/segments`.",
              "events": "Gives access to all endpoints and methods starting with `/v1/events`.",
              "client_events": "Gives access to all endpoints and methods starting with `client/v1/events`.",
              "rewards": "Gives access to all endpoints and methods starting with `/v1/rewards`.",
              "assets": "Gives access to all endpoints and methods starting with `/v1/assets`.",
              "task-results": "Gives access to all endpoints and methods starting with `/v1/task-results`.",
              "loyalties": "Gives access to all endpoints and methods starting with `/v1/loyalties`.",
              "client_consents": "Gives access to all endpoints and methods starting with `client/v1/consents`.",
              "consents": "Gives access to all endpoints and methods starting with `/v1/consents`.",
              "async-actions": "Gives access to all endpoints and methods starting with `/v1/async-actions`.",
              "product-collections": "Gives access to all endpoints and methods starting with `/v1/product-collections`.",
              "categories": "Gives access to all endpoints and methods starting with `/v1/categories`.",
              "metadata-schemas": "Gives access to all endpoints and methods starting with `/v1/metadata-schemas`.",
              "locations": "Gives access to all endpoints and methods starting with `/v1/locations`.",
              "referrals": "Gives access to all endpoints and methods starting with `/v1/referrals`.",
              "trash-bin": "Gives access to all endpoints and methods starting with `/v1/trash-bin`.",
              "templates": "Gives access to all endpoints and methods starting with `/v1/templates`."
            }
          }
        }
      }
    }
  }
}