{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "cartResponse": {
      "properties": {
        "cid": {
          "description": "CID of the cart record",
          "format": "cid",
          "type": "string"
        },
        "record": {
          "ref": "com.atiproto.cart#view",
          "type": "ref"
        },
        "uri": {
          "description": "AT-URI of the cart record",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "cid",
        "record"
      ],
      "type": "object"
    },
    "main": {
      "description": "List carts whose items pay the authenticated user — i.e. carts targeting this user as a payment recipient. Read-only, no PDS writes.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "carts": {
              "items": {
                "ref": "#cartResponse",
                "type": "ref"
              },
              "type": "array"
            },
            "cursor": {
              "description": "Pagination cursor for next page",
              "maxLength": 512,
              "type": "string"
            }
          },
          "required": [
            "carts"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "cursor": {
            "description": "Pagination cursor",
            "maxLength": 512,
            "type": "string"
          },
          "limit": {
            "default": 20,
            "description": "Results per page (1-100, default: 20)",
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "sender": {
            "description": "Optional: only return carts created by this sender DID",
            "format": "did",
            "type": "string"
          },
          "status": {
            "description": "Filter by cart status",
            "enum": [
              "open",
              "completed",
              "expired",
              "abandoned"
            ],
            "maxLength": 64,
            "type": "string"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "com.atiproto.recipient.payment.cart.list",
  "lexicon": 1
}
