{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emporix/main/json-schema/emporix-contact-assignment-create-schema.json",
  "title": "Contact Assignment create payload",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-client-management-openapi.yml#/components/schemas/contactAssignmentCreate",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Custom assignment identifier. If not provided, it is automatically generated.",
      "minLength": 1,
      "maxLength": 66,
      "pattern": "^[a-zA-Z0-9_-]$"
    },
    "legalEntity": {
      "type": "object",
      "description": "The legal entity unique identifier.",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier of the legal entity."
        }
      }
    },
    "customer": {
      "type": "object",
      "description": "The customer unique identifier.",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier of the customer."
        }
      }
    },
    "type": {
      "type": "string",
      "enum": [
        "PRIMARY",
        "BILLING",
        "LOGISTICS",
        "CONTACT"
      ],
      "description": "The type of the customer assignment. If not provided, it is set to `Contact` by default."
    },
    "primary": {
      "type": "boolean",
      "default": false,
      "description": "Indicates whether the customer is primary."
    },
    "metadata": {
      "$ref": "#/$defs/metadata_create"
    },
    "mixins": {
      "type": "object",
      "description": "Mixins request. A map where a key represent mixins set name and a value represent a map with key-value pairs.",
      "additionalProperties": true
    }
  },
  "required": [
    "legalEntity",
    "customer"
  ],
  "$defs": {
    "metadata_create": {
      "title": "metadata_create",
      "type": "object",
      "description": "Metadata request.",
      "properties": {
        "mixins": {
          "type": "object",
          "description": "Links to the mixin schemas. A map where the keys represent mixins set attributes and the values represent url to a schema for a particular set.",
          "additionalProperties": true
        }
      }
    }
  }
}