{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/print-one/json-schema/print-one-get-campaign-response-dto-schema.json",
  "title": "GetCampaignResponseDto",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/print-one-openapi.json#/components/schemas/GetCampaignResponseDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The ID of the campaign"
    },
    "identifier": {
      "type": "string",
      "description": "Custom ID for the campaign"
    },
    "name": {
      "type": "string",
      "description": "The name of the campaign"
    },
    "description": {
      "type": [
        "object",
        "null"
      ],
      "description": "The description of the campaign"
    },
    "mergeVariables": {
      "description": "The list of merge variables for the campaign",
      "nullable": false,
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "scheduleType": {
      "type": "string",
      "enum": [
        "continuous",
        "one-off"
      ],
      "description": "The type of schedule for the campaign"
    },
    "companyId": {
      "type": "string",
      "description": "The ID of the company by whom the campaign was created"
    },
    "stampId": {
      "type": [
        "object",
        "null"
      ],
      "description": "The default postal stamp for the campaign"
    },
    "sender": {
      "description": "The default return address for the campaign",
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/$defs/AddressDto"
        }
      ]
    },
    "billingId": {
      "type": [
        "object",
        "null"
      ],
      "description": "The billing ID used for the campaign"
    },
    "status": {
      "type": "string",
      "enum": [
        "created",
        "running",
        "paused",
        "completed",
        "archived"
      ],
      "description": "The status of the campaign"
    },
    "npdrCategory": {
      "type": "string",
      "enum": [
        "none",
        "all",
        "energy",
        "financial",
        "healthcare",
        "charity",
        "lotteries",
        "media",
        "telecom",
        "transport",
        "leisure",
        "webshops"
      ],
      "description": "The Postfilter.nl category for the campaign (requires FeatureFlag)"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string",
      "description": "The date at which the campaign was created"
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string",
      "description": "The date at which the campaign was last updated"
    },
    "archivedAt": {
      "type": [
        "object",
        "null"
      ],
      "description": "The date at which the campaign was archived"
    },
    "destinations": {
      "description": "List of destinations for the campaign",
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/ContinuousCampaignDestinationDto"
          },
          {
            "$ref": "#/$defs/OneOffCampaignDestinationDto"
          }
        ]
      }
    }
  },
  "required": [
    "id",
    "identifier",
    "name",
    "description",
    "mergeVariables",
    "scheduleType",
    "companyId",
    "stampId",
    "sender",
    "billingId",
    "status",
    "createdAt",
    "updatedAt",
    "archivedAt",
    "destinations"
  ],
  "$defs": {
    "AddressDto": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "addressLine2": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "country": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "address",
        "postalCode",
        "city",
        "country"
      ]
    },
    "ContinuousCampaignDestinationDto": {
      "type": "object",
      "properties": {
        "destination": {
          "type": "array",
          "description": "Destination for the campaign",
          "items": {
            "type": "string",
            "enum": [
              "NETHERLANDS",
              "GERMANY",
              "INTERNATIONAL"
            ]
          }
        },
        "threshold": {
          "type": "number",
          "description": "The threshold for the destination, which determines the minimum number of orders required to trigger the delivery",
          "minimum": 1
        },
        "product": {
          "type": "string",
          "enum": [
            "POSTCARD_A5",
            "POSTCARD_A6",
            "POSTCARD_SQ15",
            "POSTCARD_MAXI",
            "POSTCARD_DIN_LONG",
            "GREETINGCARD_SQ14",
            "LETTER_A4",
            "SELFMAILER_MAXI"
          ],
          "description": "The product used for this destination"
        },
        "finish": {
          "type": "string",
          "enum": [
            "GLOSSY",
            "MATTE"
          ],
          "description": "The finish type for the product used in this destination"
        },
        "designId": {
          "type": "string",
          "description": "The ID of an existing design used for this destination"
        },
        "variablesFallback": {
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "description": "Optional personalization data (can be an empty object)"
        },
        "enabled": {
          "type": "boolean",
          "description": "Wether the destination is enabled or not"
        },
        "lockedAt": {
          "type": [
            "object",
            "null"
          ],
          "description": "The date at which the destination was locked"
        },
        "nextSendDate": {
          "type": "date",
          "description": "The ISO date of the next shipment day"
        }
      },
      "required": [
        "destination",
        "threshold",
        "product",
        "finish",
        "nextSendDate"
      ]
    },
    "OneOffCampaignDestinationDto": {
      "type": "object",
      "properties": {
        "destination": {
          "type": "array",
          "description": "Destination for the campaign",
          "items": {
            "type": "string",
            "enum": [
              "NETHERLANDS",
              "GERMANY",
              "INTERNATIONAL"
            ]
          }
        },
        "threshold": {
          "type": "number",
          "description": "The threshold for the destination, which determines the minimum number of orders required to trigger the delivery",
          "minimum": 1
        },
        "product": {
          "type": "string",
          "enum": [
            "POSTCARD_A5",
            "POSTCARD_A6",
            "POSTCARD_SQ15",
            "POSTCARD_MAXI",
            "POSTCARD_DIN_LONG",
            "GREETINGCARD_SQ14",
            "LETTER_A4",
            "SELFMAILER_MAXI"
          ],
          "description": "The product used for this destination"
        },
        "finish": {
          "type": "string",
          "enum": [
            "GLOSSY",
            "MATTE"
          ],
          "description": "The finish type for the product used in this destination"
        },
        "designId": {
          "type": "string",
          "description": "The ID of an existing design used for this destination"
        },
        "variablesFallback": {
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "description": "Optional personalization data (can be an empty object)"
        },
        "enabled": {
          "type": "boolean",
          "description": "Wether the destination is enabled or not"
        },
        "lockedAt": {
          "type": [
            "object",
            "null"
          ],
          "description": "The date at which the destination was locked"
        },
        "deliveryWeekIso": {
          "type": "number",
          "description": "The ISO week number for the delivery of the destination"
        },
        "deliveryWeekYear": {
          "type": "number",
          "description": "The ISO year number for the delivery of the destination"
        },
        "asapFallback": {
          "type": "boolean",
          "description": "Wether the campaign should fall back to ASAP delivery if economy threshold is not met"
        }
      },
      "required": [
        "destination",
        "threshold",
        "product",
        "finish",
        "deliveryWeekIso",
        "deliveryWeekYear"
      ]
    }
  }
}