{
  "components": {
    "schemas": {
      "ListQueryParams": {
        "properties": {
          "limit": {
            "type": "number",
            "maximum": 1000,
            "minimum": 1
          },
          "skip": {
            "type": "number",
            "maximum": 9007199254740991,
            "minimum": 0
          },
          "order": {
            "type": "string",
            "enum": [
              "ASC",
              "DESC"
            ]
          },
          "filter": {}
        },
        "type": "object",
        "required": [
          "order"
        ]
      },
      "TenantConfiguration": {
        "properties": {
          "allowDuplicateEmailAddress": {
            "type": "boolean"
          },
          "allowDuplicateTelephoneNumber": {
            "type": "boolean"
          },
          "allowedTeamInvitationTypes": {
            "items": {
              "enum": [
                "REGISTER_ACCOUNT"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "enableUserGenderGuessing": {
            "type": "boolean"
          },
          "deleteAuthIdentifiers": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "XoxoOrderEvents": {
        "properties": {
          "DELIVERED": {
            "type": "string"
          },
          "CANCELLED": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "DELIVERED",
          "CANCELLED"
        ]
      },
      "XoxoIntegrationConfig": {
        "properties": {
          "clientId": {
            "type": "string"
          },
          "clientSecret": {
            "type": "string"
          },
          "refreshToken": {
            "type": "string"
          },
          "tokenExpiryInDays": {
            "type": "number"
          },
          "accessToken": {
            "type": "string"
          },
          "environment": {
            "type": "string",
            "enum": [
              "staging",
              "production"
            ]
          },
          "onlyRealtime": {
            "type": "boolean"
          },
          "useXoxoEmailDelivery": {
            "type": "boolean"
          },
          "synchronizeXoxoRewards": {
            "type": "boolean"
          },
          "eventTypes": {
            "$ref": "#/components/schemas/XoxoOrderEvents"
          }
        },
        "type": "object",
        "required": [
          "clientId",
          "clientSecret",
          "refreshToken",
          "tokenExpiryInDays",
          "environment"
        ]
      },
      "MagnatiIntegrationConfig": {
        "properties": {
          "channelId": {
            "type": "string"
          },
          "countryOfOrigin": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "productType": {
            "type": "number"
          },
          "topUpAmount": {
            "type": "number"
          },
          "webViewUrl": {
            "format": "url",
            "type": "string"
          },
          "secretKey": {
            "type": "string"
          },
          "certThumbprint": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "jwtAudienceTenantUrl": {
            "type": "string"
          },
          "baseURL": {
            "format": "url",
            "type": "string"
          },
          "proxySecretKey": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "channelId",
          "countryOfOrigin",
          "productType",
          "topUpAmount",
          "webViewUrl",
          "secretKey",
          "certThumbprint",
          "clientId",
          "jwtAudienceTenantUrl",
          "baseURL",
          "proxySecretKey"
        ]
      },
      "NotificationConfig": {
        "properties": {
          "quantity": {
            "type": "number"
          },
          "emails": {
            "items": {},
            "type": "array"
          },
          "triggered": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "quantity",
          "emails",
          "triggered"
        ]
      },
      "RoundUpLimit": {
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "monthly",
              "weekly",
              "bi_weekly"
            ]
          },
          "lower": {
            "minimum": 0,
            "type": "number"
          },
          "default": {
            "minimum": 0,
            "type": "number"
          },
          "upper": {
            "minimum": 0,
            "type": "number"
          },
          "validateLimits": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "period",
          "lower",
          "default",
          "validateLimits"
        ]
      },
      "RoundUpTransferDestination": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "description",
          "pictureUrl"
        ]
      },
      "ProgramMetadata": {
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "infoTitle": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "title",
          "description",
          "infoTitle"
        ]
      },
      "RoundupPreferences": {
        "properties": {
          "roundUpAmounts": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "minItems": 1
          },
          "limit": {
            "$ref": "#/components/schemas/RoundUpLimit"
          },
          "roundUpTransferDestinations": {
            "items": {
              "$ref": "#/components/schemas/RoundUpTransferDestination"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "roundUpAmounts",
          "limit"
        ]
      },
      "Program": {
        "properties": {
          "programType": {
            "enum": [
              "CASHBACK",
              "CASHBACK_AND_ROUNDUP"
            ],
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "preferences": {
            "$ref": "#/components/schemas/RoundupPreferences"
          }
        },
        "type": "object",
        "required": [
          "programType"
        ]
      },
      "OliveProgramConfig": {
        "properties": {
          "programs": {
            "items": {
              "$ref": "#/components/schemas/Program"
            },
            "type": "array",
            "minItems": 1
          },
          "metadata": {
            "$ref": "#/components/schemas/ProgramMetadata"
          }
        },
        "type": "object",
        "required": [
          "programs",
          "metadata"
        ]
      },
      "OliveEventTypes": {
        "properties": {
          "LINKED_CARD": {
            "type": "string"
          },
          "UNLINKED_CARD": {
            "type": "string"
          },
          "PERIODIC_ROUNDUP_CHARGED": {
            "type": "string"
          },
          "PERIODIC_ROUNDUP_CHARGE_SUCCESSFUL": {
            "type": "string"
          },
          "PERIODIC_ROUNDUP_CHARGE_FAILED": {
            "type": "string"
          },
          "CASHBACK_REGISTERED": {
            "type": "string"
          },
          "CASHBACK_REJECTED": {
            "type": "string"
          },
          "CASHBACK_EARNED": {
            "type": "string"
          },
          "ROUNDUP_REGISTERED": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "LINKED_CARD",
          "UNLINKED_CARD",
          "PERIODIC_ROUNDUP_CHARGED",
          "PERIODIC_ROUNDUP_CHARGE_SUCCESSFUL",
          "PERIODIC_ROUNDUP_CHARGE_FAILED",
          "CASHBACK_REGISTERED",
          "CASHBACK_REJECTED",
          "CASHBACK_EARNED",
          "ROUNDUP_REGISTERED"
        ]
      },
      "OliveIntegrationConfig": {
        "properties": {
          "publicKey": {
            "type": "string"
          },
          "privateKey": {
            "type": "string"
          },
          "environment": {
            "type": "string",
            "enum": [
              "staging",
              "production"
            ]
          },
          "eventTypes": {
            "$ref": "#/components/schemas/OliveEventTypes"
          },
          "programConfig": {
            "$ref": "#/components/schemas/OliveProgramConfig"
          },
          "dailyOfferSync": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "publicKey",
          "privateKey",
          "environment"
        ]
      },
      "Auth0IntegrationConfig": {
        "properties": {
          "tenantDomain": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientSecret": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "tenantDomain",
          "clientId",
          "clientSecret"
        ]
      },
      "Effectivity": {
        "properties": {
          "start": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "end": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "start"
        ]
      },
      "TransactionMetaPayloadConfig": {
        "properties": {
          "__type": {
            "enum": [
              "TRANSACTION"
            ],
            "type": "string"
          },
          "metaEventIdPath": {
            "type": "string"
          },
          "valuePath": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "valueFactor": {
            "type": "number"
          },
          "operationType": {
            "enum": [
              "UPSERT"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "__type",
          "metaEventIdPath",
          "valuePath",
          "currency",
          "valueFactor"
        ]
      },
      "MetaTypeMapping": {
        "properties": {
          "metaType": {
            "enum": [
              "TRANSACTION"
            ],
            "type": "string"
          },
          "metaPayloadConfig": {
            "type": "object"
          },
          "metaConstraint": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "metaType"
        ]
      },
      "KeyValuePair": {
        "properties": {
          "key": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          },
          "value": {}
        },
        "type": "object",
        "required": [
          "key",
          "value"
        ]
      },
      "FilterResultParams": {
        "properties": {
          "success": {
            "items": {
              "$ref": "#/components/schemas/KeyValuePair"
            },
            "type": "array"
          },
          "failure": {
            "items": {
              "$ref": "#/components/schemas/KeyValuePair"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "success",
          "failure"
        ]
      },
      "AudienceCriteria": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "criteriaFormat": {
            "enum": [
              "QUERY_TREE",
              "JSONATA"
            ],
            "type": "string"
          },
          "criteriaTree": {},
          "criteriaJsonata": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id"
        ]
      },
      "Hydratable": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id"
        ]
      },
      "GeoPoint": {
        "properties": {
          "longitude": {
            "minimum": -180,
            "type": "number",
            "maximum": 180
          },
          "latitude": {
            "minimum": -90,
            "type": "number",
            "maximum": 90
          }
        },
        "type": "object",
        "required": [
          "longitude",
          "latitude"
        ]
      },
      "VenueAttributes": {
        "properties": {
          "bookingUrl": {
            "format": "url",
            "type": "string"
          },
          "telephoneNumber": {
            "type": "string"
          },
          "openingTimes": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "Venue": {
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id"
        ]
      },
      "BaseRewardDetails": {
        "properties": {
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 10000
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "terms": {
            "type": "string",
            "maxLength": 25000
          },
          "summary": {
            "type": "string"
          },
          "logoUrl": {
            "format": "url",
            "type": "string"
          },
          "redemptionMessage": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "locale"
        ]
      },
      "AwinRewardDetails": {
        "properties": {
          "displayUrl": {
            "format": "url",
            "type": "string"
          },
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 10000
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "terms": {
            "type": "string",
            "maxLength": 25000
          },
          "summary": {
            "type": "string"
          },
          "logoUrl": {
            "format": "url",
            "type": "string"
          },
          "redemptionMessage": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "locale"
        ]
      },
      "RewardCategoryDetails": {
        "properties": {
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "description": {
            "minLength": 2,
            "maxLength": 5000,
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "locale"
        ]
      },
      "NumberDerivationArgument": {
        "properties": {
          "type": {
            "enum": [
              "JSON_VALUE",
              "NUMBER",
              "PAYLOAD_QUERY"
            ],
            "type": "string"
          },
          "value": {
            "pattern": "^[+-]?[0-9]+(\\.[0-9]+)?$",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "value"
        ]
      },
      "JsonValueDerivationArgument": {
        "properties": {
          "type": {
            "enum": [
              "JSON_VALUE",
              "NUMBER",
              "PAYLOAD_QUERY"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "value"
        ]
      },
      "QueryDerivationArgument": {
        "properties": {
          "type": {
            "enum": [
              "JSON_VALUE",
              "NUMBER",
              "PAYLOAD_QUERY"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "value"
        ]
      },
      "Derivation": {
        "properties": {
          "operation": {
            "enum": [
              "SUM",
              "PRODUCT"
            ],
            "type": "string"
          },
          "arguments": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "max": {
            "type": "number"
          },
          "roundingDirection": {
            "enum": [
              "UP",
              "DOWN"
            ],
            "type": "string"
          },
          "roundingUnit": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "object",
        "required": [
          "operation",
          "arguments"
        ]
      },
      "LinkConfig": {
        "properties": {
          "title": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024
          },
          "imageUrl": {
            "format": "url",
            "type": "string"
          },
          "desktopUrl": {
            "format": "url",
            "type": "string"
          },
          "androidUrl": {
            "format": "url",
            "type": "string"
          },
          "iosUrl": {
            "format": "url",
            "type": "string"
          },
          "androidUriScheme": {
            "type": "string",
            "minLength": 2,
            "maxLength": 256
          },
          "channel": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "feature": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "title",
          "description",
          "desktopUrl"
        ]
      },
      "OAuth2ClientCredentialsConfig": {
        "properties": {
          "tokenUrl": {
            "format": "url",
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "tokenUrl",
          "clientId"
        ]
      },
      "AwinIntegrationConfig": {
        "properties": {
          "apiToken": {
            "type": "string"
          },
          "publisherId": {
            "type": "integer"
          }
        },
        "type": "object",
        "required": [
          "apiToken",
          "publisherId"
        ]
      },
      "FidelIntegrationConfig": {
        "properties": {
          "apiKey": {
            "type": "string"
          },
          "programId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "defaultOfferPictureUrl": {
            "format": "url",
            "type": "string"
          },
          "transactionAuthSecret": {
            "type": "string"
          },
          "transactionQualifiedSecret": {
            "type": "string"
          },
          "refundQualifiedSecret": {
            "type": "string"
          },
          "transactionClearedSecret": {
            "type": "string"
          },
          "cardLinkedSecret": {
            "type": "string"
          },
          "qualificationStatus": {
            "enum": [
              "CLEARED",
              "AUTHORIZED"
            ],
            "type": "string"
          },
          "qualificationRefunds": {
            "type": "boolean"
          },
          "retainExistingRewardName": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "apiKey",
          "programId",
          "accountId"
        ]
      },
      "QueryTreeFilterConfiguration": {
        "properties": {
          "queryTree": {},
          "queryJsonLogic": {}
        },
        "type": "object",
        "required": [
          "queryTree",
          "queryJsonLogic"
        ]
      },
      "MParticleIntegrationConfig": {
        "properties": {
          "eventTypeMappings": {
            "items": {
              "$ref": "#/components/schemas/MParticleEventTypeMapping"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "eventTypeMappings"
        ]
      },
      "MParticleEventTypeMapping": {
        "properties": {
          "mparticleEventType": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          },
          "mparticleEventSubType": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          },
          "wllEventType": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "mparticleEventType",
          "wllEventType"
        ]
      },
      "WeGiftIntegrationConfig": {
        "properties": {
          "userId": {
            "type": "string"
          },
          "playground": {
            "type": "boolean"
          },
          "notificationEmail": {
            "format": "email",
            "type": "string"
          },
          "urlExpiryPeriod": {
            "type": "integer"
          },
          "emailTemplate": {
            "type": "string"
          },
          "enableBreakage": {
            "type": "boolean"
          },
          "deliveryMethod": {
            "enum": [
              "direct",
              "email"
            ],
            "type": "string"
          },
          "apiKey": {
            "type": "string"
          },
          "apiV2Key": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "playground"
        ]
      },
      "BranchIntegrationConfig": {
        "properties": {
          "key": {
            "type": "string"
          },
          "linkDomain": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "key",
          "linkDomain"
        ]
      },
      "FinconectaIntegrationConfig": {
        "properties": {
          "providerName": {
            "minLength": 2,
            "maxLength": 64,
            "type": "string"
          },
          "accountSelectionType": {
            "enum": [
              "ALL",
              "MULTIPLE",
              "SINGLE"
            ],
            "type": "string"
          },
          "authFlowType": {
            "enum": [
              "TWO_LEGGED_PASSWORD",
              "THREE_LEGGED_AUTHORIZATION"
            ],
            "type": "string"
          },
          "clientTokenBasic": {
            "type": "string"
          },
          "eventTypeMappings": {
            "items": {
              "$ref": "#/components/schemas/FinconectaEventTypeMapping"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "providerName",
          "accountSelectionType",
          "authFlowType",
          "clientTokenBasic",
          "eventTypeMappings"
        ]
      },
      "FinconectaEventTypeMapping": {
        "properties": {
          "finconectaEventType": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          },
          "wllEventType": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "finconectaEventType",
          "wllEventType"
        ]
      },
      "SimplifiTransactionEvents": {
        "properties": {
          "ACCEPTED": {
            "type": "string"
          },
          "CLEARED": {
            "type": "string"
          },
          "DECLINED": {
            "type": "string"
          },
          "SETTLED": {
            "type": "string"
          },
          "REVERSED": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SimplifiIntegrationConfig": {
        "properties": {
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "restrictedUsername": {
            "type": "string"
          },
          "restrictedPassword": {
            "type": "string"
          },
          "simplifiUrl": {
            "format": "url",
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "cardProgramId": {
            "format": "uuid",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "pointToCurrencyMultiplier": {
            "type": "number"
          },
          "maximumLoad": {
            "type": "number"
          },
          "minimumLoad": {
            "type": "number"
          },
          "maximumBalance": {
            "type": "number"
          },
          "loadCardFlowRequestTimeout": {
            "type": "number"
          },
          "loadStartedEvent": {
            "type": "string"
          },
          "loadFailedEvent": {
            "type": "string"
          },
          "loadSuccessEvent": {
            "type": "string"
          },
          "eventTypes": {
            "$ref": "#/components/schemas/SimplifiTransactionEvents"
          }
        },
        "type": "object",
        "required": [
          "username",
          "password",
          "restrictedUsername",
          "restrictedPassword",
          "simplifiUrl",
          "companyName",
          "cardProgramId",
          "currency",
          "pointToCurrencyMultiplier",
          "maximumLoad",
          "minimumLoad",
          "maximumBalance",
          "loadCardFlowRequestTimeout",
          "loadStartedEvent",
          "loadFailedEvent",
          "loadSuccessEvent"
        ]
      },
      "KindredEvents": {
        "properties": {
          "PENDING": {
            "type": "string"
          },
          "APPROVED": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "PENDING",
          "APPROVED"
        ]
      },
      "KindredIntegrationConfig": {
        "properties": {
          "clientId": {
            "type": "string"
          },
          "clientSecret": {
            "type": "string"
          },
          "partnerId": {
            "type": "string"
          },
          "countryCode": {
            "type": "string"
          },
          "eventTypes": {
            "$ref": "#/components/schemas/KindredEvents"
          },
          "importDaily": {
            "type": "boolean"
          },
          "importType": {
            "enum": [
              "FULL",
              "CASHBACK_ONLY",
              "COUPONS_ONLY"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "clientId",
          "clientSecret",
          "partnerId",
          "countryCode",
          "importDaily"
        ]
      },
      "KindredRewardMetadata": {
        "properties": {
          "dealId": {
            "type": "string"
          },
          "domains": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "dealId",
          "domains"
        ]
      },
      "KindredReward": {
        "properties": {
          "externalId": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "externalId"
        ]
      },
      "SimpleConfig": {
        "properties": {
          "expiryBasedOn": {},
          "dateModifier": {}
        },
        "type": "object",
        "required": [
          "expiryBasedOn",
          "dateModifier"
        ]
      },
      "ExpiryPrediction": {
        "properties": {
          "fullExpiryPeriod": {
            "type": "number"
          },
          "remainingPeriod": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "fullExpiryPeriod",
          "remainingPeriod"
        ]
      },
      "SegmentIntegrationConfig": {
        "properties": {
          "writeKey": {
            "type": "string"
          },
          "overrideIdPath": {
            "type": "string"
          },
          "backupOverrideIdPath": {
            "type": "string"
          },
          "usDataCenter": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "writeKey"
        ]
      },
      "CalendarWeekRestrictionArg": {
        "properties": {
          "startOfWeek": {
            "type": "string",
            "enum": [
              "SUN",
              "MON",
              "TUE",
              "WED",
              "THUR",
              "FRI",
              "SAT"
            ]
          }
        },
        "type": "object",
        "required": [
          "startOfWeek"
        ]
      },
      "CalendarNumericRestrictionArg": {
        "properties": {
          "n": {
            "exclusiveMinimum": true,
            "minimum": 0,
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "n"
        ]
      },
      "BaseRestriction": {
        "properties": {
          "maximumPoints": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "maximumPoints"
        ]
      },
      "CalendarWeekRestriction": {
        "properties": {
          "intervalType": {
            "type": "string",
            "enum": [
              "CALENDAR_WEEK"
            ]
          },
          "arg": {
            "$ref": "#/components/schemas/CalendarWeekRestrictionArg",
            "type": "object",
            "minProperties": 1
          },
          "maximumPoints": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "intervalType",
          "arg",
          "maximumPoints"
        ]
      },
      "CalendarNumericRestriction": {
        "properties": {
          "intervalType": {
            "type": "string",
            "enum": [
              "RUNNING_HOURS",
              "RUNNING_DAYS"
            ]
          },
          "arg": {
            "$ref": "#/components/schemas/CalendarNumericRestrictionArg",
            "type": "object",
            "minProperties": 1
          },
          "maximumPoints": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "intervalType",
          "arg",
          "maximumPoints"
        ]
      },
      "MaxPointsConfig": {
        "properties": {
          "liabilityEntity": {
            "enum": [
              "ACTOR",
              "TENANT"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "liabilityEntity"
        ]
      },
      "MaxPointsTransactionConfig": {
        "properties": {
          "restriction": {
            "type": "object"
          },
          "liabilityEntity": {
            "enum": [
              "ACTOR",
              "TENANT"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "restriction",
          "liabilityEntity"
        ]
      },
      "MaxPointsBalanceConfig": {
        "properties": {
          "maxPointsInCirculation": {
            "type": "number"
          },
          "liabilityEntity": {
            "enum": [
              "ACTOR",
              "TENANT"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "maxPointsInCirculation",
          "liabilityEntity"
        ]
      },
      "MaxPointsPrediction": {
        "properties": {
          "pointsCap": {
            "type": "number"
          },
          "remainingPoints": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "pointsCap",
          "remainingPoints"
        ]
      },
      "StripePayoutIntegrationConfig": {
        "properties": {
          "apiKey": {
            "type": "string"
          },
          "conversionRate": {
            "type": "number"
          },
          "minimumPayoutAmount": {
            "type": "number"
          },
          "currencyCode": {
            "type": "string"
          },
          "returnUrl": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "apiKey",
          "conversionRate",
          "minimumPayoutAmount",
          "currencyCode"
        ]
      },
      "CheckoutIntegrationConfig": {
        "properties": {
          "channelId": {
            "type": "string"
          },
          "secretKey": {
            "type": "string"
          },
          "publicKey": {
            "type": "string"
          },
          "currencyAccountId": {
            "type": "string"
          },
          "conversionRate": {
            "type": "number"
          },
          "minimumPayoutAmount": {
            "type": "number"
          },
          "currencyCode": {
            "enum": [
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BGN",
              "BHD",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BTN",
              "BWP",
              "BZD",
              "CAD",
              "CDF",
              "CHF",
              "CLP",
              "CNY",
              "COP",
              "CRC",
              "CUP",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ERN",
              "ETB",
              "EUR",
              "FJD",
              "FKP",
              "GBP",
              "GEL",
              "GIP",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "IQD",
              "IRR",
              "ISK",
              "JMD",
              "JOD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KWD",
              "KYD",
              "KZT",
              "LAK",
              "LKR",
              "LRD",
              "LSL",
              "LYD",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRU",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "OMR",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLE",
              "SLL",
              "SOS",
              "SRD",
              "STN",
              "SVC",
              "SZL",
              "THB",
              "TJS",
              "TMT",
              "TND",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "USD",
              "UYU",
              "UZS",
              "VES",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XDR",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "verifyFidelCards": {
            "type": "boolean"
          },
          "domesticCountryCode": {
            "type": "string"
          },
          "fundsTransferTypeMap": {
            "type": "object"
          },
          "sender": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "channelId",
          "secretKey",
          "publicKey",
          "currencyAccountId",
          "conversionRate",
          "minimumPayoutAmount",
          "currencyCode",
          "domesticCountryCode",
          "fundsTransferTypeMap",
          "sender"
        ]
      },
      "WalletTheme": {
        "properties": {
          "backgroundColor": {
            "type": "string"
          },
          "foregroundColor": {
            "type": "string"
          },
          "labelColor": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "icon2x": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          },
          "logo2x": {
            "type": "string"
          },
          "strip": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WalletIntegrationConfig": {
        "properties": {
          "appleSignerCert": {
            "type": "string"
          },
          "appleSignerKey": {
            "type": "string"
          },
          "appleWWDRCert": {
            "type": "string"
          },
          "applePassphrase": {
            "type": "string"
          },
          "appIdentifier": {
            "type": "string"
          },
          "appleTeamId": {
            "type": "string"
          },
          "googleIssuerId": {
            "type": "string"
          },
          "googlePrivateKey": {
            "type": "string"
          },
          "googleClientEmail": {
            "type": "string"
          },
          "applePassModel": {
            "type": "string"
          },
          "googlePassClassId": {
            "type": "string"
          },
          "theme": {
            "$ref": "#/components/schemas/WalletTheme"
          },
          "organizationName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "appleSignerCert",
          "appleSignerKey",
          "appleWWDRCert",
          "applePassphrase",
          "appIdentifier",
          "appleTeamId",
          "googleIssuerId",
          "googlePrivateKey",
          "googleClientEmail",
          "applePassModel",
          "googlePassClassId",
          "theme",
          "organizationName",
          "description"
        ]
      },
      "PurchaseRewardsConfig": {
        "properties": {
          "rewardIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "autoRedeem": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "rewardIds"
        ]
      },
      "JsonataFilterConfiguration": {
        "properties": {
          "expression": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "expression"
        ]
      },
      "KlaviyoIntegrationConfig": {
        "properties": {
          "codeVerifier": {
            "type": "string"
          },
          "authorizationCode": {
            "type": "string"
          },
          "redirectUrl": {
            "type": "string"
          },
          "audienceMap": {},
          "consentConfig": {}
        },
        "type": "object"
      },
      "CarltonOneIntegrationConfig": {
        "properties": {
          "galleryId": {
            "type": "string"
          },
          "environment": {
            "type": "string",
            "enum": [
              "staging",
              "production"
            ]
          },
          "country": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "language": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "galleryId",
          "environment",
          "country",
          "language"
        ]
      },
      "CarltonOneRewardMetadata": {
        "properties": {
          "rewardId": {
            "type": "string"
          },
          "catalogId": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "rewardId",
          "catalogId"
        ]
      },
      "MerchandiseReward": {
        "properties": {
          "stockCapacity": {
            "minimum": 0,
            "type": "integer"
          },
          "requiresDeliveryAddress": {
            "type": "boolean"
          },
          "allowedCountries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "stockCapacity",
          "requiresDeliveryAddress"
        ]
      },
      "ShippingAddress": {
        "properties": {
          "recipientName": {
            "type": "string"
          },
          "streetAddress": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "telephoneNumber": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "recipientName",
          "streetAddress",
          "city",
          "postcode",
          "country"
        ]
      },
      "EarningCampaignDetails": {
        "properties": {
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "name": {
            "minLength": 2,
            "maxLength": 128,
            "type": "string"
          },
          "description": {
            "minLength": 2,
            "maxLength": 5000,
            "type": "string"
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "locale"
        ]
      },
      "MissionDetails": {
        "properties": {
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "name": {
            "minLength": 2,
            "maxLength": 128,
            "type": "string"
          },
          "description": {
            "minLength": 2,
            "maxLength": 5000,
            "type": "string"
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "locale"
        ]
      },
      "ProfileDefinition": {
        "properties": {
          "attributes": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "UserProfileDefinition": {
        "properties": {
          "familyName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "givenName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "emailAddress": {
            "format": "email",
            "type": "string"
          },
          "gender": {
            "enum": [
              "FEMALE",
              "MALE",
              "OTHER",
              "UNKNOWN"
            ],
            "type": "string"
          },
          "birthdate": {
            "pattern": "^(19[0-9][0-9]|20[0-3][0-9])-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$",
            "type": "string"
          },
          "country": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "postcode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "streetAddress": {
            "minLength": 1,
            "maxLength": 64,
            "type": "string"
          },
          "telephoneNumber": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "attributionData": {
            "type": "object"
          },
          "attributes": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "familyName",
          "givenName"
        ]
      },
      "AttributeKeyValuePair": {
        "properties": {
          "isEnabled": {
            "type": "boolean"
          },
          "key": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          },
          "value": {}
        },
        "type": "object",
        "required": [
          "isEnabled",
          "key",
          "value"
        ]
      },
      "ReactionDefinition": {
        "properties": {
          "type": {
            "enum": [
              "HANDLER",
              "REWARD",
              "POINTS",
              "POINTS_CAP",
              "WEBHOOK",
              "ATTRIBUTE",
              "BADGE"
            ],
            "type": "string"
          },
          "handler": {
            "enum": [
              "EXAMPLE",
              "REFERRAL_TRANCHE_STATUS",
              "MISSION_PROGRESS"
            ],
            "type": "string"
          },
          "points": {
            "$ref": "#/components/schemas/Derivation"
          },
          "attributes": {
            "items": {
              "$ref": "#/components/schemas/AttributeKeyValuePair"
            },
            "type": "array"
          },
          "reward": {},
          "autoRedeem": {
            "type": "boolean"
          },
          "url": {
            "format": "url",
            "type": "string"
          },
          "forFailure": {
            "type": "boolean"
          },
          "headers": {
            "type": "object"
          },
          "authType": {
            "enum": [
              "NONE",
              "OAUTH2_CLIENT_CREDENTIALS"
            ],
            "type": "string"
          },
          "authConfig": {
            "type": "object"
          },
          "includeFullSubject": {
            "type": "boolean"
          },
          "badge": {}
        },
        "type": "object",
        "required": [
          "type"
        ]
      },
      "EventReactorDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "eventType": {},
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "constraint": {
            "type": "object"
          },
          "maxActivations": {
            "minimum": 1,
            "type": "integer"
          },
          "activationContext": {
            "enum": [
              "GLOBAL",
              "TENANT",
              "SUBJECT"
            ],
            "type": "string"
          },
          "activationCalculationType": {
            "type": "object"
          },
          "activationPeriod": {
            "type": "object"
          },
          "effectivity": {
            "$ref": "#/components/schemas/Effectivity"
          },
          "isLocked": {},
          "ownerId": {},
          "ownerType": {}
        },
        "type": "object",
        "required": [
          "name",
          "eventType"
        ]
      },
      "FilterDefinition": {
        "properties": {
          "type": {
            "enum": [
              "QUERY_TREE",
              "CUSTOM_RULE",
              "JSONATA"
            ],
            "type": "string"
          },
          "ruleProperties": {
            "type": "object"
          },
          "resultParams": {
            "$ref": "#/components/schemas/FilterResultParams",
            "items": {
              "$ref": "#/components/schemas/FilterResultParams"
            },
            "type": "array"
          },
          "configuration": {},
          "name": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          },
          "priority": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "type",
          "resultParams",
          "name",
          "priority"
        ]
      },
      "TriggerDefinition": {
        "properties": {
          "type": {
            "enum": [
              "DAILY_SCHEDULED_JOB",
              "HOURLY_SCHEDULED_JOB",
              "EVENT_REACTOR",
              "MANUAL_FOR_ONE",
              "MANUAL_FOR_ALL",
              "DAILY_POST_POINTS_LIABILITY"
            ],
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "eventReactorDefinition": {
            "$ref": "#/components/schemas/EventReactorDefinition"
          }
        },
        "type": "object",
        "required": [
          "type",
          "name"
        ]
      },
      "LogicDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "isActive": {
            "type": "boolean"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/TriggerDefinition"
            },
            "type": "array"
          },
          "filters": {
            "items": {
              "$ref": "#/components/schemas/FilterDefinition"
            },
            "type": "array"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "ownerId": {
            "format": "uuid",
            "type": "string"
          },
          "ownerDomain": {
            "enum": [
              "CAMPAIGN_TRANCHE",
              "AUDIENCE",
              "REWARD_AVAILABILITY",
              "USER_BASED_VISIBILITY"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "name",
          "isActive",
          "triggers",
          "filters",
          "reactions",
          "ownerDomain"
        ]
      },
      "LogicPatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "isActive": {
            "type": "boolean"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/TriggerDefinition"
            },
            "type": "array"
          },
          "filters": {
            "items": {
              "$ref": "#/components/schemas/FilterDefinition"
            },
            "type": "array"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ReferralActivityDefinition": {
        "properties": {
          "source": {
            "enum": [
              "EMAIL",
              "FACEBOOK",
              "TWITTER",
              "LINKEDIN",
              "OTHER"
            ],
            "type": "string"
          },
          "sourceUserId": {
            "type": "string"
          },
          "userAgent": {
            "enum": [
              "IOS",
              "ANDROID",
              "WEB",
              "UNKNOWN"
            ],
            "type": "string"
          },
          "ipAddress": {
            "type": "string"
          },
          "activityType": {
            "enum": [
              "CLICK",
              "REGISTER"
            ],
            "type": "string"
          },
          "registeredUserAuthIdentifier": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "source",
          "sourceUserId",
          "activityType"
        ]
      },
      "ReferralDefinition": {
        "properties": {
          "clickCount": {
            "type": "integer"
          },
          "source": {
            "enum": [
              "EMAIL",
              "FACEBOOK",
              "TWITTER",
              "LINKEDIN",
              "OTHER"
            ],
            "type": "string"
          },
          "sourceUserId": {
            "type": "string"
          },
          "userAgent": {
            "enum": [
              "IOS",
              "ANDROID",
              "WEB",
              "UNKNOWN"
            ],
            "type": "string"
          },
          "ipAddress": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "clickCount",
          "source",
          "sourceUserId"
        ]
      },
      "ReferralPatch": {
        "properties": {
          "clickCount": {
            "type": "integer"
          },
          "source": {
            "enum": [
              "EMAIL",
              "FACEBOOK",
              "TWITTER",
              "LINKEDIN",
              "OTHER"
            ],
            "type": "string"
          },
          "userAgent": {
            "enum": [
              "IOS",
              "ANDROID",
              "WEB",
              "UNKNOWN"
            ],
            "type": "string"
          },
          "ipAddress": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TrancheStatusUpdateDefinition": {
        "properties": {
          "type": {
            "pattern": "^[A-Z]+(_[A-Z]+)*$",
            "type": "string",
            "minLength": 2,
            "maxLength": 64
          },
          "subject": {
            "minLength": 1,
            "maxLength": 128,
            "type": "string"
          },
          "payload": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "type",
          "subject",
          "payload"
        ]
      },
      "EventReactorPatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "constraint": {
            "type": "object"
          },
          "maxActivations": {
            "minimum": 1,
            "type": "integer"
          },
          "activationContext": {
            "enum": [
              "GLOBAL",
              "TENANT",
              "SUBJECT"
            ],
            "type": "string"
          },
          "activationCalculationType": {
            "type": "object"
          },
          "activationPeriod": {
            "type": "object"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "effectivity": {
            "$ref": "#/components/schemas/Effectivity"
          }
        },
        "type": "object"
      },
      "EventTypePatch": {
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[A-Z]+(_[A-Z]+)*$",
            "minLength": 2,
            "maxLength": 64
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "schema": {
            "type": "object"
          },
          "metaTypeMappings": {
            "items": {
              "$ref": "#/components/schemas/MetaTypeMapping"
            },
            "type": "array"
          },
          "enhancers": {
            "items": {
              "enum": [
                "AUDIENCE_ENHANCER",
                "POINTS_ENHANCER",
                "REFERRAL_DETAILS",
                "CODE_POOL",
                "RANDOM_NUMBER",
                "TEST"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "isActive": {
            "type": "boolean"
          },
          "omitFromUserActivity": {
            "type": "boolean"
          },
          "isPrivate": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "RewardFacade": {
        "properties": {
          "externalId": {
            "type": "string"
          },
          "stockCapacity": {
            "minimum": 0,
            "type": "integer"
          },
          "requiresDeliveryAddress": {
            "type": "boolean"
          },
          "allowedCountries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 10000
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "terms": {
            "type": "string",
            "maxLength": 25000
          },
          "summary": {
            "type": "string"
          },
          "logoUrl": {
            "format": "url",
            "type": "string"
          },
          "redemptionMessage": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "externalId",
          "stockCapacity",
          "requiresDeliveryAddress",
          "locale"
        ]
      },
      "Gallery": {
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "Active",
              "Inactive"
            ]
          },
          "partner_id": {
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "partner_id"
        ]
      },
      "Catalog": {
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id",
          "type"
        ]
      },
      "ValidateOrderResponse": {
        "properties": {
          "valid_status": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "OrderItemStatus": {
        "properties": {
          "validation_errors": {},
          "line_item_id": {
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "minLength": 1,
            "type": "string"
          },
          "extra": {
            "type": "string"
          },
          "partner_order_number": {
            "minLength": 1,
            "type": "string"
          },
          "order_item_history": {
            "items": {},
            "type": "array"
          },
          "details": {
            "items": {},
            "type": "array"
          },
          "categories": {
            "items": {},
            "type": "array"
          },
          "user_defined_fields": {
            "items": {},
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "line_item_id",
          "status",
          "partner_order_number"
        ]
      },
      "OrderResponse": {
        "properties": {
          "validation_errors": {},
          "order_item_statuses": {
            "minLength": 1,
            "type": "array",
            "items": {}
          },
          "order_id": {
            "minLength": 1,
            "type": "string"
          },
          "status": {
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "order_item_statuses",
          "order_id",
          "status"
        ]
      },
      "CarltonOneCredentials": {
        "properties": {
          "clientId": {
            "minLength": 1,
            "type": "string"
          },
          "clientSecret": {
            "minLength": 1,
            "type": "string"
          },
          "username": {
            "minLength": 1,
            "type": "string"
          },
          "password": {
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "clientId",
          "clientSecret",
          "username",
          "password"
        ]
      },
      "ExpiryData": {
        "properties": {
          "isExpired": {
            "type": "boolean"
          },
          "pointsBalance": {
            "type": "number"
          },
          "prediction": {
            "$ref": "#/components/schemas/ExpiryPrediction",
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "isExpired"
        ]
      },
      "MaxPointsLiabilityData": {
        "properties": {
          "isLiable": {
            "type": "boolean"
          },
          "prediction": {
            "$ref": "#/components/schemas/MaxPointsPrediction",
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "isLiable"
        ]
      },
      "ExpiryPredictionSummaryPeriodEntry": {
        "properties": {
          "pointsDueToExpire": {
            "type": "number"
          },
          "timePeriod": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "pointsDueToExpire",
          "timePeriod"
        ]
      },
      "MaxPointsPredictionSummaryEntry": {
        "properties": {
          "percentageUsed": {
            "type": "number"
          },
          "pointsCap": {
            "type": "number"
          },
          "remainingPoints": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "percentageUsed",
          "pointsCap",
          "remainingPoints"
        ]
      },
      "ExpiryResultDetails": {
        "properties": {
          "expiryDetails": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ExpiryData"
            },
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "expiryDetails"
        ]
      },
      "MaxPointsLiabilityResultDetails": {
        "properties": {
          "maxPointsLiabilityDetails": {
            "$ref": "#/components/schemas/MaxPointsLiabilityData",
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "maxPointsLiabilityDetails"
        ]
      },
      "MaxPointsPredictionSummary": {
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/MaxPointsPredictionSummaryEntry"
          },
          "type": {
            "enum": [
              "MAX_POINTS",
              "EXPIRY"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type"
        ]
      },
      "ExpiryPredictionSummary": {
        "properties": {
          "summary": {
            "items": {
              "$ref": "#/components/schemas/ExpiryPredictionSummaryPeriodEntry"
            },
            "type": "array"
          },
          "type": {
            "enum": [
              "MAX_POINTS",
              "EXPIRY"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "summary",
          "type"
        ]
      },
      "CumulatedPrediction": {
        "properties": {
          "overallSummary": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "overallSummary"
        ]
      },
      "RewardAvailabilityCriteriaDefinition": {
        "properties": {
          "criteriaTree": {
            "type": "object"
          },
          "criteriaJsonLogic": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "criteriaTree",
          "criteriaJsonLogic"
        ]
      },
      "RewardAvailabilityCriteria": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id"
        ]
      },
      "RewardDefinition": {
        "properties": {
          "type": {
            "enum": [
              "AWIN_PROGRAMME",
              "FIDEL_OFFER",
              "GENERIC_OFFER",
              "KINDRED",
              "MERCHANDISE",
              "OLIVE_OFFER",
              "VOUCHER",
              "WEGIFT_PRODUCT",
              "XOXO_PRODUCT",
              "CARLTON_ONE"
            ],
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "price": {
            "maximum": 10000000,
            "type": "integer",
            "minimum": 0
          },
          "availability": {
            "$ref": "#/components/schemas/Effectivity"
          },
          "purchasable": {
            "type": "boolean"
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 10000
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "value": {
            "maximum": 10000000,
            "type": "integer",
            "minimum": 0
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          },
          "terms": {
            "type": "string",
            "maxLength": 25000
          },
          "tier": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "venues": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "category": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "categories": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "summary": {
            "type": "string"
          },
          "redemptionChannels": {
            "items": {
              "enum": [
                "IN_STORE",
                "ONLINE"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "purchasableForAudiences": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "visibilityCriteriaDefinition": {
            "$ref": "#/components/schemas/RewardAvailabilityCriteriaDefinition"
          },
          "clickThroughUrl": {
            "format": "url",
            "type": "string"
          },
          "logoUrl": {
            "format": "url",
            "type": "string"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "country": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "redemptionMessage": {
            "type": "string"
          },
          "displayUrl": {
            "format": "url",
            "type": "string"
          },
          "brandName": {
            "type": "string"
          },
          "fidelBrandId": {
            "type": "string"
          },
          "fidelOfferId": {
            "type": "string"
          },
          "schemes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "minTransactionAmount": {
            "minimum": 0,
            "type": "integer"
          },
          "maxTransactionAmount": {
            "type": "integer"
          },
          "returnPeriod": {
            "minimum": 7,
            "type": "integer"
          },
          "qualifiedTransactionsLimit": {
            "minimum": 0,
            "type": "integer"
          },
          "purchaseExpiration": {
            "type": "integer"
          },
          "codeType": {
            "enum": [
              "HUMAN",
              "OTP",
              "POOL",
              "STATIC"
            ],
            "type": "string"
          },
          "code": {
            "type": "object"
          },
          "codes": {
            "items": {},
            "type": "array"
          },
          "hideCode": {
            "type": "boolean"
          },
          "notificationConfig": {
            "$ref": "#/components/schemas/NotificationConfig"
          },
          "dynamicUrl": {
            "type": "boolean"
          },
          "productCode": {
            "type": "string"
          },
          "productCodes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "denomination": {
            "type": "string"
          },
          "margin": {
            "type": "number"
          },
          "payoutType": {
            "enum": [
              "SINGLE",
              "MULTIPLE",
              "PAY_TO_CARD"
            ],
            "type": "string"
          },
          "productId": {
            "type": "number"
          },
          "details": {
            "type": "object"
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/CarltonOneRewardMetadata"
          },
          "stockCapacity": {
            "minimum": 0,
            "type": "integer"
          },
          "requiresDeliveryAddress": {
            "type": "boolean"
          },
          "allowedCountries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "type",
          "name",
          "price",
          "availability",
          "purchasable",
          "details"
        ]
      },
      "RewardAvailabilityCriteriaPatch": {
        "properties": {
          "criteriaTree": {
            "type": "object"
          },
          "criteriaJsonLogic": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "RewardPatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 10000
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "value": {
            "maximum": 10000000,
            "type": "integer",
            "minimum": 0
          },
          "price": {
            "maximum": 10000000,
            "type": "integer",
            "minimum": 0
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          },
          "availability": {
            "$ref": "#/components/schemas/Effectivity"
          },
          "purchasable": {
            "type": "boolean"
          },
          "terms": {
            "type": "string",
            "maxLength": 25000
          },
          "tier": {},
          "venues": {},
          "purchaseExpiration": {
            "type": "integer"
          },
          "hideCode": {
            "type": "boolean"
          },
          "notificationConfig": {
            "$ref": "#/components/schemas/NotificationConfig"
          },
          "redemptionMessage": {
            "type": "string"
          },
          "codes": {
            "items": {},
            "type": "array"
          },
          "code": {
            "type": "object"
          },
          "category": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "categories": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "summary": {
            "type": "string"
          },
          "redemptionChannels": {
            "items": {
              "enum": [
                "IN_STORE",
                "ONLINE"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "clickThroughUrl": {
            "format": "url",
            "type": "string"
          },
          "displayUrl": {
            "format": "url",
            "type": "string"
          },
          "logoUrl": {
            "format": "url",
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/CarltonOneRewardMetadata"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "country": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "brandName": {
            "type": "string"
          },
          "fidelBrandId": {
            "type": "string"
          },
          "minTransactionAmount": {
            "minimum": 0,
            "type": "integer"
          },
          "maxTransactionAmount": {
            "type": "integer"
          },
          "returnPeriod": {
            "minimum": 7,
            "type": "integer"
          },
          "qualifiedTransactionsLimit": {
            "minimum": 0,
            "type": "integer"
          },
          "schemes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "productCode": {
            "type": "string"
          },
          "productCodes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "productId": {
            "type": "number"
          },
          "denomination": {
            "pattern": "^[0-9]+\\.[0-9]{2}$",
            "type": "string"
          },
          "margin": {
            "type": "number"
          },
          "payoutType": {
            "enum": [
              "SINGLE",
              "MULTIPLE",
              "PAY_TO_CARD"
            ],
            "type": "string"
          },
          "purchasableForAudiences": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "visibilityCriteriaPatch": {
            "$ref": "#/components/schemas/RewardAvailabilityCriteriaPatch"
          },
          "details": {
            "type": "object"
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "stockCapacity": {
            "minimum": 0,
            "type": "integer"
          },
          "requiresDeliveryAddress": {
            "type": "boolean"
          },
          "allowedCountries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "availability"
        ]
      },
      "AwardBadgeCommand": {
        "properties": {
          "badgeId": {
            "format": "uuid",
            "type": "string"
          },
          "beneficiaryId": {
            "format": "uuid",
            "type": "string"
          },
          "comment": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "badgeId",
          "beneficiaryId"
        ]
      },
      "HandleEventReactionCommand": {
        "properties": {
          "eventId": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "eventId"
        ]
      },
      "GiveVoucherCommand": {
        "properties": {
          "reward": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "comment": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "reward"
        ]
      },
      "VenueContactDetails": {
        "properties": {
          "type": {
            "enum": [
              "email",
              "phone",
              "sms",
              "link"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "imageUri": {
            "format": "url",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "name",
          "value"
        ]
      },
      "VenueDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "address": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "availability": {
            "$ref": "#/components/schemas/Effectivity"
          },
          "coordinates": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "attributes": {
            "$ref": "#/components/schemas/VenueAttributes"
          },
          "externalIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "isUserModifiable": {
            "type": "boolean"
          },
          "postcode": {
            "minLength": 1,
            "maxLength": 128,
            "type": "string"
          },
          "type": {
            "enum": [
              "TENANT",
              "USER",
              "MERCHANT"
            ],
            "type": "string"
          },
          "contactDetails": {
            "items": {
              "$ref": "#/components/schemas/VenueContactDetails"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "name",
          "address",
          "availability",
          "coordinates"
        ]
      },
      "UserConsentDefinition": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "checked": {
            "type": "boolean"
          },
          "user": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "checked"
        ]
      },
      "ActorDefinition": {
        "properties": {
          "externalIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "isRestricted": {
            "type": "boolean"
          },
          "linkedVenuesDefinitions": {
            "items": {
              "$ref": "#/components/schemas/VenueDefinition"
            },
            "type": "array"
          },
          "linkedVenues": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "consentsDefinition": {
            "items": {
              "$ref": "#/components/schemas/UserConsentDefinition"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UserDefinition": {
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/UserProfileDefinition"
          },
          "authIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "referralInviteCode": {
            "minLength": 1,
            "maxLength": 1024,
            "type": "string"
          },
          "userToken": {
            "minLength": 1,
            "maxLength": 1024,
            "type": "string"
          },
          "referralActivity": {
            "$ref": "#/components/schemas/ReferralActivityDefinition"
          },
          "flags": {},
          "externalIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "isRestricted": {
            "type": "boolean"
          },
          "linkedVenuesDefinitions": {
            "items": {
              "$ref": "#/components/schemas/VenueDefinition"
            },
            "type": "array"
          },
          "linkedVenues": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "consentsDefinition": {
            "items": {
              "$ref": "#/components/schemas/UserConsentDefinition"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "profile"
        ]
      },
      "DeleteUserInAuthProvider": {
        "properties": {
          "userId": {
            "format": "uuid",
            "type": "string"
          },
          "authIdentifier": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "userId",
          "authIdentifier"
        ]
      },
      "DeleteUserFidelCardsCommand": {
        "properties": {
          "userId": {
            "format": "uuid",
            "type": "string"
          },
          "authIdentifier": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "userId",
          "authIdentifier"
        ]
      },
      "BaseEventDefinition": {
        "properties": {
          "type": {
            "pattern": "^[A-Z]+(_[A-Z]+)*$",
            "type": "string",
            "minLength": 2,
            "maxLength": 64
          },
          "payload": {
            "type": "object"
          },
          "occurredAt": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type"
        ]
      },
      "EventDefinition": {
        "properties": {
          "subject": {
            "minLength": 1,
            "maxLength": 128,
            "type": "string"
          },
          "executor": {
            "minLength": 1,
            "maxLength": 128,
            "type": "string"
          },
          "type": {
            "pattern": "^[A-Z]+(_[A-Z]+)*$",
            "type": "string",
            "minLength": 2,
            "maxLength": 64
          },
          "payload": {
            "type": "object"
          },
          "occurredAt": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type"
        ]
      },
      "SqsEventDefinition": {
        "properties": {
          "subject": {},
          "retryIfUserNotFound": {},
          "type": {
            "pattern": "^[A-Z]+(_[A-Z]+)*$",
            "type": "string",
            "minLength": 2,
            "maxLength": 64
          },
          "payload": {
            "type": "object"
          },
          "occurredAt": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type"
        ]
      },
      "SqsCreateEventCommand": {
        "properties": {
          "apiKey": {
            "type": "string"
          },
          "command": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "payload": {
            "$ref": "#/components/schemas/SqsEventDefinition"
          }
        },
        "type": "object",
        "required": [
          "apiKey",
          "command",
          "payload"
        ]
      },
      "AudienceCriteriaPatch": {
        "properties": {
          "criteriaFormat": {
            "enum": [
              "QUERY_TREE",
              "JSONATA"
            ],
            "type": "string"
          },
          "criteriaTree": {
            "type": "object"
          },
          "criteriaJsonLogic": {
            "type": "object"
          },
          "criteriaJsonata": {
            "type": "string"
          },
          "triggerFrequency": {
            "enum": [
              "DAILY",
              "HOURLY",
              "REACTIVE",
              "MANUAL",
              "DAILY_REACTIVE",
              "DAILY_POST_POINTS_LIABILITY"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CalculateUserAudienceCommand": {
        "properties": {
          "audienceId": {
            "type": "string"
          },
          "audienceIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tenantId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "audienceIds",
          "tenantId",
          "userId"
        ]
      },
      "TriggerAudienceSearchCommand": {
        "properties": {
          "audienceId": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "audienceId",
          "tenantId"
        ]
      },
      "EventTypeDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[A-Z]+(_[A-Z]+)*$",
            "minLength": 2,
            "maxLength": 64
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "schema": {
            "type": "object"
          },
          "isPrivate": {
            "type": "boolean"
          },
          "isActive": {
            "type": "boolean"
          },
          "metaTypeMappings": {
            "items": {
              "$ref": "#/components/schemas/MetaTypeMapping"
            },
            "type": "array"
          },
          "enhancers": {
            "items": {
              "enum": [
                "AUDIENCE_ENHANCER",
                "POINTS_ENHANCER",
                "REFERRAL_DETAILS",
                "CODE_POOL",
                "RANDOM_NUMBER",
                "TEST"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "omitFromUserActivity": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "isPrivate"
        ]
      },
      "AudienceCriteriaDefinition": {
        "properties": {
          "criteriaFormat": {
            "enum": [
              "QUERY_TREE",
              "JSONATA"
            ],
            "type": "string"
          },
          "criteriaTree": {
            "type": "object"
          },
          "criteriaJsonLogic": {
            "type": "object"
          },
          "criteriaJsonata": {
            "type": "string"
          },
          "triggerFrequency": {
            "enum": [
              "DAILY",
              "HOURLY",
              "REACTIVE",
              "MANUAL",
              "DAILY_REACTIVE",
              "DAILY_POST_POINTS_LIABILITY"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "triggerFrequency"
        ]
      },
      "AudienceDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 10000
          },
          "isActive": {
            "type": "boolean"
          },
          "criteriaDefinition": {
            "$ref": "#/components/schemas/AudienceCriteriaDefinition"
          },
          "sendAudienceJoinedEvent": {
            "type": "boolean"
          },
          "sendAudienceLeftEvent": {
            "type": "boolean"
          },
          "calculateOnSubjectRegistration": {
            "type": "boolean"
          },
          "aiCriteriaMetadata": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "isActive",
          "criteriaDefinition"
        ]
      },
      "AudienceEstimatePayload": {
        "properties": {
          "criteriaJsonata": {
            "type": "string"
          },
          "maxSample": {
            "maximum": 5000,
            "type": "integer",
            "minimum": 100
          },
          "sampleSeed": {
            "type": "integer"
          }
        },
        "type": "object",
        "required": [
          "criteriaJsonata"
        ]
      },
      "AudiencePatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 10000
          },
          "isActive": {
            "type": "boolean"
          },
          "criteriaPatch": {
            "$ref": "#/components/schemas/AudienceCriteriaPatch"
          },
          "sendAudienceJoinedEvent": {
            "type": "boolean"
          },
          "sendAudienceLeftEvent": {
            "type": "boolean"
          },
          "calculateOnSubjectRegistration": {
            "type": "boolean"
          },
          "aiCriteriaMetadata": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "AudienceResultsPayload": {
        "properties": {
          "audienceIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "audienceIds"
        ]
      },
      "ImportAwinRewardsCommand": {
        "properties": {
          "tenantId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "tenantId"
        ]
      },
      "BranchAttributionPayload": {
        "properties": {
          "isAttributed": {
            "type": "boolean"
          },
          "lastAttributedTouchData": {
            "type": "object",
            "minProperties": 1
          },
          "hasExistingUserOnSameDevice": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "isAttributed",
          "lastAttributedTouchData"
        ]
      },
      "BulkCodeDefinition": {
        "properties": {
          "codes": {
            "items": {
              "type": "string"
            },
            "maxItems": 5000,
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "codes"
        ]
      },
      "CodeDefinition": {
        "properties": {
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          }
        },
        "type": "object",
        "required": [
          "value"
        ]
      },
      "CodePoolDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10000
          },
          "active": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "name"
        ]
      },
      "CodePoolPatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "minLength": 0,
            "maxLength": 10000
          },
          "active": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ActorAdjustPointsCommand": {
        "properties": {
          "points": {
            "type": "number"
          },
          "actorId": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "impactType": {
            "enum": [
              "EARN",
              "SPEND",
              "NONE"
            ],
            "type": "string"
          },
          "liabilityHandlingPolicy": {
            "enum": [
              "BYPASS",
              "REJECT_EVENT"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "points",
          "actorId"
        ]
      },
      "PurchaseRewardCommand": {
        "properties": {
          "beneficiaryId": {
            "format": "uuid",
            "type": "string"
          },
          "rewardId": {
            "format": "uuid",
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "deliveryAddress": {
            "$ref": "#/components/schemas/ShippingAddress"
          }
        },
        "type": "object",
        "required": [
          "rewardId"
        ]
      },
      "RedeemBenefitCommand": {
        "properties": {
          "benefitId": {
            "format": "uuid",
            "type": "string"
          },
          "position": {
            "$ref": "#/components/schemas/GeoPoint"
          }
        },
        "type": "object",
        "required": [
          "benefitId"
        ]
      },
      "ValidateVoucherCommand": {
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "allowFutureValidation": {
            "type": "boolean"
          },
          "userIdentifier": {
            "minLength": 1,
            "type": "string"
          },
          "venueIdentifier": {
            "minLength": 1,
            "type": "string"
          },
          "position": {
            "$ref": "#/components/schemas/GeoPoint"
          }
        },
        "type": "object",
        "required": [
          "code"
        ]
      },
      "VoidBenefitCommand": {
        "properties": {
          "benefitId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "benefitId"
        ]
      },
      "ConsentDefinition": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "user": {
            "$ref": "#/components/schemas/Hydratable"
          }
        },
        "type": "object",
        "required": [
          "type",
          "user"
        ]
      },
      "ConsentTypeDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "required": {
            "type": "boolean"
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object",
        "required": [
          "name",
          "required"
        ]
      },
      "ConsentTypePatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "required": {
            "type": "boolean"
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "DiscountDefinition": {
        "properties": {
          "type": {
            "enum": [
              "ABSOLUTE",
              "FIXED",
              "PERCENTAGE"
            ],
            "type": "string"
          },
          "value": {
            "type": "number"
          },
          "sku": {
            "type": "string"
          },
          "productSku": {
            "type": "string"
          },
          "venues": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "type",
          "value"
        ]
      },
      "DiscountPatch": {
        "properties": {
          "type": {
            "enum": [
              "ABSOLUTE",
              "FIXED",
              "PERCENTAGE"
            ],
            "type": "string"
          },
          "value": {
            "type": "number"
          },
          "sku": {
            "type": "string"
          },
          "productSku": {
            "type": "string"
          },
          "reward": {},
          "venues": {}
        },
        "type": "object"
      },
      "OliveCardDefinition": {
        "properties": {
          "cardToken": {
            "type": "string"
          },
          "programType": {}
        },
        "type": "object",
        "required": [
          "cardToken",
          "programType"
        ]
      },
      "OliveCardUpdateDefinition": {
        "properties": {
          "programType": {
            "enum": [
              "CASHBACK",
              "CASHBACK_AND_ROUNDUP"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "programType"
        ]
      },
      "OliveRoundUpConfig": {
        "properties": {
          "limit": {
            "type": "number"
          },
          "chargeableCardId": {
            "type": "string"
          },
          "destinationId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateOliveConfigDefinition": {
        "properties": {
          "roundUp": {
            "$ref": "#/components/schemas/OliveRoundUpConfig"
          }
        },
        "type": "object"
      },
      "PayoutRegistrationAttributeValue": {
        "properties": {
          "accountId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "UNREGISTERED",
              "INPROGRESS",
              "REGISTERED",
              "FAILED"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "accountId",
          "status"
        ]
      },
      "StripeRegistrationRequest": {
        "properties": {
          "refreshUrl": {
            "type": "string"
          },
          "returnUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "StripePayoutRequest": {
        "properties": {
          "pointsToTransfer": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "StripeInitiatePaymentRequest": {
        "properties": {
          "pointsToTransfer": {
            "type": "number"
          },
          "refreshUrl": {
            "type": "string"
          },
          "returnUrl": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "pointsToTransfer",
          "refreshUrl",
          "returnUrl"
        ]
      },
      "CheckoutPaymentBody": {
        "properties": {
          "cardToken": {
            "pattern": "^tok_.*$",
            "type": "string"
          },
          "instrumentId": {
            "pattern": "^src_.*$",
            "type": "string"
          },
          "points": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "points"
        ]
      },
      "CheckoutPaymentRequestPayload": {
        "properties": {
          "instrumentId": {
            "type": "string"
          },
          "processingChannelId": {
            "type": "string"
          },
          "points": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "enum": [
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "ANG",
              "AOA",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BGN",
              "BHD",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BRL",
              "BSD",
              "BTN",
              "BWP",
              "BZD",
              "CAD",
              "CDF",
              "CHF",
              "CLP",
              "CNY",
              "COP",
              "CRC",
              "CUP",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ERN",
              "ETB",
              "EUR",
              "FJD",
              "FKP",
              "GBP",
              "GEL",
              "GIP",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "IQD",
              "IRR",
              "ISK",
              "JMD",
              "JOD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KRW",
              "KWD",
              "KYD",
              "KZT",
              "LAK",
              "LKR",
              "LRD",
              "LSL",
              "LYD",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRU",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "OMR",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SEK",
              "SGD",
              "SHP",
              "SLE",
              "SLL",
              "SOS",
              "SRD",
              "STN",
              "SVC",
              "SZL",
              "THB",
              "TJS",
              "TMT",
              "TND",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "USD",
              "UYU",
              "UZS",
              "VES",
              "VND",
              "VUV",
              "WST",
              "XAF",
              "XCD",
              "XDR",
              "XOF",
              "XPF",
              "YER",
              "ZAR",
              "ZMW"
            ],
            "type": "string"
          },
          "fundsTransferType": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "instrumentId",
          "processingChannelId",
          "points",
          "amount",
          "currency",
          "fundsTransferType",
          "reference"
        ]
      },
      "CheckoutRegistrationInfoParams": {
        "properties": {
          "type": {
            "enum": [
              "cards",
              "audiences"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type"
        ]
      },
      "CheckoutRevokeRegistrationBody": {
        "properties": {
          "type": {
            "pattern": "^(cards)$",
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "id"
        ]
      },
      "CheckoutRegistrationRequestBody": {
        "properties": {
          "type": {
            "pattern": "^(cards)$",
            "type": "string"
          },
          "cardToken": {
            "pattern": "^tok_.*$",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "cardToken"
        ]
      },
      "ProfileData": {
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "id"
        ]
      },
      "MetricAttributes": {
        "properties": {
          "name": {
            "type": "string"
          },
          "service": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "name",
          "service"
        ]
      },
      "MetricData": {
        "properties": {
          "type": {
            "type": "string"
          },
          "attributes": {
            "$ref": "#/components/schemas/MetricAttributes"
          }
        },
        "type": "object",
        "required": [
          "type",
          "attributes"
        ]
      },
      "EventAttributes": {
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/ProfileData"
          },
          "metric": {
            "$ref": "#/components/schemas/MetricData"
          },
          "properties": {
            "type": "object"
          },
          "time": {
            "type": "string"
          },
          "unique_id": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "profile",
          "metric",
          "properties",
          "time",
          "unique_id"
        ]
      },
      "KlaviyoEventPayload": {
        "properties": {
          "type": {
            "type": "string"
          },
          "attributes": {
            "$ref": "#/components/schemas/EventAttributes"
          }
        },
        "type": "object",
        "required": [
          "type",
          "attributes"
        ]
      },
      "Attributes": {
        "properties": {
          "name": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?"
          },
          "updated": {
            "type": "string",
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?"
          },
          "opt_in_process": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone_number": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "anonymous_id": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "organization": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "image": {
            "type": "string"
          },
          "last_event_date": {
            "pattern": "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?",
            "type": "string"
          },
          "location": {
            "$ref": "#/components/schemas/Location"
          },
          "properties": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "name",
          "opt_in_process"
        ]
      },
      "Data": {
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "attributes": {
            "$ref": "#/components/schemas/Attributes"
          }
        },
        "type": "object",
        "required": [
          "type",
          "attributes"
        ]
      },
      "Links": {
        "properties": {
          "self": {
            "type": "string"
          },
          "next": {
            "type": "string"
          },
          "prev": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "KlaviyoLists": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Data"
          },
          "links": {
            "$ref": "#/components/schemas/Links"
          }
        },
        "type": "object",
        "required": [
          "data",
          "links"
        ]
      },
      "Location": {
        "properties": {
          "zip": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "address1": {
            "type": "string"
          },
          "address2": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "longitude": {
            "type": "number"
          },
          "latitude": {
            "type": "number"
          },
          "city": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "KlaviyoProfile": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Data"
          }
        },
        "type": "object",
        "required": [
          "data"
        ]
      },
      "MetadataDefinition": {
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id"
        ]
      },
      "CardDefinition": {
        "properties": {
          "id": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "programId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "scheme": {
            "type": "string"
          },
          "expYear": {
            "type": "number"
          },
          "expMonth": {
            "type": "number"
          },
          "expDate": {
            "type": "string"
          },
          "created": {
            "type": "string"
          },
          "updated": {
            "type": "string"
          },
          "live": {
            "type": "boolean"
          },
          "countryCode": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/MetadataDefinition"
          },
          "lastNumbers": {
            "type": "string"
          },
          "firstNumbers": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id",
          "accountId",
          "programId",
          "type",
          "scheme",
          "expYear",
          "expMonth",
          "expDate",
          "created",
          "updated",
          "live",
          "countryCode",
          "metadata"
        ]
      },
      "ProcessFidelCardLinkWebhookCommand": {
        "properties": {
          "integrationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "integrationId"
        ]
      },
      "BrandPayloadDefinition": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "logoURL": {
            "format": "url",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name"
        ]
      },
      "CardPayloadDefinition": {
        "properties": {
          "id": {
            "type": "string"
          },
          "scheme": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/MetadataDefinition"
          },
          "firstNumbers": {
            "type": "string"
          },
          "lastNumbers": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id",
          "scheme",
          "metadata"
        ]
      },
      "IdentifiersPayloadDefinition": {
        "properties": {
          "MID": {
            "type": "string"
          },
          "amexApprovalCode": {
            "type": "string"
          },
          "visaAuthCode": {
            "type": "string"
          },
          "mastercardAuthCode": {
            "type": "string"
          },
          "mastercardRefNumber": {
            "type": "string"
          },
          "mastercardTransactionSequenceNumber": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "MID"
        ]
      },
      "LocationPayloadDefinition": {
        "properties": {
          "id": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "countryCode": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProgramInfo": {
        "properties": {
          "programId": {
            "type": "string"
          },
          "programName": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "programId",
          "programName"
        ]
      },
      "OfferPayloadDefinition": {
        "properties": {
          "qualified": {
            "type": "boolean"
          },
          "supplier": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "automatedReimbursement": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "qualificationDate": {
            "type": "string"
          },
          "cashback": {
            "type": "number"
          },
          "performanceFee": {
            "type": "number"
          },
          "metadata": {}
        },
        "type": "object",
        "required": [
          "qualified",
          "id",
          "cashback"
        ]
      },
      "TransactionDefinition": {
        "properties": {
          "id": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "programId": {
            "type": "string"
          },
          "datetime": {
            "type": "string"
          },
          "created": {
            "type": "string"
          },
          "updated": {
            "type": "string"
          },
          "auth": {
            "type": "boolean"
          },
          "cleared": {
            "type": "boolean"
          },
          "currency": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "authCode": {
            "type": "string"
          },
          "card": {
            "$ref": "#/components/schemas/CardPayloadDefinition"
          },
          "location": {
            "$ref": "#/components/schemas/LocationPayloadDefinition"
          },
          "brand": {
            "$ref": "#/components/schemas/BrandPayloadDefinition"
          },
          "identifiers": {
            "$ref": "#/components/schemas/IdentifiersPayloadDefinition"
          },
          "refundTransactionId": {
            "type": "string"
          },
          "wallet": {
            "type": "string"
          },
          "offer": {},
          "originalTransactionId": {
            "type": "string"
          },
          "originalTransaction": {}
        },
        "type": "object",
        "required": [
          "id",
          "accountId",
          "programId",
          "datetime",
          "created",
          "updated",
          "auth",
          "cleared",
          "currency",
          "amount",
          "card",
          "location",
          "brand",
          "identifiers"
        ]
      },
      "ProcessFidelClearanceWebhookCommand": {
        "properties": {
          "integrationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "integrationId"
        ]
      },
      "ProcessFidelQualifiedWebhookCommand": {
        "properties": {
          "integrationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "integrationId"
        ]
      },
      "ProcessFidelRefundWebhookCommand": {
        "properties": {
          "integrationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "integrationId"
        ]
      },
      "ProcessFidelAuthWebhookCommand": {
        "properties": {
          "integrationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "integrationId"
        ]
      },
      "ImportFidelOffersCommand": {
        "properties": {
          "tenantId": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "tenantId"
        ]
      },
      "IntegrationDefinition": {
        "properties": {
          "type": {
            "enum": [
              "AUTH0",
              "AWIN",
              "BRANCH",
              "FIDEL",
              "FINCONECTA",
              "KINDRED",
              "MAGNATI",
              "MPARTICLE",
              "OLIVE",
              "SIMPLIFI",
              "WEGIFT",
              "XOXO",
              "SEGMENT",
              "STRIPE_PAYOUT",
              "CHECKOUT",
              "WALLET",
              "KLAVIYO",
              "CARLTON_ONE"
            ],
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "configuration": {}
        },
        "type": "object",
        "required": [
          "type",
          "active",
          "configuration"
        ]
      },
      "IntegrationPatch": {
        "properties": {
          "configuration": {},
          "active": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ImportKindredRewardsCommand": {
        "properties": {
          "tenantId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "tenantId"
        ]
      },
      "CardIssuancePayload": {
        "properties": {
          "fullName": {
            "type": "string"
          },
          "dob": {
            "description": "Before 2026-08-20T16:00:42.686Z",
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "mobile": {
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "idNumber": {
            "pattern": "\\d{3}-\\d{4}-\\d{7}-\\d",
            "type": "string"
          },
          "idExpiryDate": {
            "description": "After 2026-08-20T16:00:42.686Z",
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "city": {
            "type": "string",
            "enum": [
              "Abu Dhabi",
              "Dubai",
              "Sharjah",
              "Ajman",
              "Umm Al Quwain",
              "Ras Al Khaimah",
              "Fujairah"
            ]
          },
          "nationality": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "fullName",
          "dob",
          "mobile",
          "email",
          "idNumber",
          "idExpiryDate",
          "city",
          "nationality"
        ]
      },
      "IssueCardPayload": {
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "middleName": {
            "type": "string"
          },
          "customerType": {
            "type": "string"
          },
          "prefixTitle": {
            "type": "number"
          },
          "embossedName": {
            "type": "string"
          },
          "countryOfResidence": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "addressLine1": {
            "type": "string"
          },
          "countryCode": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "occupation": {
            "type": "string"
          },
          "idType": {
            "type": "number"
          },
          "idIssueCountryId": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "cardType": {
            "type": "string"
          },
          "productType": {
            "type": "number"
          },
          "birthPlace": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "emirates": {
            "type": "number"
          },
          "documentsVerified": {
            "type": "number"
          },
          "addressLine2": {
            "type": "string"
          },
          "addressLine3": {
            "type": "string"
          },
          "addressLine4": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "walletId": {
            "type": "string"
          },
          "pcif": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "visaExpiryDate": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "dob": {
            "description": "Before 2026-08-20T16:00:42.686Z",
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "mobile": {
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "idNumber": {
            "pattern": "\\d{3}-\\d{4}-\\d{7}-\\d",
            "type": "string"
          },
          "idExpiryDate": {
            "description": "After 2026-08-20T16:00:42.686Z",
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "city": {
            "type": "string",
            "enum": [
              "Abu Dhabi",
              "Dubai",
              "Sharjah",
              "Ajman",
              "Umm Al Quwain",
              "Ras Al Khaimah",
              "Fujairah"
            ]
          },
          "nationality": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "firstName",
          "lastName",
          "middleName",
          "customerType",
          "prefixTitle",
          "embossedName",
          "countryOfResidence",
          "addressLine1",
          "countryCode",
          "occupation",
          "idType",
          "idIssueCountryId",
          "gender",
          "cardType",
          "productType",
          "birthPlace",
          "emirates",
          "documentsVerified",
          "addressLine2",
          "addressLine3",
          "addressLine4",
          "postalCode",
          "walletId",
          "pcif",
          "companyName",
          "visaExpiryDate",
          "fullName",
          "dob",
          "mobile",
          "email",
          "idNumber",
          "idExpiryDate",
          "city",
          "nationality"
        ]
      },
      "MagnatiTopUpPayload": {
        "properties": {
          "transactionType": {
            "type": "number"
          },
          "cardId": {
            "type": "string"
          },
          "terminalId": {
            "type": "string"
          },
          "merchantId": {
            "type": "string"
          },
          "rrn": {
            "type": "string"
          },
          "transactionAmount": {
            "type": "number"
          },
          "transactionCurrency": {
            "type": "string"
          },
          "equivalentAmount": {
            "type": "number"
          },
          "equivalentCurrency": {
            "type": "string"
          },
          "authorizationCode": {
            "type": "string"
          },
          "feeAmount": {
            "type": "string"
          },
          "transactionRate": {
            "type": "number"
          },
          "remarks": {
            "type": "string"
          },
          "merchantName": {
            "type": "string"
          },
          "merchantLocation": {
            "type": "string"
          },
          "transactionDateTime": {
            "type": "string"
          },
          "feeDescription": {
            "type": "string"
          },
          "sourceTxnReferenceNo": {
            "type": "string"
          },
          "mcc": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "transactionType",
          "cardId",
          "terminalId",
          "merchantId",
          "rrn",
          "transactionAmount",
          "transactionCurrency",
          "equivalentAmount",
          "equivalentCurrency",
          "authorizationCode",
          "feeAmount",
          "transactionRate",
          "remarks",
          "merchantName",
          "merchantLocation",
          "transactionDateTime",
          "feeDescription",
          "sourceTxnReferenceNo",
          "mcc"
        ]
      },
      "MediaItemDefinition": {
        "properties": {
          "url": {
            "format": "url",
            "type": "string"
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024
          },
          "type": {
            "enum": [
              "PICTURE",
              "VIDEO"
            ],
            "type": "string"
          },
          "priority": {
            "type": "number"
          },
          "locale": {
            "pattern": "[a-z]{2,3}(-[A-Za-z]+)*",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "url",
          "type",
          "priority",
          "locale"
        ]
      },
      "MediaItemPatch": {
        "properties": {
          "url": {
            "format": "url",
            "type": "string"
          },
          "description": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024
          },
          "type": {
            "enum": [
              "PICTURE",
              "VIDEO"
            ],
            "type": "string"
          },
          "priority": {
            "type": "number"
          },
          "locale": {
            "pattern": "[a-z]{2,3}(-[A-Za-z]+)*",
            "type": "string"
          },
          "venue": {}
        },
        "type": "object"
      },
      "ProcessTransactionMetaEventCommand": {
        "properties": {
          "payload": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "payload"
        ]
      },
      "RecalculateMetaEventsForUserCommand": {
        "properties": {
          "userId": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "userId",
          "tenantId"
        ]
      },
      "GoogleWalletPassBody": {
        "properties": {
          "backgroundColor": {
            "pattern": "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
            "type": "string"
          },
          "organizationName": {
            "type": "string"
          },
          "icon": {
            "format": "url",
            "type": "string"
          },
          "memberIdHeader": {
            "type": "string"
          },
          "memberIdPath": {
            "enum": [
              "accountNumber",
              "authIdentifier",
              "id",
              "externalIdentifier"
            ],
            "type": "string"
          },
          "showMemberIdAsLabel": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "AppleWalletPassBody": {
        "properties": {
          "backgroundColor": {
            "pattern": "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
            "type": "string"
          },
          "organizationName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "foregroundColor": {
            "pattern": "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
            "type": "string"
          },
          "labelColor": {
            "pattern": "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
            "type": "string"
          },
          "memberIdPath": {
            "enum": [
              "accountNumber",
              "authIdentifier",
              "id",
              "externalIdentifier"
            ],
            "type": "string"
          },
          "showMemberIdAsLabel": {
            "type": "boolean"
          },
          "icon": {
            "type": "string"
          },
          "icon2x": {
            "type": "string"
          },
          "logo": {
            "type": "string"
          },
          "logo2x": {
            "type": "string"
          },
          "strip": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "BadgeDetailsDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "minLength": 2,
            "maxLength": 1000,
            "type": "string"
          },
          "artworkUrl": {
            "format": "url",
            "type": "string"
          },
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "name",
          "locale"
        ]
      },
      "BadgeDefinition": {
        "properties": {
          "internalName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "internalDescription": {
            "minLength": 2,
            "maxLength": 1000,
            "type": "string"
          },
          "details": {
            "items": {
              "$ref": "#/components/schemas/BadgeDetailsDefinition"
            },
            "type": "array"
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object",
        "required": [
          "internalName"
        ]
      },
      "BadgePatch": {
        "properties": {
          "internalName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "internalDescription": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1000
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          },
          "status": {
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "ARCHIVED"
            ],
            "type": "string"
          },
          "details": {
            "items": {
              "$ref": "#/components/schemas/BadgeDetailsDefinition"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SeedTenantDataCommand": {
        "properties": {
          "tenantId": {
            "type": "string"
          },
          "type": {
            "enum": [
              "DATA_GENERATION",
              "DATA_DESTRUCTION"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "tenantId",
          "type"
        ]
      },
      "MissionReactorDefinition": {
        "properties": {
          "eventType": {},
          "constraint": {
            "type": "object"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "maxActivations": {
            "minimum": 1,
            "type": "integer"
          },
          "activationContext": {
            "enum": [
              "GLOBAL",
              "TENANT",
              "SUBJECT"
            ],
            "type": "string"
          },
          "activationCalculationType": {
            "enum": [
              "LIFETIME",
              "CALENDAR_PERIOD",
              "ROLLING_WINDOW"
            ],
            "type": "string"
          },
          "activationPeriod": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "MissionDefinition": {
        "properties": {
          "details": {
            "items": {
              "$ref": "#/components/schemas/MissionDetails"
            },
            "type": "array",
            "minItems": 1
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "completionType": {
            "enum": [
              "COUNT",
              "VALUE",
              "BOOLEAN"
            ],
            "type": "string"
          },
          "targetValue": {
            "type": "object"
          },
          "valueExpression": {
            "type": "string"
          },
          "duration": {
            "type": "string",
            "pattern": "^P\\d+D$"
          },
          "cooldownDuration": {
            "type": "string",
            "pattern": "^P\\d+D$"
          },
          "requiresOptIn": {
            "type": "boolean"
          },
          "displayStyle": {
            "enum": [
              "PROGRESS_BAR",
              "STAMP_CARD",
              "COUNTER",
              "CHECKBOX"
            ],
            "type": "string"
          },
          "parentMissionId": {
            "type": "string"
          },
          "reactor": {
            "$ref": "#/components/schemas/MissionReactorDefinition"
          },
          "order": {
            "minimum": 0,
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "details",
          "reactor"
        ]
      },
      "EarningCampaignEffectivityDefinition": {
        "properties": {
          "start": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "end": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "availableImmediately": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "EarningCampaignDefinition": {
        "properties": {
          "details": {
            "items": {
              "$ref": "#/components/schemas/EarningCampaignDetails"
            },
            "type": "array",
            "minItems": 1
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "effectivity": {
            "$ref": "#/components/schemas/EarningCampaignEffectivityDefinition"
          },
          "type": {
            "enum": [
              "GOAL_BASED",
              "RULE_BASED"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "DRAFT",
              "ACTIVE",
              "PAUSED",
              "ENDED",
              "ARCHIVED"
            ],
            "type": "string"
          },
          "visibilityCriteria": {},
          "missions": {
            "items": {
              "$ref": "#/components/schemas/MissionDefinition"
            },
            "type": "array"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "details",
          "effectivity",
          "type"
        ]
      },
      "EarningCampaignEffectivityPatch": {
        "properties": {
          "start": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "end": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "availableImmediately": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "EarningCampaignPatch": {
        "properties": {
          "details": {
            "items": {
              "$ref": "#/components/schemas/EarningCampaignDetails"
            },
            "type": "array",
            "minItems": 1
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "effectivity": {
            "$ref": "#/components/schemas/EarningCampaignEffectivityPatch"
          },
          "visibilityCriteria": {},
          "type": {
            "enum": [
              "GOAL_BASED",
              "RULE_BASED"
            ],
            "type": "string"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EarningCampaignStatusTransition": {
        "properties": {
          "status": {
            "enum": [
              "DRAFT",
              "ACTIVE",
              "PAUSED",
              "ENDED",
              "ARCHIVED"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "status"
        ]
      },
      "LeaderboardDetailsDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "minLength": 2,
            "maxLength": 1000,
            "type": "string"
          },
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "name",
          "locale"
        ]
      },
      "LeaderboardDefinition": {
        "properties": {
          "internalName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "rankingMetric": {
            "enum": [
              "POINTS"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "ARCHIVED"
            ],
            "type": "string"
          },
          "timeWindowType": {
            "type": "string",
            "enum": [
              "LIFETIME",
              "FIXED",
              "RECURRING"
            ]
          },
          "recurrenceSchedule": {
            "enum": [
              "WEEKLY",
              "MONTHLY",
              "QUARTERLY",
              "YEARLY"
            ],
            "type": "string"
          },
          "startDate": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "availableImmediately": {
            "type": "boolean"
          },
          "endDate": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "audienceIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "boardSize": {
            "minimum": 1,
            "type": "integer"
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          },
          "details": {
            "type": "object"
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "internalName",
          "timeWindowType",
          "details",
          "defaultLocale"
        ]
      },
      "LeaderboardPatch": {
        "properties": {
          "internalName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "rankingMetric": {
            "enum": [
              "POINTS"
            ],
            "type": "string"
          },
          "timeWindowType": {
            "enum": [
              "LIFETIME",
              "FIXED",
              "RECURRING"
            ],
            "type": "string"
          },
          "recurrenceSchedule": {
            "enum": [
              "WEEKLY",
              "MONTHLY",
              "QUARTERLY",
              "YEARLY"
            ],
            "type": "string"
          },
          "startDate": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "endDate": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          },
          "audienceIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "boardSize": {
            "minimum": 1,
            "type": "integer"
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "details": {
            "items": {
              "$ref": "#/components/schemas/LeaderboardDetailsDefinition"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "LeaderboardStatusTransition": {
        "properties": {
          "status": {
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "ARCHIVED"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "status"
        ]
      },
      "RefreshLeaderboardCommand": {
        "properties": {
          "leaderboardId": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "leaderboardId",
          "tenantId"
        ]
      },
      "MissionReactorPatch": {
        "properties": {
          "constraint": {
            "type": "object"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "maxActivations": {
            "minimum": 1,
            "type": "integer"
          },
          "activationContext": {
            "enum": [
              "GLOBAL",
              "TENANT",
              "SUBJECT"
            ],
            "type": "string"
          },
          "activationCalculationType": {
            "enum": [
              "LIFETIME",
              "CALENDAR_PERIOD",
              "ROLLING_WINDOW"
            ],
            "type": "string"
          },
          "activationPeriod": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "MissionPatch": {
        "properties": {
          "details": {
            "items": {
              "$ref": "#/components/schemas/MissionDetails"
            },
            "type": "array",
            "minItems": 1
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "completionType": {
            "enum": [
              "COUNT",
              "VALUE",
              "BOOLEAN"
            ],
            "type": "string"
          },
          "targetValue": {
            "type": "object"
          },
          "valueExpression": {
            "type": "string"
          },
          "duration": {
            "type": "string",
            "pattern": "^P\\d+D$"
          },
          "cooldownDuration": {
            "type": "string",
            "pattern": "^P\\d+D$"
          },
          "requiresOptIn": {
            "type": "boolean"
          },
          "displayStyle": {
            "enum": [
              "PROGRESS_BAR",
              "STAMP_CARD",
              "COUNTER",
              "CHECKBOX"
            ],
            "type": "string"
          },
          "reactor": {
            "$ref": "#/components/schemas/MissionReactorPatch"
          },
          "order": {
            "minimum": 0,
            "type": "number"
          }
        },
        "type": "object"
      },
      "MissionOrderItem": {
        "properties": {
          "missionId": {
            "format": "uuid",
            "type": "string"
          },
          "order": {
            "minimum": 0,
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "missionId"
        ]
      },
      "MissionReorder": {
        "properties": {
          "missions": {
            "items": {
              "$ref": "#/components/schemas/MissionOrderItem"
            },
            "type": "array",
            "minItems": 1
          }
        },
        "type": "object",
        "required": [
          "missions"
        ]
      },
      "PointsLiabilityCriteriaDefinition": {
        "properties": {
          "type": {
            "enum": [
              "SIMPLE_EXPIRY",
              "MAXIMUM_POINTS_SPEND_CAP",
              "MAXIMUM_POINTS_EARN_CAP",
              "MAXIMUM_POINTS_BALANCE_CAP",
              "PURCHASE_REWARDS"
            ],
            "type": "string"
          },
          "liabilityType": {
            "enum": [
              "EXPIRY",
              "SPENDING_CAP",
              "EARNING_CAP",
              "PURCHASE_REWARDS"
            ],
            "type": "string"
          },
          "config": {},
          "name": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "liabilityType",
          "config",
          "name"
        ]
      },
      "PointsLiabilityCriteriaPatch": {
        "properties": {
          "type": {
            "enum": [
              "SIMPLE_EXPIRY",
              "MAXIMUM_POINTS_SPEND_CAP",
              "MAXIMUM_POINTS_EARN_CAP",
              "MAXIMUM_POINTS_BALANCE_CAP",
              "PURCHASE_REWARDS"
            ],
            "type": "string"
          },
          "liabilityType": {
            "enum": [
              "EXPIRY",
              "SPENDING_CAP",
              "EARNING_CAP",
              "PURCHASE_REWARDS"
            ],
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "config": {},
          "name": {
            "minLength": 1,
            "maxLength": 255,
            "type": "string"
          }
        },
        "type": "object"
      },
      "CategoryDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64
          },
          "priority": {
            "type": "number"
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "description": {
            "minLength": 2,
            "maxLength": 5000,
            "type": "string"
          },
          "parent": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "details": {
            "items": {
              "$ref": "#/components/schemas/RewardCategoryDetails"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "name",
          "priority"
        ]
      },
      "CategoryPatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64
          },
          "priority": {
            "type": "number"
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "description": {
            "minLength": 2,
            "maxLength": 5000,
            "type": "string"
          },
          "parent": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "details": {
            "items": {
              "$ref": "#/components/schemas/RewardCategoryDetails"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SettingDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-zA-Z./]+$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "pattern": "^[\\x00-\\x7F]+$"
          }
        },
        "type": "object",
        "required": [
          "name",
          "value"
        ]
      },
      "SettingPatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-zA-Z./]+$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "pattern": "^[\\x00-\\x7F]+$"
          }
        },
        "type": "object",
        "required": [
          "name"
        ]
      },
      "TeamMembershipDefinition": {
        "properties": {
          "user": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "role": {
            "enum": [
              "LEADER",
              "MEMBER"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "user",
          "role"
        ]
      },
      "TeamProfileDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "attributes": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "name"
        ]
      },
      "TeamDefinition": {
        "properties": {
          "memberDefinitions": {
            "items": {
              "$ref": "#/components/schemas/TeamMembershipDefinition"
            },
            "type": "array"
          },
          "profile": {
            "$ref": "#/components/schemas/TeamProfileDefinition"
          },
          "externalIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "isRestricted": {
            "type": "boolean"
          },
          "linkedVenuesDefinitions": {
            "items": {
              "$ref": "#/components/schemas/VenueDefinition"
            },
            "type": "array"
          },
          "linkedVenues": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "consentsDefinition": {
            "items": {
              "$ref": "#/components/schemas/UserConsentDefinition"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "profile"
        ]
      },
      "TeamInvitation": {
        "properties": {
          "type": {
            "enum": [
              "REGISTER_ACCOUNT"
            ],
            "type": "string"
          },
          "role": {
            "enum": [
              "LEADER",
              "MEMBER"
            ],
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/UserProfileDefinition"
          }
        },
        "type": "object",
        "required": [
          "type",
          "role"
        ]
      },
      "TeamMembershipPatch": {
        "properties": {
          "role": {
            "enum": [
              "LEADER",
              "MEMBER"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "role"
        ]
      },
      "ActorPatch": {
        "properties": {
          "externalIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "linkedVenuesDefinitions": {
            "items": {
              "$ref": "#/components/schemas/VenueDefinition"
            },
            "type": "array"
          },
          "linkedVenues": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "consentsDefinition": {
            "items": {
              "$ref": "#/components/schemas/UserConsentDefinition"
            },
            "type": "array"
          },
          "isRestricted": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ProfilePatch": {
        "properties": {
          "attributes": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "TeamProfilePatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "attributes": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "TeamPatch": {
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/TeamProfilePatch"
          },
          "externalIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "linkedVenuesDefinitions": {
            "items": {
              "$ref": "#/components/schemas/VenueDefinition"
            },
            "type": "array"
          },
          "linkedVenues": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "consentsDefinition": {
            "items": {
              "$ref": "#/components/schemas/UserConsentDefinition"
            },
            "type": "array"
          },
          "isRestricted": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TenantDefinition": {
        "properties": {
          "name": {
            "minLength": 1,
            "maxLength": 64,
            "type": "string"
          },
          "slug": {
            "pattern": "^(test--)?[a-z][a-z0-9]+(-[a-z][a-z0-9]+)*$",
            "type": "string"
          },
          "authentication": {
            "type": "object"
          },
          "key": {
            "type": "string"
          },
          "timezone": {
            "maxLength": 64,
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "counterpartEnv": {
            "type": "string",
            "enum": [
              "self",
              "external"
            ]
          },
          "liveTenant": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "name",
          "slug"
        ]
      },
      "TenantPatch": {
        "properties": {
          "configuration": {
            "$ref": "#/components/schemas/TenantConfiguration"
          },
          "profileSchema": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "configuration"
        ]
      },
      "TenantUpdatedPlatformEventPayload": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "authentication": {
            "type": "object"
          },
          "timezone": {
            "maxLength": 64,
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "counterpartEnv": {
            "type": "string",
            "enum": [
              "self",
              "external"
            ]
          },
          "liveTenant": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id"
        ]
      },
      "TierDetailsDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "description": {
            "minLength": 2,
            "maxLength": 1000,
            "type": "string"
          },
          "artworkUrl": {
            "format": "url",
            "type": "string"
          },
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "name",
          "locale"
        ]
      },
      "TierDefinition": {
        "properties": {
          "pointsRequirement": {
            "minimum": 0,
            "type": "integer"
          },
          "effectivity": {
            "$ref": "#/components/schemas/Effectivity"
          },
          "calculation": {
            "enum": [
              "LIFETIME_EARN",
              "CALENDAR_PERIOD",
              "ROLLING_WINDOW"
            ],
            "type": "string"
          },
          "accumulationPeriod": {
            "type": "object"
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          },
          "details": {
            "type": "object"
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "pointsRequirement",
          "calculation",
          "priority",
          "details",
          "defaultLocale"
        ]
      },
      "TierPatch": {
        "properties": {
          "pointsRequirement": {
            "minimum": 0,
            "type": "integer"
          },
          "effectivity": {
            "$ref": "#/components/schemas/Effectivity"
          },
          "calculation": {
            "enum": [
              "LIFETIME_EARN",
              "CALENDAR_PERIOD",
              "ROLLING_WINDOW"
            ],
            "type": "string"
          },
          "priority": {
            "minimum": 0,
            "type": "integer"
          },
          "accumulationPeriod": {
            "type": "object"
          },
          "details": {
            "type": "object"
          },
          "defaultLocale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "TranslationDefinition": {
        "properties": {
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "consentType": {
            "$ref": "#/components/schemas/Hydratable"
          }
        },
        "type": "object",
        "required": [
          "content",
          "locale",
          "consentType"
        ]
      },
      "TranslationPatch": {
        "properties": {
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "locale": {
            "enum": [
              "en",
              "fr",
              "de",
              "it",
              "es",
              "nl",
              "ar",
              "bn",
              "gu",
              "hi",
              "id",
              "ja",
              "ko",
              "ml",
              "mr",
              "mt",
              "pl",
              "pt",
              "ru",
              "sv",
              "ta",
              "te",
              "th",
              "tl",
              "tr",
              "uk",
              "ur",
              "vi"
            ],
            "type": "string"
          },
          "consentType": {
            "$ref": "#/components/schemas/Hydratable"
          }
        },
        "type": "object"
      },
      "ReferralCodeDefinition": {
        "properties": {
          "inviteCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "inviteLink": {
            "type": "string",
            "minLength": 3,
            "maxLength": 1024
          }
        },
        "type": "object",
        "required": [
          "inviteCode"
        ]
      },
      "AdjustPointsCommand": {
        "properties": {
          "points": {
            "type": "number"
          },
          "comment": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "points"
        ]
      },
      "CommandDefinition": {
        "properties": {
          "type": {
            "enum": [
              "PURCHASED_REWARD",
              "REDEEMED_VOUCHER",
              "BURNED_VOUCHER",
              "REGISTERED_ACCOUNT",
              "POINTS_ADJUSTED",
              "VOUCHER_GIVEN",
              "REFERRAL_TRANCHE_ACTIVATION",
              "PROFILE_UPDATED",
              "USER_METADATA_UPDATED",
              "CONSENT_GIVEN",
              "CONSENT_REVOKED",
              "CLOSED_ACCOUNT",
              "POINTS_EXPIRED",
              "MISSION_COMPLETED",
              "VOUCHER_VOIDED"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type"
        ]
      },
      "Resource": {
        "properties": {
          "type": {
            "enum": [
              "VOUCHER",
              "VOUCHER_REWARD",
              "WEGIFT_PRODUCT",
              "OLIVE_OFFER",
              "XOXO_PRODUCT"
            ],
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "id"
        ]
      },
      "RedemptionDefinition": {
        "properties": {
          "resource": {
            "$ref": "#/components/schemas/Resource"
          },
          "position": {
            "$ref": "#/components/schemas/GeoPoint"
          }
        },
        "type": "object",
        "required": [
          "resource"
        ]
      },
      "UserProfilePatch": {
        "properties": {
          "familyName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "givenName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "gender": {
            "enum": [
              "FEMALE",
              "MALE",
              "OTHER",
              "UNKNOWN"
            ],
            "type": "string"
          },
          "emailAddress": {
            "format": "email",
            "type": "string"
          },
          "birthdate": {
            "pattern": "^(19[0-9][0-9]|20[0-3][0-9])-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$",
            "type": "string"
          },
          "country": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "postcode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "streetAddress": {
            "minLength": 1,
            "maxLength": 64,
            "type": "string"
          },
          "telephoneNumber": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "attributes": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "UserPatch": {
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/UserProfilePatch"
          },
          "flags": {},
          "externalIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "linkedVenuesDefinitions": {
            "items": {
              "$ref": "#/components/schemas/VenueDefinition"
            },
            "type": "array"
          },
          "linkedVenues": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array"
          },
          "consentsDefinition": {
            "items": {
              "$ref": "#/components/schemas/UserConsentDefinition"
            },
            "type": "array"
          },
          "isRestricted": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "VoucherCodeDefinition": {
        "properties": {
          "value": {
            "type": "string",
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "voucher": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "value",
          "voucher"
        ]
      },
      "UpdateUserInAuthProvider": {
        "properties": {
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "userId"
        ]
      },
      "TokenProfilePayload": {
        "properties": {
          "emailAddress": {
            "format": "email",
            "type": "string"
          },
          "isRestricted": {},
          "familyName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "givenName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "gender": {
            "enum": [
              "FEMALE",
              "MALE",
              "OTHER",
              "UNKNOWN"
            ],
            "type": "string"
          },
          "birthdate": {
            "pattern": "^(19[0-9][0-9]|20[0-3][0-9])-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$",
            "type": "string"
          },
          "country": {
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "AN",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string"
          },
          "city": {
            "minLength": 1,
            "maxLength": 256,
            "type": "string"
          },
          "postcode": {
            "minLength": 1,
            "maxLength": 128,
            "type": "string"
          },
          "pictureUrl": {
            "format": "url",
            "type": "string"
          },
          "streetAddress": {
            "minLength": 1,
            "maxLength": 64,
            "type": "string"
          },
          "telephoneNumber": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "extraFields": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "emailAddress"
        ]
      },
      "UserSessionDefinition": {
        "properties": {
          "source": {
            "enum": [
              "CAMPAIGN",
              "OTHER"
            ],
            "type": "string"
          },
          "sourceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "deviceFingerprint": {},
          "locationAndIpInfo": {},
          "sessionDetails": {},
          "globalToken": {
            "type": "string",
            "minLength": 3,
            "maxLength": 1024
          },
          "token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "type": "object",
        "required": [
          "source",
          "sourceId",
          "token"
        ]
      },
      "UserTokenDefinition": {
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "globalToken": {
            "type": "string",
            "minLength": 3,
            "maxLength": 1024
          },
          "profile": {
            "$ref": "#/components/schemas/TokenProfilePayload"
          }
        },
        "type": "object",
        "required": [
          "token"
        ]
      },
      "UserTokenPatch": {
        "properties": {
          "globalToken": {
            "type": "string",
            "minLength": 3,
            "maxLength": 1024
          },
          "profile": {
            "$ref": "#/components/schemas/TokenProfilePayload"
          }
        },
        "type": "object"
      },
      "VenuePatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "address": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "availability": {
            "$ref": "#/components/schemas/Effectivity"
          },
          "coordinates": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "attributes": {
            "$ref": "#/components/schemas/VenueAttributes"
          },
          "category": {},
          "externalIdentifier": {
            "maxLength": 512,
            "type": "string"
          },
          "postcode": {
            "minLength": 1,
            "maxLength": 128,
            "type": "string"
          },
          "isUserModifiable": {
            "type": "boolean"
          },
          "shouldCalculateCoordinates": {
            "type": "boolean"
          },
          "type": {
            "enum": [
              "TENANT",
              "USER",
              "MERCHANT"
            ],
            "type": "string"
          },
          "contactDetails": {
            "items": {
              "$ref": "#/components/schemas/VenueContactDetails"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "AttributeDefinition": {
        "properties": {
          "subjectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "subjectAuthId": {
            "maxLength": 512,
            "type": "string"
          },
          "subjectType": {
            "enum": [
              "USER",
              "REWARD",
              "TENANT"
            ],
            "type": "string"
          },
          "key": {
            "maxLength": 512,
            "type": "string"
          },
          "value": {},
          "isEnabled": {
            "type": "boolean"
          },
          "shouldReplaceOnlySameKeyValue": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "subjectType",
          "key",
          "value",
          "isEnabled",
          "shouldReplaceOnlySameKeyValue"
        ]
      },
      "BatchAttributeDefinition": {
        "properties": {
          "definitions": {
            "items": {
              "$ref": "#/components/schemas/AttributeDefinition"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "definitions"
        ]
      },
      "SqsSaveAttributesCommand": {
        "properties": {
          "apiKey": {
            "type": "string"
          },
          "command": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "definitions": {
            "items": {
              "$ref": "#/components/schemas/AttributeDefinition"
            },
            "type": "array"
          },
          "onChanged": {}
        },
        "type": "object",
        "required": [
          "apiKey",
          "command",
          "definitions"
        ]
      },
      "OliveCardWebhookCommand": {
        "properties": {
          "integrationId": {
            "format": "uuid",
            "type": "string"
          },
          "command": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[\\x00-\\x7F]+$"
          }
        },
        "type": "object",
        "required": [
          "integrationId",
          "command"
        ]
      },
      "UserBasedVisibilityCriteriaDefinition": {
        "properties": {
          "criteriaTree": {
            "type": "object"
          },
          "criteriaJsonLogic": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "criteriaTree",
          "criteriaJsonLogic"
        ]
      },
      "PartiallyTranslatedLogicDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "isActive": {
            "type": "boolean"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/TriggerDefinition"
            },
            "type": "array"
          },
          "criteriaDefinition": {
            "$ref": "#/components/schemas/UserBasedVisibilityCriteriaDefinition"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "ownerId": {
            "type": "string"
          },
          "ownerDomain": {
            "enum": [
              "CAMPAIGN_TRANCHE",
              "AUDIENCE",
              "REWARD_AVAILABILITY",
              "USER_BASED_VISIBILITY"
            ],
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "name",
          "isActive",
          "triggers",
          "criteriaDefinition",
          "reactions",
          "ownerId",
          "ownerDomain"
        ]
      },
      "LogicCriteria": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id"
        ]
      },
      "PartiallyTranslatedLogicDefinitionPatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 200
          },
          "isActive": {
            "type": "boolean"
          },
          "triggers": {
            "items": {
              "$ref": "#/components/schemas/TriggerDefinition"
            },
            "type": "array"
          },
          "criteriaDefinition": {
            "$ref": "#/components/schemas/UserBasedVisibilityCriteriaDefinition"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "LogicExecutionPayload": {
        "properties": {
          "ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array",
            "minItems": 1
          },
          "triggerPayload": {},
          "domainType": {
            "enum": [
              "CAMPAIGN_TRANCHE",
              "AUDIENCE",
              "REWARD_AVAILABILITY",
              "USER_BASED_VISIBILITY"
            ],
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "ids",
          "domainType",
          "subjectId"
        ]
      },
      "CampaignDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024
          },
          "linkConfig": {
            "$ref": "#/components/schemas/LinkConfig"
          },
          "isActive": {
            "type": "boolean"
          },
          "eligibleAudiences": {
            "items": {
              "$ref": "#/components/schemas/Hydratable"
            },
            "type": "array",
            "description": "Audience UUID references. A member is eligible when they belong to any listed audience. An empty or omitted list makes the campaign an untargeted fallback."
          },
          "referralCodeType": {
            "enum": [
              "BRANCH",
              "CODE",
              "STATIC_USER_CODE",
              "STATIC_USER_WORD_CODE"
            ],
            "type": "string",
            "description": "How referral identifiers are generated. BRANCH creates a Branch deep link; CODE creates a new eight-character hexadecimal code; the STATIC variants reuse a persistent code for each tenant, member, and campaign combination.",
            "x-enumDescriptions": {
              "BRANCH": "Create an external Branch deep link and use it as the code.",
              "CODE": "Generate a new eight-character uppercase hexadecimal code.",
              "STATIC_USER_CODE": "Reuse a persistent tenant/member/campaign code based on profile initials.",
              "STATIC_USER_WORD_CODE": "Reuse a persistent tenant/member/campaign word-based code with initials and a two-digit suffix."
            },
            "default": "BRANCH"
          }
        },
        "type": "object",
        "required": [
          "name",
          "linkConfig"
        ]
      },
      "CampaignPatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024
          },
          "linkConfig": {
            "$ref": "#/components/schemas/LinkConfig"
          },
          "isActive": {
            "type": "boolean"
          },
          "referralCodeType": {
            "enum": [
              "BRANCH",
              "CODE",
              "STATIC_USER_CODE",
              "STATIC_USER_WORD_CODE"
            ],
            "type": "string",
            "description": "How referral identifiers are generated. BRANCH creates a Branch deep link; CODE creates a new eight-character hexadecimal code; the STATIC variants reuse a persistent code for each tenant, member, and campaign combination.",
            "x-enumDescriptions": {
              "BRANCH": "Create an external Branch deep link and use it as the code.",
              "CODE": "Generate a new eight-character uppercase hexadecimal code.",
              "STATIC_USER_CODE": "Reuse a persistent tenant/member/campaign code based on profile initials.",
              "STATIC_USER_WORD_CODE": "Reuse a persistent tenant/member/campaign word-based code with initials and a two-digit suffix."
            }
          }
        },
        "type": "object"
      },
      "ReferralCodePatch": {
        "properties": {
          "inviteCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "inviteLink": {
            "type": "string",
            "minLength": 3,
            "maxLength": 1024,
            "nullable": true,
            "description": "Replacement invitation URL. Send null to remove the link."
          }
        },
        "type": "object"
      },
      "TrancheDefinition": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 1024
          },
          "eventType": {
            "$ref": "#/components/schemas/Hydratable"
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "constraint": {
            "type": "object"
          },
          "maxActivations": {
            "minimum": 1,
            "type": "integer",
            "nullable": true,
            "description": "Maximum activations for the referred-user reactor. Null means unlimited."
          },
          "effectivity": {
            "$ref": "#/components/schemas/TrancheEffectivity"
          },
          "referrerReactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "name",
          "eventType",
          "reactions"
        ]
      },
      "TranchePatch": {
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[\\x00-\\x7F]+$"
          },
          "constraint": {
            "type": "object"
          },
          "maxActivations": {
            "minimum": 1,
            "type": "integer",
            "nullable": true,
            "description": "Maximum activations for the referred-user reactor. Null means unlimited."
          },
          "reactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "effectivity": {
            "$ref": "#/components/schemas/TrancheEffectivity"
          },
          "referrerReactions": {
            "items": {
              "$ref": "#/components/schemas/ReactionDefinition"
            },
            "type": "array"
          },
          "deleteReferrerReactions": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SimplifiLoadDefinition": {
        "properties": {
          "points": {
            "type": "number"
          }
        },
        "type": "object",
        "required": [
          "points"
        ]
      },
      "TrancheEffectivity": {
        "type": "object",
        "required": [
          "start",
          "end"
        ],
        "description": "Effectivity range for a referral tranche. Use a null end for no expiry.",
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 start timestamp."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "ISO 8601 end timestamp, or null for no expiry."
          }
        }
      },
      "EventListParams": {
        "type": "object"
      },
      "BenefitListParams": {
        "type": "object"
      },
      "RewardCategoryListParams": {
        "type": "object"
      },
      "TierListParams": {
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Tenant API key used to select and authenticate the tenant.",
        "x-gitbook-token-placeholder": "YOUR_API_KEY"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer credential sent as `Authorization: Bearer <access_token>`. Operations protected by an authorization permission require an administrative access token.",
        "x-gitbook-token-placeholder": "YOUR_ACCESS_TOKEN"
      },
      "userBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Member access token sent as `Authorization: Bearer <access_token>`. The token must identify the current user.",
        "x-gitbook-token-placeholder": "YOUR_USER_ACCESS_TOKEN"
      }
    }
  },
  "info": {
    "title": "loyalty-rewards",
    "version": "1.0.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/referral_codes/{code}/referral/activity": {
      "post": {
        "operationId": "ReferralCodeUtilsController.handleReferralActivity",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralActivityDefinition"
              }
            }
          },
          "description": "ReferralActivityDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Handle referral activity",
        "tags": [
          "Referral Code Utils"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/referral_codes/referral/tranche_status": {
      "post": {
        "operationId": "ReferralCodeUtilsController.handleReferralTrancheStatusUpdate",
        "parameters": [
          {
            "in": "header",
            "name": "Owner",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrancheStatusUpdateDefinition"
              }
            }
          },
          "description": "TrancheStatusUpdateDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Handle referral tranche status update",
        "tags": [
          "Referral Code Utils"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/events/": {
      "get": {
        "operationId": "EventController.list",
        "parameters": [
          {
            "in": "query",
            "name": "EventListParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EventListParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "id": 48291,
                    "type": {
                      "id": "evt-type-001",
                      "name": "Purchase"
                    },
                    "subject": {
                      "id": "9cb2cc08-e033-4200-86a7-95a03ba09462"
                    },
                    "occurredAt": "2025-01-15T14:30:00.000Z",
                    "reportedAt": "2025-01-15T14:30:05.000Z",
                    "registeredAt": "2025-01-15T14:30:06.000Z",
                    "reactedAt": "2025-01-15T14:30:07.000Z",
                    "payload": {
                      "amount": 49.99,
                      "currency": "GBP"
                    },
                    "points": {
                      "value": 50
                    }
                  },
                  {
                    "id": 48292,
                    "type": {
                      "id": "evt-type-002",
                      "name": "Referral"
                    },
                    "subject": {
                      "id": "7ab1de09-f234-4567-89ab-cdef01234567"
                    },
                    "occurredAt": "2025-01-16T09:00:00.000Z",
                    "reportedAt": "2025-01-16T09:00:02.000Z",
                    "registeredAt": "2025-01-16T09:00:03.000Z",
                    "reactedAt": "2025-01-16T09:00:04.000Z",
                    "payload": {
                      "referredUserId": "9cb2cc08-e033-4200-86a7-95a03ba09462"
                    },
                    "points": {
                      "value": 200
                    }
                  }
                ]
              }
            },
            "description": "A list of events"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "List events",
        "tags": [
          "Event"
        ],
        "description": "Returns a paginated list of events for the tenant. Requires admin auth with events scope.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "EventController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventDefinition"
              }
            }
          },
          "description": "EventDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Event"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/events/{id}": {
      "get": {
        "operationId": "EventController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "number"
            },
            "description": "The numeric ID of the event."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": 48291,
                  "type": {
                    "id": "evt-type-001",
                    "name": "Purchase"
                  },
                  "subject": {
                    "id": "9cb2cc08-e033-4200-86a7-95a03ba09462"
                  },
                  "occurredAt": "2025-01-15T14:30:00.000Z",
                  "reportedAt": "2025-01-15T14:30:05.000Z",
                  "registeredAt": "2025-01-15T14:30:06.000Z",
                  "reactedAt": "2025-01-15T14:30:07.000Z",
                  "payload": {
                    "amount": 49.99,
                    "currency": "GBP"
                  },
                  "points": {
                    "value": 50
                  }
                }
              }
            },
            "description": "Event details"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Event not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Event not found"
                }
              }
            }
          }
        },
        "summary": "Get event",
        "tags": [
          "Event"
        ],
        "description": "Retrieves a single event by its numeric ID. Requires admin auth with events scope.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/events/{id}/reactions": {
      "get": {
        "operationId": "EventController.retrieveReaction",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve reaction",
        "tags": [
          "Event"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/events/test_reaction": {
      "post": {
        "operationId": "EventController.checkPossibleReactors",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventDefinition"
              }
            }
          },
          "description": "EventDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Check possible reactors",
        "tags": [
          "Event"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/audiences/criteria-builder/config": {
      "get": {
        "operationId": "AudienceController.retrieveCriteriaBuilderConfig",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve criteria builder config",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/audiences/": {
      "get": {
        "operationId": "AudienceController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "AudienceController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudienceDefinition"
              }
            }
          },
          "description": "AudienceDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/audiences/{id}": {
      "get": {
        "operationId": "AudienceController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "AudienceController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudiencePatch"
              }
            }
          },
          "description": "AudiencePatch",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "AudienceController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/audiences/{id}/trigger-search-results": {
      "post": {
        "operationId": "AudienceController.triggerSearchResults",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Trigger search results",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/audiences/{id}/results": {
      "get": {
        "operationId": "AudienceController.retrieveResults",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve results",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/audiences/estimate": {
      "post": {
        "operationId": "AudienceController.estimate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudienceEstimatePayload"
              }
            }
          },
          "description": "AudienceEstimatePayload",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Estimate",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/audiences/syncly-search-results": {
      "post": {
        "operationId": "AudienceController.searchResultsForAudiences",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudienceResultsPayload"
              }
            }
          },
          "description": "AudienceResultsPayload",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Search results for audiences",
        "tags": [
          "Audience"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/auth0/users/{id}": {
      "delete": {
        "operationId": "Auth0Controller.deleteUser",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete user",
        "tags": [
          "Auth 0"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/awin/transaction": {
      "post": {
        "operationId": "AwinController.transactionAuth",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "awin-tenant-123"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactionId": {
                    "type": "string",
                    "example": "123456789"
                  },
                  "transactionDate": {
                    "type": "string",
                    "example": "2024-06-19T12:00:00Z"
                  },
                  "transactionCurrency": {
                    "type": "string",
                    "example": "USD"
                  },
                  "transactionAmount": {
                    "type": "string",
                    "example": "100.00"
                  },
                  "affiliateId": {
                    "type": "string",
                    "example": "affiliate-001"
                  },
                  "merchantId": {
                    "type": "string",
                    "example": "merchant-001"
                  },
                  "groupId": {
                    "type": "string",
                    "example": "group-001"
                  },
                  "bannerId": {
                    "type": "string",
                    "example": "banner-001"
                  },
                  "clickRef": {
                    "type": "string",
                    "example": "user-uuid-123"
                  },
                  "clickThroughTime": {
                    "type": "string",
                    "example": "2024-06-19T11:00:00Z"
                  },
                  "ip": {
                    "type": "string",
                    "example": "192.168.1.1"
                  },
                  "commission": {
                    "type": "string",
                    "example": "10.00"
                  },
                  "clickTime": {
                    "type": "string",
                    "example": "2024-06-19T11:05:00Z"
                  },
                  "url": {
                    "type": "string",
                    "example": "https://awin.com/track"
                  },
                  "phrase": {
                    "type": "string",
                    "example": "promo"
                  },
                  "searchEngine": {
                    "type": "string",
                    "example": "Google"
                  },
                  "commissionGroups": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "products": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "required": [
                  "transactionId",
                  "transactionDate",
                  "transactionCurrency",
                  "transactionAmount",
                  "affiliateId",
                  "merchantId",
                  "clickRef"
                ]
              },
              "example": {
                "transactionId": "123456789",
                "transactionDate": "2024-06-19T12:00:00Z",
                "transactionCurrency": "USD",
                "transactionAmount": "100.00",
                "affiliateId": "affiliate-001",
                "merchantId": "merchant-001",
                "groupId": "group-001",
                "bannerId": "banner-001",
                "clickRef": "user-uuid-123",
                "clickThroughTime": "2024-06-19T11:00:00Z",
                "ip": "192.168.1.1",
                "commission": "10.00",
                "clickTime": "2024-06-19T11:05:00Z",
                "url": "https://awin.com/track",
                "phrase": "promo",
                "searchEngine": "Google",
                "commissionGroups": [],
                "products": []
              }
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": 1,
                  "eventType": "AWIN_TRANSACTION_RECORDED",
                  "tenant": "tenant-uuid",
                  "payload": {
                    "transactionId": "123456789",
                    "transactionDate": "2024-06-19T12:00:00Z",
                    "transactionCurrency": "USD",
                    "transactionAmount": "100.00",
                    "affiliateId": "affiliate-001",
                    "merchantId": "merchant-001",
                    "clickRef": "user-uuid-123"
                  },
                  "user": "user-uuid-123",
                  "createdAt": "2024-06-19T12:01:00Z"
                }
              }
            },
            "description": "AWIN transaction recorded as event"
          },
          "400": {
            "description": "Bad request or missing required fields",
            "content": {
              "application/json": {
                "example": {
                  "message": "Publisher ID is required."
                }
              }
            }
          },
          "404": {
            "description": "Transaction or user not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Transaction not found."
                }
              }
            }
          }
        },
        "summary": "Authorize and record an AWIN transaction",
        "tags": [
          "Awin"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/awin/import_rewards": {
      "post": {
        "operationId": "AwinController.importRewards",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Import rewards",
        "tags": [
          "Awin"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/benefits/": {
      "get": {
        "operationId": "BenefitController.list",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Maximum number of results to return."
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Number of results to skip for pagination."
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/BenefitListParams",
              "type": "string",
              "enum": [
                "createdAt",
                "redeemedAt",
                "expiresAt"
              ]
            },
            "description": "Field to sort by (createdAt, redeemedAt, expiresAt)."
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order (ASC or DESC).",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Filter expression for narrowing results.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redeemable",
            "in": "query",
            "description": "Filter by redeemable status.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "id": "a3f7b2d1-8e4c-4a91-b6f0-2d3c4e5f6a7b",
                    "type": "VOUCHER",
                    "createdAt": "2024-06-10T09:15:00.000Z",
                    "redeemedAt": null,
                    "expiresAt": "2025-06-10T09:15:00.000Z",
                    "code": null,
                    "reward": {
                      "id": "c8d9e0f1-2a3b-4c5d-6e7f-8a9b0c1d2e3f",
                      "name": "10% Off Voucher"
                    },
                    "owner": {
                      "id": "9cb2cc08-e033-4200-86a7-95a03ba09462",
                      "accountNumber": 1000456
                    }
                  },
                  {
                    "id": "b4e8c3d2-9f5d-4b02-c7a1-3e4d5f6a7b8c",
                    "type": "WEGIFT_PRODUCT",
                    "createdAt": "2024-07-22T11:30:00.000Z",
                    "redeemedAt": "2024-08-01T16:45:00.000Z",
                    "expiresAt": null,
                    "pin": "1234",
                    "url": "https://gifts.example.com/redeem/abc123",
                    "reward": {
                      "id": "d9e0f1a2-3b4c-5d6e-7f8a-9b0c1d2e3f4a",
                      "name": "£20 Gift Card"
                    },
                    "owner": {
                      "id": "7ab1de09-f234-4567-89ab-cdef01234567",
                      "accountNumber": 1000789
                    }
                  }
                ]
              }
            },
            "description": "A paginated list of benefits"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "List benefits",
        "tags": [
          "Benefit"
        ],
        "description": "Returns a paginated list of benefits for the tenant. Supports both user and admin auth.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/benefits/{id}": {
      "get": {
        "operationId": "BenefitController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the benefit to retrieve.",
            "example": "a3f7b2d1-8e4c-4a91-b6f0-2d3c4e5f6a7b"
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "a3f7b2d1-8e4c-4a91-b6f0-2d3c4e5f6a7b",
                  "type": "VOUCHER",
                  "createdAt": "2024-06-10T09:15:00.000Z",
                  "redeemedAt": null,
                  "expiresAt": "2025-06-10T09:15:00.000Z",
                  "burnedAt": null,
                  "orderId": "order-98765",
                  "code": null,
                  "reward": {
                    "id": "c8d9e0f1-2a3b-4c5d-6e7f-8a9b0c1d2e3f",
                    "name": "10% Off Voucher"
                  },
                  "owner": {
                    "id": "9cb2cc08-e033-4200-86a7-95a03ba09462",
                    "accountNumber": 1000456
                  }
                }
              }
            },
            "description": "Benefit details"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Benefit not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Benefit not found"
                }
              }
            }
          }
        },
        "summary": "Retrieve a benefit",
        "tags": [
          "Benefit"
        ],
        "description": "Retrieves a single benefit by its UUID. Supports both user and admin auth.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/branch/attribution": {
      "post": {
        "operationId": "BranchController.processAttribution",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BranchAttributionPayload",
                "type": "object",
                "properties": {
                  "isAttributed": {
                    "type": "boolean",
                    "example": true
                  },
                  "lastAttributedTouchData": {
                    "type": "object",
                    "example": {
                      "channel": "email",
                      "campaign": "spring"
                    }
                  },
                  "hasExistingUserOnSameDevice": {
                    "type": "boolean",
                    "example": false
                  }
                },
                "required": [
                  "isAttributed",
                  "lastAttributedTouchData"
                ]
              },
              "example": {
                "isAttributed": true,
                "lastAttributedTouchData": {
                  "channel": "email",
                  "campaign": "spring"
                },
                "hasExistingUserOnSameDevice": false
              }
            }
          },
          "description": "BranchAttributionPayload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "updated": true
                }
              }
            },
            "description": "Attribution processed"
          },
          "400": {
            "description": "Bad request or already attributed",
            "content": {
              "application/json": {
                "example": {
                  "updated": false,
                  "reason": "Not updating attribution data because we already have some last attribution data for this user"
                }
              }
            }
          }
        },
        "summary": "Process Branch attribution for a user",
        "tags": [
          "Branch"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "userBearerAuth": []
          }
        ]
      }
    },
    "/branch/{integrationId}/webhook": {
      "post": {
        "operationId": "BranchController.handleWebhook",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "branch-tenant-123"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "name": "COMPLETE_REGISTRATION",
                "custom_data": {
                  "registrationId": "user-uuid-123"
                },
                "user_data": {
                  "developer_identity": "user-uuid-123"
                },
                "attributed": true,
                "existing_user": false,
                "last_attributed_touch_data": {
                  "channel": "email",
                  "campaign": "spring"
                }
              }
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - webhook processed",
                    "value": {
                      "updated": true,
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - webhook processed",
                    "value": {
                      "updated": true
                    }
                  }
                }
              }
            },
            "description": "Webhook processed"
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "User not found"
                }
              }
            }
          }
        },
        "summary": "Handle Branch webhook for user registration or attribution",
        "tags": [
          "Branch"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/branch/config": {
      "get": {
        "operationId": "BranchController.getIntegrationConfig",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "branchKey": "key_live_xxx",
                  "secret": "secret_xxx",
                  "enabled": true
                }
              }
            },
            "description": "Integration config"
          }
        },
        "summary": "Get Branch integration config",
        "tags": [
          "Branch"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/code_pools/{poolId}/codes/": {
      "get": {
        "operationId": "CodeController.list",
        "parameters": [
          {
            "in": "path",
            "name": "poolId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the code pool."
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all codes",
                    "value": [
                      {
                        "id": "code-123",
                        "value": "ABC123",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - visible codes",
                    "value": [
                      {
                        "id": "code-123",
                        "value": "ABC123",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of codes"
          }
        },
        "summary": "List codes",
        "tags": [
          "Code"
        ],
        "description": "Returns a paginated list of codes for the specified code pool.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "CodeController.create",
        "parameters": [
          {
            "in": "path",
            "name": "poolId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CodeDefinition"
              }
            }
          },
          "description": "CodeDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Code"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "CodeController.deleteMany",
        "parameters": [
          {
            "in": "path",
            "name": "poolId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete many",
        "tags": [
          "Code"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/code_pools/{poolId}/codes/{id}": {
      "get": {
        "operationId": "CodeController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "poolId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the code pool."
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the code to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - code details",
                    "value": {
                      "id": "code-123",
                      "value": "ABC123",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  },
                  "user": {
                    "summary": "User - code details",
                    "value": {
                      "id": "code-123",
                      "value": "ABC123",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Code details"
          }
        },
        "summary": "Get code",
        "tags": [
          "Code"
        ],
        "description": "Retrieves a single code by its unique ID from the specified code pool.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "CodeController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "poolId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Code"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/code_pools/{poolId}/codes/create_bulk": {
      "post": {
        "operationId": "CodeController.createMany",
        "parameters": [
          {
            "in": "path",
            "name": "poolId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkCodeDefinition"
              }
            }
          },
          "description": "BulkCodeDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create many",
        "tags": [
          "Code"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/code_pools/": {
      "get": {
        "operationId": "CodePoolController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Code Pool"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "CodePoolController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CodePoolDefinition"
              }
            }
          },
          "description": "CodePoolDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Code Pool"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/code_pools/{id}": {
      "get": {
        "operationId": "CodePoolController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Code Pool"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "CodePoolController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CodePoolPatch"
              }
            }
          },
          "description": "CodePoolPatch",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Code Pool"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/commands/purchase_reward": {
      "post": {
        "operationId": "CommandController.purchaseReward",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseRewardCommand"
              }
            }
          },
          "description": "PurchaseRewardCommand",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Purchase reward",
        "tags": [
          "Command"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/commands/redeem_benefit": {
      "post": {
        "operationId": "CommandController.redeemBenefit",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedeemBenefitCommand"
              }
            }
          },
          "description": "RedeemBenefitCommand",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Redeem benefit",
        "tags": [
          "Command"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/commands/validate_voucher": {
      "post": {
        "operationId": "CommandController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateVoucherCommand"
              }
            }
          },
          "description": "ValidateVoucherCommand",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Command"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/commands/adjust_points": {
      "post": {
        "operationId": "CommandController.adjustPoints",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActorAdjustPointsCommand"
              }
            }
          },
          "description": "ActorAdjustPointsCommand",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Adjust points",
        "tags": [
          "Command"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/commands/award_badge": {
      "post": {
        "operationId": "CommandController.awardBadge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AwardBadgeCommand"
              }
            }
          },
          "description": "AwardBadgeCommand",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Award badge",
        "tags": [
          "Command"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/commands/void_benefit": {
      "post": {
        "operationId": "CommandController.voidBenefit",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidBenefitCommand"
              }
            }
          },
          "description": "VoidBenefitCommand",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Void benefit",
        "tags": [
          "Command"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/consents/": {
      "get": {
        "operationId": "ConsentController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all consents",
                    "value": [
                      {
                        "id": "consent-123",
                        "type": {
                          "id": "consent-type-1",
                          "name": "Marketing Consent"
                        },
                        "user": {
                          "id": "user-1",
                          "email": "user@example.com"
                        },
                        "givenAt": "2025-01-01T00:00:00.000Z",
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - visible consents",
                    "value": [
                      {
                        "id": "consent-123",
                        "type": {
                          "id": "consent-type-1",
                          "name": "Marketing Consent"
                        },
                        "user": {
                          "id": "user-1",
                          "email": "user@example.com"
                        },
                        "givenAt": "2025-01-01T00:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of consents"
          }
        },
        "summary": "List consents",
        "tags": [
          "Consent"
        ],
        "description": "Returns a paginated list of consents."
      },
      "post": {
        "operationId": "ConsentController.create",
        "parameters": [
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentDefinition"
              }
            }
          },
          "description": "ConsentDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Consent"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/consents/{id}": {
      "get": {
        "operationId": "ConsentController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the consent to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - consent details",
                    "value": {
                      "id": "consent-123",
                      "type": {
                        "id": "consent-type-1",
                        "name": "Marketing Consent"
                      },
                      "user": {
                        "id": "user-1",
                        "email": "user@example.com"
                      },
                      "givenAt": "2025-01-01T00:00:00.000Z",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - consent details",
                    "value": {
                      "id": "consent-123",
                      "type": {
                        "id": "consent-type-1",
                        "name": "Marketing Consent"
                      },
                      "user": {
                        "id": "user-1",
                        "email": "user@example.com"
                      },
                      "givenAt": "2025-01-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Consent details"
          }
        },
        "summary": "Get consent",
        "tags": [
          "Consent"
        ],
        "description": "Retrieves a single consent by its unique ID."
      },
      "delete": {
        "operationId": "ConsentController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Consent"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/consent_types/": {
      "get": {
        "operationId": "ConsentTypeController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all consent types",
                    "value": [
                      {
                        "id": "consent-type-123",
                        "name": "Marketing Consent",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "descriptions": [],
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - visible consent types",
                    "value": [
                      {
                        "id": "consent-type-123",
                        "name": "Marketing Consent",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "descriptions": []
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of consent types"
          }
        },
        "summary": "List consent types",
        "tags": [
          "Consent Type"
        ],
        "description": "Returns a paginated list of consent types for the tenant.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "ConsentTypeController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentTypeDefinition"
              }
            }
          },
          "description": "ConsentTypeDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Consent Type"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/consent_types/{id}": {
      "get": {
        "operationId": "ConsentTypeController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the consent type to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - consent type details",
                    "value": {
                      "id": "consent-type-123",
                      "name": "Marketing Consent",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "descriptions": [],
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - consent type details",
                    "value": {
                      "id": "consent-type-123",
                      "name": "Marketing Consent",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "descriptions": []
                    }
                  }
                }
              }
            },
            "description": "Consent type details"
          }
        },
        "summary": "Get consent type",
        "tags": [
          "Consent Type"
        ],
        "description": "Retrieves a single consent type by its unique ID.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "ConsentTypeController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentTypePatch"
              }
            }
          },
          "description": "ConsentTypePatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Consent Type"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "ConsentTypeController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Consent Type"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/rewards/{rewardId}/discounts": {
      "get": {
        "operationId": "DiscountController.list",
        "parameters": [
          {
            "in": "path",
            "name": "rewardId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the reward."
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - discounts list",
                    "value": [
                      {
                        "id": "discount-123",
                        "name": "10% Off",
                        "value": 10,
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - discounts list",
                    "value": [
                      {
                        "id": "discount-123",
                        "name": "10% Off",
                        "value": 10,
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of discounts"
          }
        },
        "summary": "List discounts",
        "tags": [
          "Discount"
        ],
        "description": "Returns a paginated list of discounts for a reward.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "DiscountController.create",
        "parameters": [
          {
            "in": "path",
            "name": "rewardId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscountDefinition"
              }
            }
          },
          "description": "DiscountDefinition",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Discount"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/rewards/{rewardId}/discounts/{id}": {
      "get": {
        "operationId": "DiscountController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "rewardId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the reward."
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the discount to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - discount",
                    "value": {
                      "id": "discount-123",
                      "name": "10% Off",
                      "value": 10,
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - discount",
                    "value": {
                      "id": "discount-123",
                      "name": "10% Off",
                      "value": 10,
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Discount details"
          }
        },
        "summary": "Get discount",
        "tags": [
          "Discount"
        ],
        "description": "Retrieves a single discount by its unique ID for a reward.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "DiscountController.update",
        "parameters": [
          {
            "in": "path",
            "name": "rewardId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscountPatch"
              }
            }
          },
          "description": "DiscountPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Discount"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "DiscountController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "rewardId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Discount"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/event_reactors/": {
      "get": {
        "operationId": "EventReactorController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all event reactors",
                    "value": [
                      {
                        "id": "reactor-123",
                        "name": "Points Awarded",
                        "eventType": {
                          "id": "event-type-1",
                          "name": "User Registered"
                        },
                        "reactions": [],
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - visible event reactors",
                    "value": [
                      {
                        "id": "reactor-123",
                        "name": "Points Awarded",
                        "eventType": {
                          "id": "event-type-1",
                          "name": "User Registered"
                        },
                        "reactions": [],
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of event reactors"
          }
        },
        "summary": "List event reactors",
        "tags": [
          "Event Reactor"
        ],
        "description": "Returns a paginated list of event reactors for the tenant.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "EventReactorController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventReactorDefinition"
              }
            }
          },
          "description": "EventReactorDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Event Reactor"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/event_reactors/{id}": {
      "get": {
        "operationId": "EventReactorController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the event reactor to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - event reactor details",
                    "value": {
                      "id": "reactor-123",
                      "name": "Points Awarded",
                      "eventType": {
                        "id": "event-type-1",
                        "name": "User Registered"
                      },
                      "reactions": [],
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - event reactor details",
                    "value": {
                      "id": "reactor-123",
                      "name": "Points Awarded",
                      "eventType": {
                        "id": "event-type-1",
                        "name": "User Registered"
                      },
                      "reactions": [],
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Event reactor details"
          }
        },
        "summary": "Get event reactor",
        "tags": [
          "Event Reactor"
        ],
        "description": "Retrieves a single event reactor by its unique ID.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "EventReactorController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventReactorPatch"
              }
            }
          },
          "description": "EventReactorPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Event Reactor"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "EventReactorController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Event Reactor"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/event_types/": {
      "get": {
        "operationId": "EventTypeController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - event types list",
                    "value": [
                      {
                        "id": "event-type-123",
                        "name": "User Registered",
                        "isActive": true,
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - event types list",
                    "value": [
                      {
                        "id": "event-type-123",
                        "name": "User Registered",
                        "isActive": true,
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of event types"
          }
        },
        "summary": "List event types",
        "tags": [
          "Event Type"
        ],
        "description": "Returns a paginated list of event types for the tenant.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "EventTypeController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventTypeDefinition"
              }
            }
          },
          "description": "EventTypeDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Event Type"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/event_types/{identifier}": {
      "get": {
        "operationId": "EventTypeController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "identifier",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier or name of the event type to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - event type",
                    "value": {
                      "id": "event-type-123",
                      "name": "User Registered",
                      "isActive": true,
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  },
                  "user": {
                    "summary": "User - event type",
                    "value": {
                      "id": "event-type-123",
                      "name": "User Registered",
                      "isActive": true,
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Event type details"
          }
        },
        "summary": "Get event type",
        "tags": [
          "Event Type"
        ],
        "description": "Retrieves a single event type by its unique ID or name.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/event_types/{id}": {
      "patch": {
        "operationId": "EventTypeController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventTypePatch"
              }
            }
          },
          "description": "EventTypePatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Event Type"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/event_types/{identifier}/secret": {
      "get": {
        "operationId": "EventTypeController.retrieveSecret",
        "parameters": [
          {
            "in": "path",
            "name": "identifier",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve secret",
        "tags": [
          "Event Type"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/fidel/cards": {
      "get": {
        "operationId": "FidelController.cards",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all cards",
                    "value": [
                      {
                        "id": "card-1",
                        "scheme": "visa",
                        "last4": "1234",
                        "state": "active",
                        "internalNotes": "Admin-only field"
                      },
                      {
                        "id": "card-2",
                        "scheme": "mastercard",
                        "last4": "5678",
                        "state": "inactive",
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - visible cards",
                    "value": [
                      {
                        "id": "card-1",
                        "scheme": "visa",
                        "last4": "1234",
                        "state": "active"
                      },
                      {
                        "id": "card-2",
                        "scheme": "mastercard",
                        "last4": "5678",
                        "state": "inactive"
                      }
                    ]
                  }
                }
              }
            },
            "description": "List of Fidel cards"
          }
        },
        "summary": "Get Fidel cards for the current user",
        "tags": [
          "Fidel"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/fidel/cards/{id}": {
      "delete": {
        "operationId": "FidelController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "card-1"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "success": true
                }
              }
            },
            "description": "Card deleted"
          },
          "400": {
            "description": "Invalid upstream response or fingerprint mismatch",
            "content": {
              "application/json": {
                "example": {
                  "message": "User fingerprint does not match"
                }
              }
            }
          }
        },
        "summary": "Delete a Fidel card for the current user",
        "tags": [
          "Fidel"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/fidel/transaction/{integrationId}": {
      "post": {
        "operationId": "FidelController.transactionAuth",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "fidel-integration-1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionDefinition",
                "type": "object"
              },
              "example": {
                "id": "1234",
                "amount": 100,
                "currency": "GBP"
              }
            }
          },
          "description": "TransactionDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "queued"
                }
              }
            },
            "description": "Webhook processed"
          },
          "403": {
            "description": "Invalid Signature",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid Signature"
                }
              }
            }
          }
        },
        "summary": "Handle Fidel transaction authorization webhook",
        "tags": [
          "Fidel"
        ]
      }
    },
    "/fidel/qualified/{integrationId}": {
      "post": {
        "operationId": "FidelController.transactionQualified",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "fidel-integration-1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionDefinition",
                "type": "object"
              },
              "example": {
                "id": "1234",
                "amount": 100,
                "currency": "GBP"
              }
            }
          },
          "description": "TransactionDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "queued"
                }
              }
            },
            "description": "Webhook processed"
          },
          "403": {
            "description": "Invalid Signature",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid Signature"
                }
              }
            }
          }
        },
        "summary": "Handle Fidel transaction qualified webhook",
        "tags": [
          "Fidel"
        ]
      }
    },
    "/fidel/cleared/{integrationId}": {
      "post": {
        "operationId": "FidelController.transactionCleared",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "fidel-integration-1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionDefinition",
                "type": "object"
              },
              "example": {
                "id": "1234",
                "amount": 100,
                "currency": "GBP"
              }
            }
          },
          "description": "TransactionDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "queued"
                }
              }
            },
            "description": "Webhook processed"
          },
          "403": {
            "description": "Invalid Signature",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid Signature"
                }
              }
            }
          }
        },
        "summary": "Handle Fidel transaction cleared webhook",
        "tags": [
          "Fidel"
        ]
      }
    },
    "/fidel/refund/{integrationId}": {
      "post": {
        "operationId": "FidelController.transactionRefund",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "fidel-integration-1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionDefinition",
                "type": "object"
              },
              "example": {
                "id": "1234",
                "amount": 100,
                "currency": "GBP"
              }
            }
          },
          "description": "TransactionDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "queued"
                }
              }
            },
            "description": "Webhook processed"
          },
          "403": {
            "description": "Invalid Signature",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid Signature"
                }
              }
            }
          }
        },
        "summary": "Handle Fidel transaction refund webhook",
        "tags": [
          "Fidel"
        ]
      }
    },
    "/fidel/card/linked/{integrationId}": {
      "post": {
        "operationId": "FidelController.cardLinked",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "fidel-integration-1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardDefinition",
                "type": "object"
              },
              "example": {
                "id": "card-1",
                "scheme": "visa",
                "last4": "1234"
              }
            }
          },
          "description": "CardDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "queued"
                }
              }
            },
            "description": "Webhook processed"
          },
          "403": {
            "description": "Invalid Signature",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid Signature"
                }
              }
            }
          }
        },
        "summary": "Handle Fidel card linked webhook",
        "tags": [
          "Fidel"
        ]
      }
    },
    "/fidel/sync_venues": {
      "post": {
        "operationId": "FidelController.syncVenues",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "venues": [
                    {
                      "id": "venue-1",
                      "name": "Venue 1"
                    }
                  ]
                }
              }
            },
            "description": "Venues synced"
          },
          "400": {
            "description": "Missing API key or programId",
            "content": {
              "application/json": {
                "example": {
                  "message": "programId is required."
                }
              }
            }
          }
        },
        "summary": "Sync venues from Fidel",
        "tags": [
          "Fidel"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/fidel/export_rewards": {
      "post": {
        "operationId": "FidelController.exportOfferRewards",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "success": true
                }
              }
            },
            "description": "Rewards exported"
          }
        },
        "summary": "Export Fidel offer rewards",
        "tags": [
          "Fidel"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/fidel/import_offers": {
      "post": {
        "operationId": "FidelController.queueImport",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "queued"
                }
              }
            },
            "description": "Import queued"
          },
          "400": {
            "description": "Missing tenant ID",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tenant ID is required."
                }
              }
            }
          }
        },
        "summary": "Queue import of Fidel offers",
        "tags": [
          "Fidel"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/fidel/brands": {
      "get": {
        "operationId": "FidelController.brandList",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "id": "brand-1",
                    "name": "Brand 1"
                  },
                  {
                    "id": "brand-2",
                    "name": "Brand 2"
                  }
                ]
              }
            },
            "description": "List of brands"
          }
        },
        "summary": "Get Fidel brands",
        "tags": [
          "Fidel"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/flags/": {
      "post": {
        "operationId": "FlagController.setFlag",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Set flag",
        "tags": [
          "Flag"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/integrations/": {
      "get": {
        "operationId": "IntegrationController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Integration"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "IntegrationController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationDefinition"
              }
            }
          },
          "description": "IntegrationDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Integration"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/integrations/{id}": {
      "get": {
        "operationId": "IntegrationController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Integration"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "IntegrationController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationPatch"
              }
            }
          },
          "description": "IntegrationPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Integration"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/kindred/import_rewards": {
      "post": {
        "operationId": "KindredController.importRewards",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "queued",
                  "message": "Kindred rewards import task has been queued for tenant."
                }
              }
            },
            "description": "Rewards import task queued"
          },
          "400": {
            "description": "Bad request or missing tenant ID",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tenant ID should be defined"
                }
              }
            }
          }
        },
        "summary": "Import Kindred rewards for a tenant",
        "tags": [
          "Kindred"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/magnati/card": {
      "post": {
        "operationId": "MagnatiController.issueCard",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardIssuancePayload"
              },
              "example": {
                "fullName": "JOHN DOE",
                "dob": "1990-01-01",
                "mobile": "+971501234567",
                "email": "john.doe@email.com",
                "emiratesId": "784-1984-1234567-1",
                "nationality": "AE",
                "gender": "M"
              }
            }
          },
          "description": "CardIssuancePayload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "errorCode": "0",
                  "errorText": "",
                  "cardNumber": "1234567890123456",
                  "iban": "AE070331234567890123456",
                  "cardId": "MAGNATI123",
                  "availableBalance": 0,
                  "currentBalance": 0,
                  "lastTopUpAmount": 0,
                  "lastTopUpDate": "2023-01-01T00:00:00Z",
                  "lastTransactionAmount": 0,
                  "lastTransactionDate": "2023-01-01T00:00:00Z"
                }
              }
            },
            "description": "Card issued successfully"
          },
          "504": {
            "description": "Timeout error",
            "content": {
              "application/json": {
                "example": {
                  "message": "Contact support if needed. Timeout Error: Issue Card: 123",
                  "code": 504
                }
              }
            }
          }
        },
        "summary": "Issue a new Magnati card",
        "tags": [
          "Magnati"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "get": {
        "operationId": "MagnatiController.getCardStatus",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "errorCode": "0",
                  "errorText": "",
                  "cardNumber": "1234567890123456",
                  "iban": "AE070331234567890123456",
                  "cardId": "MAGNATI123",
                  "availableBalance": 100,
                  "currentBalance": 100,
                  "lastTopUpAmount": 50,
                  "lastTopUpDate": "2023-01-01T00:00:00Z",
                  "lastTransactionAmount": 50,
                  "lastTransactionDate": "2023-01-01T00:00:00Z"
                }
              }
            },
            "description": "Card status"
          },
          "504": {
            "description": "Timeout error",
            "content": {
              "application/json": {
                "example": {
                  "message": "Timeout Error: Get Card: 123",
                  "code": 504
                }
              }
            }
          }
        },
        "summary": "Get Magnati card status",
        "tags": [
          "Magnati"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/magnati/topup": {
      "post": {
        "operationId": "MagnatiController.topUpCard",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "errorCode": "0",
                  "errorText": "",
                  "cardNumber": "1234567890123456",
                  "iban": "AE070331234567890123456",
                  "cardId": "MAGNATI123",
                  "availableBalance": 200,
                  "currentBalance": 200,
                  "lastTopUpAmount": 100,
                  "lastTopUpDate": "2023-01-02T00:00:00Z",
                  "lastTransactionAmount": 100,
                  "lastTransactionDate": "2023-01-02T00:00:00Z"
                }
              }
            },
            "description": "Top up successful"
          },
          "504": {
            "description": "Timeout error",
            "content": {
              "application/json": {
                "example": {
                  "message": "Contact support if needed. Timeout Error: TopUp Card: 123",
                  "code": 504
                }
              }
            }
          }
        },
        "summary": "Top up Magnati card",
        "tags": [
          "Magnati"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MagnatiTopUpPayload"
              },
              "example": {
                "transactionType": 1,
                "cardId": "MAGNATI123",
                "terminalId": "TERM001",
                "merchantId": "MERCH001",
                "rrn": "123456789012",
                "transactionAmount": 100,
                "transactionCurrency": "AED",
                "equivalentAmount": 100,
                "equivalentCurrency": "AED"
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/magnati/token": {
      "get": {
        "operationId": "MagnatiController.getToken",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                  "url": "https://magnati.com/webview"
                }
              }
            },
            "description": "Token and web view URL"
          }
        },
        "summary": "Get Magnati card token",
        "tags": [
          "Magnati"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/media_items/": {
      "get": {
        "operationId": "MediaItemController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Media Item"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "MediaItemController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaItemDefinition"
              }
            }
          },
          "description": "MediaItemDefinition",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Media Item"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/media_items/{id}": {
      "get": {
        "operationId": "MediaItemController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Media Item"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "MediaItemController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaItemPatch"
              }
            }
          },
          "description": "MediaItemPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Media Item"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "MediaItemController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Media Item"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/meta_events/recalculate": {
      "post": {
        "operationId": "MetaEventController.recalculate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "type": "string",
                  "example": "user-uuid-123"
                },
                "type": "array"
              },
              "example": [
                "user-uuid-123",
                "user-uuid-456"
              ]
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - meta events",
                    "value": {
                      "successfullyDispatchedEvents": [
                        {
                          "id": "meta-event-1",
                          "state": "dispatched",
                          "internalNotes": "Admin-only field"
                        },
                        {
                          "id": "meta-event-2",
                          "state": "dispatched",
                          "internalNotes": "Admin-only field"
                        }
                      ],
                      "failedDispatchedEvents": [
                        {
                          "id": "meta-event-3",
                          "state": "failed",
                          "internalNotes": "Admin-only field"
                        }
                      ]
                    }
                  },
                  "user": {
                    "summary": "User - meta events",
                    "value": {
                      "successfullyDispatchedEvents": [
                        {
                          "id": "meta-event-1",
                          "state": "dispatched"
                        },
                        {
                          "id": "meta-event-2",
                          "state": "dispatched"
                        }
                      ],
                      "failedDispatchedEvents": [
                        {
                          "id": "meta-event-3",
                          "state": "failed"
                        }
                      ]
                    }
                  }
                }
              }
            },
            "description": "Meta events recalculated and dispatched"
          },
          "400": {
            "description": "Bad request or invalid user ids",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid user ids"
                }
              }
            }
          }
        },
        "summary": "Recalculate and dispatch meta events for users",
        "tags": [
          "Meta Event"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/apple-wallet/pass": {
      "post": {
        "operationId": "AppleWalletController.generatePass",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppleWalletPassBody",
                "type": "object",
                "properties": {
                  "organizationName": {
                    "type": "string",
                    "example": "White Label Loyalty"
                  },
                  "description": {
                    "type": "string",
                    "example": "WLL Membership Card"
                  },
                  "backgroundColor": {
                    "type": "string",
                    "example": "#41228E"
                  },
                  "foregroundColor": {
                    "type": "string",
                    "example": "#FACF39"
                  },
                  "labelColor": {
                    "type": "string",
                    "example": "#FFFFFF"
                  },
                  "icon": {
                    "type": "string",
                    "example": "https://example.com/icon.png"
                  },
                  "icon2x": {
                    "type": "string",
                    "example": "https://example.com/icon@2x.png"
                  },
                  "logo": {
                    "type": "string",
                    "example": "https://example.com/logo.png"
                  },
                  "logo2x": {
                    "type": "string",
                    "example": "https://example.com/logo@2x.png"
                  },
                  "strip": {
                    "type": "string",
                    "example": "https://example.com/strip.png"
                  },
                  "memberIdPath": {
                    "type": "string",
                    "example": "accountNumber"
                  },
                  "showMemberIdAsLabel": {
                    "type": "boolean",
                    "example": true
                  }
                }
              },
              "example": {
                "organizationName": "White Label Loyalty",
                "description": "WLL Membership Card",
                "backgroundColor": "#41228E",
                "foregroundColor": "#FACF39",
                "labelColor": "#FFFFFF",
                "icon": "https://example.com/icon.png",
                "icon2x": "https://example.com/icon@2x.png",
                "logo": "https://example.com/logo.png",
                "logo2x": "https://example.com/logo@2x.png",
                "strip": "https://example.com/strip.png",
                "memberIdPath": "accountNumber",
                "showMemberIdAsLabel": true
              }
            }
          },
          "description": "AppleWalletPassBody",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "url": "https://api.example.com/passes/loyaltyPass.pkpass"
                }
              }
            },
            "description": "Apple Wallet pass generated"
          },
          "400": {
            "description": "Bad request or invalid payload",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid pass payload"
                }
              }
            }
          }
        },
        "summary": "Generate an Apple Wallet pass for a user",
        "tags": [
          "Apple Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/badges/": {
      "get": {
        "operationId": "BadgeController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all badges",
                    "value": [
                      {
                        "id": "e5a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c",
                        "internalName": "welcome_badge",
                        "priority": 1,
                        "status": "ACTIVE",
                        "createdAt": "2024-01-15T08:00:00.000Z",
                        "updatedAt": "2024-06-01T12:00:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Welcome Badge",
                            "description": "Awarded to new members on signup.",
                            "artworkUrl": "https://cdn.example.com/badges/welcome.png"
                          }
                        ]
                      },
                      {
                        "id": "f6b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                        "internalName": "loyalty_champion",
                        "priority": 2,
                        "status": "INACTIVE",
                        "createdAt": "2024-02-20T10:30:00.000Z",
                        "updatedAt": "2024-05-15T09:45:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Loyalty Champion",
                            "description": "Earned after 12 months of membership.",
                            "artworkUrl": "https://cdn.example.com/badges/loyalty.png"
                          }
                        ]
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - active badges only",
                    "value": [
                      {
                        "id": "e5a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c",
                        "internalName": "welcome_badge",
                        "priority": 1,
                        "status": "ACTIVE",
                        "createdAt": "2024-01-15T08:00:00.000Z",
                        "updatedAt": "2024-06-01T12:00:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Welcome Badge",
                            "description": "Awarded to new members on signup.",
                            "artworkUrl": "https://cdn.example.com/badges/welcome.png"
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of badges"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "List badges",
        "tags": [
          "Badge"
        ],
        "description": "Returns a paginated list of badges for the tenant. Admin auth required for INACTIVE/ARCHIVED badges.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "BadgeController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BadgeDefinition",
                "type": "object"
              },
              "example": {
                "internalName": "early_adopter",
                "priority": 3,
                "defaultLocale": "en",
                "details": [
                  {
                    "locale": "en",
                    "name": "Early Adopter",
                    "description": "Awarded to users who joined in the first month.",
                    "artworkUrl": "https://cdn.example.com/badges/early-adopter.png"
                  }
                ]
              }
            }
          },
          "description": "BadgeDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          },
          "201": {
            "description": "Badge created",
            "content": {
              "application/json": {
                "example": {
                  "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                  "internalName": "early_adopter",
                  "priority": 3,
                  "status": "ACTIVE",
                  "createdAt": "2025-01-10T14:00:00.000Z",
                  "updatedAt": "2025-01-10T14:00:00.000Z",
                  "defaultLocale": "en",
                  "details": [
                    {
                      "locale": "en",
                      "name": "Early Adopter",
                      "description": "Awarded to users who joined in the first month.",
                      "artworkUrl": "https://cdn.example.com/badges/early-adopter.png"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid badge definition",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid badge definition"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "Create a badge",
        "tags": [
          "Badge"
        ],
        "description": "Creates a new badge. Requires admin auth.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/badges/{id}": {
      "get": {
        "operationId": "BadgeController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the badge.",
            "example": "e5a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "e5a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c",
                  "internalName": "welcome_badge",
                  "priority": 1,
                  "status": "ACTIVE",
                  "createdAt": "2024-01-15T08:00:00.000Z",
                  "updatedAt": "2024-06-01T12:00:00.000Z",
                  "defaultLocale": "en",
                  "details": [
                    {
                      "locale": "en",
                      "name": "Welcome Badge",
                      "description": "Awarded to new members on signup.",
                      "artworkUrl": "https://cdn.example.com/badges/welcome.png"
                    }
                  ]
                }
              }
            },
            "description": "Badge details"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Badge not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Badge not found"
                }
              }
            }
          }
        },
        "summary": "Retrieve a badge",
        "tags": [
          "Badge"
        ],
        "description": "Retrieves a single badge by its UUID.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "BadgeController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the badge to update.",
            "example": "e5a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BadgePatch",
                "type": "object"
              },
              "example": {
                "internalName": "welcome_badge_v2",
                "priority": 1,
                "status": "ACTIVE",
                "details": [
                  {
                    "locale": "en",
                    "name": "Welcome Badge",
                    "description": "Updated description for welcome badge.",
                    "artworkUrl": "https://cdn.example.com/badges/welcome-v2.png"
                  }
                ]
              }
            }
          },
          "description": "BadgePatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "e5a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c",
                  "internalName": "welcome_badge_v2",
                  "priority": 1,
                  "status": "ACTIVE",
                  "createdAt": "2024-01-15T08:00:00.000Z",
                  "updatedAt": "2025-02-01T10:30:00.000Z",
                  "defaultLocale": "en",
                  "details": [
                    {
                      "locale": "en",
                      "name": "Welcome Badge",
                      "description": "Updated description for welcome badge.",
                      "artworkUrl": "https://cdn.example.com/badges/welcome-v2.png"
                    }
                  ]
                }
              }
            },
            "description": "Badge updated"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Badge not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Badge not found"
                }
              }
            }
          }
        },
        "summary": "Update a badge",
        "tags": [
          "Badge"
        ],
        "description": "Updates an existing badge by ID. Requires admin auth.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/badges/earned": {
      "get": {
        "operationId": "BadgeController.listEarnedBadges",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "id": "ab12cd34-ef56-7890-ab12-cd34ef567890",
                    "badge": {
                      "id": "e5a1b2c3-d4e5-4f6a-7b8c-9d0e1f2a3b4c",
                      "internalName": "welcome_badge"
                    },
                    "userId": "9cb2cc08-e033-4200-86a7-95a03ba09462",
                    "earnedAt": "2024-04-01T09:00:00.000Z"
                  },
                  {
                    "id": "bc23de45-fg67-8901-bc23-de45fg678901",
                    "badge": {
                      "id": "f6b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                      "internalName": "loyalty_champion"
                    },
                    "userId": "7ab1de09-f234-4567-89ab-cdef01234567",
                    "earnedAt": "2024-08-15T14:30:00.000Z"
                  }
                ]
              }
            },
            "description": "List of earned badges"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "List earned badges",
        "tags": [
          "Badge"
        ],
        "description": "Returns a list of badges earned by users within the tenant.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/carltonone/rewards": {
      "get": {
        "operationId": "CarltonOneController.searchRewards",
        "parameters": [
          {
            "in": "query",
            "name": "searchKeyword",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Search rewards",
        "tags": [
          "Carlton One"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/carltonone/rewards/{id}": {
      "get": {
        "operationId": "CarltonOneController.getReward",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "catalogId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get reward",
        "tags": [
          "Carlton One"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/data-seed/": {
      "post": {
        "operationId": "DataSeedController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Data Seed"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "DataSeedController.destroy",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Destroy",
        "tags": [
          "Data Seed"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/data-seed/status": {
      "get": {
        "operationId": "DataSeedController.getStatus",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get status",
        "tags": [
          "Data Seed"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/campaigns/": {
      "get": {
        "operationId": "EarningCampaignController.list",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return, from 1 to 1000.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Zero-based number of matching records to skip.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "example": 0
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort direction for the field selected by `sort`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ],
              "default": "ASC"
            },
            "example": "DESC"
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Field to sort by, such as `createdAt`, `updatedAt`, `name`, or `status`.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdAt"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Rison-encoded field comparisons. Supported comparators include `eq`, `neq`, `lt`, `gt`, `like`, `near`, and `in`.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "status:(eq:ACTIVE)"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a",
                      "createdAt": "2026-08-20T09:00:00.000Z",
                      "updatedAt": "2026-08-20T09:00:00.000Z",
                      "name": "Summer spend challenge",
                      "details": [
                        {
                          "locale": "en",
                          "name": "Summer spend challenge",
                          "description": "Make three qualifying purchases during the campaign.",
                          "pictureUrl": "https://cdn.example.com/campaigns/summer-spend.png"
                        }
                      ],
                      "defaultLocale": "en",
                      "effectivity": {
                        "start": "2026-08-20T09:00:00.000Z",
                        "end": null
                      },
                      "status": "DRAFT",
                      "type": "GOAL_BASED",
                      "visibilityCriteria": null
                    },
                    {
                      "id": "9cf765f0-07dd-46eb-9c18-514f34da3a80",
                      "createdAt": "2026-08-20T09:00:00.000Z",
                      "updatedAt": "2026-08-20T09:00:00.000Z",
                      "name": "Always-on purchase bonus",
                      "details": [
                        {
                          "locale": "en",
                          "name": "Always-on purchase bonus",
                          "description": "Award points after every eligible purchase.",
                          "pictureUrl": "https://cdn.example.com/campaigns/purchase-bonus.png"
                        }
                      ],
                      "defaultLocale": "en",
                      "effectivity": {
                        "start": "2026-08-20T09:00:00.000Z",
                        "end": null
                      },
                      "status": "ACTIVE",
                      "type": "RULE_BASED",
                      "visibilityCriteria": null
                    }
                  ]
                }
              }
            },
            "description": "A page of earning campaigns.",
            "headers": {
              "Content-Range": {
                "description": "The resource name, zero-based indexes in this page, and total matching campaigns.",
                "schema": {
                  "type": "string"
                },
                "example": "earning_campaign 0-1/42"
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "List earning campaigns",
        "tags": [
          "Campaigns"
        ],
        "description": "Returns the tenant's admin-facing earning campaign definitions across **all lifecycle statuses**. This endpoint does not apply the member visibility rules used by user-facing campaign endpoints.\n\nUse the list query to paginate, sort, or filter the result. The `Content-Range` response header describes the returned slice and total count. Requires `read:campaigns`.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "EarningCampaignController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarningCampaignDefinition"
              },
              "example": {
                "details": [
                  {
                    "locale": "en",
                    "name": "Summer spend challenge",
                    "description": "Make three qualifying purchases during the campaign.",
                    "pictureUrl": "https://cdn.example.com/campaigns/summer-spend.png"
                  }
                ],
                "defaultLocale": "en",
                "effectivity": {
                  "availableImmediately": true,
                  "end": null
                },
                "type": "GOAL_BASED",
                "status": "DRAFT",
                "visibilityCriteria": null,
                "missions": [
                  {
                    "details": [
                      {
                        "locale": "en",
                        "name": "Make three purchases",
                        "description": "Each qualifying purchase advances this mission.",
                        "pictureUrl": "https://cdn.example.com/missions/three-purchases.png"
                      }
                    ],
                    "defaultLocale": "en",
                    "completionType": "COUNT",
                    "targetValue": 3,
                    "duration": "P30D",
                    "requiresOptIn": true,
                    "displayStyle": "PROGRESS_BAR",
                    "order": 0,
                    "reactor": {
                      "eventType": {
                        "name": "PURCHASED_REWARD"
                      },
                      "reactions": []
                    }
                  }
                ]
              }
            }
          },
          "description": "The earning campaign definition.",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a",
                    "createdAt": "2026-08-20T09:00:00.000Z",
                    "updatedAt": "2026-08-20T09:00:00.000Z",
                    "name": "Summer spend challenge",
                    "details": [
                      {
                        "locale": "en",
                        "name": "Summer spend challenge",
                        "description": "Make three qualifying purchases during the campaign.",
                        "pictureUrl": "https://cdn.example.com/campaigns/summer-spend.png"
                      }
                    ],
                    "defaultLocale": "en",
                    "effectivity": {
                      "start": "2026-08-20T09:00:00.000Z",
                      "end": null
                    },
                    "status": "DRAFT",
                    "type": "GOAL_BASED",
                    "visibilityCriteria": null,
                    "missions": [
                      {
                        "id": "02d24ac1-2221-4fa2-a6cd-4b63d778b7a0",
                        "createdAt": "2026-08-20T09:00:00.000Z",
                        "updatedAt": "2026-08-20T09:00:00.000Z",
                        "name": "Make three purchases",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Make three purchases",
                            "description": "Each PURCHASED_REWARD event advances this mission.",
                            "pictureUrl": "https://cdn.example.com/missions/three-purchases.png"
                          }
                        ],
                        "defaultLocale": "en",
                        "completionType": "COUNT",
                        "targetValue": 3,
                        "valueExpression": null,
                        "duration": "P30D",
                        "cooldownDuration": null,
                        "requiresOptIn": true,
                        "displayStyle": "PROGRESS_BAR",
                        "triggerEventType": "PURCHASED_REWARD",
                        "parentMissionId": null,
                        "order": 0,
                        "children": []
                      }
                    ],
                    "reactions": []
                  }
                }
              }
            },
            "description": "The earning campaign was created."
          },
          "400": {
            "description": "The definition failed validation or violated campaign, locale, mission, or effectivity rules.",
            "content": {
              "application/json": {
                "examples": {
                  "missingDefaultLocale": {
                    "summary": "Default locale has no matching details",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "details must include an entry for the default locale (en)",
                      "data": {}
                    }
                  },
                  "invalidInitialStatus": {
                    "summary": "Unsupported initial lifecycle status",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Cannot create an EarningCampaign with status PAUSED. Only DRAFT or ACTIVE are allowed at creation.",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Create an earning campaign",
        "tags": [
          "Campaigns"
        ],
        "description": "Creates an earning campaign and any initial missions atomically. Requires `create:campaigns`.\n\nImportant rules:\n\n- `type` is required and must be `GOAL_BASED` or `RULE_BASED`.\n- A campaign may initially be `DRAFT` (the default) or `ACTIVE`.\n- `details` must contain unique locales and an entry matching `defaultLocale` (which defaults to `en`).\n- Set `effectivity.availableImmediately` to `true`, or provide `effectivity.start`. An end date cannot be in the past or before the start date.\n- Goal-based mission fields describe measurable progress. Rule-based missions must omit goal-only fields such as `targetValue`, `duration`, and `displayStyle`.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/campaigns/status_counts": {
      "get": {
        "operationId": "EarningCampaignController.statusCounts",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "statusCount": {
                      "DRAFT": 2,
                      "ACTIVE": 5,
                      "PAUSED": 1,
                      "ENDED": 8,
                      "ARCHIVED": 3
                    }
                  }
                }
              }
            },
            "description": "Campaign counts grouped by lifecycle status."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Count earning campaigns by status",
        "tags": [
          "Campaigns"
        ],
        "description": "Returns a tenant-wide count for every earning campaign lifecycle status. Statuses with no campaigns are included with a value of `0`. Requires `read:campaigns`.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/campaigns/{id}": {
      "get": {
        "operationId": "EarningCampaignController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the earning campaign.",
            "example": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a",
                    "createdAt": "2026-08-20T09:00:00.000Z",
                    "updatedAt": "2026-08-20T09:00:00.000Z",
                    "name": "Summer spend challenge",
                    "details": [
                      {
                        "locale": "en",
                        "name": "Summer spend challenge",
                        "description": "Make three qualifying purchases during the campaign.",
                        "pictureUrl": "https://cdn.example.com/campaigns/summer-spend.png"
                      }
                    ],
                    "defaultLocale": "en",
                    "effectivity": {
                      "start": "2026-08-20T09:00:00.000Z",
                      "end": null
                    },
                    "status": "DRAFT",
                    "type": "GOAL_BASED",
                    "visibilityCriteria": null,
                    "missions": [
                      {
                        "id": "02d24ac1-2221-4fa2-a6cd-4b63d778b7a0",
                        "createdAt": "2026-08-20T09:00:00.000Z",
                        "updatedAt": "2026-08-20T09:00:00.000Z",
                        "name": "Make three purchases",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Make three purchases",
                            "description": "Each PURCHASED_REWARD event advances this mission.",
                            "pictureUrl": "https://cdn.example.com/missions/three-purchases.png"
                          }
                        ],
                        "defaultLocale": "en",
                        "completionType": "COUNT",
                        "targetValue": 3,
                        "valueExpression": null,
                        "duration": "P30D",
                        "cooldownDuration": null,
                        "requiresOptIn": true,
                        "displayStyle": "PROGRESS_BAR",
                        "triggerEventType": "PURCHASED_REWARD",
                        "parentMissionId": null,
                        "order": 0,
                        "children": []
                      }
                    ],
                    "reactions": []
                  }
                }
              }
            },
            "description": "The earning campaign configuration."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No earning campaign with this UUID exists for the tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "EarningCampaign with id 8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Retrieve an earning campaign",
        "tags": [
          "Campaigns"
        ],
        "description": "Retrieves one tenant-owned earning campaign and its missions. For a `GOAL_BASED` campaign, the internal structural root is omitted and its children are returned as a nested hierarchy. Missions for a `RULE_BASED` campaign remain a flat list. Requires `read:campaigns`.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "EarningCampaignController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the earning campaign.",
            "example": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarningCampaignPatch"
              },
              "example": {
                "details": [
                  {
                    "locale": "en",
                    "name": "Summer spend challenge — extended",
                    "description": "Make three qualifying purchases and receive a bonus.",
                    "pictureUrl": "https://cdn.example.com/campaigns/summer-spend-v2.png"
                  }
                ],
                "defaultLocale": "en"
              }
            }
          },
          "description": "Only the supplied fields are changed.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a",
                    "createdAt": "2026-08-20T09:00:00.000Z",
                    "updatedAt": "2026-08-24T11:15:00.000Z",
                    "name": "Summer spend challenge — extended",
                    "details": [
                      {
                        "locale": "en",
                        "name": "Summer spend challenge — extended",
                        "description": "Make three qualifying purchases and receive a bonus.",
                        "pictureUrl": "https://cdn.example.com/campaigns/summer-spend-v2.png"
                      }
                    ],
                    "defaultLocale": "en",
                    "effectivity": {
                      "start": "2026-08-20T09:00:00.000Z",
                      "end": null
                    },
                    "status": "DRAFT",
                    "type": "GOAL_BASED",
                    "visibilityCriteria": null,
                    "missions": [
                      {
                        "id": "02d24ac1-2221-4fa2-a6cd-4b63d778b7a0",
                        "createdAt": "2026-08-20T09:00:00.000Z",
                        "updatedAt": "2026-08-20T09:00:00.000Z",
                        "name": "Make three purchases",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Make three purchases",
                            "description": "Each PURCHASED_REWARD event advances this mission.",
                            "pictureUrl": "https://cdn.example.com/missions/three-purchases.png"
                          }
                        ],
                        "defaultLocale": "en",
                        "completionType": "COUNT",
                        "targetValue": 3,
                        "valueExpression": null,
                        "duration": "P30D",
                        "cooldownDuration": null,
                        "requiresOptIn": true,
                        "displayStyle": "PROGRESS_BAR",
                        "triggerEventType": "PURCHASED_REWARD",
                        "parentMissionId": null,
                        "order": 0,
                        "children": []
                      }
                    ],
                    "reactions": []
                  }
                }
              }
            },
            "description": "The updated earning campaign."
          },
          "400": {
            "description": "The patch failed validation or the campaign cannot be changed in its current state.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Cannot update EarningCampaign with status ENDED. Only campaigns with status DRAFT, ACTIVE, or PAUSED can be updated.",
                  "data": {}
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No earning campaign with this UUID exists for the tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "EarningCampaign with id 8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Update an earning campaign",
        "tags": [
          "Campaigns"
        ],
        "description": "Partially updates a `DRAFT`, `ACTIVE`, or `PAUSED` campaign. Use the status endpoint for lifecycle transitions and the mission endpoints to add, edit, reorder, or remove missions. Requires `update:campaigns`.\n\n`ENDED` and `ARCHIVED` campaigns are immutable. A campaign type can change only while it is `DRAFT` and before missions lock its structure. Effectivity cannot be changed after it has ended, and a start time that is already in effect cannot be moved on a non-draft campaign.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "EarningCampaignController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the earning campaign.",
            "example": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a"
          }
        ],
        "responses": {
          "204": {
            "description": "The draft campaign was deleted. No body is returned."
          },
          "400": {
            "description": "The campaign is not in `DRAFT` status.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Cannot delete EarningCampaign with status ACTIVE. Only campaigns with status DRAFT can be deleted.",
                  "data": {}
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No earning campaign with this UUID exists for the tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "EarningCampaign with id 8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Delete a draft earning campaign",
        "tags": [
          "Campaigns"
        ],
        "description": "Permanently deletes a `DRAFT` campaign together with its missions and campaign-owned event reactors. Campaigns in any other lifecycle status cannot be deleted. Requires `delete:campaigns`.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/campaigns/{id}/user-progress": {
      "get": {
        "operationId": "EarningCampaignController.userProgress",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the earning campaign.",
            "example": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a"
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive partial match on the participant's given name, family name, or email address.",
            "example": "alex"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return, from 1 to 1000.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Zero-based number of matching records to skip.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "example": 0
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort direction for the field selected by `sort`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ],
              "default": "ASC"
            },
            "example": "DESC"
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Field to sort by, such as `createdAt`, `updatedAt`, `name`, or `status`.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdAt"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Rison-encoded field comparisons. Supported comparators include `eq`, `neq`, `lt`, `gt`, `like`, `near`, and `in`.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "status:(eq:ACTIVE)"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "c5b0f115-7bd8-41b3-8cc4-eb527742f55b",
                      "userId": "c5b0f115-7bd8-41b3-8cc4-eb527742f55b",
                      "givenName": "Alex",
                      "familyName": "Morgan",
                      "gender": "UNKNOWN",
                      "beganOn": "2026-08-21T12:30:00.000Z",
                      "currentValue": 2,
                      "targetValue": 3,
                      "completedAt": null
                    },
                    {
                      "id": "cf63bc64-fe9f-449a-9243-7e1a52b6f81c",
                      "userId": "cf63bc64-fe9f-449a-9243-7e1a52b6f81c",
                      "givenName": "Alexandra",
                      "familyName": "Singh",
                      "gender": "FEMALE",
                      "beganOn": "2026-08-20T10:15:00.000Z",
                      "currentValue": 3,
                      "targetValue": 3,
                      "completedAt": "2026-08-23T16:45:00.000Z"
                    }
                  ]
                }
              }
            },
            "description": "A page of participant progress rows.",
            "headers": {
              "Content-Range": {
                "description": "The resource name, zero-based indexes in this page, and total matching participants.",
                "schema": {
                  "type": "string"
                },
                "example": "user_mission_progress 0-1/37"
              }
            }
          },
          "400": {
            "description": "Campaign-level progress was requested for a rule-based campaign.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Campaign-level progress is not available for this campaign. View participation on each mission instead.",
                  "data": {}
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No earning campaign with this UUID exists for the tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "EarningCampaign with id 8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "List user progress for an earning campaign",
        "tags": [
          "Campaigns"
        ],
        "description": "Returns the latest campaign-level progress row for each participating user in a `GOAL_BASED` campaign. Campaign-level progress is not available for `RULE_BASED` campaigns; inspect their individual missions instead.\n\n`search` performs a case-insensitive partial match against given name, family name, or email address. The `Content-Range` header reports pagination over distinct users. Requires `read:campaigns`.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/campaigns/{id}/status": {
      "patch": {
        "operationId": "EarningCampaignController.transitionStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the earning campaign.",
            "example": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarningCampaignStatusTransition"
              },
              "example": {
                "status": "ACTIVE"
              }
            }
          },
          "description": "The next lifecycle status.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a",
                    "createdAt": "2026-08-20T09:00:00.000Z",
                    "updatedAt": "2026-08-24T12:00:00.000Z",
                    "name": "Summer spend challenge",
                    "details": [
                      {
                        "locale": "en",
                        "name": "Summer spend challenge",
                        "description": "Make three qualifying purchases during the campaign.",
                        "pictureUrl": "https://cdn.example.com/campaigns/summer-spend.png"
                      }
                    ],
                    "defaultLocale": "en",
                    "effectivity": {
                      "start": "2026-08-20T09:00:00.000Z",
                      "end": null
                    },
                    "status": "ACTIVE",
                    "type": "GOAL_BASED",
                    "visibilityCriteria": null,
                    "missions": [
                      {
                        "id": "02d24ac1-2221-4fa2-a6cd-4b63d778b7a0",
                        "createdAt": "2026-08-20T09:00:00.000Z",
                        "updatedAt": "2026-08-20T09:00:00.000Z",
                        "name": "Make three purchases",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Make three purchases",
                            "description": "Each PURCHASED_REWARD event advances this mission.",
                            "pictureUrl": "https://cdn.example.com/missions/three-purchases.png"
                          }
                        ],
                        "defaultLocale": "en",
                        "completionType": "COUNT",
                        "targetValue": 3,
                        "valueExpression": null,
                        "duration": "P30D",
                        "cooldownDuration": null,
                        "requiresOptIn": true,
                        "displayStyle": "PROGRESS_BAR",
                        "triggerEventType": "PURCHASED_REWARD",
                        "parentMissionId": null,
                        "order": 0,
                        "children": []
                      }
                    ],
                    "reactions": []
                  }
                }
              }
            },
            "description": "The campaign after the status transition."
          },
          "400": {
            "description": "The requested lifecycle transition is not allowed.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid EarningCampaign status transition: DRAFT -> PAUSED",
                  "data": {}
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No earning campaign with this UUID exists for the tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "EarningCampaign with id 8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Transition an earning campaign status",
        "tags": [
          "Campaigns"
        ],
        "description": "Moves a campaign through its lifecycle and enables or disables its mission reactors accordingly. Resuming a paused campaign shifts in-flight user windows by the pause duration. Requires `update:campaigns`.\n\nAllowed transitions:\n\n- `DRAFT` → `ACTIVE`\n- `ACTIVE` → `PAUSED` or `ENDED`\n- `PAUSED` → `ACTIVE` or `ENDED`\n- `ENDED` → `ARCHIVED`\n- `ARCHIVED` is terminal",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/leaderboards/status_counts": {
      "get": {
        "operationId": "LeaderboardController.statusCounts",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Status counts",
        "tags": [
          "Leaderboard"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/leaderboards/": {
      "get": {
        "operationId": "LeaderboardController.list",
        "parameters": [
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Locale for localized content."
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Maximum number of results to return."
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams",
              "type": "number"
            },
            "description": "Number of results to skip for pagination."
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Field to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order (ASC or DESC).",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Filter expression for narrowing results.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
                    "internalName": "monthly_spenders",
                    "name": "Top Spenders",
                    "status": "ACTIVE",
                    "rankingMetric": "POINTS",
                    "timeWindowType": "RECURRING",
                    "boardSize": 50,
                    "priority": 1,
                    "defaultLocale": "en",
                    "recurrenceSchedule": "MONTHLY",
                    "startDate": null,
                    "endDate": null,
                    "currentPeriodStart": "2025-01-01T00:00:00.000Z",
                    "currentPeriodEnd": "2025-01-31T23:59:59.000Z",
                    "audienceIds": null,
                    "details": [
                      {
                        "id": "det-001",
                        "locale": "en",
                        "name": "Top Spenders",
                        "description": "Monthly leaderboard for top spenders.",
                        "artworkUrl": "https://cdn.example.com/leaderboards/spenders.png"
                      }
                    ],
                    "createdAt": "2024-06-01T00:00:00.000Z",
                    "updatedAt": "2025-01-01T00:00:00.000Z"
                  },
                  {
                    "id": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
                    "internalName": "lifetime_champions",
                    "name": "All-Time Champions",
                    "status": "ACTIVE",
                    "rankingMetric": "POINTS",
                    "timeWindowType": "LIFETIME",
                    "boardSize": 100,
                    "priority": 2,
                    "defaultLocale": "en",
                    "recurrenceSchedule": null,
                    "startDate": null,
                    "endDate": null,
                    "currentPeriodStart": null,
                    "currentPeriodEnd": null,
                    "audienceIds": [
                      "aud-123",
                      "aud-456"
                    ],
                    "details": [
                      {
                        "id": "det-002",
                        "locale": "en",
                        "name": "All-Time Champions",
                        "description": "Lifetime points leaderboard.",
                        "artworkUrl": "https://cdn.example.com/leaderboards/lifetime.png"
                      }
                    ],
                    "createdAt": "2024-03-15T00:00:00.000Z",
                    "updatedAt": "2024-12-01T00:00:00.000Z"
                  }
                ]
              }
            },
            "description": "A paginated list of leaderboards"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "List leaderboards",
        "tags": [
          "Leaderboard"
        ],
        "description": "Returns a paginated list of leaderboards. Admin auth with read:leaderboards scope sees all statuses; user auth sees only ACTIVE leaderboards.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "LeaderboardController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeaderboardDefinition",
                "type": "object"
              },
              "example": {
                "internalName": "q1_challenge",
                "timeWindowType": "FIXED",
                "defaultLocale": "en",
                "details": [
                  {
                    "locale": "en",
                    "name": "Q1 Challenge",
                    "description": "First quarter points challenge.",
                    "artworkUrl": "https://cdn.example.com/leaderboards/q1.png"
                  }
                ],
                "rankingMetric": "POINTS",
                "recurrenceSchedule": null,
                "startDate": "2025-01-01T00:00:00.000Z",
                "endDate": "2025-03-31T23:59:59.000Z",
                "audienceIds": null,
                "boardSize": 25,
                "priority": 3
              }
            }
          },
          "description": "LeaderboardDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          },
          "201": {
            "description": "Leaderboard created",
            "content": {
              "application/json": {
                "example": {
                  "id": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
                  "internalName": "q1_challenge",
                  "name": "Q1 Challenge",
                  "status": "ACTIVE",
                  "rankingMetric": "POINTS",
                  "timeWindowType": "FIXED",
                  "boardSize": 25,
                  "priority": 3,
                  "defaultLocale": "en",
                  "recurrenceSchedule": null,
                  "startDate": "2025-01-01T00:00:00.000Z",
                  "endDate": "2025-03-31T23:59:59.000Z",
                  "currentPeriodStart": "2025-01-01T00:00:00.000Z",
                  "currentPeriodEnd": "2025-03-31T23:59:59.000Z",
                  "audienceIds": null,
                  "details": [
                    {
                      "id": "det-003",
                      "locale": "en",
                      "name": "Q1 Challenge",
                      "description": "First quarter points challenge.",
                      "artworkUrl": "https://cdn.example.com/leaderboards/q1.png"
                    }
                  ],
                  "createdAt": "2025-01-01T00:00:00.000Z",
                  "updatedAt": "2025-01-01T00:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Invalid leaderboard definition",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid leaderboard definition"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "Create a leaderboard",
        "tags": [
          "Leaderboard"
        ],
        "description": "Creates a new leaderboard. Requires admin auth with create:leaderboards scope.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/leaderboards/{id}": {
      "get": {
        "operationId": "LeaderboardController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the leaderboard.",
            "example": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a"
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
                  "internalName": "monthly_spenders",
                  "name": "Top Spenders",
                  "status": "ACTIVE",
                  "rankingMetric": "POINTS",
                  "timeWindowType": "RECURRING",
                  "boardSize": 50,
                  "priority": 1,
                  "defaultLocale": "en",
                  "recurrenceSchedule": "MONTHLY",
                  "startDate": null,
                  "endDate": null,
                  "currentPeriodStart": "2025-01-01T00:00:00.000Z",
                  "currentPeriodEnd": "2025-01-31T23:59:59.000Z",
                  "audienceIds": null,
                  "details": [
                    {
                      "id": "det-001",
                      "locale": "en",
                      "name": "Top Spenders",
                      "description": "Monthly leaderboard for top spenders.",
                      "artworkUrl": "https://cdn.example.com/leaderboards/spenders.png"
                    }
                  ],
                  "createdAt": "2024-06-01T00:00:00.000Z",
                  "updatedAt": "2025-01-01T00:00:00.000Z"
                }
              }
            },
            "description": "Leaderboard details"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Leaderboard not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Leaderboard not found"
                }
              }
            }
          }
        },
        "summary": "Get leaderboard",
        "tags": [
          "Leaderboard"
        ],
        "description": "Retrieves a single leaderboard by UUID. Admin auth with read:leaderboards; non-admin users can only access ACTIVE leaderboards.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "LeaderboardController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the leaderboard to update.",
            "example": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeaderboardPatch",
                "type": "object"
              },
              "example": {
                "internalName": "monthly_spenders_v2",
                "boardSize": 75,
                "priority": 1,
                "details": [
                  {
                    "locale": "en",
                    "name": "Top Spenders v2",
                    "description": "Updated monthly leaderboard.",
                    "artworkUrl": "https://cdn.example.com/leaderboards/spenders-v2.png"
                  }
                ]
              }
            }
          },
          "description": "LeaderboardPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
                  "internalName": "monthly_spenders_v2",
                  "name": "Top Spenders v2",
                  "status": "ACTIVE",
                  "rankingMetric": "POINTS",
                  "timeWindowType": "RECURRING",
                  "boardSize": 75,
                  "priority": 1,
                  "defaultLocale": "en",
                  "recurrenceSchedule": "MONTHLY",
                  "startDate": null,
                  "endDate": null,
                  "currentPeriodStart": "2025-01-01T00:00:00.000Z",
                  "currentPeriodEnd": "2025-01-31T23:59:59.000Z",
                  "audienceIds": null,
                  "details": [
                    {
                      "id": "det-001",
                      "locale": "en",
                      "name": "Top Spenders v2",
                      "description": "Updated monthly leaderboard.",
                      "artworkUrl": "https://cdn.example.com/leaderboards/spenders-v2.png"
                    }
                  ],
                  "createdAt": "2024-06-01T00:00:00.000Z",
                  "updatedAt": "2025-02-15T09:30:00.000Z"
                }
              }
            },
            "description": "Leaderboard updated"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Leaderboard not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Leaderboard not found"
                }
              }
            }
          }
        },
        "summary": "Update a leaderboard",
        "tags": [
          "Leaderboard"
        ],
        "description": "Updates an existing leaderboard. Requires admin auth with update:leaderboards scope.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/leaderboards/{id}/status": {
      "patch": {
        "operationId": "LeaderboardController.transitionStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeaderboardStatusTransition"
              }
            }
          },
          "description": "LeaderboardStatusTransition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Transition status",
        "tags": [
          "Leaderboard"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/leaderboards/{id}/rankings": {
      "get": {
        "operationId": "LeaderboardController.rankings",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the leaderboard.",
            "example": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "entries": [
                    {
                      "rank": 1,
                      "displayName": "Jane S.",
                      "points": 2450
                    },
                    {
                      "rank": 2,
                      "displayName": "Mike T.",
                      "points": 2100
                    },
                    {
                      "rank": 3,
                      "displayName": "Sarah K.",
                      "points": 1890
                    }
                  ],
                  "currentUserEntry": {
                    "rank": 12,
                    "displayName": "You",
                    "points": 640
                  },
                  "metadata": {
                    "lastUpdatedAt": "2025-01-20T03:00:00.000Z",
                    "periodStart": "2025-01-01T00:00:00.000Z",
                    "periodEnd": "2025-01-31T23:59:59.000Z",
                    "totalParticipants": 347
                  }
                }
              }
            },
            "description": "Leaderboard rankings"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — user opted out or leaderboard not active",
            "content": {
              "application/json": {
                "example": {
                  "message": "User has opted out of leaderboards"
                }
              }
            }
          },
          "404": {
            "description": "Leaderboard not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Leaderboard not found"
                }
              }
            }
          }
        },
        "summary": "Get leaderboard rankings",
        "tags": [
          "Leaderboard"
        ],
        "description": "Returns the ranked entries for a leaderboard. User auth required; non-admin users can only access ACTIVE leaderboards. Users who have opted out of leaderboards will receive a 403.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/leaderboards/{id}/periods": {
      "get": {
        "operationId": "LeaderboardController.listPeriods",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List periods",
        "tags": [
          "Leaderboard"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/leaderboards/{leaderboard_id}/entries": {
      "get": {
        "operationId": "LeaderboardEntryController.listCurrentEntries",
        "parameters": [
          {
            "in": "path",
            "name": "leaderboard_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List current entries",
        "tags": [
          "Leaderboard Entry"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/leaderboards/{leaderboard_id}/periods/{periodStart}/entries": {
      "get": {
        "operationId": "LeaderboardEntryController.listPeriodEntries",
        "parameters": [
          {
            "in": "path",
            "name": "leaderboard_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "periodStart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List period entries",
        "tags": [
          "Leaderboard Entry"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/campaigns/{campaignId}/missions": {
      "get": {
        "operationId": "MissionController.list",
        "parameters": [
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the earning campaign that owns the missions.",
            "example": "5d89f4ca-7f2d-4a39-bef7-51f087fe6b31"
          },
          {
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Member UUID used to calculate mission gating and completion lock states.",
            "example": "0cf1157d-e25b-49f0-b3d0-1bb0efb36ac7"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "728d1607-11b1-4875-85e6-4205b52a82d7",
                      "createdAt": "2026-08-01T09:30:00.000Z",
                      "updatedAt": "2026-08-01T09:30:00.000Z",
                      "name": "Make three purchases",
                      "details": [
                        {
                          "locale": "en",
                          "name": "Make three purchases",
                          "description": "Complete three purchases during the summer challenge.",
                          "pictureUrl": "https://cdn.example.com/campaigns/three-purchases.png"
                        }
                      ],
                      "defaultLocale": "en",
                      "completionType": "COUNT",
                      "targetValue": 3,
                      "valueExpression": null,
                      "duration": "P30D",
                      "cooldownDuration": null,
                      "requiresOptIn": true,
                      "displayStyle": "STAMP_CARD",
                      "parentMissionId": "e8947348-b51e-4ace-99c5-a2f6447263c9",
                      "order": 0,
                      "triggerEventType": "PURCHASE_COMPLETED",
                      "lockState": "available"
                    }
                  ]
                }
              }
            },
            "description": "The ordered top-level missions for the campaign."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The campaign does not exist for this tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "EarningCampaign with id 5d89f4ca-7f2d-4a39-bef7-51f087fe6b31 not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "List campaign missions",
        "tags": [
          "Campaigns"
        ],
        "description": "Returns a goal-based campaign's top-level missions in ascending `order`.\n\nThe internal structural root is omitted. Pass `userId` to enrich the returned missions with a `lockState` of `available`, `locked`, or `complete` for that member. Rule-based campaigns do not use the structural hierarchy and this endpoint returns an empty list for them; retrieve the campaign to obtain its flat mission list. Requires the `read:campaigns` permission.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "MissionController.create",
        "parameters": [
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the earning campaign that owns the missions.",
            "example": "5d89f4ca-7f2d-4a39-bef7-51f087fe6b31"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MissionDefinition"
              },
              "example": {
                "details": [
                  {
                    "locale": "en",
                    "name": "Make three purchases",
                    "description": "Complete three purchases during the summer challenge.",
                    "pictureUrl": "https://cdn.example.com/campaigns/three-purchases.png"
                  }
                ],
                "defaultLocale": "en",
                "completionType": "COUNT",
                "targetValue": 3,
                "duration": "P30D",
                "requiresOptIn": true,
                "displayStyle": "STAMP_CARD",
                "order": 0,
                "reactor": {
                  "eventType": {
                    "id": "f1ca5577-bc13-4e6c-a94a-322f5810fbea"
                  },
                  "constraint": {
                    "type": "object",
                    "$schema": "http://json-schema.org/draft-06/schema#",
                    "properties": {
                      "total": {
                        "type": "number",
                        "minimum": 10
                      }
                    },
                    "required": [
                      "total"
                    ]
                  },
                  "reactions": [],
                  "activationContext": "SUBJECT"
                }
              }
            }
          },
          "description": "The mission definition and the event reactor that advances or fulfils it.",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "728d1607-11b1-4875-85e6-4205b52a82d7",
                    "createdAt": "2026-08-01T09:30:00.000Z",
                    "updatedAt": "2026-08-01T09:30:00.000Z",
                    "name": "Make three purchases",
                    "details": [
                      {
                        "locale": "en",
                        "name": "Make three purchases",
                        "description": "Complete three purchases during the summer challenge.",
                        "pictureUrl": "https://cdn.example.com/campaigns/three-purchases.png"
                      }
                    ],
                    "defaultLocale": "en",
                    "completionType": "COUNT",
                    "targetValue": 3,
                    "valueExpression": null,
                    "duration": "P30D",
                    "cooldownDuration": null,
                    "requiresOptIn": true,
                    "displayStyle": "STAMP_CARD",
                    "parentMissionId": "e8947348-b51e-4ace-99c5-a2f6447263c9",
                    "order": 0
                  }
                }
              }
            },
            "description": "The mission was created."
          },
          "400": {
            "description": "The mission definition, hierarchy, locale, event type, or reactor configuration is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "targetValue must be a positive number for goal-based missions",
                  "data": {}
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The campaign or parent mission was not found.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "EarningCampaign with id 5d89f4ca-7f2d-4a39-bef7-51f087fe6b31 not found",
                  "data": {}
                }
              }
            }
          },
          "409": {
            "description": "The parent campaign is not in DRAFT status, or another request is currently changing the same mission hierarchy.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission writes are only allowed when the parent campaign is DRAFT. Current status: ACTIVE",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Create a campaign mission",
        "tags": [
          "Campaigns"
        ],
        "description": "Creates a mission in a draft campaign. Requires the `create:campaigns` permission.\n\nTrackable goal-based missions require `completionType`, a positive `targetValue`, `displayStyle`, and a reactor event type identified by UUID or name. A structural parent mission may omit the event type and has its completion fields managed automatically when children are added. Omitting `parentMissionId` adds the mission at the campaign's top level; providing it creates a nested mission (to a maximum depth of 10). Rule-based missions must omit goal-only progress fields.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/missions/{id}": {
      "get": {
        "operationId": "MissionController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the mission.",
            "example": "728d1607-11b1-4875-85e6-4205b52a82d7"
          },
          {
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Member UUID used to calculate mission gating and completion lock states.",
            "example": "0cf1157d-e25b-49f0-b3d0-1bb0efb36ac7"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "728d1607-11b1-4875-85e6-4205b52a82d7",
                    "createdAt": "2026-08-01T09:30:00.000Z",
                    "updatedAt": "2026-08-01T09:30:00.000Z",
                    "name": "Make three purchases",
                    "details": [
                      {
                        "locale": "en",
                        "name": "Make three purchases",
                        "description": "Complete three purchases during the summer challenge.",
                        "pictureUrl": "https://cdn.example.com/campaigns/three-purchases.png"
                      }
                    ],
                    "defaultLocale": "en",
                    "completionType": "COUNT",
                    "targetValue": 3,
                    "valueExpression": null,
                    "duration": "P30D",
                    "cooldownDuration": null,
                    "requiresOptIn": true,
                    "displayStyle": "STAMP_CARD",
                    "parentMissionId": null,
                    "order": 0,
                    "triggerEventType": "PURCHASE_COMPLETED",
                    "children": [],
                    "reactor": {
                      "eventType": {
                        "id": "f1ca5577-bc13-4e6c-a94a-322f5810fbea",
                        "name": "PURCHASE_COMPLETED",
                        "description": "A member completed a purchase.",
                        "schema": {
                          "type": "object",
                          "properties": {
                            "total": {
                              "type": "number"
                            }
                          }
                        },
                        "isPrivate": false,
                        "isActive": true,
                        "isIntrinsic": false
                      },
                      "constraint": {
                        "type": "object",
                        "properties": {
                          "total": {
                            "type": "number",
                            "minimum": 10
                          }
                        },
                        "required": [
                          "total"
                        ]
                      },
                      "reactions": [],
                      "maxActivations": null,
                      "activationContext": "SUBJECT",
                      "activationCalculationType": "LIFETIME",
                      "activationPeriod": null
                    },
                    "level": 1,
                    "lockState": "available"
                  }
                }
              }
            },
            "description": "The mission and its current non-ended configuration."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The mission does not exist for this tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission with id 728d1607-11b1-4875-85e6-4205b52a82d7 not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Retrieve a mission",
        "tags": [
          "Campaigns"
        ],
        "description": "Returns one mission, its direct children, and its current non-ended reactor configuration. The reactor can still be disabled or scheduled to start in the future. Children are sorted by `order`.\n\nFor goal-based campaigns the response includes the mission's hierarchy `level`. When the requested mission is top-level, pass `userId` to include its member-specific lock state. Nested missions and the returned direct children are not lock-state enriched by this endpoint. Requires the `read:campaigns` permission.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "MissionController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the mission.",
            "example": "728d1607-11b1-4875-85e6-4205b52a82d7"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MissionPatch"
              },
              "example": {
                "details": [
                  {
                    "locale": "en",
                    "name": "Make five purchases",
                    "description": "Complete five purchases during the challenge.",
                    "pictureUrl": "https://cdn.example.com/campaigns/five-purchases.png"
                  }
                ],
                "targetValue": 5,
                "displayStyle": "STAMP_CARD",
                "requiresOptIn": true,
                "order": 0
              }
            }
          },
          "description": "Only fields present in the patch are changed.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "728d1607-11b1-4875-85e6-4205b52a82d7",
                    "createdAt": "2026-08-01T09:30:00.000Z",
                    "updatedAt": "2026-08-04T11:15:00.000Z",
                    "name": "Make five purchases",
                    "details": [
                      {
                        "locale": "en",
                        "name": "Make five purchases",
                        "description": "Complete five purchases during the challenge.",
                        "pictureUrl": "https://cdn.example.com/campaigns/five-purchases.png"
                      }
                    ],
                    "defaultLocale": "en",
                    "completionType": "COUNT",
                    "targetValue": 5,
                    "valueExpression": null,
                    "duration": "P30D",
                    "cooldownDuration": null,
                    "requiresOptIn": true,
                    "displayStyle": "STAMP_CARD",
                    "parentMissionId": "e8947348-b51e-4ace-99c5-a2f6447263c9",
                    "order": 0
                  }
                }
              }
            },
            "description": "The updated mission."
          },
          "400": {
            "description": "The merged mission, locale, progress fields, or reactor configuration is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "completionType, targetValue, and displayStyle are auto-managed for parent missions",
                  "data": {}
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The mission does not exist for this tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission with id 728d1607-11b1-4875-85e6-4205b52a82d7 not found",
                  "data": {}
                }
              }
            }
          },
          "409": {
            "description": "The completion type cannot change because members already have progress on the mission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "completionType cannot be changed once users have progress on this mission",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Update a mission",
        "tags": [
          "Campaigns"
        ],
        "description": "Updates the supplied mission fields. Requires the `update:campaigns` permission.\n\nLocale rules are revalidated after merging the patch. A parent mission's completion fields are managed from its children and cannot be edited directly. The trigger event type cannot be changed after creation, and a completion type cannot change once member progress exists.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "MissionController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the mission.",
            "example": "728d1607-11b1-4875-85e6-4205b52a82d7"
          }
        ],
        "responses": {
          "204": {
            "description": "The mission was deleted."
          },
          "400": {
            "description": "Deleting the mission would leave its parent without a child.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Parent mission must have at least one child",
                  "data": {}
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The mission does not exist for this tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission with id 728d1607-11b1-4875-85e6-4205b52a82d7 not found",
                  "data": {}
                }
              }
            }
          },
          "409": {
            "description": "The parent campaign is not in DRAFT status.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission writes are only allowed when the parent campaign is DRAFT. Current status: ACTIVE",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Delete a mission",
        "tags": [
          "Campaigns"
        ],
        "description": "Deletes a mission and all of its descendants and reactors. The parent campaign must be in DRAFT status.\n\nA child cannot be deleted if it would leave its parent without any children. Requires the `delete:campaigns` permission.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/missions/{id}/user-progress": {
      "get": {
        "operationId": "MissionController.userProgress",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the mission.",
            "example": "728d1607-11b1-4875-85e6-4205b52a82d7"
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive member name or email search.",
            "example": "sam.taylor@example.com"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of rows to return (1–1000; default 10).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 10
            },
            "example": 25
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "description": "Number of rows to skip (default 0).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "example": 0
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort direction.",
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ],
              "default": "ASC"
            },
            "example": "ASC"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Progress field to sort by.",
            "schema": {
              "type": "string"
            },
            "example": "updatedAt"
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Rison-encoded field comparisons applied to the progress rows.",
            "schema": {
              "type": "string"
            },
            "example": "completedAt:(eq:!n)"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "0cf1157d-e25b-49f0-b3d0-1bb0efb36ac7",
                      "userId": "0cf1157d-e25b-49f0-b3d0-1bb0efb36ac7",
                      "givenName": "Sam",
                      "familyName": "Taylor",
                      "gender": "OTHER",
                      "beganOn": "2026-08-03T14:20:00.000Z",
                      "currentValue": 2,
                      "targetValue": 3,
                      "completedAt": null
                    }
                  ]
                }
              }
            },
            "description": "A page of member progress rows.",
            "headers": {
              "Content-Range": {
                "description": "Pagination range in the form `resource first-last/total`, for example `user_mission_progress 0-0/1`.",
                "schema": {
                  "type": "string"
                },
                "example": "user_mission_progress 0-0/1"
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The mission does not exist for this tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission with id 728d1607-11b1-4875-85e6-4205b52a82d7 not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "List member progress for a mission",
        "tags": [
          "Campaigns"
        ],
        "description": "Returns paginated progress rows for members who have begun or opted in to the mission. Use `search` to match a member's first name, last name, or email address.\n\nPagination metadata is returned in the `Content-Range` response header. Requires the `read:campaigns` permission.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/campaigns/{campaignId}/missions/order": {
      "patch": {
        "operationId": "MissionController.reorder",
        "parameters": [
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the earning campaign that owns the missions.",
            "example": "5d89f4ca-7f2d-4a39-bef7-51f087fe6b31"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MissionReorder"
              },
              "example": {
                "missions": [
                  {
                    "missionId": "728d1607-11b1-4875-85e6-4205b52a82d7",
                    "order": 0
                  },
                  {
                    "missionId": "960b68d3-84b8-4ac6-b60d-9ae95718fc06",
                    "order": 1
                  }
                ]
              }
            }
          },
          "description": "Mission UUIDs and their new zero-based order values.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "728d1607-11b1-4875-85e6-4205b52a82d7",
                      "createdAt": "2026-08-01T09:30:00.000Z",
                      "updatedAt": "2026-08-01T09:30:00.000Z",
                      "name": "Make three purchases",
                      "details": [
                        {
                          "locale": "en",
                          "name": "Make three purchases",
                          "description": "Complete three purchases during the summer challenge.",
                          "pictureUrl": "https://cdn.example.com/campaigns/three-purchases.png"
                        }
                      ],
                      "defaultLocale": "en",
                      "completionType": "COUNT",
                      "targetValue": 3,
                      "valueExpression": null,
                      "duration": "P30D",
                      "cooldownDuration": null,
                      "requiresOptIn": true,
                      "displayStyle": "STAMP_CARD",
                      "parentMissionId": "e8947348-b51e-4ace-99c5-a2f6447263c9",
                      "order": 0
                    },
                    {
                      "id": "960b68d3-84b8-4ac6-b60d-9ae95718fc06",
                      "createdAt": "2026-08-01T09:30:00.000Z",
                      "updatedAt": "2026-08-01T09:30:00.000Z",
                      "name": "Refer a friend",
                      "details": [
                        {
                          "locale": "en",
                          "name": "Refer a friend",
                          "description": "Invite a friend who creates an account."
                        }
                      ],
                      "defaultLocale": "en",
                      "completionType": "COUNT",
                      "targetValue": 3,
                      "valueExpression": null,
                      "duration": "P30D",
                      "cooldownDuration": null,
                      "requiresOptIn": true,
                      "displayStyle": "STAMP_CARD",
                      "parentMissionId": "e8947348-b51e-4ace-99c5-a2f6447263c9",
                      "order": 1,
                      "triggerEventType": "REGISTERED_ACCOUNT"
                    }
                  ]
                }
              }
            },
            "description": "The missions that were reordered, sorted by order."
          },
          "400": {
            "description": "The campaign is not goal-based, the list contains a duplicate, or the request is otherwise invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission ordering is only supported for goal-based campaigns",
                  "data": {}
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The caller does not have the required campaign permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Insufficient permissions",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The campaign or one of the missions was not found.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission with id 728d1607-11b1-4875-85e6-4205b52a82d7 not found",
                  "data": {}
                }
              }
            }
          },
          "409": {
            "description": "The campaign is not in DRAFT status.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission writes are only allowed when the parent campaign is DRAFT. Current status: ACTIVE",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Reorder campaign missions",
        "tags": [
          "Campaigns"
        ],
        "description": "Sets the order of the supplied missions and returns them in their new order. Send `null` to remove ordering from a mission.\n\nOrdering is available only for goal-based campaigns in DRAFT status. Every mission UUID must belong to the campaign and may appear only once. Requires the `update:campaigns` permission.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/missions/{id}/opt-in": {
      "post": {
        "operationId": "MissionController.optIn",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the mission.",
            "example": "728d1607-11b1-4875-85e6-4205b52a82d7"
          }
        ],
        "responses": {
          "204": {
            "description": "The member is opted in to the mission."
          },
          "400": {
            "description": "The mission is rule-based, does not require opt-in, or its campaign is not currently live.",
            "content": {
              "application/json": {
                "examples": {
                  "notRequired": {
                    "summary": "Opt-in is not enabled",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "this mission does not require opt-in",
                      "data": {}
                    }
                  },
                  "campaignNotLive": {
                    "summary": "Campaign is not currently live",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "This campaign is not currently running.",
                      "data": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authentication is required",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The mission does not exist for this tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Mission with id 728d1607-11b1-4875-85e6-4205b52a82d7 not found",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Opt in to a mission",
        "tags": [
          "Campaigns"
        ],
        "description": "Opts the authenticated member in to a goal-based mission that has `requiresOptIn` enabled.\n\nThe parent campaign must be ACTIVE and within its effectivity window. Repeating the request is idempotent for the current progress cycle. This member-facing operation requires a valid current-user access token.",
        "security": [
          {
            "apiKeyAuth": [],
            "userBearerAuth": []
          }
        ]
      }
    },
    "/google-wallet/pass-class": {
      "post": {
        "operationId": "GoogleWalletController.createLoyaltyPassClass",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "id": "loyalty_class_123",
                "issuerName": "White Label Loyalty"
              }
            }
          },
          "description": "",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - pass class",
                    "value": {
                      "id": "loyalty_class_123",
                      "issuerName": "White Label Loyalty",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - pass class",
                    "value": {
                      "id": "loyalty_class_123",
                      "issuerName": "White Label Loyalty"
                    }
                  }
                }
              }
            },
            "description": "Pass class created or returned"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          }
        },
        "summary": "Create a Google Wallet pass class",
        "tags": [
          "Google Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/google-wallet/pass-class/{id}": {
      "patch": {
        "operationId": "GoogleWalletController.updateLoyaltyPassClass",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "loyalty_class_123"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "issuerName": "White Label Loyalty"
              }
            }
          },
          "description": "",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - updated pass class",
                    "value": {
                      "id": "loyalty_class_123",
                      "issuerName": "White Label Loyalty",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - updated pass class",
                    "value": {
                      "id": "loyalty_class_123",
                      "issuerName": "White Label Loyalty"
                    }
                  }
                }
              }
            },
            "description": "Pass class updated"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          }
        },
        "summary": "Update a Google Wallet pass class",
        "tags": [
          "Google Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "get": {
        "operationId": "GoogleWalletController.getPassClass",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "loyalty_class_123"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "loyalty_class_123",
                  "issuerName": "White Label Loyalty"
                }
              }
            },
            "description": "Pass class details"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          }
        },
        "summary": "Get a Google Wallet pass class",
        "tags": [
          "Google Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/google-wallet/pass": {
      "post": {
        "operationId": "GoogleWalletController.generatePass",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleWalletPassBody",
                "type": "object"
              },
              "example": {
                "organizationName": "White Label Loyalty",
                "backgroundColor": "#41228E",
                "icon": "https://example.com/icon.png",
                "memberIdHeader": "MEMBER ID",
                "memberIdPath": "accountNumber",
                "showMemberIdAsLabel": true
              }
            }
          },
          "description": "GoogleWalletPassBody",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "jwt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
                  "url": "https://pay.google.com/gp/v/save/eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
                }
              }
            },
            "description": "Google Wallet pass generated"
          },
          "400": {
            "description": "Bad request or invalid payload",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid pass payload"
                }
              }
            }
          }
        },
        "summary": "Generate a Google Wallet pass for a user",
        "tags": [
          "Google Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/google-wallet/pass/{id}": {
      "get": {
        "operationId": "GoogleWalletController.getPass",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "user-uuid-123"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "user-uuid-123",
                  "state": "ACTIVE"
                }
              }
            },
            "description": "Pass details"
          },
          "404": {
            "description": "Pass not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Pass not found"
                }
              }
            }
          }
        },
        "summary": "Get a Google Wallet pass for a user",
        "tags": [
          "Google Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/klaviyo/credentials": {
      "get": {
        "operationId": "KlaviyoController.getIntegrationCredentials",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get integration credentials",
        "tags": [
          "Klaviyo"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/klaviyo/audience_lists": {
      "get": {
        "operationId": "KlaviyoController.getAudienceList",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get audience list",
        "tags": [
          "Klaviyo"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/payouts/register": {
      "post": {
        "operationId": "PayoutController.register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Register",
        "tags": [
          "Payout"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/payouts/initiate-payment": {
      "post": {
        "operationId": "PayoutController.initiatePayment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Initiate payment",
        "tags": [
          "Payout"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/payouts/pay": {
      "post": {
        "operationId": "PayoutController.pay",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Pay",
        "tags": [
          "Payout"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/payouts/webhook/{integrationType}/{integrationId}": {
      "post": {
        "operationId": "PayoutController.processWebhook",
        "parameters": [
          {
            "in": "path",
            "name": "integrationType",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Process webhook",
        "tags": [
          "Payout"
        ]
      }
    },
    "/payouts/registration_info": {
      "get": {
        "operationId": "PayoutController.getRegistrationInfo",
        "parameters": [
          {
            "in": "query",
            "name": "",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get registration info",
        "tags": [
          "Payout"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/payouts/deregister": {
      "delete": {
        "operationId": "PayoutController.deregister",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Deregister",
        "tags": [
          "Payout"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/points_liability_criteria/": {
      "get": {
        "operationId": "PointsLiabilityCriteriaController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all criteria",
                    "value": [
                      {
                        "id": "criteria-123",
                        "name": "Expire after 1 year",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - visible criteria",
                    "value": [
                      {
                        "id": "criteria-123",
                        "name": "Expire after 1 year",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of points liability criteria"
          }
        },
        "summary": "List points liability criteria",
        "tags": [
          "Points Liability Criteria"
        ],
        "description": "Returns a paginated list of points liability criteria for the tenant.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "PointsLiabilityCriteriaController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PointsLiabilityCriteriaDefinition"
              }
            }
          },
          "description": "PointsLiabilityCriteriaDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Points Liability Criteria"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/points_liability_criteria/type/{type}": {
      "get": {
        "operationId": "PointsLiabilityCriteriaController.listByLiabilityType",
        "parameters": [
          {
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List by liability type",
        "tags": [
          "Points Liability Criteria"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/points_liability_criteria/{id}": {
      "get": {
        "operationId": "PointsLiabilityCriteriaController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the points liability criteria to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - criteria details",
                    "value": {
                      "id": "criteria-123",
                      "name": "Expire after 1 year",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - criteria details",
                    "value": {
                      "id": "criteria-123",
                      "name": "Expire after 1 year",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Points liability criteria details"
          }
        },
        "summary": "Get points liability criteria",
        "tags": [
          "Points Liability Criteria"
        ],
        "description": "Retrieves a single points liability criteria by its unique ID.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "PointsLiabilityCriteriaController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PointsLiabilityCriteriaPatch"
              }
            }
          },
          "description": "PointsLiabilityCriteriaPatch",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Points Liability Criteria"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "PointsLiabilityCriteriaController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Points Liability Criteria"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/points_liability_criteria/trigger_daily_cron": {
      "post": {
        "operationId": "PointsLiabilityCriteriaController.triggerDailyCron",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Trigger daily cron",
        "tags": [
          "Points Liability Criteria"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/points_liability_criteria/trigger_one": {
      "post": {
        "operationId": "PointsLiabilityCriteriaController.triggerOne",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Trigger one",
        "tags": [
          "Points Liability Criteria"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/rewards/": {
      "get": {
        "operationId": "RewardController.list",
        "parameters": [
          {
            "in": "query",
            "name": "completelySkipInvisible",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "If true, skips rewards that are invisible to the user."
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Locale to use for reward details."
          },
          {
            "in": "query",
            "name": "distance",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all rewards",
                    "value": [
                      {
                        "id": "reward-123",
                        "name": "10% Off Voucher",
                        "price": 100,
                        "value": 10,
                        "priority": 1,
                        "availability": {
                          "start": "2025-01-01T00:00:00.000Z",
                          "end": "2025-12-31T23:59:59.000Z"
                        },
                        "purchasable": true,
                        "category": {
                          "id": "cat-1",
                          "name": "Vouchers"
                        },
                        "categories": [
                          {
                            "id": "cat-1",
                            "name": "Vouchers"
                          },
                          {
                            "id": "cat-2",
                            "name": "Discounts"
                          }
                        ],
                        "tier": {
                          "id": "tier-1",
                          "name": "Gold"
                        },
                        "redemptionChannels": [
                          "IN_STORE",
                          "ONLINE"
                        ],
                        "isLocked": false,
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "10% Off Voucher",
                            "description": "Get 10% off your next purchase.",
                            "pictureUrl": "https://example.com/voucher.png",
                            "terms": "Valid for one use only.",
                            "summary": "10% off",
                            "logoUrl": "https://example.com/logo.png",
                            "redemptionMessage": "Show this code at checkout.",
                            "displayUrl": "https://example.com/redeem"
                          }
                        ]
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - visible rewards",
                    "value": [
                      {
                        "id": "reward-123",
                        "name": "10% Off Voucher",
                        "price": 100,
                        "value": 10,
                        "priority": 1,
                        "availability": {
                          "start": "2025-01-01T00:00:00.000Z",
                          "end": "2025-12-31T23:59:59.000Z"
                        },
                        "purchasable": true,
                        "category": {
                          "id": "cat-1",
                          "name": "Vouchers"
                        },
                        "categories": [
                          {
                            "id": "cat-1",
                            "name": "Vouchers"
                          },
                          {
                            "id": "cat-2",
                            "name": "Discounts"
                          }
                        ],
                        "tier": {
                          "id": "tier-1",
                          "name": "Gold"
                        },
                        "redemptionChannels": [
                          "IN_STORE",
                          "ONLINE"
                        ],
                        "isLocked": false,
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "10% Off Voucher",
                            "description": "Get 10% off your next purchase.",
                            "pictureUrl": "https://example.com/voucher.png",
                            "terms": "Valid for one use only.",
                            "summary": "10% off",
                            "logoUrl": "https://example.com/logo.png",
                            "redemptionMessage": "Show this code at checkout.",
                            "displayUrl": "https://example.com/redeem"
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of rewards"
          }
        },
        "summary": "List rewards",
        "tags": [
          "Reward"
        ],
        "description": "Returns a paginated list of rewards available to the tenant. Supports filtering, pagination, and visibility options.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "RewardController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RewardDefinition"
              }
            }
          },
          "description": "RewardDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Reward"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/rewards/{id}": {
      "get": {
        "operationId": "RewardController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the reward to retrieve."
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Locale to use for reward details."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "reward": {
                    "summary": "Reward",
                    "value": {
                      "id": "reward-123",
                      "name": "10% Off Voucher",
                      "price": 100,
                      "value": 10,
                      "priority": 1,
                      "availability": {
                        "start": "2025-01-01T00:00:00.000Z",
                        "end": "2025-12-31T23:59:59.000Z"
                      },
                      "purchasable": true,
                      "category": {
                        "id": "cat-1",
                        "name": "Vouchers"
                      },
                      "categories": [
                        {
                          "id": "cat-1",
                          "name": "Vouchers"
                        },
                        {
                          "id": "cat-2",
                          "name": "Discounts"
                        }
                      ],
                      "tier": {
                        "id": "tier-1",
                        "name": "Gold"
                      },
                      "redemptionChannels": [
                        "IN_STORE",
                        "ONLINE"
                      ],
                      "isLocked": false,
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "defaultLocale": "en",
                      "details": [
                        {
                          "locale": "en",
                          "name": "10% Off Voucher",
                          "description": "Get 10% off your next purchase.",
                          "pictureUrl": "https://example.com/voucher.png",
                          "terms": "Valid for one use only.",
                          "summary": "10% off",
                          "logoUrl": "https://example.com/logo.png",
                          "redemptionMessage": "Show this code at checkout.",
                          "displayUrl": "https://example.com/redeem"
                        }
                      ]
                    }
                  }
                }
              }
            },
            "description": "Reward details"
          }
        },
        "summary": "Get reward",
        "tags": [
          "Reward"
        ],
        "description": "Retrieves a single reward by its unique ID, including all details and related entities.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "RewardController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RewardPatch"
              }
            }
          },
          "description": "RewardPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Reward"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "RewardController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Reward"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/rewards/availability-criteria-builder/config": {
      "get": {
        "operationId": "RewardController.retrieveCriteriaBuilderConfig",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve criteria builder config",
        "tags": [
          "Reward"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/reward_categories/": {
      "get": {
        "operationId": "RewardCategoryController.list",
        "parameters": [
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "RewardCategoryListParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RewardCategoryListParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Reward Category"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "RewardCategoryController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryDefinition"
              }
            }
          },
          "description": "CategoryDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Reward Category"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/reward_categories/{id}": {
      "get": {
        "operationId": "RewardCategoryController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Reward Category"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "RewardCategoryController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryPatch"
              }
            }
          },
          "description": "CategoryPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Reward Category"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "RewardCategoryController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Reward Category"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/reward_categories/{id}/rewards": {
      "get": {
        "operationId": "RewardCategoryController.retrieveRewards",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "completelySkipInvisible",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve rewards",
        "tags": [
          "Reward Category"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/": {
      "get": {
        "operationId": "RootController.root",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Root",
        "tags": [
          "Root"
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "RootController.openapi",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Openapi",
        "tags": [
          "Root"
        ]
      }
    },
    "/settings/": {
      "get": {
        "operationId": "SettingController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Setting"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "SettingController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingDefinition"
              }
            }
          },
          "description": "SettingDefinition",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Setting"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "SettingController.update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "type": "object"
                },
                "type": "array"
              }
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Setting"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/settings/{name}": {
      "get": {
        "operationId": "SettingController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Setting"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/": {
      "get": {
        "operationId": "TeamController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - all teams",
                    "value": [
                      {
                        "id": "team-1",
                        "name": "Team Alpha",
                        "members": 5,
                        "internalNotes": "Admin-only field"
                      },
                      {
                        "id": "team-2",
                        "name": "Team Beta",
                        "members": 3,
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - visible teams",
                    "value": [
                      {
                        "id": "team-1",
                        "name": "Team Alpha",
                        "members": 5
                      },
                      {
                        "id": "team-2",
                        "name": "Team Beta",
                        "members": 3
                      }
                    ]
                  }
                }
              }
            },
            "description": "List of teams"
          }
        },
        "summary": "List all teams for a tenant",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "TeamController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamDefinition",
                "type": "object"
              },
              "example": {
                "name": "Team Alpha"
              }
            }
          },
          "description": "TeamDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          },
          "201": {
            "description": "Team created",
            "content": {
              "application/json": {
                "example": {
                  "id": "team-1",
                  "name": "Team Alpha",
                  "members": 1
                }
              }
            }
          },
          "400": {
            "description": "Invalid team definition",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid team definition"
                }
              }
            }
          }
        },
        "summary": "Create a new team",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/{id}": {
      "get": {
        "operationId": "TeamController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "team-1"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - team details",
                    "value": {
                      "id": "team-1",
                      "name": "Team Alpha",
                      "members": 5,
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - team details",
                    "value": {
                      "id": "team-1",
                      "name": "Team Alpha",
                      "members": 5
                    }
                  }
                }
              }
            },
            "description": "Team details"
          },
          "404": {
            "description": "Team not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Team not found"
                }
              }
            }
          }
        },
        "summary": "Retrieve a team by ID",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "TeamController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "team-1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamPatch",
                "type": "object"
              },
              "example": {
                "name": "Team Alpha"
              }
            }
          },
          "description": "TeamPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "team-1",
                  "name": "Team Alpha",
                  "members": 1
                }
              }
            },
            "description": "Team updated"
          },
          "404": {
            "description": "Team not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Team not found"
                }
              }
            }
          }
        },
        "summary": "Update a team by ID",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "TeamController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "team-1"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "success": true
                }
              }
            },
            "description": "Team deleted"
          },
          "404": {
            "description": "Team not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Team not found"
                }
              }
            }
          }
        },
        "summary": "Delete a team by ID",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/teams/{id}/users": {
      "post": {
        "operationId": "TeamController.inviteMember",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "team-1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamInvitation",
                "type": "object"
              },
              "example": {
                "email": "user@example.com"
              }
            }
          },
          "description": "TeamInvitation",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "success": true
                }
              }
            },
            "description": "Invitation sent"
          },
          "404": {
            "description": "Team not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Team not found"
                }
              }
            }
          }
        },
        "summary": "Invite a user to a team",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "get": {
        "operationId": "TeamController.listMembers",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "team-1"
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "id": "user-1",
                    "name": "Alice"
                  },
                  {
                    "id": "user-2",
                    "name": "Bob"
                  }
                ]
              }
            },
            "description": "List of team members"
          },
          "404": {
            "description": "Team not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Team not found"
                }
              }
            }
          }
        },
        "summary": "List members of a team",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/{id}/users/{userId}": {
      "delete": {
        "operationId": "TeamController.removeMember",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "team-1"
          },
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "user-1"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "success": true
                }
              }
            },
            "description": "User removed from team"
          },
          "404": {
            "description": "Team or user not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Team or user not found"
                }
              }
            }
          }
        },
        "summary": "Remove a user from a team",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "TeamController.updateRole",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "team-1"
          },
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "user-1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMembershipPatch",
                "type": "object"
              },
              "example": {
                "role": "Leader"
              }
            }
          },
          "description": "TeamMembershipPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "user-1",
                  "role": "Leader"
                }
              }
            },
            "description": "User role updated"
          },
          "404": {
            "description": "Team or user not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Team or user not found"
                }
              }
            }
          }
        },
        "summary": "Update a user role in a team",
        "tags": [
          "Team"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tenant/": {
      "get": {
        "operationId": "TenantController.retrieve",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - tenant",
                    "value": {
                      "id": "tenant-123",
                      "name": "Acme Corp",
                      "slug": "acme",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - tenant",
                    "value": {
                      "id": "tenant-123",
                      "name": "Acme Corp",
                      "slug": "acme",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Tenant details"
          }
        },
        "summary": "Get tenant",
        "tags": [
          "Tenant"
        ],
        "description": "Retrieves the current tenant details.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "TenantController.update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantPatch"
              }
            }
          },
          "description": "TenantPatch",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Tenant"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/tenant/populate_reactors": {
      "post": {
        "operationId": "TenantController.populateReactors",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Populate reactors",
        "tags": [
          "Tenant"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/tiers/": {
      "get": {
        "operationId": "TierController.list",
        "parameters": [
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Locale for localized content."
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Maximum number of results to return."
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TierListParams",
              "type": "number"
            },
            "description": "Number of results to skip for pagination."
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Field to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order (ASC or DESC).",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Filter expression for narrowing results.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - tier list",
                    "value": [
                      {
                        "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                        "priority": 1,
                        "pointsRequirement": 0,
                        "calculation": "LIFETIME_EARN",
                        "accumulationPeriod": null,
                        "createdAt": "2024-01-01T00:00:00.000Z",
                        "updatedAt": "2024-06-15T10:00:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Bronze",
                            "description": "Entry level tier.",
                            "artworkUrl": "https://cdn.example.com/tiers/bronze.png"
                          }
                        ]
                      },
                      {
                        "id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
                        "priority": 2,
                        "pointsRequirement": 500,
                        "calculation": "CALENDAR_PERIOD",
                        "accumulationPeriod": "P1Y",
                        "createdAt": "2024-01-01T00:00:00.000Z",
                        "updatedAt": "2024-06-15T10:00:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Silver",
                            "description": "Earn 500 points per year.",
                            "artworkUrl": "https://cdn.example.com/tiers/silver.png"
                          }
                        ]
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - tiers with earned points",
                    "value": [
                      {
                        "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                        "priority": 1,
                        "pointsRequirement": 0,
                        "calculation": "LIFETIME_EARN",
                        "createdAt": "2024-01-01T00:00:00.000Z",
                        "updatedAt": "2024-06-15T10:00:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Bronze",
                            "description": "Entry level tier.",
                            "artworkUrl": "https://cdn.example.com/tiers/bronze.png"
                          }
                        ],
                        "earnedPoints": 320,
                        "attained": true,
                        "expiringEarn": null,
                        "pointsToMaintain": 0
                      },
                      {
                        "id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
                        "priority": 2,
                        "pointsRequirement": 500,
                        "calculation": "CALENDAR_PERIOD",
                        "accumulationPeriod": "P1Y",
                        "createdAt": "2024-01-01T00:00:00.000Z",
                        "updatedAt": "2024-06-15T10:00:00.000Z",
                        "defaultLocale": "en",
                        "details": [
                          {
                            "locale": "en",
                            "name": "Silver",
                            "description": "Earn 500 points per year.",
                            "artworkUrl": "https://cdn.example.com/tiers/silver.png"
                          }
                        ],
                        "earnedPoints": 320,
                        "attained": false,
                        "expiringEarn": null,
                        "pointsToMaintain": 500
                      }
                    ]
                  }
                }
              }
            },
            "description": "A paginated list of tiers"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "List tiers",
        "tags": [
          "Tier"
        ],
        "description": "Returns a paginated list of tiers for the tenant. Dual auth: user auth returns earned points and attainment status; admin auth with admin:tiers scope returns raw tier data.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "TierController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TierDefinition",
                "type": "object"
              },
              "example": {
                "priority": 3,
                "pointsRequirement": 1000,
                "calculation": "ROLLING_WINDOW",
                "accumulationPeriod": "P1M",
                "defaultLocale": "en",
                "details": [
                  {
                    "locale": "en",
                    "name": "Gold",
                    "description": "Earn 1000 points in a rolling month.",
                    "artworkUrl": "https://cdn.example.com/tiers/gold.png"
                  }
                ]
              }
            }
          },
          "description": "TierDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          },
          "201": {
            "description": "Tier created",
            "content": {
              "application/json": {
                "example": {
                  "id": "3c4d5e6f-7a8b-4c9d-0e1f-2a3b4c5d6e7f",
                  "priority": 3,
                  "pointsRequirement": 1000,
                  "calculation": "ROLLING_WINDOW",
                  "accumulationPeriod": "P1M",
                  "createdAt": "2025-02-01T09:00:00.000Z",
                  "updatedAt": "2025-02-01T09:00:00.000Z",
                  "defaultLocale": "en",
                  "details": [
                    {
                      "locale": "en",
                      "name": "Gold",
                      "description": "Earn 1000 points in a rolling month.",
                      "artworkUrl": "https://cdn.example.com/tiers/gold.png"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid tier definition",
            "content": {
              "application/json": {
                "example": {
                  "message": "Invalid tier definition"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "Create a tier",
        "tags": [
          "Tier"
        ],
        "description": "Creates a new tier. Requires admin auth with admin:tiers scope.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/tiers/{id}": {
      "get": {
        "operationId": "TierController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the tier.",
            "example": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                  "priority": 1,
                  "pointsRequirement": 0,
                  "calculation": "LIFETIME_EARN",
                  "accumulationPeriod": null,
                  "createdAt": "2024-01-01T00:00:00.000Z",
                  "updatedAt": "2024-06-15T10:00:00.000Z",
                  "defaultLocale": "en",
                  "details": [
                    {
                      "locale": "en",
                      "name": "Bronze",
                      "description": "Entry level tier.",
                      "artworkUrl": "https://cdn.example.com/tiers/bronze.png"
                    }
                  ]
                }
              }
            },
            "description": "Tier details"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Tier not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tier not found"
                }
              }
            }
          }
        },
        "summary": "Get tier",
        "tags": [
          "Tier"
        ],
        "description": "Retrieves a single tier by UUID. Dual auth: user auth includes earned points and attainment.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "TierController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the tier to update.",
            "example": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TierPatch",
                "type": "object"
              },
              "example": {
                "priority": 1,
                "pointsRequirement": 100,
                "details": [
                  {
                    "locale": "en",
                    "name": "Bronze",
                    "description": "Updated entry level tier.",
                    "artworkUrl": "https://cdn.example.com/tiers/bronze-v2.png"
                  }
                ]
              }
            }
          },
          "description": "TierPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                  "priority": 1,
                  "pointsRequirement": 100,
                  "calculation": "LIFETIME_EARN",
                  "accumulationPeriod": null,
                  "createdAt": "2024-01-01T00:00:00.000Z",
                  "updatedAt": "2025-03-01T11:00:00.000Z",
                  "defaultLocale": "en",
                  "details": [
                    {
                      "locale": "en",
                      "name": "Bronze",
                      "description": "Updated entry level tier.",
                      "artworkUrl": "https://cdn.example.com/tiers/bronze-v2.png"
                    }
                  ]
                }
              }
            },
            "description": "Tier updated"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Tier not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tier not found"
                }
              }
            }
          }
        },
        "summary": "Update a tier",
        "tags": [
          "Tier"
        ],
        "description": "Updates an existing tier. Requires admin auth with admin:tiers scope.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "TierController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the tier to delete.",
            "example": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                  "priority": 1,
                  "pointsRequirement": 0,
                  "calculation": "LIFETIME_EARN"
                }
              }
            },
            "description": "Tier deleted"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Tier not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tier not found"
                }
              }
            }
          }
        },
        "summary": "Delete a tier",
        "tags": [
          "Tier"
        ],
        "description": "Soft-deletes a tier by setting its effectivity end date. Requires admin auth with admin:tiers scope.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/token_profiles/": {
      "get": {
        "operationId": "TokenProfileController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - token profiles list",
                    "value": [
                      {
                        "id": "profile-123",
                        "name": "Default Profile",
                        "isRestricted": false,
                        "user": {
                          "id": "user-1",
                          "name": "John Doe"
                        },
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - token profiles list",
                    "value": [
                      {
                        "id": "profile-123",
                        "name": "Default Profile",
                        "isRestricted": false,
                        "user": {
                          "id": "user-1",
                          "name": "John Doe"
                        },
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of token profiles"
          }
        },
        "summary": "List token profiles",
        "tags": [
          "Token Profile"
        ],
        "description": "Returns a paginated list of token profiles for the tenant.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/token_profiles/{id}": {
      "get": {
        "operationId": "TokenProfileController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the token profile to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - token profile",
                    "value": {
                      "id": "profile-123",
                      "name": "Default Profile",
                      "isRestricted": false,
                      "user": {
                        "id": "user-1",
                        "name": "John Doe"
                      },
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - token profile",
                    "value": {
                      "id": "profile-123",
                      "name": "Default Profile",
                      "isRestricted": false,
                      "user": {
                        "id": "user-1",
                        "name": "John Doe"
                      },
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Token profile details"
          }
        },
        "summary": "Get token profile",
        "tags": [
          "Token Profile"
        ],
        "description": "Retrieves a single token profile by its unique ID.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/token_profiles/{id}/sessions": {
      "get": {
        "operationId": "TokenProfileController.listSessions",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the token profile."
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - user sessions",
                    "value": [
                      {
                        "id": "session-1",
                        "createdAt": "2025-06-01T12:00:00.000Z",
                        "userToken": {
                          "id": "token-1"
                        },
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - user sessions",
                    "value": [
                      {
                        "id": "session-1",
                        "createdAt": "2025-06-01T12:00:00.000Z",
                        "userToken": {
                          "id": "token-1"
                        }
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of user sessions"
          }
        },
        "summary": "List sessions for token profile",
        "tags": [
          "Token Profile"
        ],
        "description": "Returns a list of user sessions for a given token profile.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/translations/": {
      "get": {
        "operationId": "TranslationController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - translations list",
                    "value": [
                      {
                        "id": "translation-123",
                        "key": "welcome",
                        "value": "Welcome!",
                        "locale": "en",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - translations list",
                    "value": [
                      {
                        "id": "translation-123",
                        "key": "welcome",
                        "value": "Welcome!",
                        "locale": "en",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of translations"
          }
        },
        "summary": "List translations",
        "tags": [
          "Translation"
        ],
        "description": "Returns a paginated list of translations for the tenant.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "TranslationController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationDefinition"
              }
            }
          },
          "description": "TranslationDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Translation"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/translations/{id}": {
      "get": {
        "operationId": "TranslationController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the translation to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - translation",
                    "value": {
                      "id": "translation-123",
                      "key": "welcome",
                      "value": "Welcome!",
                      "locale": "en",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - translation",
                    "value": {
                      "id": "translation-123",
                      "key": "welcome",
                      "value": "Welcome!",
                      "locale": "en",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z"
                    }
                  }
                }
              }
            },
            "description": "Translation details"
          }
        },
        "summary": "Get translation",
        "tags": [
          "Translation"
        ],
        "description": "Retrieves a single translation by its unique ID.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "TranslationController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationPatch"
              }
            }
          },
          "description": "TranslationPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Translation"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "TranslationController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Translation"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/users/": {
      "get": {
        "operationId": "UserController.list",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Maximum number of results to return."
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams",
              "type": "number"
            },
            "description": "Number of results to skip for pagination."
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Field to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order (ASC or DESC).",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ]
            }
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Filter expression for narrowing results.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "description": "Locale for localized content.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "id": "9cb2cc08-e033-4200-86a7-95a03ba09462",
                    "accountNumber": 1000456,
                    "authIdentifier": "auth0|abc123def456",
                    "externalIdentifier": "EXT-USER-001",
                    "createdAt": "2024-03-15T10:30:00.000Z",
                    "updatedAt": "2025-01-20T14:22:00.000Z",
                    "isRestricted": false,
                    "profile": {
                      "givenName": "Jane",
                      "familyName": "Smith",
                      "emailAddress": "jane.smith@example.com",
                      "gender": "female",
                      "dateOfBirth": "1990-05-12"
                    },
                    "linkedVenues": [],
                    "flags": {
                      "genderProvided": true
                    }
                  }
                ]
              }
            },
            "description": "A paginated list of users"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "List users",
        "tags": [
          "User"
        ],
        "description": "Returns a paginated list of users for the tenant. Requires admin auth with admin:users scope.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "UserController.create",
        "parameters": [
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDefinition"
              }
            }
          },
          "description": "UserDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/users/summary": {
      "get": {
        "operationId": "UserController.retrieveUserSummaries",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve user summaries",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/users/{id}/active_campaign": {
      "get": {
        "operationId": "UserController.fetchActiveCampaign",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Fetch active campaign",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/{id}/campaigns": {
      "get": {
        "operationId": "UserController.listCampaigns",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Use `me` for the member authenticated by the bearer token. An admin token with `read:users` may instead supply a user UUID, auth identifier, or account number.",
            "examples": {
              "currentMember": {
                "summary": "The authenticated member",
                "value": "me"
              },
              "adminImpersonation": {
                "summary": "A member UUID supplied by an administrator",
                "value": "c5b0f115-7bd8-41b3-8cc4-eb527742f55b"
              }
            }
          },
          {
            "in": "query",
            "name": "participatingOnly",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, return only live campaigns with any stored mission progress for this member. When false, exclude campaigns with a completed parentless/root mission; child completion alone does not exclude a campaign.",
            "example": true
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "fr",
                "de",
                "it",
                "es",
                "nl",
                "ar",
                "bn",
                "gu",
                "hi",
                "id",
                "ja",
                "ko",
                "ml",
                "mr",
                "mt",
                "pl",
                "pt",
                "ru",
                "sv",
                "ta",
                "te",
                "th",
                "tl",
                "tr",
                "uk",
                "ur",
                "vi"
              ]
            },
            "description": "Preferred locale for campaign and mission names, descriptions, and images. Missing translations fall back to each resource's default locale.",
            "example": "en"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of campaigns to consider, from 1 to 1000.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Zero-based number of matching campaigns to skip.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            },
            "example": 0
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a",
                      "type": "GOAL_BASED",
                      "status": "ACTIVE",
                      "name": "Summer spend challenge",
                      "description": "Make three qualifying purchases during the campaign.",
                      "pictureUrl": "https://cdn.example.com/campaigns/summer-spend.png",
                      "effectivity": {
                        "start": "2026-08-01T00:00:00.000Z",
                        "end": null
                      },
                      "progress": null,
                      "missions": [
                        {
                          "id": "02d24ac1-2221-4fa2-a6cd-4b63d778b7a0",
                          "name": "Make three purchases",
                          "description": "Each qualifying purchase advances this mission.",
                          "pictureUrl": "https://cdn.example.com/missions/three-purchases.png",
                          "completionType": "COUNT",
                          "targetValue": 3,
                          "displayStyle": "PROGRESS_BAR",
                          "requiresOptIn": true,
                          "progress": {
                            "currentValue": 2,
                            "targetValue": 3,
                            "windowStart": "2026-08-20T09:30:00.000Z",
                            "windowEnd": "2026-09-19T09:30:00.000Z",
                            "optedInAt": "2026-08-20T09:30:00.000Z",
                            "completedAt": null,
                            "availableAgainAt": null,
                            "cooldownCycle": null
                          },
                          "lockState": "available",
                          "order": 0,
                          "duration": "P30D",
                          "cooldownDuration": null,
                          "children": []
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "description": "A page of member-visible campaigns.",
            "headers": {
              "Content-Range": {
                "description": "Pagination range in the form `campaigns first-last/total`. The total is counted before audience visibility filtering.",
                "schema": {
                  "type": "string"
                },
                "example": "campaigns 0-0/12"
              }
            }
          },
          "400": {
            "description": "The pagination query is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid queries, check 'errors' property for more info.",
                  "data": {
                    "name": "BadRequestError",
                    "errors": [
                      {
                        "property": "limit",
                        "children": [],
                        "constraints": {
                          "min": "limit must not be less than 1"
                        }
                      }
                    ],
                    "paramName": ""
                  }
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing or invalid, an admin token lacks `read:users`, or the token does not resolve to a user. Admin callers must identify a concrete user rather than use `me`.",
            "content": {
              "application/json": {
                "examples": {
                  "missingAuthentication": {
                    "summary": "Missing authentication",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Unauthorized",
                      "data": {
                        "name": "UnauthorizedError"
                      }
                    }
                  },
                  "missingPermission": {
                    "summary": "Admin token lacks read:users",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Provided authentication is invalid: some required permissions are missing",
                      "data": {
                        "name": "InvalidAuthenticationError"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The API key is invalid or a member token attempted to access another user.",
            "content": {
              "application/json": {
                "examples": {
                  "invalidApiKey": {
                    "summary": "Invalid API key",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Provided API key is invalid",
                      "data": {
                        "name": "InvalidApiKeyError"
                      }
                    }
                  },
                  "forbiddenImpersonation": {
                    "summary": "A member attempted to impersonate another user",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Request does not contain valid credentials to impersonate user 'c5b0f115-7bd8-41b3-8cc4-eb527742f55b'.",
                      "data": {
                        "name": "ImpersonationForbiddenError"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The user identifier does not match a user in this tenant.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching Actor",
                  "data": {
                    "name": "NotFoundError"
                  }
                }
              }
            }
          }
        },
        "summary": "List campaigns for a user",
        "tags": [
          "Campaigns"
        ],
        "description": "Returns the live earning campaigns that a member is eligible to see, with localized presentation fields, mission lock states, and that member's progress. Goal-based mission hierarchies are nested; rule-based missions remain a flat list.\n\nOnly `ACTIVE` campaigns whose effectivity includes the current time are considered. With the default `participatingOnly=false`, a campaign is excluded when the member has completed its parentless/root mission; child progress or completion alone does not exclude it. Set `participatingOnly=true` to return live campaigns where the member has at least one mission progress record, including completed campaigns. Audience visibility rules apply in both modes.\n\nResults are ordered newest first. Pagination and the `Content-Range` total are calculated before audience visibility is applied, so a page can contain fewer than `limit` items and the total can be greater than the number of campaigns returned in `data`. Use `me` with a member token, or provide a user identifier with an admin token that has `read:users` permission.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/{id}/campaigns/{campaignId}": {
      "get": {
        "operationId": "UserController.retrieveCampaign",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Use `me` for the member authenticated by the bearer token. An admin token with `read:users` may instead supply a user UUID, auth identifier, or account number.",
            "examples": {
              "currentMember": {
                "summary": "The authenticated member",
                "value": "me"
              },
              "adminImpersonation": {
                "summary": "A member UUID supplied by an administrator",
                "value": "c5b0f115-7bd8-41b3-8cc4-eb527742f55b"
              }
            }
          },
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID of the earning campaign.",
            "example": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a"
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "fr",
                "de",
                "it",
                "es",
                "nl",
                "ar",
                "bn",
                "gu",
                "hi",
                "id",
                "ja",
                "ko",
                "ml",
                "mr",
                "mt",
                "pl",
                "pt",
                "ru",
                "sv",
                "ta",
                "te",
                "th",
                "tl",
                "tr",
                "uk",
                "ur",
                "vi"
              ]
            },
            "description": "Preferred locale for campaign and mission names, descriptions, and images. Missing translations fall back to each resource's default locale.",
            "example": "en"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a",
                    "type": "GOAL_BASED",
                    "status": "ACTIVE",
                    "name": "Summer spend challenge",
                    "description": "Make three qualifying purchases during the campaign.",
                    "pictureUrl": "https://cdn.example.com/campaigns/summer-spend.png",
                    "effectivity": {
                      "start": "2026-08-01T00:00:00.000Z",
                      "end": null
                    },
                    "progress": null,
                    "missions": [
                      {
                        "id": "02d24ac1-2221-4fa2-a6cd-4b63d778b7a0",
                        "name": "Make three purchases",
                        "description": "Each qualifying purchase advances this mission.",
                        "pictureUrl": "https://cdn.example.com/missions/three-purchases.png",
                        "completionType": "COUNT",
                        "targetValue": 3,
                        "displayStyle": "PROGRESS_BAR",
                        "requiresOptIn": true,
                        "progress": {
                          "currentValue": 2,
                          "targetValue": 3,
                          "windowStart": "2026-08-20T09:30:00.000Z",
                          "windowEnd": "2026-09-19T09:30:00.000Z",
                          "optedInAt": "2026-08-20T09:30:00.000Z",
                          "completedAt": null,
                          "availableAgainAt": null,
                          "cooldownCycle": null
                        },
                        "lockState": "available",
                        "order": 0,
                        "duration": "P30D",
                        "cooldownDuration": null,
                        "children": []
                      }
                    ]
                  }
                }
              }
            },
            "description": "The member-facing campaign with its missions and progress."
          },
          "401": {
            "description": "The bearer token is missing or invalid, an admin token lacks `read:users`, or the token does not resolve to a user. Admin callers must identify a concrete user rather than use `me`.",
            "content": {
              "application/json": {
                "examples": {
                  "missingAuthentication": {
                    "summary": "Missing authentication",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Unauthorized",
                      "data": {
                        "name": "UnauthorizedError"
                      }
                    }
                  },
                  "missingPermission": {
                    "summary": "Admin token lacks read:users",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Provided authentication is invalid: some required permissions are missing",
                      "data": {
                        "name": "InvalidAuthenticationError"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The API key is invalid or a member token attempted to access another user.",
            "content": {
              "application/json": {
                "examples": {
                  "invalidApiKey": {
                    "summary": "Invalid API key",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Provided API key is invalid",
                      "data": {
                        "name": "InvalidApiKeyError"
                      }
                    }
                  },
                  "forbiddenImpersonation": {
                    "summary": "A member attempted to impersonate another user",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Request does not contain valid credentials to impersonate user 'c5b0f115-7bd8-41b3-8cc4-eb527742f55b'.",
                      "data": {
                        "name": "ImpersonationForbiddenError"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The user does not exist, or the campaign is missing, inactive, outside its effectivity window, or hidden from this user by its audience criteria.",
            "content": {
              "application/json": {
                "examples": {
                  "campaignUnavailable": {
                    "summary": "Campaign is unavailable to this user",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "EarningCampaign with id 8f6c9c8e-7f7f-4a6f-9b6e-8a60e25bd50a not found",
                      "data": {
                        "name": "EarningCampaignNotFoundError"
                      }
                    }
                  },
                  "userNotFound": {
                    "summary": "The requested user does not exist",
                    "value": {
                      "status": "fail",
                      "code": 9999,
                      "message": "Failed to find a matching Actor",
                      "data": {
                        "name": "NotFoundError"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Retrieve a campaign for a user",
        "tags": [
          "Campaigns"
        ],
        "description": "Returns one live earning campaign as the member sees it, including localized presentation fields, mission gating, and the member's progress. Goal-based mission hierarchies are nested; rule-based missions remain a flat list.\n\nThe campaign must be `ACTIVE`, effective at the current time, owned by the API-key tenant, and visible to the member under its audience criteria. Unlike the list's default mode, direct retrieval can return a campaign the member has already completed. If the requested locale is unavailable, localized fields fall back to each resource's default locale.\n\nUse `me` with a member token, or provide a user identifier with an admin token that has `read:users` permission.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/{id}/missions/{missionId}/opt-in": {
      "post": {
        "operationId": "UserController.optInToMission",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "missionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Opt in to mission",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/{id}/audience_domain_payload": {
      "get": {
        "operationId": "UserController.getAudienceDomainPayload",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get audience domain payload",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/users/{id}": {
      "get": {
        "operationId": "UserController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The user identifier — can be a UUID, authIdentifier, or accountNumber."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "9cb2cc08-e033-4200-86a7-95a03ba09462",
                  "accountNumber": 1000456,
                  "authIdentifier": "auth0|abc123def456",
                  "externalIdentifier": "EXT-USER-001",
                  "createdAt": "2024-03-15T10:30:00.000Z",
                  "updatedAt": "2025-01-20T14:22:00.000Z",
                  "isRestricted": false,
                  "profile": {
                    "givenName": "Jane",
                    "familyName": "Smith",
                    "emailAddress": "jane.smith@example.com",
                    "gender": "female",
                    "dateOfBirth": "1990-05-12"
                  },
                  "linkedVenues": [],
                  "flags": {
                    "genderProvided": true
                  }
                }
              }
            },
            "description": "User details"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key or insufficient permissions",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "User not found"
                }
              }
            }
          }
        },
        "summary": "Get user",
        "tags": [
          "User"
        ],
        "description": "Retrieves a single user by ID. The id parameter accepts a UUID, authIdentifier, or accountNumber. Requires admin auth with admin:users scope.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "UserController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserPatch"
              }
            }
          },
          "description": "UserPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "UserController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/me/fingerprint": {
      "get": {
        "operationId": "UserController.fingerprint",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Fingerprint",
        "tags": [
          "User"
        ]
      }
    },
    "/users/{id}/purchases": {
      "post": {
        "operationId": "UserController.handlePurchase",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Handle purchase",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/{id}/redemptions": {
      "post": {
        "operationId": "UserController.handleRedemption",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedemptionDefinition"
              }
            }
          },
          "description": "RedemptionDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Handle redemption",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/{id}/redemptions/validate": {
      "post": {
        "operationId": "UserController.validateVoucherCode",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoucherCodeDefinition"
              }
            }
          },
          "description": "VoucherCodeDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Validate voucher code",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/users/{id}/commands": {
      "post": {
        "operationId": "UserController.handleCommand",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommandDefinition"
              }
            }
          },
          "description": "CommandDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Handle command",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/users/{id}/referral_code": {
      "post": {
        "operationId": "UserController.generateReferralCode",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "forceNewCode",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Generate referral code",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "get": {
        "operationId": "UserController.fetchReferralCode",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Fetch referral code",
        "tags": [
          "User"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/user_sessions/": {
      "get": {
        "operationId": "UserSessionController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - user sessions list",
                    "value": [
                      {
                        "id": "session-123",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "userToken": {
                          "id": "token-1"
                        },
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - user sessions list",
                    "value": [
                      {
                        "id": "session-123",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "userToken": {
                          "id": "token-1"
                        }
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of user sessions"
          }
        },
        "summary": "List user sessions",
        "tags": [
          "User Session"
        ],
        "description": "Returns a paginated list of user sessions for the tenant.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "UserSessionController.createSession",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserSessionDefinition"
              }
            }
          },
          "description": "UserSessionDefinition",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create session",
        "tags": [
          "User Session"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/user_sessions/{id}": {
      "get": {
        "operationId": "UserSessionController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the user session to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - user session",
                    "value": {
                      "id": "session-123",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "userToken": {
                        "id": "token-1"
                      },
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - user session",
                    "value": {
                      "id": "session-123",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "userToken": {
                        "id": "token-1"
                      }
                    }
                  }
                }
              }
            },
            "description": "User session details"
          }
        },
        "summary": "Get user session",
        "tags": [
          "User Session"
        ],
        "description": "Retrieves a single user session by its unique ID.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "UserSessionController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "User Session"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/user_sessions/{id}/profile": {
      "post": {
        "operationId": "UserSessionController.createAndLinkTokenProfile",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenProfilePayload"
              }
            }
          },
          "description": "TokenProfilePayload",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create and link token profile",
        "tags": [
          "User Session"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/user_tokens/": {
      "get": {
        "operationId": "UserTokenController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "User Token"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "UserTokenController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserTokenDefinition"
              }
            }
          },
          "description": "UserTokenDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "User Token"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/user_tokens/{id}": {
      "get": {
        "operationId": "UserTokenController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "User Token"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "UserTokenController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserTokenPatch"
              }
            }
          },
          "description": "UserTokenPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "User Token"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "UserTokenController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "User Token"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/venue_categories/": {
      "get": {
        "operationId": "VenueCategoryController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Venue Category"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "VenueCategoryController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryDefinition"
              }
            }
          },
          "description": "CategoryDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Venue Category"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/venue_categories/{id}": {
      "get": {
        "operationId": "VenueCategoryController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Venue Category"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "VenueCategoryController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryPatch"
              }
            }
          },
          "description": "CategoryPatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Venue Category"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "VenueCategoryController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Venue Category"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/venue_categories/{id}/rewards": {
      "get": {
        "operationId": "VenueCategoryController.getRewards",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get rewards",
        "tags": [
          "Venue Category"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/venues/": {
      "get": {
        "operationId": "VenueController.list",
        "parameters": [
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "distance",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": [
                  {
                    "id": "8f1a2b3c-4d5e-4f6a-7b8c-9d0e1f2a3b4c",
                    "name": "Main Street Store",
                    "address": "123 Main Street, London, EC1A 1BB",
                    "description": "Our flagship retail location.",
                    "coordinates": {
                      "longitude": -0.1278,
                      "latitude": 51.5074
                    },
                    "attributes": {
                      "bookingUrl": "https://book.example.com/main-street",
                      "telephoneNumber": "+44 20 7946 0958",
                      "openingTimes": "Mon-Sat 9am-6pm, Sun 11am-5pm"
                    },
                    "availability": {
                      "start": "2024-01-01T00:00:00.000Z",
                      "end": null
                    },
                    "externalIdentifier": "VENUE-EXT-001",
                    "createdAt": "2024-01-10T08:00:00.000Z",
                    "updatedAt": "2025-01-05T14:30:00.000Z"
                  }
                ]
              }
            },
            "description": "A list of venues"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          }
        },
        "summary": "List venues",
        "tags": [
          "Venue"
        ],
        "description": "Returns a paginated list of venues for the tenant. No auth required (API key only).",
        "security": [
          {
            "apiKeyAuth": []
          },
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "VenueController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VenueDefinition"
              }
            }
          },
          "description": "VenueDefinition",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Venue"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/venues/{id}": {
      "get": {
        "operationId": "VenueController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The UUID of the venue.",
            "example": "8f1a2b3c-4d5e-4f6a-7b8c-9d0e1f2a3b4c"
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "8f1a2b3c-4d5e-4f6a-7b8c-9d0e1f2a3b4c",
                  "name": "Main Street Store",
                  "address": "123 Main Street, London, EC1A 1BB",
                  "description": "Our flagship retail location.",
                  "coordinates": {
                    "longitude": -0.1278,
                    "latitude": 51.5074
                  },
                  "attributes": {
                    "bookingUrl": "https://book.example.com/main-street",
                    "telephoneNumber": "+44 20 7946 0958",
                    "openingTimes": "Mon-Sat 9am-6pm, Sun 11am-5pm"
                  },
                  "availability": {
                    "start": "2024-01-01T00:00:00.000Z",
                    "end": null
                  },
                  "externalIdentifier": "VENUE-EXT-001",
                  "createdAt": "2024-01-10T08:00:00.000Z",
                  "updatedAt": "2025-01-05T14:30:00.000Z"
                }
              }
            },
            "description": "Venue details"
          },
          "401": {
            "description": "Unauthorized — missing or invalid auth token",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — invalid API key",
            "content": {
              "application/json": {
                "example": {
                  "message": "InvalidApiKey"
                }
              }
            }
          },
          "404": {
            "description": "Venue not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Venue not found"
                }
              }
            }
          }
        },
        "summary": "Get venue",
        "tags": [
          "Venue"
        ],
        "description": "Retrieves a single venue by UUID. No auth required (API key only).",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "VenueController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VenuePatch"
              }
            }
          },
          "description": "VenuePatch",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Venue"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "VenueController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Venue"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/venues/{id}/rewards": {
      "get": {
        "operationId": "VenueController.rewards",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Rewards",
        "tags": [
          "Venue"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/venues/{id}/users": {
      "get": {
        "operationId": "VenueController.linkedUsers",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Linked users",
        "tags": [
          "Venue"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/rewards/{id}/codes": {
      "get": {
        "operationId": "VoucherCodeController.list",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Voucher Code"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "VoucherCodeController.create",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoucherCodeDefinition"
              }
            }
          },
          "description": "VoucherCodeDefinition",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Voucher Code"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/rewards/{id}/codes/{codeId}": {
      "delete": {
        "operationId": "VoucherCodeController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "codeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete",
        "tags": [
          "Voucher Code"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/rewards/{id}/upload-url/": {
      "get": {
        "operationId": "VoucherCodeController.getUploadUrl",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get upload url",
        "tags": [
          "Voucher Code"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/vouchers/": {
      "get": {
        "operationId": "VoucherController.list",
        "parameters": [
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - vouchers list",
                    "value": [
                      {
                        "id": "voucher-123",
                        "code": "ABC123",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "reward": {
                          "id": "reward-1",
                          "name": "10% Off"
                        },
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - vouchers list",
                    "value": [
                      {
                        "id": "voucher-123",
                        "code": "ABC123",
                        "createdAt": "2025-01-01T00:00:00.000Z",
                        "updatedAt": "2025-06-01T00:00:00.000Z",
                        "reward": {
                          "id": "reward-1",
                          "name": "10% Off"
                        }
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of vouchers"
          }
        },
        "summary": "List vouchers",
        "tags": [
          "Voucher"
        ],
        "description": "Returns a paginated list of vouchers for the tenant.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/vouchers/{id}": {
      "get": {
        "operationId": "VoucherController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the voucher to retrieve."
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - voucher",
                    "value": {
                      "id": "voucher-123",
                      "code": "ABC123",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "reward": {
                        "id": "reward-1",
                        "name": "10% Off"
                      },
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - voucher",
                    "value": {
                      "id": "voucher-123",
                      "code": "ABC123",
                      "createdAt": "2025-01-01T00:00:00.000Z",
                      "updatedAt": "2025-06-01T00:00:00.000Z",
                      "reward": {
                        "id": "reward-1",
                        "name": "10% Off"
                      }
                    }
                  }
                }
              }
            },
            "description": "Voucher details"
          }
        },
        "summary": "Get voucher",
        "tags": [
          "Voucher"
        ],
        "description": "Retrieves a single voucher by its unique ID.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/users/{userId}/wallet": {
      "get": {
        "operationId": "WalletController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "includeAllUnvalidatedVouchers",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "includeDiscounts",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/users/{userId}/wallet/predictions": {
      "get": {
        "operationId": "WalletController.retrievePredictions",
        "parameters": [
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve predictions",
        "tags": [
          "Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/{teamId}/wallet": {
      "get": {
        "operationId": "WalletController.retrieveTeamWallet",
        "parameters": [
          {
            "in": "path",
            "name": "teamId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locale",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve team wallet",
        "tags": [
          "Wallet"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/wegift/products/{code}": {
      "get": {
        "operationId": "WeGiftController.retrieveProduct",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve product",
        "tags": [
          "We Gift"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/wegift/products": {
      "get": {
        "operationId": "WeGiftController.listProducts",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List products",
        "tags": [
          "We Gift"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/wegift/account_balance": {
      "get": {
        "operationId": "WeGiftController.getTenantBalance",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get tenant balance",
        "tags": [
          "We Gift"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/xoxo/products/{code}": {
      "get": {
        "operationId": "XoxoController.retrieveProduct",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The code of the Xoxo product to retrieve."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - Xoxo product",
                    "value": {
                      "code": "XOXO-123",
                      "name": "Gift Card",
                      "value": 100,
                      "currency": "USD",
                      "available": true,
                      "internalNotes": "Admin-only field"
                    }
                  },
                  "user": {
                    "summary": "User - Xoxo product",
                    "value": {
                      "code": "XOXO-123",
                      "name": "Gift Card",
                      "value": 100,
                      "currency": "USD",
                      "available": true
                    }
                  }
                }
              }
            },
            "description": "Xoxo product details"
          }
        },
        "summary": "Get Xoxo product",
        "tags": [
          "Xoxo"
        ],
        "description": "Retrieves a single Xoxo product by its code.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/xoxo/products": {
      "get": {
        "operationId": "XoxoController.listProducts",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "admin": {
                    "summary": "Admin - Xoxo products list",
                    "value": [
                      {
                        "code": "XOXO-123",
                        "name": "Gift Card",
                        "value": 100,
                        "currency": "USD",
                        "available": true,
                        "internalNotes": "Admin-only field"
                      }
                    ]
                  },
                  "user": {
                    "summary": "User - Xoxo products list",
                    "value": [
                      {
                        "code": "XOXO-123",
                        "name": "Gift Card",
                        "value": 100,
                        "currency": "USD",
                        "available": true
                      }
                    ]
                  }
                }
              }
            },
            "description": "A list of Xoxo products"
          }
        },
        "summary": "List Xoxo products",
        "tags": [
          "Xoxo"
        ],
        "description": "Returns a paginated list of Xoxo products for the tenant.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/xoxo/{integrationId}/status/webhook": {
      "post": {
        "operationId": "XoxoController.orderStatusChangedWebhook",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Order status changed webhook",
        "tags": [
          "Xoxo"
        ]
      }
    },
    "/xoxo/account_balance": {
      "get": {
        "operationId": "XoxoController.getTenantBalance",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get tenant balance",
        "tags": [
          "Xoxo"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/attributes/": {
      "get": {
        "operationId": "AttributeController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Attribute"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "AttributeController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttributeDefinition"
              }
            }
          },
          "description": "AttributeDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Attribute"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/attributes/{id}": {
      "get": {
        "operationId": "AttributeController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Attribute"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/attributes/batch": {
      "post": {
        "operationId": "AttributeController.batchSave",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchAttributeDefinition"
              }
            }
          },
          "description": "BatchAttributeDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Batch save",
        "tags": [
          "Attribute"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/olive/cards/": {
      "post": {
        "operationId": "OliveCardController.register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OliveCardDefinition"
              }
            }
          },
          "description": "OliveCardDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Register",
        "tags": [
          "Olive Card"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "get": {
        "operationId": "OliveCardController.list",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Olive Card"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/olive/cards/{cardId}": {
      "patch": {
        "operationId": "OliveCardController.updateCardAndConfig",
        "parameters": [
          {
            "in": "path",
            "name": "cardId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OliveCardUpdateDefinition"
              }
            }
          },
          "description": "OliveCardUpdateDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update card and config",
        "tags": [
          "Olive Card"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "get": {
        "operationId": "OliveCardController.getCardDetail",
        "parameters": [
          {
            "in": "path",
            "name": "cardId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get card detail",
        "tags": [
          "Olive Card"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "OliveCardController.deactivate",
        "parameters": [
          {
            "in": "path",
            "name": "cardId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Deactivate",
        "tags": [
          "Olive Card"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/olive/cards/config": {
      "get": {
        "operationId": "OliveCardController.getConfig",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get config",
        "tags": [
          "Olive Card"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "OliveCardController.updateConfig",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOliveConfigDefinition"
              }
            }
          },
          "description": "UpdateOliveConfigDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update config",
        "tags": [
          "Olive Card"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/olive/cards/webhook/integrations/{integrationId}/{eventType}": {
      "post": {
        "operationId": "OliveCardController.processWebhook",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "eventType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Process webhook",
        "tags": [
          "Olive Card"
        ]
      }
    },
    "/olive/offers/import": {
      "post": {
        "operationId": "OliveOfferController.importOffers",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Import offers",
        "tags": [
          "Olive Offer"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/olive/offers/": {
      "delete": {
        "operationId": "OliveOfferController.deleteOffers",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete offers",
        "tags": [
          "Olive Offer"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/logics/": {
      "post": {
        "operationId": "LogicController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartiallyTranslatedLogicDefinition"
              }
            }
          },
          "description": "PartiallyTranslatedLogicDefinition",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Create",
        "tags": [
          "Logic"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "LogicController.list",
        "parameters": [
          {
            "in": "query",
            "name": "ListQueryParams",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListQueryParams"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "List",
        "tags": [
          "Logic"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/logics/{id}": {
      "patch": {
        "operationId": "LogicController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartiallyTranslatedLogicDefinitionPatch"
              }
            }
          },
          "description": "PartiallyTranslatedLogicDefinitionPatch",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Update",
        "tags": [
          "Logic"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "LogicController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Retrieve",
        "tags": [
          "Logic"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/logics/batch_execute": {
      "post": {
        "operationId": "LogicController.batchExecute",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogicExecutionPayload"
              }
            }
          },
          "description": "LogicExecutionPayload",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Batch execute",
        "tags": [
          "Logic"
        ],
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/referral_campaigns/": {
      "get": {
        "operationId": "CampaignController.list",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of campaigns to return.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of campaigns to skip before collecting the page.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "example": 0
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort direction used by the list query. The accepted values are `ASC` and `DESC`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ],
              "default": "ASC"
            },
            "example": "DESC"
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Campaign field to sort by, such as `createdAt`, `name`, or `isActive`.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdAt"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Rison-encoded list filter. Tenant scoping is always applied in addition to this filter.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "isActive:(eq:!t)"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2",
                      "createdAt": "2026-08-20T09:15:00.000Z",
                      "updatedAt": "2026-08-20T09:15:00.000Z",
                      "name": "Refer a friend — Autumn 2026",
                      "linkConfig": {
                        "title": "Give a friend £10, get 500 points",
                        "description": "Invite a friend to join. They receive £10 after their first qualifying purchase and you receive 500 points.",
                        "imageUrl": "https://cdn.example.com/referrals/autumn-2026.png",
                        "desktopUrl": "https://www.example.com/join",
                        "androidUrl": "https://play.google.com/store/apps/details?id=com.example.app",
                        "iosUrl": "https://apps.apple.com/app/example/id123456789",
                        "androidUriScheme": "example://join",
                        "channel": "member-get-member",
                        "feature": "autumn-2026",
                        "tags": [
                          "referral",
                          "autumn-2026"
                        ]
                      },
                      "isActive": true,
                      "referralCodeType": "CODE",
                      "tranches": [
                        {
                          "id": "537ad8ed-d058-4c81-b434-24ea431f8429",
                          "createdAt": "2026-08-20T09:30:00.000Z",
                          "updatedAt": "2026-08-20T09:30:00.000Z",
                          "name": "First qualifying purchase",
                          "maxActivations": 1
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "description": "A tenant-scoped page of referral campaigns.",
            "headers": {
              "Content-Range": {
                "description": "Pagination window and total count in `<resource> <first>-<last>/<total>` form.",
                "schema": {
                  "type": "string"
                },
                "example": "campaign 0-0/1"
              }
            }
          },
          "400": {
            "description": "The list query could not be parsed or validated.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid query, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "filter",
                        "children": [],
                        "constraints": {
                          "isListFilter": "filter contains an unsupported comparison"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "List referral campaigns",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Returns a paginated list of referral campaigns owned by the tenant identified by `X-Api-Key`.\n\nRequires the `read:referral_campaigns` permission. Each campaign includes its stored tranche records; use the campaign or tranche retrieval endpoints when inflated event-reactor details are needed.\n\nThe `Content-Range` response header describes the returned window and total number of tenant campaigns.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "CampaignController.create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignDefinition"
              },
              "example": {
                "name": "Refer a friend — Autumn 2026",
                "linkConfig": {
                  "title": "Give a friend £10, get 500 points",
                  "description": "Invite a friend to join. They receive £10 after their first qualifying purchase and you receive 500 points.",
                  "imageUrl": "https://cdn.example.com/referrals/autumn-2026.png",
                  "desktopUrl": "https://www.example.com/join",
                  "androidUrl": "https://play.google.com/store/apps/details?id=com.example.app",
                  "iosUrl": "https://apps.apple.com/app/example/id123456789",
                  "androidUriScheme": "example://join",
                  "channel": "member-get-member",
                  "feature": "autumn-2026",
                  "tags": [
                    "referral",
                    "autumn-2026"
                  ]
                },
                "isActive": true,
                "eligibleAudiences": [
                  {
                    "id": "98d6860c-235d-4f90-86b8-59a3dfe2ac67"
                  },
                  {
                    "id": "625d8702-4825-4a5e-bf9d-bcf8536c71d6"
                  }
                ],
                "referralCodeType": "CODE"
              }
            }
          },
          "description": "The referral campaign definition.",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2",
                    "createdAt": "2026-08-20T09:15:00.000Z",
                    "updatedAt": "2026-08-20T09:15:00.000Z",
                    "name": "Refer a friend — Autumn 2026",
                    "linkConfig": {
                      "title": "Give a friend £10, get 500 points",
                      "description": "Invite a friend to join. They receive £10 after their first qualifying purchase and you receive 500 points.",
                      "imageUrl": "https://cdn.example.com/referrals/autumn-2026.png",
                      "desktopUrl": "https://www.example.com/join",
                      "androidUrl": "https://play.google.com/store/apps/details?id=com.example.app",
                      "iosUrl": "https://apps.apple.com/app/example/id123456789",
                      "androidUriScheme": "example://join",
                      "channel": "member-get-member",
                      "feature": "autumn-2026",
                      "tags": [
                        "referral",
                        "autumn-2026"
                      ]
                    },
                    "isActive": true,
                    "eligibleAudiences": [
                      {
                        "id": "98d6860c-235d-4f90-86b8-59a3dfe2ac67"
                      },
                      {
                        "id": "625d8702-4825-4a5e-bf9d-bcf8536c71d6"
                      }
                    ],
                    "referralCodeType": "CODE"
                  }
                }
              }
            },
            "description": "The referral campaign was created."
          },
          "400": {
            "description": "The definition failed validation, for example because a URL, enum, or required link field is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid body, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "name",
                        "children": [],
                        "constraints": {
                          "isLength": "name must be longer than or equal to 2 characters"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Create a referral campaign",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Creates a referral campaign for the tenant identified by `X-Api-Key`. Requires the `create:referral_campaigns` permission.\n\n`eligibleAudiences` contains audience references. A user is eligible when they belong to **any one** of the listed audiences (OR semantics, not AND). If the field is omitted or empty, the campaign acts as the untargeted fallback when no active audience-targeted campaign matches the member.\n\n`referralCodeType` controls identifiers created for members and defaults to `BRANCH` when omitted:\n\n- `BRANCH` creates an external Branch deep link and stores it as both the code and link.\n- `CODE` creates a new eight-character uppercase hexadecimal code without a link.\n- `STATIC_USER_CODE` reuses a persistent code for the member in this campaign, based on profile initials.\n- `STATIC_USER_WORD_CODE` reuses a persistent word-based code for the member in this campaign, with initials and a two-digit suffix.\n\nTranches are configured separately after campaign creation.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/referral_campaigns/{id}": {
      "get": {
        "operationId": "CampaignController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of a referral campaign belonging to the tenant identified by `X-Api-Key`.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2",
                    "createdAt": "2026-08-20T09:15:00.000Z",
                    "updatedAt": "2026-08-20T09:15:00.000Z",
                    "name": "Refer a friend — Autumn 2026",
                    "linkConfig": {
                      "title": "Give a friend £10, get 500 points",
                      "description": "Invite a friend to join. They receive £10 after their first qualifying purchase and you receive 500 points.",
                      "imageUrl": "https://cdn.example.com/referrals/autumn-2026.png",
                      "desktopUrl": "https://www.example.com/join",
                      "androidUrl": "https://play.google.com/store/apps/details?id=com.example.app",
                      "iosUrl": "https://apps.apple.com/app/example/id123456789",
                      "androidUriScheme": "example://join",
                      "channel": "member-get-member",
                      "feature": "autumn-2026",
                      "tags": [
                        "referral",
                        "autumn-2026"
                      ]
                    },
                    "isActive": true,
                    "referralCodeType": "CODE",
                    "tranches": [
                      {
                        "id": "537ad8ed-d058-4c81-b434-24ea431f8429",
                        "createdAt": "2026-08-20T09:30:00.000Z",
                        "updatedAt": "2026-08-20T09:30:00.000Z",
                        "name": "First qualifying purchase",
                        "maxActivations": 1,
                        "eventReactorDetails": {
                          "id": "94f7cc93-26e4-4527-92df-e23536303f08",
                          "name": "First qualifying purchase",
                          "constraint": {
                            "type": "object",
                            "required": [
                              "referralTrancheStatuses",
                              "campaignId",
                              "isCampaignActive"
                            ],
                            "properties": {
                              "campaignId": {
                                "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                              },
                              "isCampaignActive": {
                                "const": true
                              },
                              "referralTrancheStatuses": {
                                "type": "array"
                              }
                            }
                          },
                          "maxActivations": 1,
                          "activationContext": "SUBJECT",
                          "isLocked": false,
                          "eventType": {
                            "id": "843de949-7f50-442b-8709-d3153e5f1c70",
                            "name": "CLEARED_TRANSACTION",
                            "description": "A card transaction has cleared.",
                            "isPrivate": false,
                            "isActive": true,
                            "isIntrinsic": false,
                            "enhancers": [
                              "REFERRAL_DETAILS"
                            ]
                          },
                          "reactions": [
                            {
                              "type": "REWARD",
                              "reward": {
                                "id": "3de57c9e-a8a6-4457-a89c-349402c3b15d"
                              },
                              "autoRedeem": true,
                              "forFailure": null
                            },
                            {
                              "type": "HANDLER",
                              "handler": "REFERRAL_TRANCHE_STATUS",
                              "forFailure": null
                            }
                          ],
                          "effectivity": {
                            "start": "2026-09-01T00:00:00.000Z",
                            "end": "2026-11-30T23:59:59.000Z"
                          },
                          "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                          "ownerType": "CAMPAIGN_TRANCHE",
                          "enabled": true
                        },
                        "referrerEventReactorDetails": {
                          "id": "00e9bc1f-f349-4b25-8166-caf573acba39",
                          "name": "First qualifying purchase Referrer Rewarder",
                          "constraint": {
                            "type": "object",
                            "required": [
                              "trancheId",
                              "campaignId"
                            ],
                            "properties": {
                              "trancheId": {
                                "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                              },
                              "campaignId": {
                                "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                              }
                            }
                          },
                          "maxActivations": null,
                          "activationContext": "SUBJECT",
                          "isLocked": false,
                          "eventType": {
                            "id": "17874304-d5c2-4c9d-ae12-ffca892453f1",
                            "name": "REFERRAL_TRANCHE_ACTIVATION",
                            "description": "A referred user completed a referral tranche.",
                            "isPrivate": false,
                            "isActive": true,
                            "isIntrinsic": true
                          },
                          "reactions": [
                            {
                              "type": "POINTS",
                              "points": {
                                "operation": "SUM",
                                "arguments": [
                                  {
                                    "type": "NUMBER",
                                    "value": "500"
                                  }
                                ]
                              },
                              "forFailure": null
                            }
                          ],
                          "effectivity": {
                            "start": "2026-09-01T00:00:00.000Z",
                            "end": "2026-11-30T23:59:59.000Z"
                          },
                          "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                          "ownerType": "CAMPAIGN_TRANCHE",
                          "enabled": true
                        }
                      }
                    ]
                  }
                }
              }
            },
            "description": "The referral campaign with inflated tranche reactors."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No matching campaign exists for this tenant and UUID.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching Campaign",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Retrieve a referral campaign",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Returns one referral campaign and its tranches, scoped to the tenant identified by `X-Api-Key`.\n\nRequires the `read:referral_campaigns` permission. Event reactors whose effectivity has not ended are inflated into each tranche as `eventReactorDetails` for the referred user and, when configured, `referrerEventReactorDetails` for the referring user.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "CampaignController.update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of a referral campaign belonging to the tenant identified by `X-Api-Key`.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignPatch"
              },
              "example": {
                "name": "Refer a friend — Winter 2026",
                "isActive": false,
                "referralCodeType": "STATIC_USER_CODE",
                "linkConfig": {
                  "title": "Give a friend £10, get 500 points",
                  "description": "Invite a friend to join. They receive £10 after their first qualifying purchase and you receive 500 points.",
                  "imageUrl": "https://cdn.example.com/referrals/autumn-2026.png",
                  "desktopUrl": "https://www.example.com/join",
                  "androidUrl": "https://play.google.com/store/apps/details?id=com.example.app",
                  "iosUrl": "https://apps.apple.com/app/example/id123456789",
                  "androidUriScheme": "example://join",
                  "channel": "member-get-member",
                  "feature": "autumn-2026",
                  "tags": [
                    "referral",
                    "autumn-2026"
                  ]
                }
              }
            }
          },
          "description": "The campaign fields to replace.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2",
                    "createdAt": "2026-08-20T09:15:00.000Z",
                    "updatedAt": "2026-10-15T14:20:00.000Z",
                    "name": "Refer a friend — Winter 2026",
                    "linkConfig": {
                      "title": "Give a friend £10, get 500 points",
                      "description": "Invite a friend to join. They receive £10 after their first qualifying purchase and you receive 500 points.",
                      "imageUrl": "https://cdn.example.com/referrals/autumn-2026.png",
                      "desktopUrl": "https://www.example.com/join",
                      "androidUrl": "https://play.google.com/store/apps/details?id=com.example.app",
                      "iosUrl": "https://apps.apple.com/app/example/id123456789",
                      "androidUriScheme": "example://join",
                      "channel": "member-get-member",
                      "feature": "autumn-2026",
                      "tags": [
                        "referral",
                        "autumn-2026"
                      ]
                    },
                    "isActive": false,
                    "referralCodeType": "STATIC_USER_CODE",
                    "tranches": [
                      {
                        "id": "537ad8ed-d058-4c81-b434-24ea431f8429",
                        "createdAt": "2026-08-20T09:30:00.000Z",
                        "updatedAt": "2026-08-20T09:30:00.000Z",
                        "name": "First qualifying purchase",
                        "maxActivations": 1
                      }
                    ]
                  }
                }
              }
            },
            "description": "The updated referral campaign."
          },
          "400": {
            "description": "The patch contains an invalid field value.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid body, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "referralCodeType",
                        "children": [],
                        "constraints": {
                          "isEnum": "referralCodeType must be a valid enum value"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No matching campaign exists for this tenant and UUID.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching Campaign",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Update a referral campaign",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Partially updates a tenant-owned campaign. Requires the `update:referral_campaigns` permission.\n\nOnly `name`, `linkConfig`, `isActive`, and `referralCodeType` can be changed through this endpoint. `eligibleAudiences` and `tranches` are not patchable here. When `linkConfig` is supplied it replaces the stored object, so send the complete link configuration rather than only one nested field. Changing `referralCodeType` affects codes generated in the future; it does not rewrite codes already issued.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "CampaignController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of a referral campaign belonging to the tenant identified by `X-Api-Key`.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "deletedCampaignResult": {
                      "raw": [],
                      "affected": 1
                    },
                    "affectedTranches": 1
                  }
                }
              }
            },
            "description": "The campaign and the currently discoverable resources for its tranches were deleted."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No matching campaign exists for this tenant and UUID.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching Campaign",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Delete a referral campaign",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Deletes a tenant-owned campaign. Requires the `update:referral_campaigns` permission.\n\nFor each tranche, the service deletes the referred-user and referrer reactors returned by its current non-ended-reactor lookup, then deletes the campaign. Referral-code rows are retained with their campaign relationship cleared. The response contains the TypeORM delete result for the campaign and the number of tranche delete operations performed.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/referral_campaigns/{campaign_id}/referral_codes/": {
      "get": {
        "operationId": "ReferralCodeController.list",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral campaign. Referral-code lookups require the code, campaign, and tenant to match.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of referral codes to return.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of referral codes to skip before collecting the page.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "example": 0
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort direction: `ASC` or `DESC`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ],
              "default": "ASC"
            },
            "example": "DESC"
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Referral-code field to sort by, such as `createdAt` or `inviteCode`.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdAt"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Rison-encoded list filter. Campaign and tenant constraints are always applied in addition to this filter.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "inviteCode:(like:MAYA%)"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "a402bf91-8357-4e0d-80fe-450204391fb8",
                      "createdAt": "2026-08-01T09:00:00.000Z",
                      "updatedAt": "2026-08-10T13:05:00.000Z",
                      "inviteCode": "MAYA-8K4P",
                      "inviteLink": "https://join.example.com/r/MAYA-8K4P",
                      "referrer": {
                        "id": "5bb32fde-0f76-414e-8f0c-fd0788f4612e",
                        "createdAt": "2025-11-04T10:25:00.000Z",
                        "updatedAt": "2026-08-18T16:40:00.000Z",
                        "externalIdentifier": "crm-member-10482",
                        "accountNumber": 10482,
                        "isRestricted": false
                      },
                      "referrals": [
                        {
                          "id": "d71a0e6a-a85b-43d4-bc1b-d134014d3238",
                          "createdAt": "2026-08-04T12:20:00.000Z",
                          "updatedAt": "2026-08-10T13:05:00.000Z",
                          "sourceUserId": "share-session-7f93c1",
                          "ipAddress": "203.0.113.42",
                          "source": "EMAIL",
                          "userAgent": "WEB",
                          "clickCount": 2,
                          "registeredUser": {
                            "id": "6cc78c54-e233-47c7-9455-98e38d1d7de2",
                            "createdAt": "2026-08-10T13:05:00.000Z",
                            "updatedAt": "2026-08-10T13:05:00.000Z",
                            "externalIdentifier": "crm-member-12217",
                            "accountNumber": 12217,
                            "isRestricted": false
                          },
                          "referralTrancheStatuses": [
                            {
                              "trancheId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                              "activations": 1,
                              "isCompleted": true
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "description": "A tenant- and campaign-scoped page of referral codes.",
            "headers": {
              "Content-Range": {
                "description": "Pagination window and total count in `<resource> <first>-<last>/<total>` form.",
                "schema": {
                  "type": "string"
                },
                "example": "referral_code 0-0/1"
              }
            }
          },
          "400": {
            "description": "The list query could not be parsed or validated.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid query, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "limit",
                        "children": [],
                        "constraints": {
                          "max": "limit must not be greater than 1000"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "List referral codes for a campaign",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Returns a paginated page of referral codes for one campaign and tenant. Requires the `read:users` permission.\n\nEach code includes its referrer and referrals. The list query also loads each referral's registered user, when registration has been attributed to that referral. A referral's `referralTrancheStatuses` records progress through the campaign's tranches.\n\nThe `Content-Range` response header describes the returned window and total matching code count.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/referral_campaigns/{campaign_id}/referral_codes/{id}": {
      "get": {
        "operationId": "ReferralCodeController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral campaign. Referral-code lookups require the code, campaign, and tenant to match.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral code.",
            "example": "a402bf91-8357-4e0d-80fe-450204391fb8"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "a402bf91-8357-4e0d-80fe-450204391fb8",
                    "createdAt": "2026-08-01T09:00:00.000Z",
                    "updatedAt": "2026-08-10T13:05:00.000Z",
                    "inviteCode": "MAYA-8K4P",
                    "inviteLink": "https://join.example.com/r/MAYA-8K4P",
                    "referrer": {
                      "id": "5bb32fde-0f76-414e-8f0c-fd0788f4612e",
                      "createdAt": "2025-11-04T10:25:00.000Z",
                      "updatedAt": "2026-08-18T16:40:00.000Z",
                      "externalIdentifier": "crm-member-10482",
                      "accountNumber": 10482,
                      "isRestricted": false
                    },
                    "referrals": [
                      {
                        "id": "d71a0e6a-a85b-43d4-bc1b-d134014d3238",
                        "createdAt": "2026-08-04T12:20:00.000Z",
                        "updatedAt": "2026-08-10T13:05:00.000Z",
                        "sourceUserId": "share-session-7f93c1",
                        "ipAddress": "203.0.113.42",
                        "source": "EMAIL",
                        "userAgent": "WEB",
                        "clickCount": 2,
                        "registeredUser": {
                          "id": "6cc78c54-e233-47c7-9455-98e38d1d7de2",
                          "createdAt": "2026-08-10T13:05:00.000Z",
                          "updatedAt": "2026-08-10T13:05:00.000Z",
                          "externalIdentifier": "crm-member-12217",
                          "accountNumber": 12217,
                          "isRestricted": false
                        },
                        "referralTrancheStatuses": [
                          {
                            "trancheId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                            "activations": 1,
                            "isCompleted": true
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "description": "The referral code, referrer, and referral activity."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No referral code matches this UUID, campaign, and tenant combination.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching ReferralCode",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Retrieve a referral code",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Returns one referral code when its UUID, campaign UUID, and tenant all match. Requires the `read:users` permission.\n\nThe response includes the referrer and referrals. Registered users may be present on referrals that have converted.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "ReferralCodeController.update",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral campaign. Referral-code lookups require the code, campaign, and tenant to match.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral code.",
            "example": "a402bf91-8357-4e0d-80fe-450204391fb8"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralCodePatch"
              },
              "example": {
                "inviteCode": "MAYA-WINTER",
                "inviteLink": "https://join.example.com/r/MAYA-WINTER"
              }
            }
          },
          "description": "The invite-code fields to update.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "a402bf91-8357-4e0d-80fe-450204391fb8",
                    "createdAt": "2026-08-01T09:00:00.000Z",
                    "updatedAt": "2026-08-20T15:45:00.000Z",
                    "inviteCode": "MAYA-WINTER",
                    "inviteLink": "https://join.example.com/r/MAYA-WINTER"
                  }
                }
              }
            },
            "description": "The updated referral code."
          },
          "400": {
            "description": "The invite code or link failed validation.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid body, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "inviteCode",
                        "children": [],
                        "constraints": {
                          "isLength": "inviteCode must be longer than or equal to 1 characters"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No referral code matches this UUID, campaign, and tenant combination.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching ReferralCode",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Update a referral code",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Partially updates a referral code after matching its UUID, campaign, and tenant. Requires the `update:users` permission.\n\nOnly `inviteCode` and `inviteLink` are patchable. Send `inviteLink: null` to remove a stored link. This endpoint cannot change the referrer, campaign, referrals, or tranche progress. Invite codes remain unique within a tenant.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "ReferralCodeController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral campaign. Referral-code lookups require the code, campaign, and tenant to match.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral code.",
            "example": "a402bf91-8357-4e0d-80fe-450204391fb8"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "raw": [],
                    "affected": 1
                  }
                }
              }
            },
            "description": "The referral code was deleted."
          },
          "403": {
            "description": "The supplied `X-Api-Key` is missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Provided API key is invalid",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No referral code matches this UUID, campaign, and tenant combination.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching ReferralCode",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Delete a referral code",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Deletes a referral code after matching its UUID, campaign, and tenant. Referrals linked to the code are deleted by the database relationship.\n\nThis route resolves the tenant from `X-Api-Key` and enforces campaign/tenant ownership, but it does not apply an additional named permission decorator. The response is the TypeORM delete result.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/referral_campaigns/{campaign_id}/referral_codes/{id}/referral": {
      "post": {
        "operationId": "ReferralCodeController.createReferral",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral campaign. Referral-code lookups require the code, campaign, and tenant to match.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral code.",
            "example": "a402bf91-8357-4e0d-80fe-450204391fb8"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralDefinition"
              },
              "example": {
                "sourceUserId": "share-session-a882de",
                "source": "EMAIL",
                "clickCount": 1,
                "userAgent": "WEB",
                "ipAddress": "203.0.113.84"
              }
            }
          },
          "description": "The administrative referral activity to record.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "44c6c952-c945-4b21-a3be-4b9c23efbc37",
                    "createdAt": "2026-08-20T16:00:00.000Z",
                    "updatedAt": "2026-08-20T16:00:00.000Z",
                    "sourceUserId": "share-session-a882de",
                    "ipAddress": "203.0.113.84",
                    "source": "EMAIL",
                    "userAgent": "WEB",
                    "clickCount": 1,
                    "referralCode": {
                      "id": "a402bf91-8357-4e0d-80fe-450204391fb8",
                      "createdAt": "2026-08-01T09:00:00.000Z",
                      "updatedAt": "2026-08-10T13:05:00.000Z",
                      "inviteCode": "MAYA-8K4P",
                      "inviteLink": "https://join.example.com/r/MAYA-8K4P"
                    },
                    "referralTrancheStatuses": []
                  }
                }
              }
            },
            "description": "The referral was created."
          },
          "400": {
            "description": "The referral definition failed validation, for example because a source enum or click count is invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid body, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "source",
                        "children": [],
                        "constraints": {
                          "isEnum": "source must be a valid enum value"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No referral code matches this UUID, campaign, and tenant combination.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching ReferralCode",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Create a referral for a code",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Creates referral activity against an existing referral code for administrative use. Requires the `update:users` permission.\n\nThe code must match the route's campaign and the tenant identified by `X-Api-Key`. `sourceUserId` is the source-specific identifier used with `source` and the referral code to prevent duplicate activity. `registeredUser` and tranche status cannot be supplied here; a new referral starts with an empty `referralTrancheStatuses` array.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/referral_campaigns/{campaign_id}/tranches/": {
      "get": {
        "operationId": "TrancheController.list",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral campaign that contains the tranches.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of tranche records to query.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 10
            },
            "example": 20
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of tranche records to skip before collecting the page.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "example": 0
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort direction: `ASC` or `DESC`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ASC",
                "DESC"
              ],
              "default": "ASC"
            },
            "example": "ASC"
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Tranche field to sort by, such as `createdAt` or `name`.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "createdAt"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Rison-encoded list filter. Campaign and tenant constraints are always applied in addition to this filter.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "name:(like:First%)"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": [
                    {
                      "id": "537ad8ed-d058-4c81-b434-24ea431f8429",
                      "createdAt": "2026-08-20T09:30:00.000Z",
                      "updatedAt": "2026-08-20T09:30:00.000Z",
                      "name": "First qualifying purchase",
                      "maxActivations": 1,
                      "eventReactorDetails": {
                        "id": "94f7cc93-26e4-4527-92df-e23536303f08",
                        "createdAt": "2026-08-20T09:30:00.000Z",
                        "updatedAt": "2026-08-20T09:30:00.000Z",
                        "name": "First qualifying purchase",
                        "description": null,
                        "constraint": {
                          "type": "object",
                          "$schema": "http://json-schema.org/draft-06/schema#",
                          "required": [
                            "referralTrancheStatuses",
                            "campaignId",
                            "isCampaignActive",
                            "amount"
                          ],
                          "properties": {
                            "amount": {
                              "type": "number",
                              "minimum": 25
                            },
                            "referralTrancheStatuses": {
                              "type": "array",
                              "additionalItems": true,
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "required": [
                                      "trancheId",
                                      "isCompleted"
                                    ],
                                    "additionalProperties": true,
                                    "properties": {
                                      "trancheId": {
                                        "type": "string",
                                        "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                                      },
                                      "isCompleted": {
                                        "type": "boolean",
                                        "const": false
                                      }
                                    }
                                  },
                                  {
                                    "type": "object",
                                    "additionalProperties": true,
                                    "properties": {
                                      "trancheId": {
                                        "type": "string",
                                        "not": {
                                          "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                                        }
                                      },
                                      "isCompleted": {
                                        "type": "boolean"
                                      }
                                    }
                                  }
                                ]
                              }
                            },
                            "campaignId": {
                              "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                            },
                            "isCampaignActive": {
                              "const": true
                            }
                          }
                        },
                        "maxActivations": 1,
                        "activationContext": "SUBJECT",
                        "activationCalculationType": "LIFETIME",
                        "activationPeriod": null,
                        "isLocked": false,
                        "eventType": {
                          "id": "843de949-7f50-442b-8709-d3153e5f1c70",
                          "createdAt": "2026-07-10T08:00:00.000Z",
                          "updatedAt": "2026-08-20T10:00:00.000Z",
                          "name": "CLEARED_TRANSACTION",
                          "description": "A card transaction has cleared.",
                          "schema": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "number"
                              }
                            }
                          },
                          "isPrivate": false,
                          "isActive": true,
                          "isIntrinsic": false,
                          "enhancers": [
                            "REFERRAL_DETAILS"
                          ],
                          "omitFromUserActivity": false
                        },
                        "reactions": [
                          {
                            "type": "POINTS",
                            "points": {
                              "operation": "SUM",
                              "arguments": [
                                {
                                  "type": "NUMBER",
                                  "value": "250"
                                }
                              ]
                            },
                            "forFailure": null
                          },
                          {
                            "type": "HANDLER",
                            "handler": "REFERRAL_TRANCHE_STATUS",
                            "forFailure": null
                          }
                        ],
                        "effectivity": {
                          "start": "2026-08-20T09:30:00.000Z",
                          "end": null
                        },
                        "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                        "ownerType": "CAMPAIGN_TRANCHE",
                        "enabled": true
                      },
                      "referrerEventReactorDetails": {
                        "id": "00e9bc1f-f349-4b25-8166-caf573acba39",
                        "createdAt": "2026-08-20T09:30:00.000Z",
                        "updatedAt": "2026-08-20T09:30:00.000Z",
                        "name": "First qualifying purchase Referrer Rewarder",
                        "description": null,
                        "constraint": {
                          "type": "object",
                          "$schema": "http://json-schema.org/draft-06/schema#",
                          "required": [
                            "trancheId",
                            "campaignId"
                          ],
                          "properties": {
                            "trancheId": {
                              "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                            },
                            "campaignId": {
                              "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                            }
                          }
                        },
                        "maxActivations": null,
                        "activationContext": "SUBJECT",
                        "activationCalculationType": "LIFETIME",
                        "activationPeriod": null,
                        "isLocked": false,
                        "eventType": {
                          "id": "17874304-d5c2-4c9d-ae12-ffca892453f1",
                          "createdAt": "2024-01-10T08:00:00.000Z",
                          "updatedAt": "2024-01-10T08:00:00.000Z",
                          "name": "REFERRAL_TRANCHE_ACTIVATION",
                          "description": "A referred user completed a referral tranche.",
                          "schema": {
                            "type": "object",
                            "properties": {
                              "trancheId": {
                                "type": "string"
                              },
                              "campaignId": {
                                "type": "string"
                              },
                              "referredUser": {
                                "type": "string"
                              },
                              "referrerUser": {
                                "type": "string"
                              },
                              "isTrancheCompleted": {
                                "type": "boolean"
                              }
                            }
                          },
                          "isPrivate": false,
                          "isActive": true,
                          "isIntrinsic": true,
                          "omitFromUserActivity": false
                        },
                        "reactions": [
                          {
                            "type": "POINTS",
                            "points": {
                              "operation": "SUM",
                              "arguments": [
                                {
                                  "type": "NUMBER",
                                  "value": "500"
                                }
                              ]
                            },
                            "forFailure": null
                          }
                        ],
                        "effectivity": {
                          "start": "2026-08-20T09:30:00.000Z",
                          "end": null
                        },
                        "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                        "ownerType": "CAMPAIGN_TRANCHE",
                        "enabled": true
                      }
                    }
                  ]
                }
              }
            },
            "description": "The campaign tranches that currently have a non-ended referred-user reactor.",
            "headers": {
              "Content-Range": {
                "description": "Stored tranche window and total count in `<resource> <first>-<last>/<total>` form, before ended-reactor filtering.",
                "schema": {
                  "type": "string"
                },
                "example": "tranche 0-0/1"
              }
            }
          },
          "400": {
            "description": "The list query could not be parsed or validated.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid query, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "skip",
                        "children": [],
                        "constraints": {
                          "min": "skip must not be less than 0"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "List tranches for a referral campaign",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Returns tranches matching the route's campaign and the tenant identified by `X-Api-Key`. Requires the `read:referral_campaigns` permission.\n\nFor each tranche, the service loads event reactors whose effectivity has not ended. `eventReactorDetails` evaluates events for the referred user; optional `referrerEventReactorDetails` rewards the referrer after a tranche activation. Tranches whose referred-user reactor is missing or has ended are omitted from the response body.\n\nThe `Content-Range` total is calculated from stored tranches **before** that reactor-based filtering, so its count can be greater than the number of items in `data`.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "TrancheController.create",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the referral campaign that contains the tranches.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrancheDefinition"
              },
              "example": {
                "name": "First qualifying purchase",
                "eventType": {
                  "id": "843de949-7f50-442b-8709-d3153e5f1c70"
                },
                "constraint": {
                  "type": "object",
                  "$schema": "http://json-schema.org/draft-06/schema#",
                  "required": [
                    "amount"
                  ],
                  "properties": {
                    "amount": {
                      "type": "number",
                      "minimum": 25
                    }
                  }
                },
                "reactions": [
                  {
                    "type": "POINTS",
                    "points": {
                      "operation": "SUM",
                      "arguments": [
                        {
                          "type": "NUMBER",
                          "value": "250"
                        }
                      ]
                    }
                  }
                ],
                "maxActivations": 1,
                "referrerReactions": [
                  {
                    "type": "POINTS",
                    "points": {
                      "operation": "SUM",
                      "arguments": [
                        {
                          "type": "NUMBER",
                          "value": "500"
                        }
                      ]
                    }
                  }
                ]
              }
            }
          },
          "description": "Definition for the tranche and its event reactors.",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "537ad8ed-d058-4c81-b434-24ea431f8429",
                    "createdAt": "2026-08-20T09:30:00.000Z",
                    "updatedAt": "2026-08-20T09:30:00.000Z",
                    "name": "First qualifying purchase",
                    "maxActivations": 1,
                    "eventReactorDetails": {
                      "id": "94f7cc93-26e4-4527-92df-e23536303f08",
                      "createdAt": "2026-08-20T09:30:00.000Z",
                      "updatedAt": "2026-08-20T09:30:00.000Z",
                      "name": "First qualifying purchase",
                      "description": null,
                      "constraint": {
                        "type": "object",
                        "$schema": "http://json-schema.org/draft-06/schema#",
                        "required": [
                          "referralTrancheStatuses",
                          "campaignId",
                          "isCampaignActive",
                          "amount"
                        ],
                        "properties": {
                          "amount": {
                            "type": "number",
                            "minimum": 25
                          },
                          "referralTrancheStatuses": {
                            "type": "array",
                            "additionalItems": true,
                            "items": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "trancheId",
                                    "isCompleted"
                                  ],
                                  "additionalProperties": true,
                                  "properties": {
                                    "trancheId": {
                                      "type": "string",
                                      "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                                    },
                                    "isCompleted": {
                                      "type": "boolean",
                                      "const": false
                                    }
                                  }
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": true,
                                  "properties": {
                                    "trancheId": {
                                      "type": "string",
                                      "not": {
                                        "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                                      }
                                    },
                                    "isCompleted": {
                                      "type": "boolean"
                                    }
                                  }
                                }
                              ]
                            }
                          },
                          "campaignId": {
                            "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                          },
                          "isCampaignActive": {
                            "const": true
                          }
                        }
                      },
                      "maxActivations": 1,
                      "activationContext": "SUBJECT",
                      "activationCalculationType": "LIFETIME",
                      "activationPeriod": null,
                      "isLocked": false,
                      "eventType": {
                        "id": "843de949-7f50-442b-8709-d3153e5f1c70"
                      },
                      "reactions": [
                        {
                          "type": "POINTS",
                          "points": {
                            "operation": "SUM",
                            "arguments": [
                              {
                                "type": "NUMBER",
                                "value": "250"
                              }
                            ]
                          },
                          "forFailure": null
                        },
                        {
                          "type": "HANDLER",
                          "handler": "REFERRAL_TRANCHE_STATUS",
                          "forFailure": null
                        }
                      ],
                      "effectivity": {
                        "start": "2026-08-20T09:30:00.000Z",
                        "end": null
                      },
                      "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                      "ownerType": "CAMPAIGN_TRANCHE",
                      "enabled": true
                    },
                    "referrerEventReactorDetails": {
                      "id": "00e9bc1f-f349-4b25-8166-caf573acba39",
                      "createdAt": "2026-08-20T09:30:00.000Z",
                      "updatedAt": "2026-08-20T09:30:00.000Z",
                      "name": "First qualifying purchase Referrer Rewarder",
                      "description": null,
                      "constraint": {
                        "type": "object",
                        "$schema": "http://json-schema.org/draft-06/schema#",
                        "required": [
                          "trancheId",
                          "campaignId"
                        ],
                        "properties": {
                          "trancheId": {
                            "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                          },
                          "campaignId": {
                            "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                          }
                        }
                      },
                      "maxActivations": null,
                      "activationContext": "SUBJECT",
                      "activationCalculationType": "LIFETIME",
                      "activationPeriod": null,
                      "isLocked": false,
                      "eventType": {
                        "id": "17874304-d5c2-4c9d-ae12-ffca892453f1",
                        "createdAt": "2024-01-10T08:00:00.000Z",
                        "updatedAt": "2024-01-10T08:00:00.000Z",
                        "name": "REFERRAL_TRANCHE_ACTIVATION",
                        "description": "A referred user completed a referral tranche.",
                        "schema": {
                          "type": "object",
                          "properties": {
                            "trancheId": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "referredUser": {
                              "type": "string"
                            },
                            "referrerUser": {
                              "type": "string"
                            },
                            "isTrancheCompleted": {
                              "type": "boolean"
                            }
                          }
                        },
                        "isPrivate": false,
                        "isActive": true,
                        "isIntrinsic": true,
                        "omitFromUserActivity": false
                      },
                      "reactions": [
                        {
                          "type": "POINTS",
                          "points": {
                            "operation": "SUM",
                            "arguments": [
                              {
                                "type": "NUMBER",
                                "value": "500"
                              }
                            ]
                          },
                          "forFailure": null
                        }
                      ],
                      "effectivity": {
                        "start": "2026-08-20T09:30:00.000Z",
                        "end": null
                      },
                      "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                      "ownerType": "CAMPAIGN_TRANCHE",
                      "enabled": true
                    },
                    "campaign": {
                      "id": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2",
                      "createdAt": "2026-08-20T09:15:00.000Z",
                      "updatedAt": "2026-08-20T09:15:00.000Z",
                      "name": "Refer a friend — Autumn 2026",
                      "linkConfig": {
                        "title": "Give a friend £10, get 500 points",
                        "description": "Invite a friend to join.",
                        "desktopUrl": "https://www.example.com/join"
                      },
                      "isActive": true,
                      "referralCodeType": "CODE"
                    }
                  }
                }
              }
            },
            "description": "The tranche and its event reactors were created."
          },
          "400": {
            "description": "The definition failed validation, for example because the custom constraint is not a draft-06 object schema.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid body, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "constraint",
                        "children": [],
                        "constraints": {
                          "isJsonSchema": "schema is not supported or malformed"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "The campaign or event type could not be found.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching EventType",
                  "data": {}
                }
              }
            }
          },
          "500": {
            "description": "The current implementation reports an effectivity start more than 60 seconds in the past as a server error.",
            "content": {
              "application/json": {
                "example": {
                  "status": "error",
                  "code": 9999,
                  "message": "Effectivity start date can not be in the past",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Create a referral campaign tranche",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Creates a tranche and its event reactors. Requires the `update:referral_campaigns` permission for the tenant identified by `X-Api-Key`.\n\nThe current campaign and event-type lookups use their UUIDs directly and do not validate that those resources belong to the tenant identified by `X-Api-Key`. Callers must therefore supply a campaign and event type owned by that tenant. If the event type lacks the `REFERRAL_DETAILS` enhancer, this operation adds it.\n\nThe service creates a referred-user reactor from `eventType`, `constraint`, and `reactions`. A supplied constraint must be an object JSON Schema with `$schema` set to `http://json-schema.org/draft-06/schema#`. The service augments it with campaign and tranche-progress checks and appends an internal `REFERRAL_TRANCHE_STATUS` handler reaction.\n\nWhen `referrerReactions` is present, a second reactor listens for the intrinsic `REFERRAL_TRANCHE_ACTIVATION` event and rewards the referrer. Both reactors share the supplied effectivity. If effectivity is omitted it starts immediately with no end; an explicit start cannot be more than 60 seconds in the past. `maxActivations: null` means unlimited activations.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/referral_campaigns/{campaign_id}/tranches/{id}": {
      "get": {
        "operationId": "TrancheController.retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign UUID retained as route context. Item lookup is scoped by tranche UUID and the persisted campaign tenant; the current implementation does not compare this value with the tranche campaign.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the tranche.",
            "example": "537ad8ed-d058-4c81-b434-24ea431f8429"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "537ad8ed-d058-4c81-b434-24ea431f8429",
                    "createdAt": "2026-08-20T09:30:00.000Z",
                    "updatedAt": "2026-08-20T09:30:00.000Z",
                    "name": "First qualifying purchase",
                    "maxActivations": 1,
                    "eventReactorDetails": {
                      "id": "94f7cc93-26e4-4527-92df-e23536303f08",
                      "createdAt": "2026-08-20T09:30:00.000Z",
                      "updatedAt": "2026-08-20T09:30:00.000Z",
                      "name": "First qualifying purchase",
                      "description": null,
                      "constraint": {
                        "type": "object",
                        "$schema": "http://json-schema.org/draft-06/schema#",
                        "required": [
                          "referralTrancheStatuses",
                          "campaignId",
                          "isCampaignActive",
                          "amount"
                        ],
                        "properties": {
                          "amount": {
                            "type": "number",
                            "minimum": 25
                          },
                          "referralTrancheStatuses": {
                            "type": "array",
                            "additionalItems": true,
                            "items": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "trancheId",
                                    "isCompleted"
                                  ],
                                  "additionalProperties": true,
                                  "properties": {
                                    "trancheId": {
                                      "type": "string",
                                      "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                                    },
                                    "isCompleted": {
                                      "type": "boolean",
                                      "const": false
                                    }
                                  }
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": true,
                                  "properties": {
                                    "trancheId": {
                                      "type": "string",
                                      "not": {
                                        "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                                      }
                                    },
                                    "isCompleted": {
                                      "type": "boolean"
                                    }
                                  }
                                }
                              ]
                            }
                          },
                          "campaignId": {
                            "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                          },
                          "isCampaignActive": {
                            "const": true
                          }
                        }
                      },
                      "maxActivations": 1,
                      "activationContext": "SUBJECT",
                      "activationCalculationType": "LIFETIME",
                      "activationPeriod": null,
                      "isLocked": false,
                      "eventType": {
                        "id": "843de949-7f50-442b-8709-d3153e5f1c70",
                        "createdAt": "2026-07-10T08:00:00.000Z",
                        "updatedAt": "2026-08-20T10:00:00.000Z",
                        "name": "CLEARED_TRANSACTION",
                        "description": "A card transaction has cleared.",
                        "schema": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "number"
                            }
                          }
                        },
                        "isPrivate": false,
                        "isActive": true,
                        "isIntrinsic": false,
                        "enhancers": [
                          "REFERRAL_DETAILS"
                        ],
                        "omitFromUserActivity": false
                      },
                      "reactions": [
                        {
                          "type": "POINTS",
                          "points": {
                            "operation": "SUM",
                            "arguments": [
                              {
                                "type": "NUMBER",
                                "value": "250"
                              }
                            ]
                          },
                          "forFailure": null
                        },
                        {
                          "type": "HANDLER",
                          "handler": "REFERRAL_TRANCHE_STATUS",
                          "forFailure": null
                        }
                      ],
                      "effectivity": {
                        "start": "2026-08-20T09:30:00.000Z",
                        "end": null
                      },
                      "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                      "ownerType": "CAMPAIGN_TRANCHE",
                      "enabled": true
                    },
                    "referrerEventReactorDetails": {
                      "id": "00e9bc1f-f349-4b25-8166-caf573acba39",
                      "createdAt": "2026-08-20T09:30:00.000Z",
                      "updatedAt": "2026-08-20T09:30:00.000Z",
                      "name": "First qualifying purchase Referrer Rewarder",
                      "description": null,
                      "constraint": {
                        "type": "object",
                        "$schema": "http://json-schema.org/draft-06/schema#",
                        "required": [
                          "trancheId",
                          "campaignId"
                        ],
                        "properties": {
                          "trancheId": {
                            "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                          },
                          "campaignId": {
                            "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                          }
                        }
                      },
                      "maxActivations": null,
                      "activationContext": "SUBJECT",
                      "activationCalculationType": "LIFETIME",
                      "activationPeriod": null,
                      "isLocked": false,
                      "eventType": {
                        "id": "17874304-d5c2-4c9d-ae12-ffca892453f1",
                        "createdAt": "2024-01-10T08:00:00.000Z",
                        "updatedAt": "2024-01-10T08:00:00.000Z",
                        "name": "REFERRAL_TRANCHE_ACTIVATION",
                        "description": "A referred user completed a referral tranche.",
                        "schema": {
                          "type": "object",
                          "properties": {
                            "trancheId": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "referredUser": {
                              "type": "string"
                            },
                            "referrerUser": {
                              "type": "string"
                            },
                            "isTrancheCompleted": {
                              "type": "boolean"
                            }
                          }
                        },
                        "isPrivate": false,
                        "isActive": true,
                        "isIntrinsic": true,
                        "omitFromUserActivity": false
                      },
                      "reactions": [
                        {
                          "type": "POINTS",
                          "points": {
                            "operation": "SUM",
                            "arguments": [
                              {
                                "type": "NUMBER",
                                "value": "500"
                              }
                            ]
                          },
                          "forFailure": null
                        }
                      ],
                      "effectivity": {
                        "start": "2026-08-20T09:30:00.000Z",
                        "end": null
                      },
                      "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                      "ownerType": "CAMPAIGN_TRANCHE",
                      "enabled": true
                    },
                    "campaign": {
                      "id": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2",
                      "createdAt": "2026-08-20T09:15:00.000Z",
                      "updatedAt": "2026-08-20T09:15:00.000Z",
                      "name": "Refer a friend — Autumn 2026",
                      "linkConfig": {
                        "title": "Give a friend £10, get 500 points",
                        "description": "Invite a friend to join.",
                        "desktopUrl": "https://www.example.com/join"
                      },
                      "isActive": true,
                      "referralCodeType": "CODE"
                    }
                  }
                }
              }
            },
            "description": "The tranche with available event-reactor details."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No matching tranche exists for the tenant and UUID.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching Tranche",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Retrieve a referral campaign tranche",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Returns a tranche and inflates referred-user and referrer event reactors whose effectivity has not ended. Requires the `read:referral_campaigns` permission.\n\nTenant ownership is checked through the tranche's persisted campaign. The `campaign_id` segment is route context; the current item lookup does not compare it with the tranche's campaign ID. An ended reactor is not inflated, but unlike the list endpoint the tranche itself is still returned.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "TrancheController.update",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign UUID retained as route context. Item lookup is scoped by tranche UUID and the persisted campaign tenant; the current implementation does not compare this value with the tranche campaign.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the tranche.",
            "example": "537ad8ed-d058-4c81-b434-24ea431f8429"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranchePatch"
              },
              "examples": {
                "changeRewards": {
                  "summary": "Change both reward sets",
                  "value": {
                    "name": "First 25 GBP purchase",
                    "maxActivations": 1,
                    "reactions": [
                      {
                        "type": "POINTS",
                        "points": {
                          "operation": "SUM",
                          "arguments": [
                            {
                              "type": "NUMBER",
                              "value": "300"
                            }
                          ]
                        }
                      }
                    ],
                    "referrerReactions": [
                      {
                        "type": "POINTS",
                        "points": {
                          "operation": "SUM",
                          "arguments": [
                            {
                              "type": "NUMBER",
                              "value": "600"
                            }
                          ]
                        }
                      }
                    ]
                  }
                },
                "removeReferrerReward": {
                  "summary": "Stop rewarding the referrer for this tranche",
                  "value": {
                    "deleteReferrerReactions": true
                  }
                }
              }
            }
          },
          "description": "The tranche and reactor fields to update.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "id": "537ad8ed-d058-4c81-b434-24ea431f8429",
                    "createdAt": "2026-08-20T09:30:00.000Z",
                    "updatedAt": "2026-10-15T14:20:00.000Z",
                    "name": "First 25 GBP purchase",
                    "maxActivations": 1,
                    "eventReactorDetails": {
                      "id": "94f7cc93-26e4-4527-92df-e23536303f08",
                      "createdAt": "2026-08-20T09:30:00.000Z",
                      "updatedAt": "2026-10-15T14:20:00.000Z",
                      "name": "First 25 GBP purchase",
                      "description": null,
                      "constraint": {
                        "type": "object",
                        "$schema": "http://json-schema.org/draft-06/schema#",
                        "required": [
                          "referralTrancheStatuses",
                          "campaignId",
                          "isCampaignActive",
                          "amount"
                        ],
                        "properties": {
                          "amount": {
                            "type": "number",
                            "minimum": 25
                          },
                          "referralTrancheStatuses": {
                            "type": "array",
                            "additionalItems": true,
                            "items": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "trancheId",
                                    "isCompleted"
                                  ],
                                  "additionalProperties": true,
                                  "properties": {
                                    "trancheId": {
                                      "type": "string",
                                      "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                                    },
                                    "isCompleted": {
                                      "type": "boolean",
                                      "const": false
                                    }
                                  }
                                },
                                {
                                  "type": "object",
                                  "additionalProperties": true,
                                  "properties": {
                                    "trancheId": {
                                      "type": "string",
                                      "not": {
                                        "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                                      }
                                    },
                                    "isCompleted": {
                                      "type": "boolean"
                                    }
                                  }
                                }
                              ]
                            }
                          },
                          "campaignId": {
                            "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                          },
                          "isCampaignActive": {
                            "const": true
                          }
                        }
                      },
                      "maxActivations": 1,
                      "activationContext": "SUBJECT",
                      "activationCalculationType": "LIFETIME",
                      "activationPeriod": null,
                      "isLocked": false,
                      "eventType": {
                        "id": "843de949-7f50-442b-8709-d3153e5f1c70",
                        "createdAt": "2026-07-10T08:00:00.000Z",
                        "updatedAt": "2026-08-20T10:00:00.000Z",
                        "name": "CLEARED_TRANSACTION",
                        "description": "A card transaction has cleared.",
                        "schema": {
                          "type": "object",
                          "properties": {
                            "amount": {
                              "type": "number"
                            }
                          }
                        },
                        "isPrivate": false,
                        "isActive": true,
                        "isIntrinsic": false,
                        "enhancers": [
                          "REFERRAL_DETAILS"
                        ],
                        "omitFromUserActivity": false
                      },
                      "reactions": [
                        {
                          "type": "POINTS",
                          "points": {
                            "operation": "SUM",
                            "arguments": [
                              {
                                "type": "NUMBER",
                                "value": "300"
                              }
                            ]
                          },
                          "forFailure": null
                        },
                        {
                          "type": "HANDLER",
                          "handler": "REFERRAL_TRANCHE_STATUS",
                          "forFailure": null
                        }
                      ],
                      "effectivity": {
                        "start": "2026-08-20T09:30:00.000Z",
                        "end": null
                      },
                      "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                      "ownerType": "CAMPAIGN_TRANCHE",
                      "enabled": true
                    },
                    "referrerEventReactorDetails": {
                      "id": "00e9bc1f-f349-4b25-8166-caf573acba39",
                      "createdAt": "2026-08-20T09:30:00.000Z",
                      "updatedAt": "2026-10-15T14:20:00.000Z",
                      "name": "First 25 GBP purchase Referrer Rewarder",
                      "description": null,
                      "constraint": {
                        "type": "object",
                        "$schema": "http://json-schema.org/draft-06/schema#",
                        "required": [
                          "trancheId",
                          "campaignId"
                        ],
                        "properties": {
                          "trancheId": {
                            "const": "537ad8ed-d058-4c81-b434-24ea431f8429"
                          },
                          "campaignId": {
                            "const": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
                          }
                        }
                      },
                      "maxActivations": null,
                      "activationContext": "SUBJECT",
                      "activationCalculationType": "LIFETIME",
                      "activationPeriod": null,
                      "isLocked": false,
                      "eventType": {
                        "id": "17874304-d5c2-4c9d-ae12-ffca892453f1",
                        "createdAt": "2024-01-10T08:00:00.000Z",
                        "updatedAt": "2024-01-10T08:00:00.000Z",
                        "name": "REFERRAL_TRANCHE_ACTIVATION",
                        "description": "A referred user completed a referral tranche.",
                        "schema": {
                          "type": "object",
                          "properties": {
                            "trancheId": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "referredUser": {
                              "type": "string"
                            },
                            "referrerUser": {
                              "type": "string"
                            },
                            "isTrancheCompleted": {
                              "type": "boolean"
                            }
                          }
                        },
                        "isPrivate": false,
                        "isActive": true,
                        "isIntrinsic": true,
                        "omitFromUserActivity": false
                      },
                      "reactions": [
                        {
                          "type": "POINTS",
                          "points": {
                            "operation": "SUM",
                            "arguments": [
                              {
                                "type": "NUMBER",
                                "value": "600"
                              }
                            ]
                          },
                          "forFailure": null
                        }
                      ],
                      "effectivity": {
                        "start": "2026-08-20T09:30:00.000Z",
                        "end": null
                      },
                      "ownerId": "537ad8ed-d058-4c81-b434-24ea431f8429",
                      "ownerType": "CAMPAIGN_TRANCHE",
                      "enabled": true
                    },
                    "campaign": {
                      "id": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2",
                      "createdAt": "2026-08-20T09:15:00.000Z",
                      "updatedAt": "2026-08-20T09:15:00.000Z",
                      "name": "Refer a friend — Autumn 2026",
                      "linkConfig": {
                        "title": "Give a friend £10, get 500 points",
                        "description": "Invite a friend to join.",
                        "desktopUrl": "https://www.example.com/join"
                      },
                      "isActive": true,
                      "referralCodeType": "CODE"
                    }
                  }
                }
              }
            },
            "description": "The updated tranche and its current reactors."
          },
          "400": {
            "description": "The patch failed validation.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Invalid body, check 'errors' property for more info.",
                  "data": {
                    "name": "ValidationError",
                    "errors": [
                      {
                        "property": "name",
                        "children": [],
                        "constraints": {
                          "isAscii": "name must contain only ASCII characters"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No matching tranche exists for the tenant and UUID.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching Tranche",
                  "data": {}
                }
              }
            }
          },
          "500": {
            "description": "Malformed effectivity ranges currently surface as server errors rather than validation errors.",
            "content": {
              "application/json": {
                "examples": {
                  "missingStart": {
                    "summary": "An effectivity object has no start date",
                    "value": {
                      "status": "error",
                      "code": 9999,
                      "message": "Start date is required.",
                      "data": {}
                    }
                  },
                  "endBeforeStart": {
                    "summary": "The end precedes the start",
                    "value": {
                      "status": "error",
                      "code": 9999,
                      "message": "End date should always be greater than start date.",
                      "data": {}
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Update a referral campaign tranche",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Partially updates a tenant-owned tranche and its reactors. Requires the `update:referral_campaigns` permission.\n\nPatchable fields are `name`, `constraint`, `maxActivations`, `reactions`, `effectivity`, `referrerReactions`, and `deleteReferrerReactions`. The campaign and referred-user `eventType` cannot be changed. Supplied `reactions` replace the referred-user reactor's reaction set and the service appends the required tranche-status handler if absent.\n\nWhen `effectivity` is supplied, both `start` and `end` are required; set `end` to `null` for no end. If the current reactor has already started, the supplied `start` is ignored and the original start is retained, while `end` is still applied. Future reactors can receive a new start and end. Use `referrerReactions` to add or replace the referrer reward reactions, or `deleteReferrerReactions: true` to remove that reactor.\n\nTenant ownership is checked through the tranche's persisted campaign. The route's `campaign_id` is not compared with that campaign ID.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "TrancheController.delete",
        "parameters": [
          {
            "in": "path",
            "name": "campaign_id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign UUID retained as route context. Item lookup is scoped by tranche UUID and the persisted campaign tenant; the current implementation does not compare this value with the tranche campaign.",
            "example": "2f6b3e40-8f21-4a5c-bc35-b7df390d9fc2"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID of the tranche.",
            "example": "537ad8ed-d058-4c81-b434-24ea431f8429"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "status": "success",
                  "data": {
                    "raw": [],
                    "affected": 1
                  }
                }
              }
            },
            "description": "The tranche and its currently discoverable event reactors were deleted."
          },
          "401": {
            "description": "Authentication credentials are missing or invalid.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Authorization is required",
                  "data": {}
                }
              }
            }
          },
          "403": {
            "description": "The authenticated identity lacks the required permission.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Forbidden",
                  "data": {}
                }
              }
            }
          },
          "404": {
            "description": "No matching tranche exists for the tenant and UUID.",
            "content": {
              "application/json": {
                "example": {
                  "status": "fail",
                  "code": 9999,
                  "message": "Failed to find a matching Tranche",
                  "data": {}
                }
              }
            }
          }
        },
        "summary": "Delete a referral campaign tranche",
        "tags": [
          "Referral campaigns"
        ],
        "description": "Deletes a tenant-owned tranche after deleting the referred-user and optional referrer reactors returned by the current non-ended-reactor lookup. Ended reactor records are not returned by that lookup. Requires the `update:referral_campaigns` permission.\n\nTenant ownership is checked through the tranche's persisted campaign. The route's `campaign_id` is not compared with that campaign ID. The response is the TypeORM delete result for the tranche.",
        "security": [
          {
            "apiKeyAuth": [],
            "bearerAuth": []
          }
        ]
      }
    },
    "/simplifi/users/me": {
      "get": {
        "operationId": "SimplifiController.getUserDetails",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get user details",
        "tags": [
          "Simplifi"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/simplifi/cards/load": {
      "post": {
        "operationId": "SimplifiController.loadCard",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimplifiLoadDefinition"
              }
            }
          },
          "description": "SimplifiLoadDefinition",
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Load card",
        "tags": [
          "Simplifi"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/simplifi/config": {
      "get": {
        "operationId": "SimplifiController.getIntegrationConfig",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Get integration config",
        "tags": [
          "Simplifi"
        ],
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/simplifi/{integrationId}/cards/transaction/webhook": {
      "post": {
        "operationId": "SimplifiController.handleCardTransactionWebhook",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Handle card transaction webhook",
        "tags": [
          "Simplifi"
        ]
      }
    },
    "/simplifi/{integrationId}/cards/load/webhook": {
      "post": {
        "operationId": "SimplifiController.handleLoadCardFlowWebhook",
        "parameters": [
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "description": "",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "Successful response"
          }
        },
        "summary": "Handle load card flow webhook",
        "tags": [
          "Simplifi"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "Campaigns",
      "x-page-title": "Campaigns",
      "x-page-icon": "bullseye",
      "x-page-description": "Build earning experiences from campaigns, missions, events, and rewards.",
      "description": "Campaigns define how members earn through a time-bound experience.\n\nUse a **goal-based** campaign for visible, progress-based missions such as “make three purchases”. Use a **rule-based** campaign when an event should trigger reactions without exposing goal progress.\n\nCampaigns follow the lifecycle `DRAFT → ACTIVE → PAUSED or ENDED → ARCHIVED`. Configure missions while the campaign is in draft, then use the status endpoint to move it through that lifecycle."
    },
    {
      "name": "Referral campaigns",
      "x-page-title": "Referral campaigns",
      "x-page-icon": "user-plus",
      "x-page-description": "Create member referral programs, invitation codes, and milestone rewards.",
      "description": "Referral campaigns configure member-get-member journeys.\n\nThe campaign controls invitation-link presentation, code generation, audience eligibility, and whether referrals are active. **Referral codes** identify the referring member, while **tranches** define the milestones and reactions that reward referred members and, optionally, their referrers.\n\nReferral campaigns are distinct from the earning campaigns exposed at `/campaigns`."
    }
  ]
}
