{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/carbonmark-com/json-schema/carbonmark-com-owner-order-schema.json",
  "title": "OwnerOrder",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/carbonmark-com-openapi.json#/components/schemas/OwnerOrder",
  "type": "object",
  "properties": {
    "id": {
      "minimum": 1,
      "maximum": 9007199254740991,
      "type": "integer"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "beneficiary_address": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "beneficiary_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "retirement_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "retirement_index": {
      "anyOf": [
        {
          "minimum": 0,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "transaction_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "execution_status": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "PENDING"
          ]
        },
        {
          "type": "string",
          "enum": [
            "SUBMITTED"
          ]
        },
        {
          "type": "string",
          "enum": [
            "INITIATED"
          ]
        },
        {
          "type": "string",
          "enum": [
            "COMMITTED"
          ]
        },
        {
          "type": "string",
          "enum": [
            "MINTED"
          ]
        },
        {
          "type": "string",
          "enum": [
            "COMPLETED"
          ]
        },
        {
          "type": "string",
          "enum": [
            "FAILED"
          ]
        }
      ]
    },
    "credential": {
      "type": "object",
      "properties": {
        "id": {
          "minimum": 1,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "is_test": {
          "type": "boolean"
        },
        "deleted_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "display_name",
        "is_test",
        "deleted_at"
      ]
    },
    "quote": {
      "type": "object",
      "properties": {
        "id": {
          "minimum": 1,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "uuid": {
          "type": "string"
        },
        "asset_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "asset_price_source_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "listing_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "quantity_tonnes": {
          "type": "number"
        },
        "cost_usdc": {
          "type": "number"
        },
        "chain_id": {
          "minimum": 1,
          "maximum": 9007199254740991,
          "type": "integer"
        },
        "settlement_token": {
          "type": "string"
        },
        "erc1155_token_id": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "uuid",
        "asset_id",
        "asset_price_source_id",
        "listing_id",
        "quantity_tonnes",
        "cost_usdc",
        "chain_id",
        "settlement_token",
        "erc1155_token_id"
      ]
    },
    "financial": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "properties": {
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "reserved"
                  ]
                },
                {
                  "type": "string",
                  "enum": [
                    "charged"
                  ]
                },
                {
                  "type": "string",
                  "enum": [
                    "released"
                  ]
                }
              ]
            },
            "amount_usd": {
              "minimum": 0,
              "type": "number"
            },
            "accepted_at": {
              "type": "string"
            },
            "resolved_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "state",
            "amount_usd",
            "accepted_at",
            "resolved_at"
          ]
        }
      ]
    },
    "status": {
      "type": "string"
    },
    "consumption_metadata": {
      "type": "object",
      "properties": {
        "retiring_address": {
          "type": "string"
        },
        "country_of_consumption": {
          "type": "string"
        },
        "country_of_consumption_code": {
          "type": "string"
        },
        "consumption_period_start": {
          "type": "number"
        },
        "consumption_period_end": {
          "type": "number"
        }
      }
    },
    "registry_specific_data": {
      "type": "object",
      "properties": {
        "puro_earth": {
          "type": "object",
          "properties": {
            "puro_batch_token_id": {
              "type": "string"
            }
          }
        }
      }
    },
    "on_chain_explorer_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "view_retirement_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "created_at",
    "updated_at",
    "completed_at",
    "beneficiary_address",
    "beneficiary_name",
    "retirement_message",
    "retirement_index",
    "transaction_hash",
    "execution_status",
    "credential",
    "quote",
    "financial",
    "status",
    "consumption_metadata",
    "registry_specific_data",
    "on_chain_explorer_url",
    "view_retirement_url"
  ]
}