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