{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/laboratory-love/json-schema/laboratory-love-testing-checkout-schema.json",
  "title": "TestingCheckout",
  "description": "A created testing checkout.",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/laboratory-love-openapi.json#/components/schemas/TestingCheckout",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "checkout_id",
    "checkout_url",
    "status",
    "requires_user_completion",
    "amount",
    "currency",
    "expires_at",
    "tier",
    "products_submitted",
    "terms",
    "next_step"
  ],
  "properties": {
    "checkout_id": {
      "type": "string",
      "description": "Checkout id for GET /checkouts/{checkout_id}."
    },
    "checkout_url": {
      "type": "string",
      "description": "Secure Stripe-hosted payment page for the person to open.",
      "format": "uri"
    },
    "status": {
      "type": "string",
      "description": "Always awaiting_user_payment on creation.",
      "enum": [
        "awaiting_user_payment"
      ]
    },
    "requires_user_completion": {
      "type": "boolean",
      "description": "Always true."
    },
    "amount": {
      "type": "number",
      "description": "USD."
    },
    "currency": {
      "type": "string",
      "description": "Currency.",
      "enum": [
        "USD"
      ]
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "When checkout_url stops working.",
      "format": "date-time"
    },
    "tier": {
      "$ref": "#/$defs/TestingTier"
    },
    "products_submitted": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "Submitted product.",
        "additionalProperties": false,
        "required": [
          "url",
          "notes"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "URL."
          },
          "notes": {
            "type": "string",
            "description": "Notes (may be empty)."
          }
        }
      },
      "description": "Products saved with the order."
    },
    "terms": {
      "$ref": "#/$defs/TestingTerms"
    },
    "next_step": {
      "type": "string",
      "description": "What to do next."
    }
  },
  "$defs": {
    "TestingTerms": {
      "type": "object",
      "description": "Terms to show before a person orders testing.",
      "additionalProperties": false,
      "required": [
        "seller",
        "turnaround",
        "refund_policy",
        "publication",
        "terms_url"
      ],
      "properties": {
        "seller": {
          "type": "string",
          "description": "Merchant of record."
        },
        "turnaround": {
          "type": "string",
          "description": "Expected timing."
        },
        "refund_policy": {
          "type": "string",
          "description": "Refund rules."
        },
        "publication": {
          "type": "string",
          "description": "Whether results are published."
        },
        "terms_url": {
          "type": "string",
          "description": "Full terms.",
          "format": "uri"
        }
      }
    },
    "TestingTier": {
      "type": "object",
      "description": "A direct testing package.",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "price",
        "currency",
        "products_included",
        "samples_per_product",
        "lab_tests_total",
        "panels",
        "best_for"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Tier id.",
          "enum": [
            "single",
            "kitchen",
            "pantry"
          ]
        },
        "name": {
          "type": "string",
          "description": "Name."
        },
        "price": {
          "type": "number",
          "description": "Total price, USD."
        },
        "currency": {
          "type": "string",
          "description": "Currency.",
          "enum": [
            "USD"
          ]
        },
        "products_included": {
          "type": "integer",
          "description": "Products you may submit."
        },
        "samples_per_product": {
          "type": "integer",
          "description": "Retail samples tested per product."
        },
        "lab_tests_total": {
          "type": "integer",
          "description": "Total lab tests."
        },
        "panels": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Chemical panels."
        },
        "best_for": {
          "type": [
            "string",
            "null"
          ],
          "description": "Who it suits."
        }
      }
    }
  }
}