{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "array",
    "minItems": 0,
    "_uniqueItems": true,
    "items": {
        "type": "object",
        "properties": {
            "hmrcTransactionID": {
                "$ref": "#/definitions/IDType"
            },
            "accountID": {
                "$ref": "#/definitions/IDType"
            },
            "paymentReference": {
                "$ref": "#/definitions/IDType"
            },
            "transactionType": {
                "$ref": "#/definitions/transactionTypeType"
            },
            "transactionTimestamp": {
                "$ref": "#/definitions/ISO8601-Timestamp"
            },
            "LISAManagerReferenceNumber": {
                "$ref": "#/definitions/LISAManagerReferenceNumberType"
            },
            "amount": {
                "type": "number"
            },
            "paymentForTransaction": {
                "$ref": "#/definitions/IDType"
            },
            "applicablePeriod": {
                "type": "object",
                "properties": {
                    "startDate": {
                        "$ref": "#/definitions/ISO8601-Date"
                    },
                    "endDate": {
                        "$ref": "#/definitions/ISO8601-Date"
                    }
                }
            },
            "_links": {
                "type": "object"
            }
        },
        "required": [
            "hmrcTransactionID",
            "accountID",
            "LISAManagerReferenceNumber",
            "paymentReference",
            "amount",
            "paymentForTransaction",
            "transactionType",
            "applicablePeriod"
        ],
        "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}$"
        },
        "transactionTypeType": {
            "type": "string",
            "enum": [
                "bonus",
                "charge"
            ]
        }
    }
}