{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/BillingAppStripeCreateCheckoutSessionResult",
  "title": "BillingAppStripeCreateCheckoutSessionResult",
  "description": "Result of creating a Stripe Checkout Session.\n\nContains all the information needed to redirect customers to the checkout\nor initialize an embedded checkout flow.",
  "type": "object",
  "properties": {
    "customer_id": {
      "description": "The customer ID in the billing system.",
      "type": "string",
      "example": "01G65Z755AFWAKHE12NY0CQ9FH",
      "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
      "title": "ULID"
    },
    "stripe_customer_id": {
      "description": "The Stripe customer ID.",
      "type": "string"
    },
    "session_id": {
      "description": "The Stripe checkout session ID.",
      "type": "string"
    },
    "setup_intent_id": {
      "description": "The setup intent ID created for collecting the payment method.",
      "type": "string"
    },
    "client_secret": {
      "description": "Client secret for initializing Stripe.js on the client side.\n\nRequired for embedded checkout sessions.\nSee: https://docs.stripe.com/payments/checkout/custom-success-page",
      "type": "string"
    },
    "client_reference_id": {
      "description": "The client reference ID provided in the request.\n\nUseful for reconciling the session with your internal systems.",
      "type": "string"
    },
    "customer_email": {
      "description": "Customer's email address if provided to Stripe.",
      "type": "string"
    },
    "currency": {
      "description": "Currency code for the checkout session.",
      "type": "string",
      "example": "USD",
      "maxLength": 3,
      "minLength": 3,
      "pattern": "^[A-Z]{3}$"
    },
    "created_at": {
      "description": "Timestamp when the checkout session was created.",
      "type": "string",
      "format": "date-time",
      "example": "2023-01-01T01:01:01.001Z",
      "title": "RFC3339 Date-Time"
    },
    "expires_at": {
      "description": "Timestamp when the checkout session will expire.",
      "type": "string",
      "format": "date-time",
      "example": "2023-01-01T01:01:01.001Z",
      "title": "RFC3339 Date-Time"
    },
    "metadata": {
      "description": "Metadata attached to the checkout session.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "status": {
      "description": "The status of the checkout session.\n\nSee: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-status",
      "type": "string"
    },
    "url": {
      "description": "URL to redirect customers to the checkout page (for hosted mode).",
      "type": "string"
    },
    "mode": {
      "description": "Mode of the checkout session.\n\nCurrently only \"setup\" mode is supported for collecting payment methods.",
      "type": "string",
      "enum": [
        "setup"
      ]
    },
    "cancel_url": {
      "description": "The cancel URL where customers are redirected if they cancel.",
      "type": "string"
    },
    "success_url": {
      "description": "The success URL where customers are redirected after completion.",
      "type": "string"
    },
    "return_url": {
      "description": "The return URL for embedded sessions after authentication.",
      "type": "string"
    }
  },
  "required": [
    "customer_id",
    "stripe_customer_id",
    "session_id",
    "setup_intent_id",
    "created_at",
    "mode"
  ]
}