{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cuvo-co/json-schema/cuvo-co-acp-checkout-session-schema.json",
  "title": "AcpCheckoutSession",
  "description": "ACP checkout session (agenticcommerce.dev, spec 2026-01-30).",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cuvo-co-openapi.json#/components/schemas/AcpCheckoutSession",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^acp_cs_[0-9a-f-]{36}$"
    },
    "protocol": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        }
      },
      "required": [
        "version"
      ]
    },
    "capabilities": {
      "type": "object"
    },
    "status": {
      "type": "string",
      "enum": [
        "not_ready_for_payment",
        "ready_for_payment",
        "completed",
        "canceled"
      ]
    },
    "currency": {
      "type": "string",
      "enum": [
        "usd"
      ]
    },
    "line_items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcpLineItem"
      }
    },
    "fulfillment_details": {
      "type": [
        "object",
        "null"
      ]
    },
    "fulfillment_options": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "selected_fulfillment_options": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "totals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcpAmount"
      }
    },
    "messages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcpMessage"
      }
    },
    "links": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "type",
          "url"
        ]
      }
    },
    "buyer": {
      "$ref": "#/$defs/AcpBuyer"
    },
    "order": {
      "$ref": "#/$defs/AcpOrder"
    }
  },
  "required": [
    "id",
    "status",
    "currency",
    "line_items",
    "totals"
  ],
  "$defs": {
    "AcpAmount": {
      "type": "object",
      "description": "A display total row. Amounts are integer cents.",
      "properties": {
        "type": {
          "type": "string"
        },
        "display_text": {
          "type": "string"
        },
        "amount": {
          "type": "integer"
        }
      },
      "required": [
        "type",
        "amount"
      ]
    },
    "AcpBuyer": {
      "type": "object",
      "description": "Buyer contact details for the ACP checkout.",
      "properties": {
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone_number": {
          "type": "string"
        }
      },
      "required": [
        "first_name",
        "email"
      ]
    },
    "AcpLineItem": {
      "type": "object",
      "description": "The single $0 discovery-call line item.",
      "properties": {
        "id": {
          "type": "string"
        },
        "item": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            }
          },
          "required": [
            "id"
          ]
        },
        "quantity": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "unit_amount": {
          "type": "integer"
        },
        "totals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AcpAmount"
          }
        }
      },
      "required": [
        "id",
        "item",
        "quantity",
        "unit_amount"
      ]
    },
    "AcpMessage": {
      "type": "object",
      "description": "Informational or error message in a session.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "info",
            "error"
          ]
        },
        "code": {
          "type": "string"
        },
        "content_type": {
          "type": "string",
          "enum": [
            "plain"
          ]
        },
        "content": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "content"
      ]
    },
    "AcpOrder": {
      "type": "object",
      "description": "Order returned on completion; permalink_url is the /booking page where the buyer schedules the call.",
      "properties": {
        "id": {
          "type": "string"
        },
        "checkout_session_id": {
          "type": "string"
        },
        "permalink_url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "id",
        "checkout_session_id",
        "permalink_url"
      ]
    }
  }
}