{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "array",
    "minItems": 0,
    "_uniqueItems": true,
    "items": {
        "type": "object",
        "properties": {
            "LISAManagerReferenceNumber": {
                "$ref": "#/definitions/LISAManagerReferenceNumberType"
            },
            "paymentReference": {
                "$ref": "#/definitions/IDType"
            },
            "method": {
                "$ref": "#/definitions/paymentMethodType"
            },
            "direction": {
                "$ref": "#/definitions/paymentDirectionType"
            },
            "paymentDate": {
                "$ref": "#/definitions/ISO8601-Date"
            },
            "amount": {
                "type": "number"
            },
            "status": {
                "$ref": "#/definitions/paymentStatusType"
            },
            "financialPeriod": {
                "$ref": "#/definitions/financialPeriodType"
            },
            "_links": {
                "type": "object"
            }
        },
        "required": [
            "LISAManagerReferenceNumber",
            "paymentReference",
            "method",
            "direction",
            "paymentDate",
            "amount",
            "financialPeriod"
        ],
        "additionalProperties": false
    },
    "definitions": {
        "ISO8601-Date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "ISO8601-Timestamp": {
            "type": "string",
            "pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(([+-]\\d{2}(:\\d{2})?)|Z)"
        },
        "financialPeriodType": {
            "type": "object",
            "properties": {
                "startDate": {
                    "$ref": "#/definitions/ISO8601-Date"
                },
                "endDate": {
                    "$ref": "#/definitions/ISO8601-Date"
                }
            }
        },
        "IDType": {
            "type": "string",
            "pattern": "^\\d{10}$"
        },
        "LISAManagerReferenceNumberType": {
            "type": "string",
            "pattern": "^Z\\d{6}$"
        },
        "paymentMethodType": {
            "type": "string",
            "enum": [
                "directDebit",
                "BACS"
            ]
        },
        "paymentDirectionType": {
            "type": "string",
            "enum": [
                "credit",
                "debit"
            ]
        },
        "paymentStatusType": {
            "type": "string",
            "enum": [
                "pending",
                "submitted",
                "completed"
            ]
        }
    }
}