{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/good-grants/json-schema/good-grants-allocation-payment-list-schema.json",
  "title": "AllocationPaymentList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/good-grants-allocation-payments-api-openapi.yml#/components/schemas/AllocationPaymentList",
  "allOf": [
    {
      "$ref": "#/$defs/Pagination"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AllocationPaymentSummary"
          }
        }
      }
    }
  ],
  "$defs": {
    "AllocationPaymentSummary": {
      "type": "object",
      "description": "Core allocation payment fields shared by the list and single-payment responses.",
      "properties": {
        "allocation": {
          "type": "object",
          "description": "Allocation the payment is drawn against.",
          "properties": {
            "slug": {
              "type": "string",
              "description": "URL-safe identifier of the allocation."
            },
            "link": {
              "type": "string",
              "format": "uri",
              "description": "Canonical URL of the allocation resource."
            }
          }
        },
        "amount": {
          "type": "number",
          "description": "Amount of the payment, in the fund's currency."
        },
        "comments": {
          "type": "string",
          "description": "Comment log attached to the payment, formatted as newline-joined `author (timestamp): body` entries, empty when there are none."
        },
        "created": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time when the payment was created."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 currency code of the payment's amounts, drawn from the fund's currency."
        },
        "date_due": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time when the payment is due, `null` if not set."
        },
        "date_paid": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time when the payment was made, `null` if not yet paid."
        },
        "external_id": {
          "type": "string",
          "description": "External identifier of the payment, used to reconcile with downstream systems, empty when none is set."
        },
        "grant_status": {
          "type": [
            "object",
            "null"
          ],
          "description": "Grant status of the application, `null` when there is none.",
          "properties": {
            "slug": {
              "type": "string",
              "description": "URL-safe identifier of the grant status."
            },
            "link": {
              "type": "string",
              "format": "uri",
              "description": "Canonical URL of the grant status resource."
            },
            "name": {
              "type": "object",
              "description": "Name of the grant status.",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        },
        "payment_method": {
          "type": [
            "object",
            "null"
          ],
          "description": "Payment method recorded against the payment, `null` when none is set.",
          "properties": {
            "slug": {
              "type": "string",
              "description": "URL-safe identifier of the payment method."
            },
            "link": {
              "type": "string",
              "format": "uri",
              "description": "Canonical URL of the payment method resource."
            },
            "name": {
              "type": "object",
              "description": "Name of the payment method.",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        },
        "reference": {
          "type": "string",
          "description": "Free-text reference for the payment, empty when none is set."
        },
        "season": {
          "type": "object",
          "description": "Season the payment belongs to.",
          "properties": {
            "slug": {
              "type": "string",
              "description": "URL-safe identifier of the season."
            },
            "link": {
              "type": "string",
              "format": "uri",
              "description": "Canonical URL of the season resource."
            },
            "name": {
              "type": "object",
              "description": "Name of the season.",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        },
        "slug": {
          "type": "string",
          "description": "URL-safe identifier of the payment."
        },
        "status": {
          "type": "string",
          "description": "Lifecycle status of the payment, returned as a localised label such as `Scheduled`, `Processing`, `Paid`, `Failed`, or `Failed permanently`."
        },
        "updated": {
          "type": "string",
          "format": "date-time",
          "description": "Date and time when the payment was last updated."
        }
      }
    },
    "Pagination": {
      "type": "object",
      "title": "Pagination",
      "properties": {
        "current_page": {
          "type": "integer",
          "description": "Number of the page returned by this response, starting at `1`."
        },
        "first_page_url": {
          "type": "string",
          "description": "URL of the first page in the result set, relative when the requested page is beyond the last page."
        },
        "from": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Position of the first record on this page within the full result set, starting at `1`, or `null` when the requested page is beyond the last page."
        },
        "last_page": {
          "type": "integer",
          "description": "Total number of pages."
        },
        "last_page_url": {
          "type": "string",
          "description": "URL of the last page in the result set, relative when the requested page is beyond the last page."
        },
        "next_page_url": {
          "type": "string",
          "description": "URL of the next page in the result set, empty when the current page is the last page."
        },
        "path": {
          "type": "string",
          "description": "Canonical URL of the endpoint, without query parameters."
        },
        "per_page": {
          "type": "integer",
          "default": 10,
          "description": "Maximum number of records returned per page."
        },
        "prev_page_url": {
          "type": "string",
          "description": "URL of the previous page in the result set, empty when the current page is the first page."
        },
        "to": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Position of the last record on this page within the full result set, or `null` when the requested page is beyond the last page."
        },
        "total": {
          "type": "integer",
          "description": "Total number of records across all pages."
        }
      }
    }
  }
}