{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Create a new empty cart",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "currency": {
              "description": "ISO 4217 currency code",
              "maxLength": 3,
              "type": "string"
            },
            "redirectUrl": {
              "description": "URI to redirect to after checkout is complete/cancelled",
              "format": "uri",
              "type": "string"
            },
            "workflow": {
              "description": "Workflow callback envelope. Present on agent-driven callbacks; absent on initial calls.",
              "ref": "com.atiproto.actions#inboundWorkflow",
              "type": "ref"
            }
          },
          "required": [
            "currency"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cart": {
              "description": "The created cart record",
              "ref": "com.atiproto.cart#view",
              "type": "ref"
            },
            "cartUri": {
              "description": "URI of the cart record",
              "format": "at-uri",
              "type": "string"
            },
            "checkoutUrl": {
              "description": "Checkout URL hosted by atiproto",
              "format": "uri",
              "type": "string"
            },
            "workflow": {
              "description": "Workflow envelope. When present, the agent runs the actions and calls back. When absent, this is the final native result.",
              "ref": "com.atiproto.actions#outboundWorkflow",
              "type": "ref"
            }
          },
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "com.atiproto.payment.cart.create",
  "lexicon": 1
}
