{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimcarbon-com/json-schema/trimcarbon-com-offset-request-schema.json",
  "title": "OffsetRequest",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimcarbon-com-openapi.json#/components/schemas/OffsetRequest",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "kg": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000,
          "description": "kg of CO₂ to offset."
        },
        "reference": {
          "description": "Your own label, such as a trip or invoice ID. Returned as you sent it; never public, never sent to the credit supplier.",
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      },
      "required": [
        "kg"
      ],
      "additionalProperties": false,
      "title": "By volume"
    },
    {
      "type": "object",
      "properties": {
        "amount_cents": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5000000,
          "description": "US cents to spend. Buys the most whole kg whose charge fits in this amount."
        },
        "reference": {
          "description": "Your own label, such as a trip or invoice ID. Returned as you sent it; never public, never sent to the credit supplier.",
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      },
      "required": [
        "amount_cents"
      ],
      "additionalProperties": false,
      "title": "By price"
    }
  ]
}