{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/silvercar/json-schema/silvercar-admin-contract-pricing-response-schema.json",
  "title": "AdminContractPricingResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/silvercar-invoicing-api-openapi.yml#/components/schemas/AdminContractPricingResponse",
  "type": "object",
  "required": [
    "id",
    "balance",
    "customer_balance",
    "customer_payments_total",
    "payer_total",
    "payer_balance",
    "payer_payments_total",
    "customer_total",
    "payments_total",
    "total",
    "currency_code",
    "pricing",
    "additional_payer_totals",
    "links"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "description": "Statement ID"
    },
    "balance": {
      "type": "number",
      "format": "float",
      "description": "Remaining balance due for the contract"
    },
    "customer_balance": {
      "type": "number",
      "format": "float",
      "description": "Remaining balance due for the customer"
    },
    "total": {
      "type": "number",
      "format": "float",
      "description": "Total cost of the contract, before applied payments"
    },
    "customer_total": {
      "type": "number",
      "format": "float",
      "description": "Total customer cost of the contract, before applied payments"
    },
    "customer_payments_total": {
      "type": "number",
      "format": "float",
      "description": "Total of successful customer payments on the contract"
    },
    "payer_total": {
      "type": "number",
      "format": "float",
      "description": "Total additional payer cost of the contract"
    },
    "payer_payments_total": {
      "type": "number",
      "format": "float",
      "description": "Total of payments made by the additional payer"
    },
    "payer_balance": {
      "type": "number",
      "format": "float",
      "description": "Remaining additional payer balance of the contract"
    },
    "payments_total": {
      "type": "number",
      "format": "float",
      "description": "Total of successful payments on the contract"
    },
    "currency_code": {
      "type": "string",
      "description": "Applicable currency code for the contract"
    },
    "pricing": {
      "type": "array",
      "description": "Collection of charge types and line items",
      "items": {
        "$ref": "#/$defs/AdminContractPricing"
      }
    },
    "additional_payer_totals": {
      "type": "array",
      "description": "Collection of split bill totals by each payer",
      "items": {
        "$ref": "#/$defs/AdminContractAdditionalPayerTotals"
      }
    },
    "links": {
      "properties": {
        "contract": {
          "$ref": "#/$defs/HypermediaLink"
        }
      }
    }
  },
  "$defs": {
    "AdminContractAdditionalPayerTotals": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "customer_name": {
          "type": "string",
          "description": "Name of the additional payer"
        },
        "amount": {
          "type": "number",
          "format": "float",
          "description": "Total amount owed by the additional payer"
        }
      }
    },
    "AdminContractPricing": {
      "type": "object",
      "required": [
        "name",
        "type",
        "total",
        "groups"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Display name of pricing section"
        },
        "type": {
          "type": "string",
          "description": "Type of adjustment or charge line items"
        },
        "total": {
          "type": "number",
          "format": "float",
          "description": "Sum of included line items."
        },
        "groups": {
          "type": "array",
          "description": "Grouped line items for split bills",
          "items": {
            "type": "object",
            "required": [
              "description",
              "total",
              "items"
            ],
            "properties": {
              "description": {
                "type": "string",
                "description": "The description of the line item"
              },
              "total": {
                "type": "number",
                "format": "float",
                "description": "Total of the line items"
              },
              "items": {
                "type": "array",
                "description": "Line items for the line item group",
                "items": {
                  "type": "object",
                  "required": [
                    "bill_to",
                    "total"
                  ],
                  "properties": {
                    "bill_to": {
                      "type": "string",
                      "description": "Bill To Name"
                    },
                    "total": {
                      "type": "number",
                      "format": "float",
                      "description": "Total of the line item"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "HypermediaLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "ID of the associated resource"
        },
        "href": {
          "type": "string",
          "description": "Link to the associated resource"
        }
      }
    }
  }
}