{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-rc.4/account/report-usage-response.json",
  "title": "Report Usage Response",
  "description": "Response from report_usage. Partial acceptance is valid — records that pass validation are stored even when others fail.",
  "type": "object",
  "allOf": [
    {
      "$ref": "/schemas/3.1.0-rc.4/core/version-envelope.json"
    },
    {
      "$ref": "/schemas/3.1.0-rc.4/core/protocol-envelope.json"
    }
  ],
  "properties": {
    "accepted": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of usage records successfully stored."
    },
    "errors": {
      "type": "array",
      "description": "Validation errors for individual records. The field property identifies which record failed (e.g., 'usage[1].pricing_option_id').",
      "items": {
        "$ref": "/schemas/3.1.0-rc.4/core/error.json"
      }
    },
    "sandbox": {
      "type": "boolean",
      "description": "When true, the account is a sandbox account and no billing occurred."
    },
    "context": {
      "$ref": "/schemas/3.1.0-rc.4/core/context.json"
    },
    "ext": {
      "$ref": "/schemas/3.1.0-rc.4/core/ext.json"
    }
  },
  "required": [
    "accepted"
  ],
  "additionalProperties": true,
  "examples": [
    {
      "description": "All records accepted",
      "data": {
        "status": "completed",
        "accepted": 2
      }
    },
    {
      "description": "Partial acceptance — one record failed validation",
      "data": {
        "status": "completed",
        "accepted": 1,
        "errors": [
          {
            "code": "INVALID_PRICING_OPTION",
            "message": "pricing_option_id 'po_unknown' does not exist on this account",
            "field": "usage[1].pricing_option_id"
          }
        ]
      }
    }
  ]
}
