{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paytrail/json-schema/paytrail-payment-report-request-schema.json",
  "title": "PaymentReportRequest",
  "description": "Payment report request",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paytrail-openapi.yml#/components/schemas/PaymentReportRequest",
  "type": "object",
  "required": [
    "requestType",
    "callbackUrl"
  ],
  "properties": {
    "requestType": {
      "type": "string",
      "description": "In which format is the report delivered in",
      "enum": [
        "json",
        "csv"
      ]
    },
    "callbackUrl": {
      "type": "string",
      "format": "url",
      "description": "To which URL is the report delivered to. Callback URLs must use HTTPS"
    },
    "paymentStatus": {
      "type": "string",
      "description": "How are the payments statuses filtered. \"Default\" includes both paid and settled payments. \"Paid\" includes paid payments that have not been settled yet. \"All\" includes everything, for example unpaid or failed payments.",
      "enum": [
        "default",
        "all",
        "paid",
        "settled"
      ],
      "default": "default"
    },
    "startDate": {
      "type": "string",
      "format": "datetime",
      "description": "Filter out payments created before given datetime."
    },
    "endDate": {
      "type": "string",
      "format": "datetime",
      "description": "Filter out payments created after given datetime."
    },
    "limit": {
      "type": "integer",
      "description": "Limit the amount of payments included in the report.",
      "maximum": 50000,
      "default": 50000
    },
    "reportFields": {
      "type": "array",
      "description": "Limit the amount of fields included in the report. By default all fields are included.",
      "items": {
        "type": "string",
        "enum": [
          "entryDate",
          "created",
          "amount",
          "status",
          "firstname",
          "familyname",
          "description",
          "reference",
          "paymentMethod",
          "stamp",
          "address",
          "postcode",
          "postoffice",
          "country",
          "checkoutReference",
          "archiveNumber",
          "payerName",
          "settlementId",
          "settlementDate",
          "originalTradeReference",
          "vatPercentage",
          "vatAmount",
          "paymentMethodFee",
          "paymentMethodCommission",
          "shopInShopCommission",
          "shopInShopCommissionVatPercentage",
          "shopInShopCommissionVatAmount",
          "settlementReference",
          "transactionId",
          "settlementDueDate",
          "companyName",
          "vatId",
          "refunditems",
          "tradeitems"
        ]
      }
    },
    "submerchant": {
      "type": "integer",
      "description": "Get submerchant's payment report"
    },
    "includeItems": {
      "type": "boolean",
      "description": "Include trade items in created payment report"
    }
  }
}