{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ordogrid/json-schema/ordogrid-api-identity-schema.json",
  "title": "ApiIdentity",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ordogrid-meta-api-openapi.yml#/components/schemas/ApiIdentity",
  "properties": {
    "api_key": {
      "properties": {
        "effective_scopes": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "expires_at": {
          "description": "UTC, ISO 8601 with milliseconds and Z, e.g. 2026-10-22T10:00:00.123Z.",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "pattern": "^[a-fA-F0-9]{24}$",
          "type": "string"
        },
        "integration_id": {
          "type": "string"
        },
        "masked_token": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "rate_limit_per_minute": {
          "type": "integer"
        },
        "scopes": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "capabilities": {
      "$ref": "#/$defs/ApiCapabilities"
    },
    "company": {
      "properties": {
        "id": {
          "pattern": "^[a-fA-F0-9]{24}$",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "vat_number": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "object": {
      "const": "api_identity"
    }
  },
  "type": "object",
  "$defs": {
    "ApiCapabilities": {
      "properties": {
        "contract_version": {
          "type": "string"
        },
        "currencies": {
          "items": {
            "properties": {
              "code": {
                "type": "string"
              },
              "minor_unit": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "margin_schemes": {
          "items": {
            "$ref": "#/$defs/MarginCapability"
          },
          "type": "array"
        },
        "overpayment_policy": {
          "const": "refuse"
        },
        "payment_methods": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "payment_operations": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "settlement_version": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "MarginCapability": {
      "properties": {
        "contract_version": {
          "type": "string"
        },
        "credit_policy": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "exemption_reason_code": {
          "type": "string"
        },
        "jurisdiction": {
          "type": "string"
        },
        "profile": {
          "type": "string"
        },
        "scheme": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "supplier_statuses": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "tax_rates": {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        "wire_category": {
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}