{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shopsafe-com-au/json-schema/shopsafe-com-au-usage-response-schema.json",
  "title": "UsageResponse",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shopsafe-com-au-openapi.json#/components/schemas/UsageResponse",
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "1.0",
      "title": "Schema Version",
      "default": "1.0"
    },
    "currency": {
      "type": "string",
      "const": "AUD",
      "title": "Currency",
      "default": "AUD"
    },
    "scope": {
      "type": "string",
      "enum": [
        "credential",
        "account"
      ],
      "title": "Scope"
    },
    "start_date": {
      "type": "string",
      "format": "date",
      "title": "Start Date"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "title": "End Date"
    },
    "timezone": {
      "type": "string",
      "const": "UTC",
      "title": "Timezone",
      "default": "UTC"
    },
    "request_cutoff_at": {
      "type": "string",
      "format": "date-time",
      "title": "Request Cutoff At"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Generated At"
    },
    "totals": {
      "$ref": "#/$defs/UsageTotals"
    },
    "receipts": {
      "items": {
        "$ref": "#/$defs/UsageReceipt"
      },
      "type": "array",
      "title": "Receipts"
    },
    "limit": {
      "type": "integer",
      "title": "Limit"
    },
    "page_cursor": {
      "type": "string",
      "title": "Page Cursor"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Cursor"
    },
    "reading_cost_aud_cents": {
      "type": "integer",
      "const": 0,
      "title": "Reading Cost Aud Cents",
      "default": 0
    },
    "interpretation": {
      "type": "string",
      "title": "Interpretation",
      "default": "Requests are selected by creation date, including both UTC dates. Totals cover the entire selected period and scope. Existing running requests can change after reading. Released amounts are recorded refunds of verification reservations, not credit-pack refunds. This read does not start work, settle, refund or recover reservations. It excludes credit purchases, credit-pack refunds and browser-beta checks. Follow next_cursor for more receipts."
    }
  },
  "type": "object",
  "required": [
    "scope",
    "start_date",
    "end_date",
    "request_cutoff_at",
    "generated_at",
    "totals",
    "receipts",
    "limit",
    "page_cursor",
    "next_cursor"
  ],
  "$defs": {
    "UsageReceipt": {
      "properties": {
        "verification_id": {
          "type": "string",
          "title": "Verification Id"
        },
        "target_url": {
          "type": "string",
          "maxLength": 2048,
          "title": "Target Url"
        },
        "requested_at": {
          "type": "string",
          "format": "date-time",
          "title": "Requested At"
        },
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completed At"
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "complete",
            "failed"
          ],
          "title": "Status"
        },
        "billing_mode": {
          "type": "string",
          "enum": [
            "trial",
            "prepaid",
            "cache"
          ],
          "title": "Billing Mode"
        },
        "coverage": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "complete",
                "partial",
                "incomplete"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Coverage"
        },
        "cost_aud_cents": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Cost Aud Cents"
        },
        "reserved_aud_cents": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Reserved Aud Cents"
        },
        "released_aud_cents": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Released Aud Cents"
        }
      },
      "type": "object",
      "required": [
        "verification_id",
        "target_url",
        "requested_at",
        "completed_at",
        "status",
        "billing_mode",
        "coverage",
        "cost_aud_cents",
        "reserved_aud_cents",
        "released_aud_cents"
      ],
      "title": "UsageReceipt"
    },
    "UsageTotals": {
      "properties": {
        "requests": {
          "type": "integer",
          "title": "Requests"
        },
        "completed": {
          "type": "integer",
          "title": "Completed"
        },
        "failed": {
          "type": "integer",
          "title": "Failed"
        },
        "running": {
          "type": "integer",
          "title": "Running"
        },
        "cache_hits": {
          "type": "integer",
          "title": "Cache Hits"
        },
        "trial_attempts": {
          "type": "integer",
          "title": "Trial Attempts"
        },
        "charged_requests": {
          "type": "integer",
          "title": "Charged Requests"
        },
        "incomplete_results": {
          "type": "integer",
          "title": "Incomplete Results"
        },
        "charged_aud_cents": {
          "type": "integer",
          "title": "Charged Aud Cents"
        },
        "reserved_aud_cents": {
          "type": "integer",
          "title": "Reserved Aud Cents"
        },
        "released_aud_cents": {
          "type": "integer",
          "title": "Released Aud Cents"
        }
      },
      "type": "object",
      "required": [
        "requests",
        "completed",
        "failed",
        "running",
        "cache_hits",
        "trial_attempts",
        "charged_requests",
        "incomplete_results",
        "charged_aud_cents",
        "reserved_aud_cents",
        "released_aud_cents"
      ],
      "title": "UsageTotals"
    }
  }
}