{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-custom-field-definition-schema.json",
  "title": "Custom field definition",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-custom-field-definition-api-openapi.yml#/components/schemas/CustomFieldDefinition",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "title": "Custom field definition ID",
      "readOnly": true
    },
    "object": {
      "type": "string",
      "title": "Object type",
      "readOnly": true
    },
    "related_type": {
      "title": "Related Recurly object type",
      "$ref": "#/$defs/RelatedTypeEnum"
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Used by the API to identify the field or reading and writing. The name can only be used once per Recurly object type.",
      "pattern": "/^[a-z0-9_-]+$/i",
      "maxLength": 50
    },
    "user_access": {
      "title": "User access",
      "description": "The access control applied inside Recurly's admin UI:\n- `api_only` - No one will be able to view or edit this field's data via the admin UI.\n- `read_only` - Users with the Customers role will be able to view this field's data via the admin UI, but\n  editing will only be available via the API.\n- `write` - Users with the Customers role will be able to view and edit this field's data via the admin UI.\n- `set_only` - Users with the Customers role will be able to set this field's data via the admin console.\n",
      "$ref": "#/$defs/UserAccessEnum"
    },
    "display_name": {
      "type": "string",
      "title": "Display name",
      "description": "Used to label the field when viewing and editing the field in Recurly's admin UI.",
      "maxLength": 50
    },
    "tooltip": {
      "type": "string",
      "title": "Tooltip description",
      "description": "Displayed as a tooltip when editing the field in the Recurly admin UI.",
      "pattern": "/^[a-z0-9_-]+$/i",
      "maxLength": 255
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created at",
      "readOnly": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Last updated at",
      "readOnly": true
    },
    "deleted_at": {
      "type": "string",
      "format": "date-time",
      "title": "Deleted at",
      "description": "Definitions are initially soft deleted, and once all the values are removed from the accouts or subscriptions, will be hard deleted an no longer visible.",
      "readOnly": true
    }
  },
  "$defs": {
    "RelatedTypeEnum": {
      "type": "string",
      "enum": [
        "account",
        "item",
        "plan",
        "subscription",
        "charge"
      ]
    },
    "UserAccessEnum": {
      "type": "string",
      "enum": [
        "api_only",
        "read_only",
        "write",
        "set_only"
      ]
    }
  }
}