{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/cloverly/main/json-schema/cloverly-purchase-schema.json", "title": "Cloverly Purchase", "description": "A retired-offset record returned by POST /purchases/{type} or POST /purchases (estimate conversion).", "type": "object", "required": ["slug", "state", "total_co2e_in_grams", "total_cost_in_usd_cents"], "properties": { "slug": { "type": "string" }, "state": { "type": "string", "enum": ["purchased", "cancelled"] }, "total_co2e_in_grams": { "type": "number", "minimum": 0 }, "total_cost_in_usd_cents": { "type": "integer", "minimum": 0 }, "transaction_cost_in_usd_cents": { "type": "integer", "minimum": 0 }, "offset_cost_in_usd_cents": { "type": "integer", "minimum": 0 }, "offset": { "type": "object", "properties": { "slug": { "type": "string" }, "name": { "type": "string" }, "registry_name": { "type": "string" }, "offset_type": { "type": "string" }, "country": { "type": "string" }, "vintage_year": { "type": "integer" }, "price_per_kg_in_usd_cents": { "type": "number" } } }, "retirement": { "type": "object", "description": "Registry-issued retirement record for this purchase.", "properties": { "serial_number": { "type": "string" }, "registry_url": { "type": "string", "format": "uri" }, "retired_at": { "type": "string", "format": "date-time" } } }, "receipt_url": { "type": "string", "format": "uri" }, "pretty_url": { "type": "string", "format": "uri" }, "created_at": { "type": "string", "format": "date-time" } }, "additionalProperties": true }