{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/totalparks-com-au/json-schema/totalparks-com-au-cart-confirm-progress-response-schema.json",
  "title": "CartConfirmProgressResponse",
  "description": "``GET /carts/{id}/confirm-progress`` — per stay plus one payment row.\n\nNever exposes the provider phase. ``confirmed`` and ``failed`` come from\nthe committed cart; ``checking`` is manual recovery or a confirm that\nstopped reporting.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/totalparks-com-au-openapi.json#/components/schemas/CartConfirmProgressResponse",
  "properties": {
    "cart_id": {
      "type": "integer",
      "title": "Cart Id"
    },
    "status": {
      "type": "string",
      "enum": [
        "not_started",
        "in_progress",
        "confirmed",
        "failed",
        "checking"
      ],
      "title": "Status"
    },
    "payment": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "authorized",
            "captured",
            "released",
            "refunded",
            "unknown"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Payment"
    },
    "stays": {
      "items": {
        "$ref": "#/$defs/ConfirmStayProgress"
      },
      "type": "array",
      "title": "Stays",
      "description": "Every stay, in date order."
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updated At"
    },
    "checkout_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Checkout Code",
      "description": "The ``TPC-`` display code of a 2+ stay cart: the reference the guest quotes to Total Parks, also after an unwind."
    },
    "grand_total": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Grand Total",
      "description": "The cart total: the amount authorised, refunded, or released."
    },
    "currency": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Currency"
    },
    "confirmation_ref": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Confirmation Ref",
      "description": "On a ``confirmed`` cart, the ``ref`` the confirmation page looks up: a 2+ stay cart's ``TPC-`` bearer, else the first booking's confirmation number. Lets a checkout that lost confirm's response (a reload, a dropped request) open its confirmation. Given to a cart token, cookie, or session only; never to a PAT or OAuth client."
    }
  },
  "type": "object",
  "required": [
    "cart_id",
    "status"
  ],
  "$defs": {
    "ConfirmStayProgress": {
      "properties": {
        "stay_id": {
          "type": "integer",
          "title": "Stay Id"
        },
        "property_id": {
          "type": "integer",
          "title": "Property Id"
        },
        "status": {
          "type": "string",
          "enum": [
            "waiting",
            "booking",
            "done",
            "failed",
            "cancelled"
          ],
          "title": "Status",
          "description": "waiting, booking, done, failed (could not book), or cancelled (undone by an unwind after another stay failed)."
        },
        "check_in": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Check In",
          "description": "The stay's earliest line check-in."
        },
        "check_out": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Check Out",
          "description": "The stay's latest line check-out."
        },
        "cause": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "unavailable",
                "other"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Cause",
          "description": "On a ``failed`` stay after an unwind: ``unavailable`` when its park said the room or site was no longer available, else ``other``. Null on every other stay."
        }
      },
      "type": "object",
      "required": [
        "stay_id",
        "property_id",
        "status"
      ],
      "title": "ConfirmStayProgress",
      "description": "One stay's row in the confirm progress read model."
    }
  }
}